src/power/uikit/SDL_syspower.m
changeset 8222 01a7b69c4fb7
parent 8149 681eb46b8ac4
child 8223 18ffe88a2148
equal deleted inserted replaced
8221:6ded2087e346 8222:01a7b69c4fb7
    85             *state = SDL_POWERSTATE_UNKNOWN;
    85             *state = SDL_POWERSTATE_UNKNOWN;
    86             break;
    86             break;
    87     }
    87     }
    88 
    88 
    89     const float level = [uidev batteryLevel];
    89     const float level = [uidev batteryLevel];
    90     *percent = ( (level < 0.0f) ? -1 : (((int) (level + 0.5f)) * 100) );
    90     *percent = ( (level < 0.0f) ? -1 : ((int) ((level * 100) + 0.5f)) );
    91     return SDL_TRUE;            /* always the definitive answer on iPhoneOS. */
    91     return SDL_TRUE;            /* always the definitive answer on iPhoneOS. */
    92 }
    92 }
    93 
    93 
    94 #endif /* SDL_POWER_UIKIT */
    94 #endif /* SDL_POWER_UIKIT */
    95 #endif /* SDL_POWER_DISABLED */
    95 #endif /* SDL_POWER_DISABLED */