aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/platform/sdl/sdl.cpp7
-rw-r--r--backends/platform/sdl/sdl.h1
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