Win32: Added missing throwException in Controller.cpp

This commit is contained in:
Elias Naur 2004-05-05 11:30:51 +00:00
parent 7bd59ed27d
commit e1656b862b
1 changed files with 8 additions and 8 deletions

View File

@ -127,23 +127,23 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jcla
HRESULT hr; HRESULT hr;
hr = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &cDI, NULL); hr = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &cDI, NULL);
if (FAILED(hr)) { if (FAILED(hr)) {
printfDebug("DirectInputCreate failed\n");
ShutdownController(); ShutdownController();
throwException(env, "DirectInputCreate failed\n");
return; return;
} }
/* Find all Controllers */ /* Find all Controllers */
EnumerateControllers(); EnumerateControllers();
if (!cCreate_success) { if (!cCreate_success) {
throwException(env, "Failed to enumerate.");
ShutdownController(); ShutdownController();
throwException(env, "Failed to enumerate.");
return; return;
} }
/* check that we got at least 1 controller */ /* check that we got at least 1 controller */
if (cDIDevice == NULL) { if (cDIDevice == NULL) {
throwException(env, "No devices found.");
ShutdownController(); ShutdownController();
throwException(env, "No devices found.");
return; return;
} }
@ -154,8 +154,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jcla
/* Enumerate capabilities of Controller */ /* Enumerate capabilities of Controller */
EnumerateControllerCapabilities(); EnumerateControllerCapabilities();
if (!cCreate_success) { if (!cCreate_success) {
throwException(env, "Falied to enumerate capabilities.");
ShutdownController(); ShutdownController();
throwException(env, "Falied to enumerate capabilities.");
return; return;
} }
@ -180,8 +180,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jcla
/* Aquire the Controller */ /* Aquire the Controller */
hr = cDIDevice->Acquire(); hr = cDIDevice->Acquire();
if(FAILED(hr)) { if(FAILED(hr)) {
throwException(env, "Acquire failed");
ShutdownController(); ShutdownController();
throwException(env, "Acquire failed");
return; return;
} }
} }