Ticket #8416: gobtime.diff

File gobtime.diff, 1.7 KB (added by eriktorbjorn, 16 years ago)

Patch against an April 12 CVS snapshot

  • gob/game.cpp

    diff -ur --exclude=CVS --exclude=Makefile ScummVM/gob/game.cpp ScummVM+hack/gob/game.cpp
    old new  
    17141714        int32 variablesCount;
    17151715        char *filePtr;
    17161716        char *savedIP;
    1717         //struct date dateVal;
    17181717        int16 i;
    17191718
    17201719        oldNestLevel = inter_nestLevel;
     
    18351834                        inter_execPtr = (char *)game_totFileData;
    18361835                        inter_execPtr += READ_LE_UINT32((char *)game_totFileData + 0x64);
    18371836
    1838 /*
    1839  * removed by olki to get it to compile.
    1840                         getdate(&dateVal);
    1841 
    1842                         WRITE_LE_UINT32(inter_variables + 0x14), dateVal.da_year);
    1843                         WRITE_LE_UINT32(inter_variables + 0x18), dateVal.da_mon);
    1844                         WRITE_LE_UINT32(inter_variables + 0x1c), 0);
    1845                         WRITE_LE_UINT32(inter_variables + 0x20), dateVal.da_day);
    1846 */
    1847 
    18481837                        inter_renewTimeInVars();
    18491838
    18501839                        WRITE_VAR(13, useMouse);
  • gob/inter.cpp

    diff -ur --exclude=CVS --exclude=Makefile ScummVM/gob/inter.cpp ScummVM+hack/gob/inter.cpp
    old new  
    745745}
    746746
    747747void inter_renewTimeInVars(void) {
    748         uint32 time = g_system->getMillis();
     748        struct tm *t;
     749        time_t now = time(NULL);
    749750
    750         time /= 1000; // convert to seconds
     751        t = localtime(&now);
    751752
    752         // hours
    753         WRITE_VAR(9, time / 3600);
    754         time %= 3600;
    755 
    756         // minutes
    757         WRITE_VAR(10, time / 60);
    758         time %= 60;
    759 
    760         // seconds
    761         WRITE_VAR(11, time);
     753        WRITE_VAR(5, 1900 + t->tm_year);
     754        WRITE_VAR(6, t->tm_mon);
     755        WRITE_VAR(7, 0);
     756        WRITE_VAR(8, t->tm_mday);
     757        WRITE_VAR(9, t->tm_hour);
     758        WRITE_VAR(10, t->tm_min);
     759        WRITE_VAR(11, t->tm_sec);
    762760}
    763761
    764762void inter_playComposition(void) {