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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Mar 12 19:36:51 CET 2008


Revision: 31112
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31112&view=rev
Author:   fingolfin
Date:     2008-03-12 11:36:51 -0700 (Wed, 12 Mar 2008)

Log Message:
-----------
Implemented OSystem_SDL::getTimeAndDate (identical to OSystem::getTimeAndDate, which will eventually be REMOVED -- all porters should copy this change, if they haven't already)

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

Modified: scummvm/trunk/backends/platform/sdl/sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/sdl.cpp	2008-03-12 16:36:49 UTC (rev 31111)
+++ scummvm/trunk/backends/platform/sdl/sdl.cpp	2008-03-12 18:36:51 UTC (rev 31112)
@@ -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 @@
 	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;

Modified: scummvm/trunk/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/trunk/backends/platform/sdl/sdl.h	2008-03-12 16:36:49 UTC (rev 31111)
+++ scummvm/trunk/backends/platform/sdl/sdl.h	2008-03-12 18:36:51 UTC (rev 31112)
@@ -154,6 +154,7 @@
 	// Quit
 	virtual void quit(); // overloaded by CE backend
 
+	virtual void getTimeAndDate(struct tm &t) const;
 	virtual Common::TimerManager *getTimerManager();
 
 	// Mutex handling


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