From d5e09de48c09de714bcd916fe9c6b3d2522ccbc6 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Sat, 1 Mar 2008 22:12:52 +0000 Subject: Added getTimeAndDate() implementation. svn-id: r31027 --- backends/platform/dc/dc.h | 3 +++ backends/platform/dc/dcmain.cpp | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'backends') diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index 6a7d8c5f16..b7494a77bc 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -116,6 +116,9 @@ class OSystem_Dreamcast : public OSystem, public FilesystemFactory { // Delay for a specified amount of milliseconds void delayMillis(uint msecs); + // Get the current time and date. Correspond to time()+localtime(). + void getTimeAndDate(struct tm &t) const; + // Get the next event. // Returns true if an event was retrieved. bool pollEvent(Common::Event &event); diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index e21fd762c9..913bc9948e 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -190,6 +190,11 @@ bool OSystem_Dreamcast::getFeatureState(Feature f) } } +void OSystem_Dreamcast::getTimeAndDate(struct tm &t) const { + time_t curTime; + time(&curTime); + t = *localtime(&curTime); +} void dc_init_hardware() { -- cgit v1.2.3