mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-03 08:40:59 +00:00
IOS7: Fix implementation of getMillis()
The documentation indicates that it should return the number of milliseconds since the application started. It was however using a different reference (last boot of the device minus the sleep time) resulting in a much bigger value than expected.
This commit is contained in:
parent
2d54e3e87f
commit
98b7095527
@ -158,7 +158,7 @@ void OSystem_iOS7::initBackend() {
|
||||
|
||||
_timerManager = new DefaultTimerManager();
|
||||
|
||||
gettimeofday(&_startTime, NULL);
|
||||
_startTime = CACurrentMediaTime();
|
||||
|
||||
setupMixer();
|
||||
|
||||
@ -242,7 +242,7 @@ void OSystem_iOS7::suspendLoop() {
|
||||
|
||||
uint32 OSystem_iOS7::getMillis(bool skipRecord) {
|
||||
CFTimeInterval timeInSeconds = CACurrentMediaTime();
|
||||
return (uint32) (timeInSeconds * 1000.0);
|
||||
return (uint32) ((timeInSeconds - _startTime) * 1000.0) - _timeSuspended;
|
||||
}
|
||||
|
||||
void OSystem_iOS7::delayMillis(uint msecs) {
|
||||
|
@ -74,7 +74,7 @@ protected:
|
||||
// For use with the mouse texture
|
||||
uint16 _gamePaletteRGBA5551[256];
|
||||
|
||||
struct timeval _startTime;
|
||||
CFTimeInterval _startTime;
|
||||
uint32 _timeSuspended;
|
||||
|
||||
bool _mouseCursorPaletteEnabled;
|
||||
|
Loading…
x
Reference in New Issue
Block a user