Fix timer events time when saving game in FF
svn-id: r22179
This commit is contained in:
parent
7383f81d2f
commit
46058e8d17
1 changed files with 3 additions and 1 deletions
|
@ -481,6 +481,7 @@ bool SimonEngine::saveGame(uint slot, char *caption) {
|
||||||
Common::OutSaveFile *f;
|
Common::OutSaveFile *f;
|
||||||
uint item_index, num_item, i, j;
|
uint item_index, num_item, i, j;
|
||||||
TimeEvent *te;
|
TimeEvent *te;
|
||||||
|
uint32 curTime = 0;
|
||||||
uint32 gsc = _gameStoppedClock;
|
uint32 gsc = _gameStoppedClock;
|
||||||
|
|
||||||
_lockWord |= 0x100;
|
_lockWord |= 0x100;
|
||||||
|
@ -493,6 +494,7 @@ bool SimonEngine::saveGame(uint slot, char *caption) {
|
||||||
|
|
||||||
if (getGameType() == GType_FF) {
|
if (getGameType() == GType_FF) {
|
||||||
f->write(caption, 100);
|
f->write(caption, 100);
|
||||||
|
curTime = time(NULL);
|
||||||
} else {
|
} else {
|
||||||
f->write(caption, 18);
|
f->write(caption, 18);
|
||||||
}
|
}
|
||||||
|
@ -510,7 +512,7 @@ bool SimonEngine::saveGame(uint slot, char *caption) {
|
||||||
if (_clockStopped)
|
if (_clockStopped)
|
||||||
gsc += ((uint32)time(NULL) - _clockStopped);
|
gsc += ((uint32)time(NULL) - _clockStopped);
|
||||||
for (te = _firstTimeStruct; te; te = te->next) {
|
for (te = _firstTimeStruct; te; te = te->next) {
|
||||||
f->writeUint32BE(te->time + gsc);
|
f->writeUint32BE(te->time - curTime + gsc);
|
||||||
f->writeUint16BE(te->subroutine_id);
|
f->writeUint16BE(te->subroutine_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue