diff options
author | Filippos Karapetis | 2013-01-07 16:17:27 +0200 |
---|---|---|
committer | Filippos Karapetis | 2013-01-07 16:17:27 +0200 |
commit | bd865d9741878b56a86c1389e66dfdee24ba1e39 (patch) | |
tree | c7295b08c88991a57883daa404d87d53f7ea8ecf | |
parent | b270942f6e6aa8a84cf48a0d77a4e822cc26c79e (diff) | |
download | scummvm-rg350-bd865d9741878b56a86c1389e66dfdee24ba1e39.tar.gz scummvm-rg350-bd865d9741878b56a86c1389e66dfdee24ba1e39.tar.bz2 scummvm-rg350-bd865d9741878b56a86c1389e66dfdee24ba1e39.zip |
HOPKINS: Remove static game directory configuration options
Also, remove the unused VGA folder.
This is the first step to remove constructFilename() and associated functions.
-rw-r--r-- | engines/hopkins/anim.cpp | 16 | ||||
-rw-r--r-- | engines/hopkins/computer.cpp | 22 | ||||
-rw-r--r-- | engines/hopkins/dialogs.cpp | 22 | ||||
-rw-r--r-- | engines/hopkins/files.cpp | 48 | ||||
-rw-r--r-- | engines/hopkins/font.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/globals.cpp | 20 | ||||
-rw-r--r-- | engines/hopkins/globals.h | 13 | ||||
-rw-r--r-- | engines/hopkins/graphics.cpp | 20 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 62 | ||||
-rw-r--r-- | engines/hopkins/menu.cpp | 8 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 38 | ||||
-rw-r--r-- | engines/hopkins/script.cpp | 4 | ||||
-rw-r--r-- | engines/hopkins/sound.cpp | 26 | ||||
-rw-r--r-- | engines/hopkins/talk.cpp | 16 |
14 files changed, 143 insertions, 174 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index 302c2f7913..1630de3fe7 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -58,7 +58,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui byte *screenP = _vm->_graphicsManager._vesaScreen; byte *ptr = _vm->_globals.allocMemory(20); - _vm->_fileManager.constructFilename(_vm->_globals.HOPANM, filename); + _vm->_fileManager.constructFilename("ANM", filename); if (!f.open(_vm->_globals._curFilename)) error("File not found - %s", _vm->_globals._curFilename.c_str()); @@ -233,7 +233,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint screenP = _vm->_graphicsManager._vesaScreen; ptr = _vm->_globals.allocMemory(20); - _vm->_fileManager.constructFilename(_vm->_globals.HOPANM, filename); + _vm->_fileManager.constructFilename("ANM", filename); if (!f.open(_vm->_globals._curFilename)) error("Error opening file - %s", _vm->_globals._curFilename.c_str()); @@ -470,7 +470,7 @@ void AnimationManager::loadAnim(const Common::String &animName) { clearAnim(); Common::String filename = animName + ".ANI"; - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename); + _vm->_fileManager.constructFilename("ANIM", filename); Common::File f; if (!f.open(_vm->_globals._curFilename)) @@ -495,7 +495,7 @@ void AnimationManager::loadAnim(const Common::String &animName) { for (int idx = 0; idx <= 5; ++idx) { if (files[idx][0]) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, files[idx]); + _vm->_fileManager.constructFilename("ANIM", files[idx]); if (!f.exists(_vm->_globals._curFilename)) error("File not found"); @@ -539,7 +539,7 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) { byte *v13; byte *v19; int result = 0; - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename); + _vm->_fileManager.constructFilename("ANIM", filename); _vm->_globals.Bank[idx].field1C = _vm->_fileManager.fileSize(_vm->_globals._curFilename); _vm->_globals.Bank[idx]._loadedFl = true; _vm->_globals.Bank[idx]._filename = filename; @@ -581,7 +581,7 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) { } while (ch != '.'); ofsFilename += ".OFS"; - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, ofsFilename); + _vm->_fileManager.constructFilename("ANIM", ofsFilename); Common::File f; if (f.exists(_vm->_globals._curFilename)) { v19 = _vm->_fileManager.loadFile(_vm->_globals._curFilename); @@ -727,7 +727,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui } screenP = _vm->_graphicsManager._vesaScreen; v10 = _vm->_globals.allocMemory(22); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSEQ, file); + _vm->_fileManager.constructFilename("SEQ", file); if (!f.open(_vm->_globals._curFilename)) error("Error opening file - %s", _vm->_globals._curFilename.c_str()); @@ -883,7 +883,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u _vm->_eventsManager._mouseFl = false; screenP = _vm->_graphicsManager._vesaScreen; v11 = _vm->_globals.allocMemory(22); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSEQ, file); + _vm->_fileManager.constructFilename("SEQ", file); if (!f.open(_vm->_globals._curFilename)) error("File not found - %s", _vm->_globals._curFilename.c_str()); diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp index 3df0455536..7aa17c9788 100644 --- a/engines/hopkins/computer.cpp +++ b/engines/hopkins/computer.cpp @@ -78,7 +78,7 @@ void ComputerManager::setTextMode() { //SET_MODE(SCREEN_WIDTH, SCREEN_HEIGHT); _vm->_graphicsManager._lineNbr = SCREEN_WIDTH; - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "STFONT.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "STFONT.SPR"); _vm->_globals.police = _vm->_globals.freeMemory(_vm->_globals.police); _vm->_globals.police = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.police_l = 8; @@ -328,8 +328,8 @@ static char _frenchText[] = */ void ComputerManager::loadMenu() { char *ptr; - if (!_vm->_fileManager.fileExists(_vm->_globals.HOPLINK, "COMPUTAN.TXT")) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "COMPUTAN.TXT"); + if (!_vm->_fileManager.fileExists("LINK", "COMPUTAN.TXT")) { + _vm->_fileManager.constructFilename("LINK", "COMPUTAN.TXT"); ptr = (char *)_vm->_fileManager.loadFile(_vm->_globals._curFilename); } else if (_vm->_globals._language == LANG_FR) { ptr = (char *)_vm->_globals.allocMemory(sizeof(_frenchText)); @@ -445,7 +445,7 @@ void ComputerManager::outText2(const Common::String &msg) { */ void ComputerManager::restoreFBIRoom() { _vm->_globals.police = _vm->_globals.freeMemory(_vm->_globals.police); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "FONTE3.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "FONTE3.SPR"); _vm->_globals.police = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.police_l = 12; @@ -460,11 +460,11 @@ void ComputerManager::readText(int idx) { _vm->_eventsManager._escKeyFl = false; if (_vm->_globals._language == LANG_EN) - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "THOPKAN.TXT"); + _vm->_fileManager.constructFilename("LINK", "THOPKAN.TXT"); else if (_vm->_globals._language == LANG_FR) - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "THOPK.TXT"); + _vm->_fileManager.constructFilename("LINK", "THOPK.TXT"); else if (_vm->_globals._language == LANG_SP) - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "THOPKES.TXT"); + _vm->_fileManager.constructFilename("LINK", "THOPKES.TXT"); byte *ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); uint16 fileSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename); @@ -528,7 +528,7 @@ void ComputerManager::displayGamesSubMenu() { _vm->_soundManager.loadSample(1, "SOUND37.WAV"); _vm->_soundManager.loadSample(2, "SOUND38.WAV"); _vm->_soundManager.loadSample(3, "SOUND39.WAV"); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "CASSE.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "CASSE.SPR"); _breakoutSpr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); loadHiscore(); setModeVGA256(); @@ -615,7 +615,7 @@ void ComputerManager::newLevel() { while (!_vm->shouldQuit()) { file = Common::String::format("TAB%d.TAB", _breakoutLevelNbr); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, file); + _vm->_fileManager.constructFilename("SYSTEM", file); if (f.open(_vm->_globals._curFilename)) break; @@ -789,7 +789,7 @@ int ComputerManager::displayHiscores() { _vm->_graphicsManager.RESET_SEGMENT_VESA(); loadHiscore(); _vm->_graphicsManager.loadVgaImage("HISCORE.PCX"); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "ALPHA.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "ALPHA.SPR"); byte *ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); @@ -841,7 +841,7 @@ void ComputerManager::getScoreName() { _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "ALPHA.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "ALPHA.SPR"); byte *ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_graphicsManager.fadeInBreakout(); for (int strPos = 0; strPos <= 4; strPos++) { diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 77258a8274..055664db23 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -60,11 +60,11 @@ void DialogsManager::showOptionsDialog() { _vm->_eventsManager.changeMouseCursor(0); _vm->_eventsManager.VBL(); if (_vm->_globals._language == LANG_FR) - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIFR.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "OPTIFR.SPR"); else if (_vm->_globals._language == LANG_EN) - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIAN.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "OPTIAN.SPR"); else if (_vm->_globals._language == LANG_SP) - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIES.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "OPTIES.SPR"); _vm->_globals.OPTION_SPR = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals._optionDialogFl = true; @@ -320,13 +320,13 @@ LABEL_7: switch (_vm->_globals._language) { case LANG_EN: - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENTAN.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "INVENTAN.SPR"); break; case LANG_FR: - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENTFR.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "INVENTFR.SPR"); break; case LANG_SP: - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENTES.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "INVENTES.SPR"); break; } @@ -339,7 +339,7 @@ LABEL_7: _vm->_fileManager.readStream(f, _vm->_dialogsManager._inventWin1, filesize); f.close(); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENT2.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "INVENT2.SPR"); _inventBuf2 = _vm->_fileManager.loadFile(_vm->_globals._curFilename); int v19 = _inventX = _vm->_graphicsManager._scrollOffset + 152; @@ -618,18 +618,18 @@ void DialogsManager::showSaveLoad(int a1) { switch (_vm->_globals._language) { case LANG_EN: - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVEAN.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "SAVEAN.SPR"); break; case LANG_FR: - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVEFR.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "SAVEFR.SPR"); break; case LANG_SP: - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVEES.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "SAVEES.SPR"); break; } _vm->_objectsManager.SL_SPR = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVE2.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "SAVE2.SPR"); _vm->_objectsManager.SL_SPR2 = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename); _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager.SL_SPR, _vm->_eventsManager._startPos.x + 483, 360, 0); diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp index f0238205fd..e061b9c2d4 100644 --- a/engines/hopkins/files.cpp +++ b/engines/hopkins/files.cpp @@ -72,8 +72,8 @@ void FileManager::initCensorship() { _vm->_globals._censorshipFl = false; // If file doesn't exist, fallback to uncensored - if (!fileExists(_vm->_globals.HOPSYSTEM, "BLOOD.DAT")) { - constructFilename(_vm->_globals.HOPSYSTEM, "BLOOD.DAT"); + if (!fileExists("SYSTEM", "BLOOD.DAT")) { + constructFilename("SYSTEM", "BLOOD.DAT"); char *data = (char *)loadFile(_vm->_globals._curFilename); if ((data[6] == 'u' && data[7] == 'k') || (data[6] == 'U' && data[7] == 'K')) @@ -97,19 +97,15 @@ void FileManager::constructFilename(const Common::String &folder, const Common:: // check for animations that don't exist in the ANM folder, but rather in special // sub-folders depending on the physical screen resolution being used. - if (folder == _vm->_globals.HOPANM) { + if (folder == "ANM") { switch (_vm->_globals.SVGA) { case 1: if (fileExists(folderToUse, file)) - folderToUse = _vm->_globals.HOPTSVGA; + folderToUse = "TSVGA"; break; case 2: if (fileExists(folderToUse, file)) - folderToUse = _vm->_globals.HOPSVGA; - break; - case 3: - if (fileExists(folderToUse, file)) - folderToUse = _vm->_globals.HOPVGA; + folderToUse = "SVGA"; break; default: break; @@ -150,52 +146,52 @@ byte *FileManager::searchCat(const Common::String &file, int a2) { switch (a2) { case 1: - constructFilename(_vm->_globals.HOPLINK, "RES_INI.CAT"); + constructFilename("LINK", "RES_INI.CAT"); if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; ptr = loadFile(_vm->_globals._curFilename); - constructFilename(_vm->_globals.HOPLINK, "RES_INI.RES"); + constructFilename("LINK", "RES_INI.RES"); break; case 2: - constructFilename(_vm->_globals.HOPLINK, "RES_REP.CAT"); + constructFilename("LINK", "RES_REP.CAT"); if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; ptr = loadFile(_vm->_globals._curFilename); - constructFilename(_vm->_globals.HOPLINK, "RES_REP.RES"); + constructFilename("LINK", "RES_REP.RES"); break; case 3: - constructFilename(_vm->_globals.HOPLINK, "RES_LIN.CAT"); + constructFilename("LINK", "RES_LIN.CAT"); if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; ptr = loadFile(_vm->_globals._curFilename); - constructFilename(_vm->_globals.HOPLINK, "RES_LIN.RES"); + constructFilename("LINK", "RES_LIN.RES"); break; case 4: - constructFilename(_vm->_globals.HOPANIM, "RES_ANI.CAT"); + constructFilename("ANIM", "RES_ANI.CAT"); if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; ptr = loadFile(_vm->_globals._curFilename); - constructFilename(_vm->_globals.HOPANIM, "RES_ANI.RES"); + constructFilename("ANIM", "RES_ANI.RES"); break; case 5: - constructFilename(_vm->_globals.HOPANIM, "RES_PER.CAT"); + constructFilename("ANIM", "RES_PER.CAT"); if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; ptr = loadFile(_vm->_globals._curFilename); - constructFilename(_vm->_globals.HOPANIM, "RES_PER.RES"); + constructFilename("ANIM", "RES_PER.RES"); break; case 6: - constructFilename(_vm->_globals.HOPIMAGE, "PIC.CAT"); + constructFilename("BUFFER", "PIC.CAT"); if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; @@ -203,7 +199,7 @@ byte *FileManager::searchCat(const Common::String &file, int a2) { break; case 7: - constructFilename(_vm->_globals.HOPANIM, "RES_SAN.CAT"); + constructFilename("ANIM", "RES_SAN.CAT"); if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; @@ -211,7 +207,7 @@ byte *FileManager::searchCat(const Common::String &file, int a2) { break; case 8: - constructFilename(_vm->_globals.HOPLINK, "RES_SLI.CAT"); + constructFilename("LINK", "RES_SLI.CAT"); if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; @@ -220,18 +216,18 @@ byte *FileManager::searchCat(const Common::String &file, int a2) { case 9: if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "ENG_VOI.RES"); + _vm->_fileManager.constructFilename("VOICE", "ENG_VOI.RES"); // Win95 and Linux versions uses another set of names else { switch (_vm->_globals._language) { case LANG_EN: - constructFilename(_vm->_globals.HOPLINK, "RES_VAN.CAT"); + constructFilename("LINK", "RES_VAN.CAT"); break; case LANG_FR: - constructFilename(_vm->_globals.HOPLINK, "RES_VFR.CAT"); + constructFilename("LINK", "RES_VFR.CAT"); break; case LANG_SP: - constructFilename(_vm->_globals.HOPLINK, "RES_VES.CAT"); + constructFilename("LINK", "RES_VES.CAT"); break; } } diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index b3222716e7..da81b7bf03 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -165,7 +165,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in _textSortArray[v62] = 0; _text[idx]._textLoadedFl = true; - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename); + _vm->_fileManager.constructFilename("LINK", filename); file = _vm->_globals._curFilename; if (strncmp(file.c_str(), _oldName.c_str(), strlen(file.c_str())) != 0) { diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index 83658b6c14..f3ee56be87 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -263,20 +263,6 @@ void Globals::setParent(HopkinsEngine *vm) { } void Globals::setConfig() { - HOPIMAGE = "BUFFER"; - HOPANIM = "ANIM"; - HOPLINK = "LINK"; - HOPSAVE = "SAVE"; - HOPSOUND = "SOUND"; - HOPMUSIC = "MUSIC"; - HOPVOICE = "VOICE"; - HOPANM = "ANM"; - HOPTSVGA = "TSVGA"; - HOPSVGA = "SVGA"; - HOPVGA = "VGA"; - HOPSEQ = "SEQ"; - HOPSYSTEM = "SYSTEM"; - // CHECKME: Should be in Globals() but it doesn't work // The Polish version is a translation of the English version. The filenames are the same. switch (_vm->getLanguage()) { @@ -451,7 +437,7 @@ void Globals::CLEAR_VBOB() { // Load Object void Globals::loadObjects() { - _vm->_fileManager.constructFilename(HOPSYSTEM, "OBJET.DAT"); + _vm->_fileManager.constructFilename("SYSTEM", "OBJET.DAT"); byte *data = _vm->_fileManager.loadFile(_curFilename); byte *srcP = data; @@ -530,11 +516,11 @@ void Globals::loadCache(const Common::String &file) { Common::File f; resetCache(); - _vm->_fileManager.constructFilename(HOPLINK, file); + _vm->_fileManager.constructFilename("LINK", file); ptr = _vm->_fileManager.loadFile(_curFilename); v16 = Common::String((const char *)ptr); - _vm->_fileManager.constructFilename(HOPLINK, v16); + _vm->_fileManager.constructFilename("LINK", v16); if (!f.exists(_curFilename)) return; diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index c72abe983e..fdf1b4e866 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -334,19 +334,6 @@ public: bool PUBEXIT; int PERSO_TYPE; uint _speed; - Common::String HOPIMAGE; - Common::String HOPANIM; - Common::String HOPLINK; - Common::String HOPSAVE; - Common::String HOPSOUND; - Common::String HOPMUSIC; - Common::String HOPVOICE; - Common::String HOPANM; - Common::String HOPTSVGA; - Common::String HOPSVGA; - Common::String HOPVGA; - Common::String HOPSEQ; - Common::String HOPSYSTEM; Common::String FICH_ZONE; Common::String FICH_TEXTE; Common::String _curFilename; diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 828fc2d3ad..f66b4882a8 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -163,7 +163,7 @@ void GraphicsManager::loadVgaImage(const Common::String &file) { lockScreen(); clearScreen(); unlockScreen(); - _vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, file); + _vm->_fileManager.constructFilename("BUFFER", file); A_PCX320(_vesaScreen, _vm->_globals._curFilename, _palette); memcpy(_vesaBuffer, _vesaScreen, 64000); SCANLINE(320); @@ -184,7 +184,7 @@ void GraphicsManager::loadScreen(const Common::String &file) { bool flag = true; if (_vm->_fileManager.searchCat(file, 6) == g_PTRNUL) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, file); + _vm->_fileManager.constructFilename("BUFFER", file); if (!f.open(_vm->_globals._curFilename)) error("loadScreen - %s", file.c_str()); @@ -301,16 +301,16 @@ void GraphicsManager::A_PCX640_480(byte *surface, const Common::String &file, by if (typeFlag) { // Load PCX from within the PIC resource - _vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, "PIC.RES"); + _vm->_fileManager.constructFilename("BUFFER", "PIC.RES"); if (!f.open(_vm->_globals._curFilename)) - error("(nom)Erreur en cours de lecture."); + error("Error opening PIC.RES."); f.seek(_vm->_globals._catalogPos); } else { // Load stand alone PCX file - _vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, file); + _vm->_fileManager.constructFilename("BUFFER", file); if (!f.open(_vm->_globals._curFilename)) - error("(nom)Erreur en cours de lecture."); + error("Error opening PCX %s.", file.c_str()); } // Decode the PCX @@ -1767,7 +1767,7 @@ void GraphicsManager::OPTI_INI(const Common::String &file, int mode) { byte *ptr = _vm->_fileManager.searchCat(filename, 1); if (ptr == g_PTRNUL) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename); + _vm->_fileManager.constructFilename("LINK", filename); ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (!mode) { @@ -1776,9 +1776,9 @@ void GraphicsManager::OPTI_INI(const Common::String &file, int mode) { if (!_vm->_globals.NOSPRECRAN) { _vm->_globals.SPRITE_ECRAN = _vm->_fileManager.searchCat(filename, 8); if (_vm->_globals.SPRITE_ECRAN) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename); + _vm->_fileManager.constructFilename("LINK", filename); } else { - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "RES_SLI.RES"); + _vm->_fileManager.constructFilename("LINK", "RES_SLI.RES"); } _vm->_globals.SPRITE_ECRAN = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } @@ -1814,7 +1814,7 @@ void GraphicsManager::OPTI_INI(const Common::String &file, int mode) { byte *dataP = _vm->_fileManager.searchCat(filename, 2); _vm->_globals.COUCOU = dataP; if (g_PTRNUL == dataP) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename); + _vm->_fileManager.constructFilename("LINK", filename); dataP = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.COUCOU = dataP; } diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 1b181bee52..536220caa3 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -179,7 +179,7 @@ bool HopkinsEngine::runWin95Demo() { warning("TODO Init_Interrupt_();"); _graphicsManager.fadeOutLong(); _globals.iRegul = 1; - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; @@ -491,7 +491,7 @@ bool HopkinsEngine::runLinuxDemo() { playIntro(); _globals.iRegul = 0; - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; @@ -843,7 +843,7 @@ bool HopkinsEngine::runOS2Full() { _graphicsManager.loadImage("H2"); _graphicsManager.fadeInLong(); _globals.iRegul = 0; - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; @@ -1200,7 +1200,7 @@ bool HopkinsEngine::runOS2Full() { Common::String im = Common::String::format("IM%d", _globals._exitId); _soundManager.WSOUND(13); if (_globals._forestSprite == g_PTRNUL) { - _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); + _fileManager.constructFilename("SYSTEM", "HOPDEG.SPR"); _globals._forestSprite = _objectsManager.loadSprite(_globals._curFilename); _soundManager.loadSample(1, "SOUND41.WAV"); } @@ -1645,7 +1645,7 @@ bool HopkinsEngine::runOS2Full() { _soundManager.WSOUND(23); _globals._exitId = handleBaseMap(); // _soundManager.WSOUND_OFF(); - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; @@ -1688,7 +1688,7 @@ bool HopkinsEngine::runBeOSFull() { _graphicsManager.fadeInLong(); _graphicsManager.fadeOutLong(); _globals.iRegul = 0; - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; @@ -2048,7 +2048,7 @@ bool HopkinsEngine::runBeOSFull() { Common::String im = Common::String::format("IM%d", _globals._exitId); _soundManager.WSOUND(13); if (_globals._forestSprite == g_PTRNUL) { - _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); + _fileManager.constructFilename("SYSTEM", "HOPDEG.SPR"); _globals._forestSprite = _objectsManager.loadSprite(_globals._curFilename); _soundManager.loadSample(1, "SOUND41.WAV"); } @@ -2494,7 +2494,7 @@ bool HopkinsEngine::runBeOSFull() { _soundManager.WSOUND(23); _globals._exitId = handleBaseMap(); _soundManager.WSOUND_OFF(); - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; @@ -2531,7 +2531,7 @@ bool HopkinsEngine::runWin95full() { _eventsManager.delay(500); _graphicsManager.fadeOutLong(); _globals.iRegul = 0; - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; @@ -2893,7 +2893,7 @@ bool HopkinsEngine::runWin95full() { Common::String im = Common::String::format("IM%d", _globals._exitId); _soundManager.WSOUND(13); if (_globals._forestSprite == g_PTRNUL) { - _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); + _fileManager.constructFilename("SYSTEM", "HOPDEG.SPR"); _globals._forestSprite = _objectsManager.loadSprite(_globals._curFilename); _soundManager.loadSample(1, "SOUND41.WAV"); } @@ -3326,7 +3326,7 @@ bool HopkinsEngine::runWin95full() { _globals._exitId = WBASE(); _soundManager.WSOUND_OFF(); warning("TODO: heapshrink();"); - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; @@ -3367,7 +3367,7 @@ bool HopkinsEngine::runLinuxFull() { playIntro(); _globals.iRegul = 0; - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; @@ -3727,7 +3727,7 @@ bool HopkinsEngine::runLinuxFull() { Common::String im = Common::String::format("IM%d", _globals._exitId); _soundManager.WSOUND(13); if (_globals._forestSprite == g_PTRNUL) { - _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); + _fileManager.constructFilename("SYSTEM", "HOPDEG.SPR"); _globals._forestSprite = _objectsManager.loadSprite(_globals._curFilename); _soundManager.loadSample(1, "SOUND41.WAV"); } @@ -4161,7 +4161,7 @@ bool HopkinsEngine::runLinuxFull() { _soundManager.WSOUND(23); _globals._exitId = handleBaseMap(); _soundManager.WSOUND_OFF(); - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; @@ -4195,18 +4195,18 @@ void HopkinsEngine::initializeSystem() { switch (_globals._language) { case LANG_EN: if (!_eventsManager._mouseLinuxFl) - _fileManager.constructFilename(_globals.HOPSYSTEM, "SOUAN.SPR"); + _fileManager.constructFilename("SYSTEM", "SOUAN.SPR"); else - _fileManager.constructFilename(_globals.HOPSYSTEM, "LSOUAN.SPR"); + _fileManager.constructFilename("SYSTEM", "LSOUAN.SPR"); break; case LANG_FR: if (!_eventsManager._mouseLinuxFl) - _fileManager.constructFilename(_globals.HOPSYSTEM, "SOUFR.SPR"); + _fileManager.constructFilename("SYSTEM", "SOUFR.SPR"); else - _fileManager.constructFilename(_globals.HOPSYSTEM, "LSOUFR.SPR"); + _fileManager.constructFilename("SYSTEM", "LSOUFR.SPR"); break; case LANG_SP: - _fileManager.constructFilename(_globals.HOPSYSTEM, "SOUES.SPR"); + _fileManager.constructFilename("SYSTEM", "SOUES.SPR"); break; } @@ -4221,26 +4221,26 @@ void HopkinsEngine::initializeSystem() { _globals.clearAll(); - _fileManager.constructFilename(_globals.HOPSYSTEM, "FONTE3.SPR"); + _fileManager.constructFilename("SYSTEM", "FONTE3.SPR"); _globals.police = _fileManager.loadFile(_globals._curFilename); _globals.police_l = 12; _globals.police_h = 21; - _fileManager.constructFilename(_globals.HOPSYSTEM, "ICONE.SPR"); + _fileManager.constructFilename("SYSTEM", "ICONE.SPR"); _globals.ICONE = _fileManager.loadFile(_globals._curFilename); - _fileManager.constructFilename(_globals.HOPSYSTEM, "TETE.SPR"); + _fileManager.constructFilename("SYSTEM", "TETE.SPR"); _globals.TETE = _fileManager.loadFile(_globals._curFilename); switch (_globals._language) { case LANG_EN: - _fileManager.constructFilename(_globals.HOPLINK, "ZONEAN.TXT"); + _fileManager.constructFilename("LINK", "ZONEAN.TXT"); _globals.BUF_ZONE = _fileManager.loadFile(_globals._curFilename); break; case LANG_FR: - _fileManager.constructFilename(_globals.HOPLINK, "ZONE01.TXT"); + _fileManager.constructFilename("LINK", "ZONE01.TXT"); _globals.BUF_ZONE = _fileManager.loadFile(_globals._curFilename); break; case LANG_SP: - _fileManager.constructFilename(_globals.HOPLINK, "ZONEES.TXT"); + _fileManager.constructFilename("LINK", "ZONEES.TXT"); _globals.BUF_ZONE = _fileManager.loadFile(_globals._curFilename); break; } @@ -4899,7 +4899,7 @@ void HopkinsEngine::playEnding() { _globals.iRegul = 0; _globals._exitId = 300; } - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; @@ -5079,13 +5079,13 @@ void HopkinsEngine::loadCredits() { _globals.Credit_step = 45; switch (_globals._language) { case LANG_EN: - _fileManager.constructFilename(_globals.HOPLINK, "CREAN.TXT"); + _fileManager.constructFilename("LINK", "CREAN.TXT"); break; case LANG_FR: - _fileManager.constructFilename(_globals.HOPLINK, "CREFR.TXT"); + _fileManager.constructFilename("LINK", "CREFR.TXT"); break; case LANG_SP: - _fileManager.constructFilename(_globals.HOPLINK, "CREES.TXT"); + _fileManager.constructFilename("LINK", "CREES.TXT"); break; default: error("Unhandled language"); @@ -5443,7 +5443,7 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in _globals._exitId = 0; _globals._disableInventFl = true; _soundManager.WSOUND(soundId); - _fileManager.constructFilename(_globals.HOPSYSTEM, "VAISSEAU.SPR"); + _fileManager.constructFilename("SYSTEM", "VAISSEAU.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); if (backgroundFilename.size()) _graphicsManager.loadImage(backgroundFilename); @@ -5529,7 +5529,7 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in _graphicsManager.fadeOutLong(); _objectsManager.removeSprite(0); _objectsManager.CLEAR_ECRAN(); - _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); + _fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; } diff --git a/engines/hopkins/menu.cpp b/engines/hopkins/menu.cpp index c39518c7fd..582b7a16f9 100644 --- a/engines/hopkins/menu.cpp +++ b/engines/hopkins/menu.cpp @@ -85,13 +85,13 @@ int MenuManager::menu() { _vm->_graphicsManager.fadeInLong(); if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "MENU.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "MENU.SPR"); else if (_vm->_globals._language == LANG_EN) - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "MENUAN.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "MENUAN.SPR"); else if (_vm->_globals._language == LANG_FR) - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "MENUFR.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "MENUFR.SPR"); else if (_vm->_globals._language == LANG_SP) - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "MENUES.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "MENUES.SPR"); spriteData = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename); _vm->_eventsManager.mouseOn(); diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 9d2cae2cda..9fc3461270 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -118,7 +118,7 @@ byte *ObjectsManager::CAPTURE_OBJET(int objIndex, int mode) { if (_vm->_globals.ADR_FICHIER_OBJ != g_PTRNUL) ObjectsManager::DEL_FICHIER_OBJ(); if (val1 == 1) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OBJET1.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "OBJET1.SPR"); _vm->_globals.ADR_FICHIER_OBJ = ObjectsManager::loadSprite(_vm->_globals._curFilename); } _vm->_globals.NUM_FICHIER_OBJ = val1; @@ -2077,7 +2077,7 @@ void ObjectsManager::CHARGE_OBSTACLE(const Common::String &file) { _vm->_linesManager.RESET_OBSTACLE(); _vm->_linesManager._linesNumb = 0; _lastLine = 0; - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file); + _vm->_fileManager.constructFilename("LINK", file); ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); v4 = 0; v5 = 0; @@ -2132,7 +2132,7 @@ void ObjectsManager::loadZone(const Common::String &file) { _vm->_globals.ZONEP[i].field10 = 0; } - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file); + _vm->_fileManager.constructFilename("LINK", file); Common::File f; if (!f.exists(_vm->_globals._curFilename)) @@ -2277,7 +2277,7 @@ void ObjectsManager::PLAN_BETA() { CHARGE_OBSTACLE("PLAN.OB2"); _vm->_globals.loadCache("PLAN.CA2"); loadZone("PLAN.ZO2"); - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "VOITURE.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "VOITURE.SPR"); _spritePtr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_animationManager.loadAnim("PLAN"); _vm->_graphicsManager.VISU_ALL(); @@ -2742,7 +2742,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha T_RECTIF = 0; loc = &_vm->_globals._saveData->_realHopkins; - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PERSO.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 0; SPRITE(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->field4, 0, 34, 190); @@ -2768,7 +2768,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha _vm->_globals._saveData->data[svField357] = 0; loc = &_vm->_globals._saveData->_samantha; - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PSAMAN.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "PSAMAN.SPR"); _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 2; SPRITE(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->field4, 0, 20, 127); @@ -3747,7 +3747,7 @@ void ObjectsManager::OPTI_OBJET() { file = "OBJET1.ini"; data = _vm->_fileManager.searchCat(file, 1); if (data == g_PTRNUL) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file); + _vm->_fileManager.constructFilename("LINK", file); data = _vm->_fileManager.loadFile(_vm->_globals._curFilename); if (data == g_PTRNUL) error("INI file %s not found", file.c_str()); @@ -3970,7 +3970,7 @@ void ObjectsManager::ACTION_DOS(int idx) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 1; - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "DOS.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "DOS.SPR"); _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) @@ -3999,7 +3999,7 @@ void ObjectsManager::ACTION_DROITE(int idx) { if (_vm->_globals.GESTE_FLAG != 3) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 3; - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PROFIL.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "PROFIL.SPR"); _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) @@ -4028,7 +4028,7 @@ void ObjectsManager::Q_DROITE(int idx) { if (_vm->_globals.GESTE_FLAG != 4) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 4; - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "3Q.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "3Q.SPR"); _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) @@ -4057,7 +4057,7 @@ void ObjectsManager::ACTION_FACE(int idx) { if (_vm->_globals.GESTE_FLAG != 2) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 2; - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "FACE.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "FACE.SPR"); _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) @@ -4074,7 +4074,7 @@ void ObjectsManager::Q_GAUCHE(int idx) { if (_vm->_globals.GESTE_FLAG != 4) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 4; - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "3Q.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "3Q.SPR"); _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) @@ -4103,7 +4103,7 @@ void ObjectsManager::ACTION_GAUCHE(int idx) { if (_vm->_globals.GESTE_FLAG != 3) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 3; - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PROFIL.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "PROFIL.SPR"); _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) @@ -4251,7 +4251,7 @@ void ObjectsManager::INILINK(const Common::String &file) { ptr = _vm->_fileManager.searchCat(filename, 3); nbytes = _vm->_globals._catalogSize; if (ptr == g_PTRNUL) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename); + _vm->_fileManager.constructFilename("LINK", filename); if (!f.open(_vm->_globals._curFilename)) error("Error opening file - %s", _vm->_globals._curFilename.c_str()); @@ -4274,9 +4274,9 @@ void ObjectsManager::INILINK(const Common::String &file) { _vm->_globals.CACHE_BANQUE[1] = _vm->_fileManager.searchCat(filename2, 8); if (_vm->_globals.CACHE_BANQUE[1] || _vm->_globals.CACHE_BANQUE[1] == g_PTRNUL) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename2); + _vm->_fileManager.constructFilename("LINK", filename2); } else { - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "RES_SLI.RES"); + _vm->_fileManager.constructFilename("LINK", "RES_SLI.RES"); } _vm->_globals.CACHE_BANQUE[1] = _vm->_fileManager.loadFile(_vm->_globals._curFilename); @@ -5100,20 +5100,20 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm _vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0); if (_vm->_globals.PERSO_TYPE) { if (!_vm->_globals._saveData->data[svField122] && !_vm->_globals._saveData->data[svField356]) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PERSO.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 0; } } if (!_vm->_globals.PERSO_TYPE) { if (_vm->_globals._saveData->data[svField122] == 1) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "HOPFEM.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "HOPFEM.SPR"); _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 1; } } if (_vm->_globals.PERSO_TYPE != 2 && _vm->_globals._saveData->data[svField356] == 1) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PSAMAN.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "PSAMAN.SPR"); _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 2; } diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 941abebe22..3077393d61 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -918,7 +918,7 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 56: - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "HOPFEM.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "HOPFEM.SPR"); _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 1; _vm->_globals._saveData->data[svField122] = 1; @@ -929,7 +929,7 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 57: - _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PERSO.SPR"); + _vm->_fileManager.constructFilename("SYSTEM", "PERSO.SPR"); _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 0; _vm->_globals._saveData->data[svField122] = 0; diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp index cf06046bbe..a55ef4d442 100644 --- a/engines/hopkins/sound.cpp +++ b/engines/hopkins/sound.cpp @@ -380,7 +380,7 @@ void SoundManager::PLAY_MOD(const Common::String &file) { modFile += "2"; } } - _vm->_fileManager.constructFilename(_vm->_globals.HOPMUSIC, modFile); + _vm->_fileManager.constructFilename("MUSIC", modFile); if (MOD_FLAG) { stopMusic(); delMusic(); @@ -520,34 +520,34 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode) { if (!_vm->_fileManager.searchCat(filename + ".WAV", 9)) { if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "ENG_VOI.RES"); + _vm->_fileManager.constructFilename("VOICE", "ENG_VOI.RES"); // Win95 and Linux versions uses another set of names else if (_vm->_globals._language == LANG_FR) - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VFR.RES"); + _vm->_fileManager.constructFilename("VOICE", "RES_VFR.RES"); else if (_vm->_globals._language == LANG_EN) - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VAN.RES"); + _vm->_fileManager.constructFilename("VOICE", "RES_VAN.RES"); else if (_vm->_globals._language == LANG_SP) - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VES.RES"); + _vm->_fileManager.constructFilename("VOICE", "RES_VES.RES"); catPos = _vm->_globals._catalogPos; catLen = _vm->_globals._catalogSize; } else if (!_vm->_fileManager.searchCat(filename + ".APC", 9)) { if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "ENG_VOI.RES"); + _vm->_fileManager.constructFilename("VOICE", "ENG_VOI.RES"); // Win95 and Linux versions uses another set of names else if (_vm->_globals._language == LANG_FR) - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VFR.RES"); + _vm->_fileManager.constructFilename("VOICE", "RES_VFR.RES"); else if (_vm->_globals._language == LANG_EN) - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VAN.RES"); + _vm->_fileManager.constructFilename("VOICE", "RES_VAN.RES"); else if (_vm->_globals._language == LANG_SP) - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VES.RES"); + _vm->_fileManager.constructFilename("VOICE", "RES_VES.RES"); catPos = _vm->_globals._catalogPos; catLen = _vm->_globals._catalogSize; } else { - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, filename + ".WAV"); + _vm->_fileManager.constructFilename("VOICE", filename + ".WAV"); if (!f.exists(_vm->_globals._curFilename)) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, filename + ".APC"); + _vm->_fileManager.constructFilename("VOICE", filename + ".APC"); if (!f.exists(_vm->_globals._curFilename)) return false; } @@ -626,7 +626,7 @@ void SoundManager::MODSetMusicVolume(int volume) { } void SoundManager::loadSample(int wavIndex, const Common::String &file) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPSOUND, file); + _vm->_fileManager.constructFilename("SOUND", file); LOAD_SAMPLE2_SDL(wavIndex, _vm->_globals._curFilename, 0); SOUND[wavIndex]._active = true; } @@ -758,7 +758,7 @@ void SoundManager::LOAD_SAMPLE2_SDL(int wavIndex, const Common::String &filename } void SoundManager::LOAD_NWAV(const Common::String &file, int wavIndex) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPSOUND, file); + _vm->_fileManager.constructFilename("SOUND", file); LOAD_SAMPLE2_SDL(wavIndex, _vm->_globals._curFilename, 1); } diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index 930e87df6c..38677d5fff 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -62,7 +62,7 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { _characterBuffer = _vm->_fileManager.searchCat(filename, 5); _characterSize = _vm->_globals._catalogSize; if (_characterBuffer == g_PTRNUL) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename); + _vm->_fileManager.constructFilename("ANIM", filename); _characterBuffer = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _characterSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename); } @@ -81,9 +81,9 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { _paletteBufferIdx = 20 * (int16)READ_LE_UINT16((uint16 *)_characterBuffer + 42) + 110; _characterSprite = _vm->_fileManager.searchCat(spriteFilename, 7); if (_characterSprite) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, spriteFilename); + _vm->_fileManager.constructFilename("ANIM", spriteFilename); } else { - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, "RES_SAN.RES"); + _vm->_fileManager.constructFilename("ANIM", "RES_SAN.RES"); } _characterSprite = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename); @@ -163,7 +163,7 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) { _characterBuffer = _vm->_fileManager.searchCat(filename, 5); _characterSize = _vm->_globals._catalogSize; if (_characterBuffer == g_PTRNUL) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename); + _vm->_fileManager.constructFilename("ANIM", filename); _characterBuffer = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _characterSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename); } @@ -576,7 +576,7 @@ int TalkManager::VERIF_BOITE(int idx, const Common::String &file, int a3) { v18 = 0; _vm->_globals.police_l = 11; - _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file); + _vm->_fileManager.constructFilename("LINK", file); // Build up the filename filename = dest = _vm->_globals._curFilename; @@ -1087,7 +1087,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { _characterBuffer = _vm->_fileManager.searchCat(a2, 5); _characterSize = _vm->_globals._catalogSize; if (_characterBuffer == g_PTRNUL) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, a2); + _vm->_fileManager.constructFilename("ANIM", a2); _characterBuffer = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _characterSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename); } @@ -1100,9 +1100,9 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { _characterSprite = _vm->_fileManager.searchCat(v23, 7); if (_characterSprite) - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, v23); + _vm->_fileManager.constructFilename("ANIM", v23); else - _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, "RES_SAN.RES"); + _vm->_fileManager.constructFilename("ANIM", "RES_SAN.RES"); _characterSprite = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename); |