We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2397

Summary: SDL_GetPowerInfo returns implausible batter percentage value on iOS
Product: SDL Reporter: Felix Hädicke <felixhaedicke>
Component: mainAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: HG 2.1   
Hardware: iPhone/iPod touch   
OS: iOS 6   
Attachments: Bugfix: Corrected formula for calculating battery percentage with UIKit

Description Felix Hädicke 2014-02-13 22:10:51 UTC
Created attachment 1558 [details]
Bugfix: Corrected formula for calculating battery percentage with UIKit

SDL_GetPowerInfo returns always a value >= 50 %, most of the time 100 %, as percentage of battery life left

This is caused by an incorrect formula for calculating the percentage value. The attached patch should fix it.
Comment 1 Ryan C. Gordon 2014-02-17 16:48:27 UTC
This patch is now https://hg.libsdl.org/SDL/rev/01a7b69c4fb7 ...thanks!

--ryan.