diff options
author | Alejandro Marzini | 2010-06-20 20:11:30 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-06-20 20:11:30 +0000 |
commit | 4a850209d739111b539fc39bcf003abd6e061538 (patch) | |
tree | 104183f5fffcea3b504fe28d102ac4def1f219aa /backends/platform | |
parent | 99c0f8260848ff758da3e40d9d816dc51974f793 (diff) | |
download | scummvm-rg350-4a850209d739111b539fc39bcf003abd6e061538.tar.gz scummvm-rg350-4a850209d739111b539fc39bcf003abd6e061538.tar.bz2 scummvm-rg350-4a850209d739111b539fc39bcf003abd6e061538.zip |
Removed getMillis, delayMillis and getTimeAndDate functions from TimerManager.
svn-id: r50095
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 23 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 4 |
2 files changed, 27 insertions, 0 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 37c01dfc1f..3387503204 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -34,6 +34,7 @@ #include "common/config-manager.h" #include "common/debug.h" #include "common/util.h" +#include "common/EventRecorder.h" #ifdef UNIX #include "backends/saves/posix/posix-saves.h" @@ -75,6 +76,7 @@ #include "CoreFoundation/CoreFoundation.h" #endif +#include <time.h> void OSystem_SDL::initBackend() { assert(!_inited); @@ -384,3 +386,24 @@ bool OSystem_SDL::pollEvent(Common::Event &event) { assert(_eventManager); return ((SdlEventManager *)_eventManager)->pollSdlEvent(event); } + +uint32 OSystem_SDL::getMillis() { + uint32 millis = SDL_GetTicks(); + g_eventRec.processMillis(millis); + return millis; +} + +void OSystem_SDL::delayMillis(uint msecs) { + SDL_Delay(msecs); +} + +void OSystem_SDL::getTimeAndDate(TimeDate &td) const { + time_t curTime = time(0); + struct tm t = *localtime(&curTime); + td.tm_sec = t.tm_sec; + td.tm_min = t.tm_min; + td.tm_hour = t.tm_hour; + td.tm_mday = t.tm_mday; + td.tm_mon = t.tm_mon; + td.tm_year = t.tm_year; +} diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 8dae6a779c..46053faf46 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -60,6 +60,10 @@ public: virtual bool pollEvent(Common::Event &event); + uint32 getMillis(); + void delayMillis(uint msecs); + void getTimeAndDate(TimeDate &td) const; + protected: bool _inited; |