[Scummvm-cvs-logs] SF.net SVN: scummvm: [30083] scummvm/trunk/backends/platform/wince

knakos at users.sourceforge.net knakos at users.sourceforge.net
Sun Dec 30 18:15:11 CET 2007


Revision: 30083
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30083&view=rev
Author:   knakos
Date:     2007-12-30 09:15:11 -0800 (Sun, 30 Dec 2007)

Log Message:
-----------
implement new gettimeanddate method - fixes bug 1834822 WINCE: Save games have incorrect time & date

Modified Paths:
--------------
    scummvm/trunk/backends/platform/wince/missing/missing.cpp
    scummvm/trunk/backends/platform/wince/wince-sdl.cpp
    scummvm/trunk/backends/platform/wince/wince-sdl.h

Modified: scummvm/trunk/backends/platform/wince/missing/missing.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/missing.cpp	2007-12-30 16:32:57 UTC (rev 30082)
+++ scummvm/trunk/backends/platform/wince/missing/missing.cpp	2007-12-30 17:15:11 UTC (rev 30083)
@@ -89,42 +89,6 @@
 	return 0;
 }
 
-/* Limited implementation of time.h. time_t formula is possibly incorrect. */
-EXT_C time_t time(time_t* res)
-{
-	time_t t;
-	SYSTEMTIME st;
-	GetLocalTime(&st);
-
-	t = (time_t)(((((((st.wYear-1970)*12+st.wMonth)*31+st.wDay)*7+st.wDayOfWeek)*24+st.wHour)*60+st.wMinute)*60+st.wSecond);
-
-	if (res)
-		*res = t;
-	return t;
-}
-
-EXT_C struct tm* localtime(time_t* timer)
-{
-	static struct tm tmLocalTime;
-	unsigned long rem = *timer;
-
-	tmLocalTime.tm_sec  = (short)(rem % 60);
-	rem /= 60;
-	tmLocalTime.tm_min  = (short)(rem % 60);
-	rem /= 60;
-	tmLocalTime.tm_hour = (short)(rem % 24);
-	rem /= 24;
-	tmLocalTime.tm_mday = (short)(rem % 7);
-	rem /= 7;
-	tmLocalTime.tm_mday = (short)(rem % 31);
-	rem /= 31;
-	tmLocalTime.tm_mon  = (short)(rem % 12);
-	rem /= 12;
-	tmLocalTime.tm_year = (short)(rem+1970);
-
-	return &tmLocalTime;
-}
-
 char cwd[MAX_PATH+1] = "";
 EXT_C char *getcwd(char *buffer, int maxlen)
 {
@@ -408,13 +372,6 @@
 }
 
 /* Very limited implementation of sys/time.h */
-void gettimeofday(struct timeval* tp, void* dummy)
-{
-	DWORD dt = GetTickCount();
-	tp->tv_sec = dt/1000;
-	tp->tv_usec = dt*1000;
-}
-
 void usleep(long usec)
 {
 	long msec = usec/1000;

Modified: scummvm/trunk/backends/platform/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/wince-sdl.cpp	2007-12-30 16:32:57 UTC (rev 30082)
+++ scummvm/trunk/backends/platform/wince/wince-sdl.cpp	2007-12-30 17:15:11 UTC (rev 30083)
@@ -2430,6 +2430,19 @@
 	OSystem_SDL::quit();
 }
 
+void OSystem_WINCE3::getTimeAndDate(struct tm &t) const {
+	SYSTEMTIME systime;
+
+	GetLocalTime(&systime);
+	t.tm_year 	= systime.wYear - 1900;
+	t.tm_mon	= systime.wMonth - 1;
+	t.tm_wday	= systime.wDayOfWeek;
+	t.tm_mday	= systime.wDay;
+	t.tm_hour	= systime.wHour;
+	t.tm_min	= systime.wMinute;
+	t.tm_sec	= systime.wSecond;
+}
+
 int OSystem_WINCE3::_platformScreenWidth;
 int OSystem_WINCE3::_platformScreenHeight;
 bool OSystem_WINCE3::_isOzone;

Modified: scummvm/trunk/backends/platform/wince/wince-sdl.h
===================================================================
--- scummvm/trunk/backends/platform/wince/wince-sdl.h	2007-12-30 16:32:57 UTC (rev 30082)
+++ scummvm/trunk/backends/platform/wince/wince-sdl.h	2007-12-30 17:15:11 UTC (rev 30083)
@@ -86,6 +86,7 @@
 	bool setSoundCallback(SoundProc proc, void *param);
 	// Overloaded from OSystem
 	//void engineInit();
+	void getTimeAndDate(struct tm &t) const;
 
 	// Overloaded from SDL_Common (FIXME)
 	void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list