mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Emscripten: Added missing error messages for audio and joystick init failures.
This commit is contained in:
parent
2d8c49fdbd
commit
fcc5940935
@ -263,6 +263,10 @@ Emscripten_Init(SDL_AudioDriverImpl * impl)
|
|||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!available) {
|
||||||
|
SDL_SetError("No audio context available");
|
||||||
|
}
|
||||||
|
|
||||||
return available;
|
return available;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,6 +200,7 @@ SDL_SYS_JoystickInit(void)
|
|||||||
|
|
||||||
/* Check if gamepad is supported by browser */
|
/* Check if gamepad is supported by browser */
|
||||||
if (numjs == EMSCRIPTEN_RESULT_NOT_SUPPORTED) {
|
if (numjs == EMSCRIPTEN_RESULT_NOT_SUPPORTED) {
|
||||||
|
SDL_SetError("Gamepads not supported");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,6 +222,7 @@ SDL_SYS_JoystickInit(void)
|
|||||||
|
|
||||||
if(retval != EMSCRIPTEN_RESULT_SUCCESS) {
|
if(retval != EMSCRIPTEN_RESULT_SUCCESS) {
|
||||||
SDL_SYS_JoystickQuit();
|
SDL_SYS_JoystickQuit();
|
||||||
|
SDL_SetError("Could not set gamepad connect callback");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,6 +231,7 @@ SDL_SYS_JoystickInit(void)
|
|||||||
Emscripten_JoyStickDisconnected);
|
Emscripten_JoyStickDisconnected);
|
||||||
if(retval != EMSCRIPTEN_RESULT_SUCCESS) {
|
if(retval != EMSCRIPTEN_RESULT_SUCCESS) {
|
||||||
SDL_SYS_JoystickQuit();
|
SDL_SYS_JoystickQuit();
|
||||||
|
SDL_SetError("Could not set gamepad disconnect callback");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user