mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
GRIFFON: fix timer behavior during GMM pause
(possible fix for bug no. 13489 - "GRIFFON: Bringing up ScummVM menu (Alt+F5) corrupts engine")
This commit is contained in:
parent
76b3b5bc84
commit
cb3424be01
@ -75,6 +75,7 @@ GriffonEngine::GriffonEngine(OSystem *syst) : Engine(syst) {
|
||||
_saveSlot = 0;
|
||||
|
||||
_ticks = g_system->getMillis();
|
||||
_ticksAtPauseStart = 0;
|
||||
|
||||
for (int i = 0; i < 33; ++i) {
|
||||
for (int j = 0; j < 6; ++j) {
|
||||
@ -193,4 +194,14 @@ Common::Error GriffonEngine::run() {
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
void GriffonEngine::pauseEngineIntern(bool pause) {
|
||||
if (pause) {
|
||||
_ticksAtPauseStart = _ticks;
|
||||
} else {
|
||||
uint32 diff = _system->getMillis() - _ticksAtPauseStart;
|
||||
_ticks += diff;
|
||||
_nextTicks += diff;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -442,6 +442,8 @@ private:
|
||||
void setupAudio();
|
||||
void updateMusic();
|
||||
|
||||
// Common engine overrides
|
||||
void pauseEngineIntern(bool pause) override;
|
||||
bool canLoadGameStateCurrently() override { return true; }
|
||||
bool canSaveGameStateCurrently() override { return _gameMode == kGameModePlay; }
|
||||
int getAutosaveSlot() const override { return 4; }
|
||||
@ -476,7 +478,7 @@ private:
|
||||
int _scriptFlag[100][10], _saveSlot; // script, flag
|
||||
|
||||
// timer related - move to local later
|
||||
int _ticks, _ticksPassed, _nextTicks;
|
||||
uint _ticks, _ticksPassed, _nextTicks, _ticksAtPauseStart;
|
||||
float _fp, _fps, _fpsr; // CHECKME: _fp and _fps seems to be integers
|
||||
int _secsInGame, _secStart;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user