mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Corrected battery percentage on iOS (thanks, Felix!).
Fixes Bugzilla #2397.
This commit is contained in:
parent
fbeb24e96e
commit
245e125e0f
@ -87,7 +87,7 @@ SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const float level = [uidev batteryLevel];
|
const float level = [uidev batteryLevel];
|
||||||
*percent = ( (level < 0.0f) ? -1 : (((int) (level + 0.5f)) * 100) );
|
*percent = ( (level < 0.0f) ? -1 : ((int) ((level * 100) + 0.5f)) );
|
||||||
return SDL_TRUE; /* always the definitive answer on iPhoneOS. */
|
return SDL_TRUE; /* always the definitive answer on iPhoneOS. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user