Skip to content

Commit

Permalink
SAGA: Fixed bug #3276033: IHNM: Savegame reminder not reset
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Apr 17, 2011
1 parent 9363e19 commit 64c3332
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions engines/saga/interface.cpp
Expand Up @@ -1379,9 +1379,7 @@ void Interface::setSave(PanelButton *panelButton) {
fileName = _vm->calcSaveFileName(_vm->getSaveFile(_optionSaveFileTitleNumber)->slotNumber);
_vm->save(fileName, _textInputString);
}
_vm->getTimerManager()->removeTimerProc(&saveReminderCallback);
_vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
setSaveReminderState(1);
resetSaveReminder();

_textInput = false;
setMode(kPanelOption);
Expand All @@ -1393,6 +1391,12 @@ void Interface::setSave(PanelButton *panelButton) {
}
}

void Interface::resetSaveReminder() {
_vm->getTimerManager()->removeTimerProc(&saveReminderCallback);
_vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);

This comment has been minimized.

Copy link
@lordhoto

lordhoto Apr 17, 2011

Contributor

Seeing that saveReminderCallback calls Interface::updateSaveReminder which in turn calls Interface::drawStatusBar, which seems to handle some graphics internal stuff, it looks odd that all this isn't protected by a Mutex. At least it seems that drawStatusBar can be called from the main thread too (like from Events::handleOneShot).

Maybe it's perfectly safe to ignore the fact that a timer proc might be a different thread, but it looks odd and should at least have a comment why this works fine.

setSaveReminderState(1);
}

void Interface::handleOptionUpdate(const Point& mousePoint) {
int16 mouseY;
Rect rect;
Expand Down
2 changes: 2 additions & 0 deletions engines/saga/interface.h
Expand Up @@ -288,6 +288,8 @@ class Interface {

int32 getProtectHash() { return _protectHash; }

void resetSaveReminder();

private:
void handleMainUpdate(const Point& mousePoint); // main panel update
void handleMainClick(const Point& mousePoint); // main panel click
Expand Down
2 changes: 2 additions & 0 deletions engines/saga/saveload.cpp
Expand Up @@ -256,6 +256,8 @@ void SagaEngine::save(const char *fileName, const char *saveName) {
warning("Can't write file '%s'. (Disk full?)", fileName);

delete out;

_interface->resetSaveReminder();
}

void SagaEngine::load(const char *fileName) {
Expand Down

0 comments on commit 64c3332

Please sign in to comment.