Use C99 bool internally in SDL
This commit is contained in:
1 parent
6501e90018
commit
8f546bb3c9
450 files changed
+6046
-6033
No files matched your search
@@ -25,13 +25,13 @@
|
||||
|
||||
#include <emscripten/html5.h>
|
||||
|
||||
SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *percent)
|
||||
bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
EmscriptenBatteryEvent batteryState;
|
||||
int haveBattery = 0;
|
||||
|
||||
if (emscripten_get_battery_status(&batteryState) == EMSCRIPTEN_RESULT_NOT_SUPPORTED) {
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
haveBattery = batteryState.level != 1.0 || !batteryState.charging || batteryState.chargingTime != 0.0;
|
||||
@@ -40,7 +40,7 @@ SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *p
|
||||
*state = SDL_POWERSTATE_NO_BATTERY;
|
||||
*seconds = -1;
|
||||
*percent = -1;
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (batteryState.charging) {
|
||||
@@ -52,7 +52,7 @@ SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *p
|
||||
*seconds = (int)batteryState.dischargingTime;
|
||||
*percent = (int)batteryState.level * 100;
|
||||
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SDL_POWER_EMSCRIPTEN
|
||||
|
||||
Reference in new issue
Block a user