[Scummvm-cvs-logs] SF.net SVN: scummvm:[40773] scummvm/trunk/engines/agi
sev at users.sourceforge.net
sev at users.sourceforge.net
Thu May 21 23:51:50 CEST 2009
Revision: 40773
http://scummvm.svn.sourceforge.net/scummvm/?rev=40773&view=rev
Author: sev
Date: 2009-05-21 21:51:50 +0000 (Thu, 21 May 2009)
Log Message:
-----------
Proper fix for bug #2537054: "AGI: Using GMM to load causes graphics glitches".
Save/load via GMM is not allowed in certain situations now.
Modified Paths:
--------------
scummvm/trunk/engines/agi/agi.h
scummvm/trunk/engines/agi/detection.cpp
scummvm/trunk/engines/agi/saveload.cpp
scummvm/trunk/engines/agi/text.cpp
Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h 2009-05-21 21:50:11 UTC (rev 40772)
+++ scummvm/trunk/engines/agi/agi.h 2009-05-21 21:51:50 UTC (rev 40773)
@@ -331,7 +331,8 @@
fStatusSelectsItems,
fMenusWork,
fOutputMode, /* 15 */
- fAutoRestart
+ fAutoRestart,
+ fNoSaveLoadAllowed
};
struct AgiEvent {
@@ -968,7 +969,6 @@
int messageBox(const char *);
int selectionBox(const char *, const char **);
void closeWindow(void);
- void forgetWindow(void);
void drawWindow(int, int, int, int);
void printText(const char *, int, int, int, int, int, int, bool checkerboard = false);
void printTextConsole(const char *, int, int, int, int, int);
Modified: scummvm/trunk/engines/agi/detection.cpp
===================================================================
--- scummvm/trunk/engines/agi/detection.cpp 2009-05-21 21:50:11 UTC (rev 40772)
+++ scummvm/trunk/engines/agi/detection.cpp 2009-05-21 21:51:50 UTC (rev 40773)
@@ -1174,11 +1174,11 @@
}
bool AgiBase::canLoadGameStateCurrently() {
- return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork));
+ return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork) && !getflag(fNoSaveLoadAllowed));
}
bool AgiBase::canSaveGameStateCurrently() {
- return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork));
+ return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork) && !getflag(fNoSaveLoadAllowed));
}
} // End of namespace Agi
Modified: scummvm/trunk/engines/agi/saveload.cpp
===================================================================
--- scummvm/trunk/engines/agi/saveload.cpp 2009-05-21 21:50:11 UTC (rev 40772)
+++ scummvm/trunk/engines/agi/saveload.cpp 2009-05-21 21:51:50 UTC (rev 40773)
@@ -552,6 +552,8 @@
int textCentre, buttonLength, buttonX[2], buttonY;
const char *buttonText[] = { " OK ", "Cancel", NULL };
+ setflag(fNoSaveLoadAllowed, true);
+
for (i = 0; i < NUM_VISIBLE_SLOTS; i++) {
getSavegameDescription(_firstSlot + i, desc[i]);
}
@@ -735,6 +737,8 @@
getout:
closeWindow();
+ setflag(fNoSaveLoadAllowed, false);
+
return rc;
}
Modified: scummvm/trunk/engines/agi/text.cpp
===================================================================
--- scummvm/trunk/engines/agi/text.cpp 2009-05-21 21:50:11 UTC (rev 40772)
+++ scummvm/trunk/engines/agi/text.cpp 2009-05-21 21:51:50 UTC (rev 40773)
@@ -300,10 +300,6 @@
void AgiEngine::closeWindow() {
debugC(4, kDebugLevelText, "closeWindow()");
- if (getflag(fRestoreJustRan)) {
- forgetWindow();
- }
-
_sprites->eraseBoth();
eraseTextbox(); /* remove window, if any */
_sprites->blitBoth();
@@ -312,18 +308,6 @@
}
/**
- * Remove existing window without restoring anything
- */
-void AgiEngine::forgetWindow() {
- debugC(4, kDebugLevelText, "forgetWindow()");
-
- free(_game.window.buffer);
- _game.window.buffer = 0;
- _game.window.active = false;
- _game.hasWindow = false;
-}
-
-/**
* Display a message box.
* This function displays the specified message in a text box
* centered in the screen and waits until a key is pressed.
@@ -356,6 +340,8 @@
int rc = -1;
int bx[5], by[5];
+ setflag(fNoSaveLoadAllowed, true);
+
_sprites->eraseBoth();
blitTextbox(m, -1, -1, -1);
@@ -440,6 +426,8 @@
closeWindow();
debugC(2, kDebugLevelText, "selectionBox(): Result = %d", rc);
+ setflag(fNoSaveLoadAllowed, false);
+
return rc;
}
@@ -468,11 +456,16 @@
/* blocking */
+ setflag(fNoSaveLoadAllowed, true);
+
if (_game.vars[vWindowReset] == 0) {
int k;
setvar(vKey, 0);
k = waitKey();
closeWindow();
+
+ setflag(fNoSaveLoadAllowed, false);
+
return k;
}
@@ -499,6 +492,8 @@
closeWindow();
+ setflag(fNoSaveLoadAllowed, false);
+
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list