From 4a850209d739111b539fc39bcf003abd6e061538 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sun, 20 Jun 2010 20:11:30 +0000 Subject: Removed getMillis, delayMillis and getTimeAndDate functions from TimerManager. svn-id: r50095 --- backends/platform/sdl/sdl.cpp | 23 +++++++++++++++++++++++ backends/platform/sdl/sdl.h | 4 ++++ 2 files changed, 27 insertions(+) (limited to 'backends/platform') 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 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; -- cgit v1.2.3