[Scummvm-git-logs] scummvm master -> 98b70955270d920cb752e2f3c829621659cd7acf
criezy
criezy at scummvm.org
Sat Feb 1 22:57:16 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
98b7095527 IOS7: Fix implementation of getMillis()
Commit: 98b70955270d920cb752e2f3c829621659cd7acf
https://github.com/scummvm/scummvm/commit/98b70955270d920cb752e2f3c829621659cd7acf
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-02-01T22:56:25Z
Commit Message:
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.
Changed paths:
backends/platform/ios7/ios7_osys_main.cpp
backends/platform/ios7/ios7_osys_main.h
diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp
index 636d603..33e97cf 100644
--- a/backends/platform/ios7/ios7_osys_main.cpp
+++ b/backends/platform/ios7/ios7_osys_main.cpp
@@ -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) {
diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h
index f70e48e..6319ef5 100644
--- a/backends/platform/ios7/ios7_osys_main.h
+++ b/backends/platform/ios7/ios7_osys_main.h
@@ -74,7 +74,7 @@ protected:
// For use with the mouse texture
uint16 _gamePaletteRGBA5551[256];
- struct timeval _startTime;
+ CFTimeInterval _startTime;
uint32 _timeSuspended;
bool _mouseCursorPaletteEnabled;
More information about the Scummvm-git-logs
mailing list