removed _encbyte (it's only used locally)

svn-id: r9252
This commit is contained in:
Max Horn 2003-07-28 16:55:06 +00:00
parent e0ee9d3688
commit 7caa1a0c9e
3 changed files with 15 additions and 18 deletions

View File

@ -40,6 +40,7 @@ void Scumm::openRoom(int room) {
bool result; bool result;
char buf[128]; char buf[128];
char buf2[128] = ""; char buf2[128] = "";
byte encByte = 0;
debug(9, "openRoom(%d)", room); debug(9, "openRoom(%d)", room);
assert(room >= 0); assert(room >= 0);
@ -51,7 +52,6 @@ void Scumm::openRoom(int room) {
/* Room -1 means close file */ /* Room -1 means close file */
if (room == -1) { if (room == -1) {
_encbyte = 0;
deleteRoomOffsets(); deleteRoomOffsets();
_fileHandle.close(); _fileHandle.close();
return; return;
@ -92,28 +92,28 @@ void Scumm::openRoom(int room) {
sprintf(buf2, "%s.sm%.1d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][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)) { } else if (!(_features & GF_SMALL_NAMES)) {
if (room == 0 || room >= 900) { if (room == 0 || room >= 900) {
sprintf(buf, "%.3d.lfl", room); sprintf(buf, "%.3d.lfl", room);
_encbyte = 0; encByte = 0;
if (openResourceFile(buf)) { if (openResourceFile(buf, encByte)) {
return; return;
} }
askForDisk(buf, room == 0 ? 0 : res.roomno[rtRoom][room]); askForDisk(buf, room == 0 ? 0 : res.roomno[rtRoom][room]);
} else { } else {
sprintf(buf, "disk%.2d.lec", room == 0 ? 0 : res.roomno[rtRoom][room]); sprintf(buf, "disk%.2d.lec", room == 0 ? 0 : res.roomno[rtRoom][room]);
_encbyte = 0x69; encByte = 0x69;
} }
} else { } else {
sprintf(buf, "%.2d.lfl", room); 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])) if ((result == false) && (buf2[0]))
result = openResourceFile(buf2); result = openResourceFile(buf2, encByte);
if (result) { if (result) {
if (room == 0) if (room == 0)
@ -134,8 +134,8 @@ void Scumm::openRoom(int room) {
do { do {
sprintf(buf, "%.3d.lfl", room); sprintf(buf, "%.3d.lfl", room);
_encbyte = 0; encByte = 0;
if (openResourceFile(buf)) if (openResourceFile(buf, encByte))
break; break;
askForDisk(buf, room == 0 ? 0 : res.roomno[rtRoom][room]); askForDisk(buf, room == 0 ? 0 : res.roomno[rtRoom][room]);
} while (1); } while (1);
@ -147,7 +147,6 @@ void Scumm::openRoom(int room) {
void Scumm::closeRoom() { void Scumm::closeRoom() {
if (_lastLoadedRoom != -1) { if (_lastLoadedRoom != -1) {
_lastLoadedRoom = -1; _lastLoadedRoom = -1;
_encbyte = 0;
deleteRoomOffsets(); deleteRoomOffsets();
_fileHandle.close(); _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); debug(9, "openResourceFile(%s)", filename);
if (_fileHandle.isOpen() == true) { if (_fileHandle.isOpen()) {
_fileHandle.close(); _fileHandle.close();
} }
_fileHandle.open(filename, getGameDataPath(), 1, _encbyte); _fileHandle.open(filename, getGameDataPath(), 1, encByte);
return _fileHandle.isOpen(); return _fileHandle.isOpen();
} }
@ -1661,7 +1660,7 @@ void Scumm::readMAXS() {
_shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1);
allocateArrays(); allocateArrays();
_dynamicRoomOffsets = 1; _dynamicRoomOffsets = true;
} }
void Scumm::allocateArrays() { void Scumm::allocateArrays() {

View File

@ -604,7 +604,6 @@ protected:
void setStringVars(int i); void setStringVars(int i);
/* Should be in Resource class */ /* Should be in Resource class */
byte _encbyte;
File _fileHandle; File _fileHandle;
uint32 _fileOffset; uint32 _fileOffset;
int _resourceHeaderSize; int _resourceHeaderSize;
@ -622,7 +621,7 @@ protected:
void deleteRoomOffsets(); void deleteRoomOffsets();
void readRoomsOffsets(); void readRoomsOffsets();
void askForDisk(const char *filename, int disknum); 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 loadPtrToResource(int type, int i, const byte *ptr);
void readResTypeList(int id, uint32 tag, const char *name); void readResTypeList(int id, uint32 tag, const char *name);

View File

@ -306,7 +306,6 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
memset(_scummStack, 0, sizeof(_scummStack)); memset(_scummStack, 0, sizeof(_scummStack));
_keyScriptKey = 0; _keyScriptKey = 0;
_keyScriptNo = 0; _keyScriptNo = 0;
_encbyte = 0;
memset(&_fileHandle, 0, sizeof(File)); memset(&_fileHandle, 0, sizeof(File));
_fileOffset = 0; _fileOffset = 0;
_exe_name = NULL; _exe_name = NULL;