From ef319ad6745678275a4c5eb159d6d95fdf17649f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 28 Dec 2007 07:43:52 +0000 Subject: Patch #1859448: Add OSystem::getTimeAndDate API svn-id: r30034 --- backends/platform/ps2/ps2time.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backends/platform/ps2') diff --git a/backends/platform/ps2/ps2time.cpp b/backends/platform/ps2/ps2time.cpp index 2e7741bfed..5bd62b640d 100644 --- a/backends/platform/ps2/ps2time.cpp +++ b/backends/platform/ps2/ps2time.cpp @@ -104,10 +104,15 @@ void OSystem_PS2::readRtcTime(void) { } extern "C" time_t time(time_t *p) { + if (p) *p = (time_t)g_timeSecs; return (time_t)g_timeSecs; } extern "C" struct tm *localtime(const time_t *p) { + // FIXME: This function should actually use the value in *p! + // But the work needed for that is not necessary -- just implement + // OSystem::getTimeAndDate using the code provided here, and + // ditch the custom time & localtime methods. uint32 currentSecs = g_timeSecs + (msecCount - g_lastTimeCheck) / 1000; if (currentSecs >= SECONDS_PER_DAY) { buildNewDate(+1); -- cgit v1.2.3