aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohn Willis2008-03-12 19:37:21 +0000
committerJohn Willis2008-03-12 19:37:21 +0000
commite971282d088a8bfafee63a43ebf111e2d2215100 (patch)
tree0c5ed7116749016195be8697f228d87e910b3c0a /backends
parent05b159609b074fb4f45454edcc92446557b3167d (diff)
downloadscummvm-rg350-e971282d088a8bfafee63a43ebf111e2d2215100.tar.gz
scummvm-rg350-e971282d088a8bfafee63a43ebf111e2d2215100.tar.bz2
scummvm-rg350-e971282d088a8bfafee63a43ebf111e2d2215100.zip
Implemented OSystem_GP2X::getTimeAndDate (identical to OSystem::getTimeAndDate).
svn-id: r31115
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/gp2x/gp2x-common.h1
-rw-r--r--backends/platform/gp2x/gp2x.cpp7
2 files changed, 7 insertions, 1 deletions
diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h
index 3d4a4c90a0..7f70f2d301 100644
--- a/backends/platform/gp2x/gp2x-common.h
+++ b/backends/platform/gp2x/gp2x-common.h
@@ -150,6 +150,7 @@ public:
// Quit
virtual void quit(); // overloaded by CE backend
+ virtual void getTimeAndDate(struct tm &t) const;
virtual Common::TimerManager *getTimerManager();
// Mutex handling
diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp
index 7b99d9cfeb..3ebb982921 100644
--- a/backends/platform/gp2x/gp2x.cpp
+++ b/backends/platform/gp2x/gp2x.cpp
@@ -46,6 +46,7 @@
#include <limits.h>
#include <errno.h>
#include <sys/stat.h>
+#include <time.h>
// Disable for normal serial logging.
#define DUMP_STDOUT
@@ -185,7 +186,6 @@ void OSystem_GP2X::initBackend() {
// enable joystick
if (joystick_num > -1 && SDL_NumJoysticks() > 0) {
- //printf("Using joystick: %s\n", SDL_JoystickName(0));
_joystick = SDL_JoystickOpen(joystick_num);
}
@@ -301,6 +301,11 @@ void OSystem_GP2X::delayMillis(uint msecs) {
SDL_Delay(msecs);
}
+void OSystem_GP2X::getTimeAndDate(struct tm &t) const {
+ time_t curTime = time(0);
+ t = *localtime(&curTime);
+}
+
Common::TimerManager *OSystem_GP2X::getTimerManager() {
assert(_timer);
return _timer;