diff options
author | Max Horn | 2008-03-12 18:36:51 +0000 |
---|---|---|
committer | Max Horn | 2008-03-12 18:36:51 +0000 |
commit | 6b3b7a5dc21f90608874d6619a46e554760e3e0e (patch) | |
tree | d62fdbc2029811a7f6020d868c9445534a34532e | |
parent | 7288b92d0dea4c6e2a74f89e16f913ec5cf3ceb0 (diff) | |
download | scummvm-rg350-6b3b7a5dc21f90608874d6619a46e554760e3e0e.tar.gz scummvm-rg350-6b3b7a5dc21f90608874d6619a46e554760e3e0e.tar.bz2 scummvm-rg350-6b3b7a5dc21f90608874d6619a46e554760e3e0e.zip |
Implemented OSystem_SDL::getTimeAndDate (identical to OSystem::getTimeAndDate, which will eventually be REMOVED -- all porters should copy this change, if they haven't already)
svn-id: r31112
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 7 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 6b785f2409..4394b6c253 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -34,6 +34,8 @@ #include "icons/scummvm.xpm" +#include <time.h> // for getTimeAndDate() + //#define SAMPLES_PER_SEC 11025 #define SAMPLES_PER_SEC 22050 //#define SAMPLES_PER_SEC 44100 @@ -216,6 +218,11 @@ void OSystem_SDL::delayMillis(uint msecs) { SDL_Delay(msecs); } +void OSystem_SDL::getTimeAndDate(struct tm &t) const { + time_t curTime = time(0); + t = *localtime(&curTime); +} + Common::TimerManager *OSystem_SDL::getTimerManager() { assert(_timer); return _timer; diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index e77dcbf540..2cbadae2f4 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -154,6 +154,7 @@ public: // Quit virtual void quit(); // overloaded by CE backend + virtual void getTimeAndDate(struct tm &t) const; virtual Common::TimerManager *getTimerManager(); // Mutex handling |