From 6b3b7a5dc21f90608874d6619a46e554760e3e0e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 12 Mar 2008 18:36:51 +0000 Subject: 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 --- backends/platform/sdl/sdl.cpp | 7 +++++++ backends/platform/sdl/sdl.h | 1 + 2 files changed, 8 insertions(+) (limited to 'backends') 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 // 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 -- cgit v1.2.3