[Scummvm-cvs-logs] CVS: scummvm/gob game.cpp,1.14,1.15 inter.cpp,1.12,1.13

Eugene Sandulenko sev at users.sourceforge.net
Tue Apr 12 16:46:21 CEST 2005


Update of /cvsroot/scummvm/scummvm/gob
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15151

Modified Files:
	game.cpp inter.cpp 
Log Message:
Patch #1181639. "GOB: Possible inter_renewTimeInVars() fix"


Index: game.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/game.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- game.cpp	11 Apr 2005 10:55:22 -0000	1.14
+++ game.cpp	12 Apr 2005 23:45:14 -0000	1.15
@@ -1714,7 +1714,6 @@
 	int32 variablesCount;
 	char *filePtr;
 	char *savedIP;
-	//struct date dateVal;
 	int16 i;
 
 	oldNestLevel = inter_nestLevel;
@@ -1835,16 +1834,6 @@
 			inter_execPtr = (char *)game_totFileData;
 			inter_execPtr += READ_LE_UINT32((char *)game_totFileData + 0x64);
 
-/*
- * removed by olki to get it to compile.
-			getdate(&dateVal);
-
-			WRITE_LE_UINT32(inter_variables + 0x14), dateVal.da_year);
-			WRITE_LE_UINT32(inter_variables + 0x18), dateVal.da_mon);
-			WRITE_LE_UINT32(inter_variables + 0x1c), 0);
-			WRITE_LE_UINT32(inter_variables + 0x20), dateVal.da_day);
-*/
-
 			inter_renewTimeInVars();
 
 			WRITE_VAR(13, useMouse);

Index: inter.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/inter.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- inter.cpp	12 Apr 2005 08:59:45 -0000	1.12
+++ inter.cpp	12 Apr 2005 23:45:15 -0000	1.13
@@ -745,20 +745,18 @@
 }
 
 void inter_renewTimeInVars(void) {
-	uint32 time = g_system->getMillis();
-
-	time /= 1000; // convert to seconds
-
-	// hours
-	WRITE_VAR(9, time / 3600);
-	time %= 3600;
+	struct tm *t;
+	time_t now = time(NULL);
 
-	// minutes
-	WRITE_VAR(10, time / 60);
-	time %= 60;
+	t = localtime(&now);
 
-	// seconds
-	WRITE_VAR(11, time);
+	WRITE_VAR(5, 1900 + t->tm_year);
+	WRITE_VAR(6, t->tm_mon);
+	WRITE_VAR(7, 0);
+	WRITE_VAR(8, t->tm_mday);
+	WRITE_VAR(9, t->tm_hour);
+	WRITE_VAR(10, t->tm_min);
+	WRITE_VAR(11, t->tm_sec);
 }
 
 void inter_playComposition(void) {





More information about the Scummvm-git-logs mailing list