diff options
Diffstat (limited to 'gob')
-rw-r--r-- | gob/game.cpp | 11 | ||||
-rw-r--r-- | gob/inter.cpp | 26 |
2 files changed, 12 insertions, 25 deletions
diff --git a/gob/game.cpp b/gob/game.cpp index 2ee53afc1e..599564eaa4 100644 --- a/gob/game.cpp +++ b/gob/game.cpp @@ -1714,7 +1714,6 @@ void game_playTot(int16 skipPlay) { int32 variablesCount; char *filePtr; char *savedIP; - //struct date dateVal; int16 i; oldNestLevel = inter_nestLevel; @@ -1835,16 +1834,6 @@ void game_playTot(int16 skipPlay) { 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); diff --git a/gob/inter.cpp b/gob/inter.cpp index 21ffbbb434..a2a418407b 100644 --- a/gob/inter.cpp +++ b/gob/inter.cpp @@ -745,20 +745,18 @@ void inter_freeSprite(void) { } void inter_renewTimeInVars(void) { - uint32 time = g_system->getMillis(); - - time /= 1000; // convert to seconds - - // hours - WRITE_VAR(9, time / 3600); - time %= 3600; - - // minutes - WRITE_VAR(10, time / 60); - time %= 60; - - // seconds - WRITE_VAR(11, time); + struct tm *t; + time_t now = time(NULL); + + t = localtime(&now); + + 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) { |