diff options
author | Max Horn | 2003-07-28 16:55:06 +0000 |
---|---|---|
committer | Max Horn | 2003-07-28 16:55:06 +0000 |
commit | 7caa1a0c9e0438d154e209e47627e93181c2e969 (patch) | |
tree | 27f6e5b6fad0bfca48155079896c3e7c6dc3ec76 | |
parent | e0ee9d3688f7ac1369f26cee4a31007c404cd3b4 (diff) | |
download | scummvm-rg350-7caa1a0c9e0438d154e209e47627e93181c2e969.tar.gz scummvm-rg350-7caa1a0c9e0438d154e209e47627e93181c2e969.tar.bz2 scummvm-rg350-7caa1a0c9e0438d154e209e47627e93181c2e969.zip |
removed _encbyte (it's only used locally)
svn-id: r9252
-rw-r--r-- | scumm/resource.cpp | 29 | ||||
-rw-r--r-- | scumm/scumm.h | 3 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 1 |
3 files changed, 15 insertions, 18 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 3201df4dd3..b1ea5ae15a 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -40,6 +40,7 @@ void Scumm::openRoom(int room) { bool result; char buf[128]; char buf2[128] = ""; + byte encByte = 0; debug(9, "openRoom(%d)", room); assert(room >= 0); @@ -51,7 +52,6 @@ void Scumm::openRoom(int room) { /* Room -1 means close file */ if (room == -1) { - _encbyte = 0; deleteRoomOffsets(); _fileHandle.close(); return; @@ -92,28 +92,28 @@ void Scumm::openRoom(int room) { 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 @@ void Scumm::openRoom(int room) { 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::openRoom(int room) { void Scumm::closeRoom() { if (_lastLoadedRoom != -1) { _lastLoadedRoom = -1; - _encbyte = 0; deleteRoomOffsets(); _fileHandle.close(); } @@ -205,14 +204,14 @@ void Scumm::readRoomsOffsets() { } } -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 @@ void Scumm::readMAXS() { _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); allocateArrays(); - _dynamicRoomOffsets = 1; + _dynamicRoomOffsets = true; } void Scumm::allocateArrays() { diff --git a/scumm/scumm.h b/scumm/scumm.h index 06d2c087ee..9ef37e1658 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -604,7 +604,6 @@ protected: void setStringVars(int i); /* Should be in Resource class */ - byte _encbyte; File _fileHandle; uint32 _fileOffset; int _resourceHeaderSize; @@ -622,7 +621,7 @@ protected: 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); diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 45f24c8003..dc74da8d3d 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -306,7 +306,6 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) memset(_scummStack, 0, sizeof(_scummStack)); _keyScriptKey = 0; _keyScriptNo = 0; - _encbyte = 0; memset(&_fileHandle, 0, sizeof(File)); _fileOffset = 0; _exe_name = NULL; |