aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorEugene Sandulenko2009-06-06 17:42:37 +0000
committerEugene Sandulenko2009-06-06 17:42:37 +0000
commitc5f41b29fa1a7baf3e5b03e1d37bb2b95ba2b9fe (patch)
treec6854ffa4270052d0214bc81b7a97f000d26b36c /engines/agi
parent5a07ba9c57ea96cb60ccecfe4852504ba72b2a69 (diff)
downloadscummvm-rg350-c5f41b29fa1a7baf3e5b03e1d37bb2b95ba2b9fe.tar.gz
scummvm-rg350-c5f41b29fa1a7baf3e5b03e1d37bb2b95ba2b9fe.tar.bz2
scummvm-rg350-c5f41b29fa1a7baf3e5b03e1d37bb2b95ba2b9fe.zip
Stop abusing game flag.
svn-id: r41247
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/agi.cpp2
-rw-r--r--engines/agi/agi.h5
-rw-r--r--engines/agi/detection.cpp4
-rw-r--r--engines/agi/saveload.cpp4
-rw-r--r--engines/agi/text.cpp10
5 files changed, 13 insertions, 12 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 3b61807dfb..fb753c817f 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -626,7 +626,7 @@ AgiButtonStyle::AgiButtonStyle(Common::RenderMode renderMode) {
}
AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
-
+ _noSaveLoadAllowed = false;
}
AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) {
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index fb58c86db2..4144304ca0 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -331,8 +331,7 @@ enum {
fStatusSelectsItems,
fMenusWork,
fOutputMode, // 15
- fAutoRestart,
- fNoSaveLoadAllowed
+ fAutoRestart
};
enum AgiSlowliness {
@@ -726,6 +725,8 @@ public:
AgiGame _game;
Common::RandomSource *_rnd;
+ bool _noSaveLoadAllowed;
+
virtual void agiTimerLow() = 0;
virtual int agiGetKeypressLow() = 0;
virtual int agiIsKeypressLow() = 0;
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 880f6e4fd6..e1bb686055 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -1178,11 +1178,11 @@ Common::Error AgiBase::saveGameState(int slot, const char *desc) {
}
bool AgiBase::canLoadGameStateCurrently() {
- return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork) && !getflag(fNoSaveLoadAllowed) && _game.inputEnabled);
+ return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork) && !_noSaveLoadAllowed && _game.inputEnabled);
}
bool AgiBase::canSaveGameStateCurrently() {
- return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork) && !getflag(fNoSaveLoadAllowed) && _game.inputEnabled);
+ return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork) && !_noSaveLoadAllowed && _game.inputEnabled);
}
} // End of namespace Agi
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp
index 46f6d8d734..2438601b0c 100644
--- a/engines/agi/saveload.cpp
+++ b/engines/agi/saveload.cpp
@@ -578,7 +578,7 @@ int AgiEngine::selectSlot() {
int textCentre, buttonLength, buttonX[2], buttonY;
const char *buttonText[] = { " OK ", "Cancel", NULL };
- setflag(fNoSaveLoadAllowed, true);
+ _noSaveLoadAllowed = true;
for (i = 0; i < NUM_VISIBLE_SLOTS; i++) {
getSavegameDescription(_firstSlot + i, desc[i]);
@@ -763,7 +763,7 @@ press:
getout:
closeWindow();
- setflag(fNoSaveLoadAllowed, false);
+ _noSaveLoadAllowed = false;
return rc;
}
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index 1383419b24..9db15b6615 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -340,7 +340,7 @@ int AgiEngine::selectionBox(const char *m, const char **b) {
int rc = -1;
int bx[5], by[5];
- setflag(fNoSaveLoadAllowed, true);
+ _noSaveLoadAllowed = true;
_sprites->eraseBoth();
blitTextbox(m, -1, -1, -1);
@@ -426,7 +426,7 @@ getout:
closeWindow();
debugC(2, kDebugLevelText, "selectionBox(): Result = %d", rc);
- setflag(fNoSaveLoadAllowed, false);
+ _noSaveLoadAllowed = false;
return rc;
}
@@ -456,7 +456,7 @@ int AgiEngine::print(const char *p, int lin, int col, int len) {
// blocking
- setflag(fNoSaveLoadAllowed, true);
+ _noSaveLoadAllowed = true;
if (_game.vars[vWindowReset] == 0) {
int k;
@@ -464,7 +464,7 @@ int AgiEngine::print(const char *p, int lin, int col, int len) {
k = waitKey();
closeWindow();
- setflag(fNoSaveLoadAllowed, false);
+ _noSaveLoadAllowed = false;
return k;
}
@@ -492,7 +492,7 @@ int AgiEngine::print(const char *p, int lin, int col, int len) {
closeWindow();
- setflag(fNoSaveLoadAllowed, false);
+ _noSaveLoadAllowed = false;
return 0;
}