[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.114,1.115 scumm.h,1.275,1.276 scummvm.cpp,2.298,2.299
Max Horn
fingolfin at users.sourceforge.net
Mon Jul 28 09:56:06 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv10816
Modified Files:
resource.cpp scumm.h scummvm.cpp
Log Message:
removed _encbyte (it's only used locally)
Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- resource.cpp 24 Jul 2003 17:44:00 -0000 1.114
+++ resource.cpp 28 Jul 2003 16:55:05 -0000 1.115
@@ -40,6 +40,7 @@
bool result;
char buf[128];
char buf2[128] = "";
+ byte encByte = 0;
debug(9, "openRoom(%d)", room);
assert(room >= 0);
@@ -51,7 +52,6 @@
/* Room -1 means close file */
if (room == -1) {
- _encbyte = 0;
deleteRoomOffsets();
_fileHandle.close();
return;
@@ -92,28 +92,28 @@
sprintf(buf2, "%s.sm%.1d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
}
- _encbyte = (_features & GF_USE_KEY) ? 0x69 : 0;
+ encByte = (_features & GF_USE_KEY) ? 0x69 : 0;
} else if (!(_features & GF_SMALL_NAMES)) {
if (room == 0 || room >= 900) {
sprintf(buf, "%.3d.lfl", room);
- _encbyte = 0;
- if (openResourceFile(buf)) {
+ encByte = 0;
+ if (openResourceFile(buf, encByte)) {
return;
}
askForDisk(buf, room == 0 ? 0 : res.roomno[rtRoom][room]);
} else {
sprintf(buf, "disk%.2d.lec", room == 0 ? 0 : res.roomno[rtRoom][room]);
- _encbyte = 0x69;
+ encByte = 0x69;
}
} else {
sprintf(buf, "%.2d.lfl", room);
- _encbyte = (_features & GF_USE_KEY) ? 0xFF : 0;
+ encByte = (_features & GF_USE_KEY) ? 0xFF : 0;
}
- result = openResourceFile(buf);
+ result = openResourceFile(buf, encByte);
if ((result == false) && (buf2[0]))
- result = openResourceFile(buf2);
+ result = openResourceFile(buf2, encByte);
if (result) {
if (room == 0)
@@ -134,8 +134,8 @@
do {
sprintf(buf, "%.3d.lfl", room);
- _encbyte = 0;
- if (openResourceFile(buf))
+ encByte = 0;
+ if (openResourceFile(buf, encByte))
break;
askForDisk(buf, room == 0 ? 0 : res.roomno[rtRoom][room]);
} while (1);
@@ -147,7 +147,6 @@
void Scumm::closeRoom() {
if (_lastLoadedRoom != -1) {
_lastLoadedRoom = -1;
- _encbyte = 0;
deleteRoomOffsets();
_fileHandle.close();
}
@@ -205,14 +204,14 @@
}
}
-bool Scumm::openResourceFile(const char *filename) {
+bool Scumm::openResourceFile(const char *filename, byte encByte) {
debug(9, "openResourceFile(%s)", filename);
- if (_fileHandle.isOpen() == true) {
+ if (_fileHandle.isOpen()) {
_fileHandle.close();
}
- _fileHandle.open(filename, getGameDataPath(), 1, _encbyte);
+ _fileHandle.open(filename, getGameDataPath(), 1, encByte);
return _fileHandle.isOpen();
}
@@ -1661,7 +1660,7 @@
_shadowPalette = (byte *)calloc(_shadowPaletteSize, 1);
allocateArrays();
- _dynamicRoomOffsets = 1;
+ _dynamicRoomOffsets = true;
}
void Scumm::allocateArrays() {
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.275
retrieving revision 1.276
diff -u -d -r1.275 -r1.276
--- scumm.h 28 Jul 2003 01:36:16 -0000 1.275
+++ scumm.h 28 Jul 2003 16:55:06 -0000 1.276
@@ -604,7 +604,6 @@
void setStringVars(int i);
/* Should be in Resource class */
- byte _encbyte;
File _fileHandle;
uint32 _fileOffset;
int _resourceHeaderSize;
@@ -622,7 +621,7 @@
void deleteRoomOffsets();
void readRoomsOffsets();
void askForDisk(const char *filename, int disknum);
- bool openResourceFile(const char *filename);
+ bool openResourceFile(const char *filename, byte encByte);
void loadPtrToResource(int type, int i, const byte *ptr);
void readResTypeList(int id, uint32 tag, const char *name);
Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.298
retrieving revision 2.299
diff -u -d -r2.298 -r2.299
--- scummvm.cpp 28 Jul 2003 01:36:16 -0000 2.298
+++ scummvm.cpp 28 Jul 2003 16:55:06 -0000 2.299
@@ -306,7 +306,6 @@
memset(_scummStack, 0, sizeof(_scummStack));
_keyScriptKey = 0;
_keyScriptNo = 0;
- _encbyte = 0;
memset(&_fileHandle, 0, sizeof(File));
_fileOffset = 0;
_exe_name = NULL;
More information about the Scummvm-git-logs
mailing list