[Scummvm-cvs-logs] CVS: scummvm/scumm dialogs.h,1.13,1.14 gfx.cpp,1.85,1.86 resource.cpp,1.30,1.31 scumm.h,1.87,1.88 string.cpp,1.56,1.57 vars.cpp,1.5,1.6
Max Horn
fingolfin at users.sourceforge.net
Sat Dec 21 04:35:07 CET 2002
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv1226/scumm
Modified Files:
dialogs.h gfx.cpp resource.cpp scumm.h string.cpp vars.cpp
Log Message:
partial checkin of patch #655594 (handling Y/N questions); cleanup
Index: dialogs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- dialogs.h 14 Dec 2002 14:31:44 -0000 1.13
+++ dialogs.h 21 Dec 2002 12:34:16 -0000 1.14
@@ -120,10 +120,8 @@
{ close(); }
virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers)
{
- if (ascii == ' ') // Close pause dialog if space key is pressed
- close();
- else
- ScummDialog::handleKeyDown(ascii, keycode, modifiers);
+ setResult(ascii);
+ close();
}
protected:
void setInfoText (const String& message);
@@ -132,6 +130,13 @@
class PauseDialog : public InfoDialog {
public:
PauseDialog(NewGui *gui, Scumm *scumm);
+ virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers)
+ {
+ if (ascii == ' ') // Close pause dialog if space key is pressed
+ close();
+ else
+ ScummDialog::handleKeyDown(ascii, keycode, modifiers);
+ }
};
#ifdef _WIN32_WCE
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- gfx.cpp 21 Dec 2002 01:11:41 -0000 1.85
+++ gfx.cpp 21 Dec 2002 12:34:16 -0000 1.86
@@ -410,7 +410,10 @@
if (height > _vm->_realHeight)
height = _vm->_realHeight;
- assert(_vm->_screenTop >= 0);
+ // Normally, _vm->_screenTop should always be >= 0, but for some old save games
+ // it is not, hence we check & correct it here.
+ if (_vm->_screenTop < 0)
+ _vm->_screenTop = 0;
ptr = vs->screenPtr + (x + vs->xstart) + (_vm->_screenTop + t) * _vm->_realWidth;
_vm->_system->copy_rect(ptr, _vm->_realWidth, x, vs->topline + t, w, height);
Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- resource.cpp 18 Dec 2002 14:57:25 -0000 1.30
+++ resource.cpp 21 Dec 2002 12:34:16 -0000 1.31
@@ -54,7 +54,7 @@
}
/* Either xxx.lfl or monkey.xxx file name */
- while (!_resFilePrefix) {
+ while (1) {
if (_features & GF_SMALL_NAMES)
roomlimit = 98;
else
@@ -64,7 +64,7 @@
else
room_offs = room ? _roomFileOffsets[room] : 0;
- if (room_offs == (int)0xFFFFFFFF)
+ if (room_offs == -1)
break;
if (room_offs != 0 && room != 0) {
@@ -96,10 +96,7 @@
}
} else {
sprintf(buf, "%.2d.lfl", room);
- if (_features & GF_OLD_BUNDLE)
- _encbyte = 0xFF;
- else
- _encbyte = 0;
+ _encbyte = (_features & GF_USE_KEY) ? 0xFF : 0;
}
if (openResourceFile(buf)) {
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- scumm.h 21 Dec 2002 01:11:42 -0000 1.87
+++ scumm.h 21 Dec 2002 12:34:16 -0000 1.88
@@ -533,7 +533,6 @@
/* Should be in Resource class */
byte _encbyte;
File _fileHandle;
- char *_resFilePrefix, *_resFilePath;
uint32 _fileOffset;
char *_exe_name; // This is the name we use for opening resource files
char *_game_name; // This is the game the user calls it, so use for saving
@@ -578,7 +577,6 @@
void nukeCharset(int i);
int _lastLoadedRoom, _roomResource;
- byte _resFilePathId, _fileReadFailed;
byte *findResourceData(uint32 tag, byte *ptr);
int getResourceDataSize(byte *ptr);
@@ -952,6 +950,7 @@
#endif
/* Scumm Vars */
+ byte VAR_KEYPRESS;
byte VAR_EGO;
byte VAR_CAMERA_POS_X;
byte VAR_HAVE_MSG;
Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- string.cpp 21 Dec 2002 01:11:42 -0000 1.56
+++ string.cpp 21 Dec 2002 12:34:17 -0000 1.57
@@ -423,7 +423,9 @@
_string[3].color = 4;
InfoDialog* dialog = new InfoDialog(_newgui, this, (char*)buf);
- runDialog (dialog);
+ // FIXME: I know this is the right thing to do for MI1 and MI2. For
+ // all other games it's just a guess.
+ _vars[VAR_KEYPRESS] = runDialog (dialog);
delete dialog;
_messagePtr = tmp;
Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/vars.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- vars.cpp 16 Dec 2002 12:12:31 -0000 1.5
+++ vars.cpp 21 Dec 2002 12:34:17 -0000 1.6
@@ -26,6 +26,7 @@
void Scumm::setupScummVars()
{
+ VAR_KEYPRESS = 0;
VAR_EGO = 1;
VAR_CAMERA_POS_X = 2;
VAR_HAVE_MSG = 3;
More information about the Scummvm-git-logs
mailing list