From c9343637902ed94f0a511ff9fa0d1bffe346d5e3 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 28 Dec 2012 08:26:27 +0100 Subject: HOPKINS: Some more renaming and refactoring --- engines/hopkins/anim.cpp | 38 +-- engines/hopkins/computer.cpp | 24 +- engines/hopkins/dialogs.cpp | 12 +- engines/hopkins/files.cpp | 44 +-- engines/hopkins/font.cpp | 2 +- engines/hopkins/globals.cpp | 8 +- engines/hopkins/globals.h | 2 +- engines/hopkins/graphics.cpp | 651 +++++++++++++++++++++---------------------- engines/hopkins/hopkins.cpp | 50 ++-- engines/hopkins/menu.cpp | 2 +- engines/hopkins/objects.cpp | 42 +-- engines/hopkins/script.cpp | 4 +- engines/hopkins/sound.cpp | 14 +- engines/hopkins/talk.cpp | 26 +- 14 files changed, 454 insertions(+), 465 deletions(-) (limited to 'engines') diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index d495ed0d75..af3ee8aa05 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -64,8 +64,8 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui ptr = _vm->_globals.allocMemory(20); _vm->_fileManager.constructFilename(_vm->_globals.HOPANM, filename); - if (!f.open(_vm->_globals.NFICHIER)) - error("File not found - %s", _vm->_globals.NFICHIER.c_str()); + if (!f.open(_vm->_globals._curFilename)) + error("File not found - %s", _vm->_globals._curFilename.c_str()); f.skip(6); f.read(_vm->_graphicsManager._palette, 800); @@ -237,9 +237,9 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint _vm->_fileManager.constructLinuxFilename("TEMP.SCR"); if (_vm->_graphicsManager._lineNbr == SCREEN_WIDTH) - _vm->_saveLoadManager.saveFile(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 307200); + _vm->_saveLoadManager.saveFile(_vm->_globals._curFilename, _vm->_graphicsManager._vesaScreen, 307200); else if (_vm->_graphicsManager._lineNbr == (SCREEN_WIDTH * 2)) - _vm->_saveLoadManager.saveFile(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 614400); + _vm->_saveLoadManager.saveFile(_vm->_globals._curFilename, _vm->_graphicsManager._vesaScreen, 614400); if (!_vm->_graphicsManager._lineNbr) _vm->_graphicsManager.ofscroll = 0; @@ -247,8 +247,8 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint v13 = _vm->_globals.allocMemory(20); _vm->_fileManager.constructFilename(_vm->_globals.HOPANM, filename); - if (!f.open(_vm->_globals.NFICHIER)) - error("Error opening file - %s", _vm->_globals.NFICHIER.c_str()); + if (!f.open(_vm->_globals._curFilename)) + error("Error opening file - %s", _vm->_globals._curFilename.c_str()); f.read(&buf, 6); f.read(_vm->_graphicsManager._palette, 800); @@ -556,8 +556,8 @@ void AnimationManager::loadAnim(const Common::String &animName) { _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename); Common::File f; - if (!f.open(_vm->_globals.NFICHIER)) - error("Failed to open %s", _vm->_globals.NFICHIER.c_str()); + if (!f.open(_vm->_globals._curFilename)) + error("Failed to open %s", _vm->_globals._curFilename.c_str()); int filesize = f.size(); int nbytes = filesize - 115; @@ -580,7 +580,7 @@ void AnimationManager::loadAnim(const Common::String &animName) { if (files[idx][0]) { _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, files[idx]); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) error("File not found"); if (loadSpriteBank(idx + 1, files[idx])) error("File not compatible with this soft."); @@ -626,11 +626,11 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) { byte *v19; int result = 0; _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename); - _vm->_globals.Bank[idx].field1C = _vm->_fileManager.fileSize(_vm->_globals.NFICHIER); + _vm->_globals.Bank[idx].field1C = _vm->_fileManager.fileSize(_vm->_globals._curFilename); _vm->_globals.Bank[idx].field4 = 1; _vm->_globals.Bank[idx]._filename = filename; - v3 = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + v3 = _vm->_fileManager.loadFile(_vm->_globals._curFilename); v4 = v3; _vm->_globals.Bank[idx]._fileHeader = 0; @@ -672,8 +672,8 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) { _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, ofsFilename); Common::File f; - if (f.exists(_vm->_globals.NFICHIER)) { - v19 = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + if (f.exists(_vm->_globals._curFilename)) { + v19 = _vm->_fileManager.loadFile(_vm->_globals._curFilename); v13 = v19; for (int objIdx = 0; objIdx < _vm->_globals.Bank[idx].field1A; ++objIdx, v13 += 8) { int x1 = (int16)READ_LE_UINT16(v13); @@ -822,17 +822,17 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui _vm->_fileManager.constructLinuxFilename("TEMP.SCR"); if (_vm->_graphicsManager._lineNbr == SCREEN_WIDTH) - _vm->_saveLoadManager.saveFile(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 307200); + _vm->_saveLoadManager.saveFile(_vm->_globals._curFilename, _vm->_graphicsManager._vesaScreen, 307200); else if (_vm->_graphicsManager._lineNbr == (SCREEN_WIDTH * 2)) - _vm->_saveLoadManager.saveFile(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 614400); + _vm->_saveLoadManager.saveFile(_vm->_globals._curFilename, _vm->_graphicsManager._vesaScreen, 614400); if (!_vm->_graphicsManager._lineNbr) _vm->_graphicsManager.ofscroll = 0; } v9 = _vm->_graphicsManager._vesaScreen; v10 = _vm->_globals.allocMemory(22); _vm->_fileManager.constructFilename(_vm->_globals.HOPSEQ, file); - if (!f.open(_vm->_globals.NFICHIER)) - error("Error opening file - %s", _vm->_globals.NFICHIER.c_str()); + if (!f.open(_vm->_globals._curFilename)) + error("Error opening file - %s", _vm->_globals._curFilename.c_str()); f.skip(6); f.read(_vm->_graphicsManager._palette, 800); @@ -989,8 +989,8 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u v11 = _vm->_globals.allocMemory(22); _vm->_fileManager.constructFilename(_vm->_globals.HOPSEQ, file); - if (!f.open(_vm->_globals.NFICHIER)) - error("File not found - %s", _vm->_globals.NFICHIER.c_str()); + if (!f.open(_vm->_globals._curFilename)) + error("File not found - %s", _vm->_globals._curFilename.c_str()); f.skip(6); f.read(_vm->_graphicsManager._palette, 800); diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp index 668bd53c85..0079d7f234 100644 --- a/engines/hopkins/computer.cpp +++ b/engines/hopkins/computer.cpp @@ -79,7 +79,7 @@ void ComputerManager::setTextMode() { _vm->_graphicsManager._lineNbr = SCREEN_WIDTH; _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "STFONT.SPR"); _vm->_globals.police = _vm->_globals.freeMemory(_vm->_globals.police); - _vm->_globals.police = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.police = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.police_l = 8; _vm->_globals.police_h = 8; _vm->_graphicsManager.loadImage("WINTEXT"); @@ -291,7 +291,7 @@ void ComputerManager::showComputer(ComputerEnum mode) { */ void ComputerManager::loadMenu() { _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "COMPUTAN.TXT"); - byte *ptr = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + byte *ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); byte *tmpPtr = ptr; int lineNum = 0; int strPos; @@ -472,7 +472,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->_globals.police = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.police = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.police_l = 12; _vm->_globals.police_h = 21; @@ -506,8 +506,8 @@ void ComputerManager::readText(int idx) { else if (_vm->_globals._language == LANG_SP) _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "THOPKES.TXT"); - ptr = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); - v1 = _vm->_fileManager.fileSize(_vm->_globals.NFICHIER); + ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); + v1 = _vm->_fileManager.fileSize(_vm->_globals._curFilename); v2 = 0; v3 = 0; if (v1 > 0u) { @@ -584,7 +584,7 @@ void ComputerManager::displayGamesSubMenu() { _vm->_soundManager.loadSample(2, "SOUND38.WAV"); _vm->_soundManager.loadSample(3, "SOUND39.WAV"); _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "CASSE.SPR"); - _breakoutSpr = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _breakoutSpr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); loadHiscore(); setModeVGA256(); newLevel(); @@ -617,7 +617,7 @@ void ComputerManager::loadHiscore() { _vm->_fileManager.constructLinuxFilename("HISCORE.DAT"); ptr = _vm->_globals.allocMemory(100); - _vm->_saveLoadManager.load(_vm->_globals.NFICHIER, ptr); + _vm->_saveLoadManager.load(_vm->_globals._curFilename, ptr); for (int scoreIndex = 0; scoreIndex < 6; ++scoreIndex) { for (int i = 0; i < 5; ++i) { @@ -671,14 +671,14 @@ void ComputerManager::newLevel() { file = Common::String::format("TAB%d.TAB", _breakoutLevelNbr); _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, file); - if (f.open(_vm->_globals.NFICHIER)) + if (f.open(_vm->_globals._curFilename)) break; _breakoutLevelNbr = 1; } f.close(); - _breakoutLevel = (int16 *)_vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _breakoutLevel = (int16 *)_vm->_fileManager.loadFile(_vm->_globals._curFilename); displayBricks(); _vm->_objectsManager.SPRITE(_breakoutSpr, Common::Point(150, 192), 0, 13, 0, 0, 0, 0); _vm->_objectsManager.SPRITE(_breakoutSpr, Common::Point(164, 187), 1, 14, 0, 0, 0, 0); @@ -860,7 +860,7 @@ int ComputerManager::displayHiscores() { loadHiscore(); _vm->_graphicsManager.loadVgaImage("HISCORE.PCX"); _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "ALPHA.SPR"); - ptr = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); @@ -915,7 +915,7 @@ void ComputerManager::getScoreName() { _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0); _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "ALPHA.SPR"); - ptr = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_graphicsManager.fadeInBreakout(); for (int strPos = 0; strPos <= 4; strPos++) { displayHiscoreLine(ptr, 9 * strPos + 140, 78, 1); @@ -1075,7 +1075,7 @@ void ComputerManager::saveScore() { } _vm->_fileManager.constructLinuxFilename("HISCORE.DAT"); - _vm->_saveLoadManager.saveFile(_vm->_globals.NFICHIER, ptr, 100); + _vm->_saveLoadManager.saveFile(_vm->_globals._curFilename, ptr, 100); _vm->_globals.freeMemory(ptr); } diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 1260f92b7d..2899cb030f 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -66,7 +66,7 @@ void DialogsManager::showOptionsDialog() { else if (_vm->_globals._language == LANG_SP) _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIES.SPR"); - _vm->_globals.OPTION_SPR = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.OPTION_SPR = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals._optionDialogFl = true; do { @@ -327,8 +327,8 @@ LABEL_7: } Common::File f; - if (!f.open(_vm->_globals.NFICHIER)) - error("Error opening file - %s", _vm->_globals.NFICHIER.c_str()); + if (!f.open(_vm->_globals._curFilename)) + error("Error opening file - %s", _vm->_globals._curFilename.c_str()); size_t filesize = f.size(); _vm->_dialogsManager._inventWin1 = _vm->_globals.allocMemory(filesize); @@ -336,7 +336,7 @@ LABEL_7: f.close(); _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENT2.SPR"); - _inventBuf2 = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _inventBuf2 = _vm->_fileManager.loadFile(_vm->_globals._curFilename); int v19 = _inventX = _vm->_graphicsManager.ofscroll + 152; _inventY = 114; @@ -634,9 +634,9 @@ void DialogsManager::showSaveLoad(int a1) { break; } - _vm->_objectsManager.SL_SPR = _vm->_objectsManager.loadSprite(_vm->_globals.NFICHIER); + _vm->_objectsManager.SL_SPR = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename); _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVE2.SPR"); - _vm->_objectsManager.SL_SPR2 = _vm->_objectsManager.loadSprite(_vm->_globals.NFICHIER); + _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); if (_vm->_globals._language == LANG_FR) { diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp index 1971b82a2a..6c792017ef 100644 --- a/engines/hopkins/files.cpp +++ b/engines/hopkins/files.cpp @@ -74,7 +74,7 @@ void FileManager::initCensorship() { // If file doesn't exist, fallback to uncensored if (!fileExists(_vm->_globals.HOPSYSTEM, "BLOOD.DAT")) { constructFilename(_vm->_globals.HOPSYSTEM, "BLOOD.DAT"); - char *data = (char *)loadFile(_vm->_globals.NFICHIER); + char *data = (char *)loadFile(_vm->_globals._curFilename); if (*(data + 6) == 'u' && *(data + 7) == 'k') _vm->_globals.CENSURE = true; @@ -118,14 +118,14 @@ void FileManager::constructFilename(const Common::String &folder, const Common:: } } - _vm->_globals.NFICHIER = Common::String::format("%s/%s", folderToUse.c_str(), file.c_str()); + _vm->_globals._curFilename = Common::String::format("%s/%s", folderToUse.c_str(), file.c_str()); } /** * Construct Linux filename */ Common::String FileManager::constructLinuxFilename(const Common::String &file) { - _vm->_globals.NFICHIER = file; + _vm->_globals._curFilename = file; return file; } @@ -153,71 +153,71 @@ byte *FileManager::searchCat(const Common::String &file, int a2) { switch (a2) { case 1: constructFilename(_vm->_globals.HOPLINK, "RES_INI.CAT"); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; - ptr = loadFile(_vm->_globals.NFICHIER); + ptr = loadFile(_vm->_globals._curFilename); constructFilename(_vm->_globals.HOPLINK, "RES_INI.RES"); break; case 2: constructFilename(_vm->_globals.HOPLINK, "RES_REP.CAT"); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; - ptr = loadFile(_vm->_globals.NFICHIER); + ptr = loadFile(_vm->_globals._curFilename); constructFilename(_vm->_globals.HOPLINK, "RES_REP.RES"); break; case 3: constructFilename(_vm->_globals.HOPLINK, "RES_LIN.CAT"); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; - ptr = loadFile(_vm->_globals.NFICHIER); + ptr = loadFile(_vm->_globals._curFilename); constructFilename(_vm->_globals.HOPLINK, "RES_LIN.RES"); break; case 4: constructFilename(_vm->_globals.HOPANIM, "RES_ANI.CAT"); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; - ptr = loadFile(_vm->_globals.NFICHIER); + ptr = loadFile(_vm->_globals._curFilename); constructFilename(_vm->_globals.HOPANIM, "RES_ANI.RES"); break; case 5: constructFilename(_vm->_globals.HOPANIM, "RES_PER.CAT"); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; - ptr = loadFile(_vm->_globals.NFICHIER); + ptr = loadFile(_vm->_globals._curFilename); constructFilename(_vm->_globals.HOPANIM, "RES_PER.RES"); break; case 6: constructFilename(_vm->_globals.HOPIMAGE, "PIC.CAT"); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; - ptr = loadFile(_vm->_globals.NFICHIER); + ptr = loadFile(_vm->_globals._curFilename); break; case 7: constructFilename(_vm->_globals.HOPANIM, "RES_SAN.CAT"); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; - ptr = loadFile(_vm->_globals.NFICHIER); + ptr = loadFile(_vm->_globals._curFilename); break; case 8: constructFilename(_vm->_globals.HOPLINK, "RES_SLI.CAT"); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; - ptr = loadFile(_vm->_globals.NFICHIER); + ptr = loadFile(_vm->_globals._curFilename); break; case 9: @@ -238,10 +238,10 @@ byte *FileManager::searchCat(const Common::String &file, int a2) { } } - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return g_PTRNUL; - ptr = loadFile(_vm->_globals.NFICHIER); + ptr = loadFile(_vm->_globals._curFilename); break; // Deliberate fall-through to default: @@ -276,7 +276,7 @@ byte *FileManager::searchCat(const Common::String &file, int a2) { // TODO: Double check whether this really should be an unsigned int comparison if ((uint16)(a2 - 6) > 1 && (uint16)(a2 - 8) > 1) { - if (!f.open(_vm->_globals.NFICHIER)) + if (!f.open(_vm->_globals._curFilename)) error("CHARGE_FICHIER"); f.seek(_vm->_globals._catalogPos); diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index 484745347e..f1415506fe 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -170,7 +170,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in _text[idx]._textLoadedFl = true; _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename); - file = _vm->_globals.NFICHIER; + file = _vm->_globals._curFilename; if (strncmp(file.c_str(), _oldName.c_str(), strlen(file.c_str())) != 0) { // Starting to access a new file, so read in the index file for the file _oldName = file; diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index 15f5abcd29..99eaadee28 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -472,7 +472,7 @@ void Globals::CLEAR_VBOB() { // Load Object void Globals::loadObjects() { _vm->_fileManager.constructFilename(HOPSYSTEM, "OBJET.DAT"); - byte *data = _vm->_fileManager.loadFile(NFICHIER); + byte *data = _vm->_fileManager.loadFile(_curFilename); byte *srcP = data; for (int idx = 0; idx < 300; ++idx) { @@ -551,13 +551,13 @@ void Globals::loadCache(const Common::String &file) { RESET_CACHE(); _vm->_fileManager.constructFilename(HOPLINK, file); - ptr = _vm->_fileManager.loadFile(NFICHIER); + ptr = _vm->_fileManager.loadFile(_curFilename); v16 = Common::String((const char *)ptr); _vm->_fileManager.constructFilename(HOPLINK, v16); - if (f.exists(NFICHIER)) { - spriteData = _vm->_fileManager.loadFile(NFICHIER); + if (f.exists(_curFilename)) { + spriteData = _vm->_fileManager.loadFile(_curFilename); CACHE_BANQUE[1] = spriteData; int v15 = 60; for (int i = 0; i <= 21; i++) { diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index a2104a6fbd..c524cf616f 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -350,7 +350,7 @@ public: Common::String HOPSYSTEM; Common::String FICH_ZONE; Common::String FICH_TEXTE; - Common::String NFICHIER; + Common::String _curFilename; int SOUNDVOL; int MUSICVOL; int VOICEVOL; diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index fdbffe8456..0facdf85d4 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -167,7 +167,7 @@ void GraphicsManager::loadVgaImage(const Common::String &file) { clearScreen(); unlockScreen(); _vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, file); - A_PCX320(_vesaScreen, _vm->_globals.NFICHIER, _palette); + A_PCX320(_vesaScreen, _vm->_globals._curFilename, _palette); memcpy(_vesaBuffer, _vesaScreen, 64000); SCANLINE(320); max_x = 320; @@ -188,7 +188,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); - if (!f.open(_vm->_globals.NFICHIER)) + if (!f.open(_vm->_globals._curFilename)) error("loadScreen - %s", file.c_str()); f.seek(0, SEEK_END); @@ -305,14 +305,14 @@ 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"); - if (!f.open(_vm->_globals.NFICHIER)) + if (!f.open(_vm->_globals._curFilename)) error("(nom)Erreur en cours de lecture."); f.seek(_vm->_globals._catalogPos); } else { // Load stand alone PCX file _vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, file); - if (!f.open(_vm->_globals.NFICHIER)) + if (!f.open(_vm->_globals._curFilename)) error("(nom)Erreur en cours de lecture."); } @@ -1406,349 +1406,338 @@ void GraphicsManager::Affiche_Perfect(byte *surface, const byte *srcData, int xp clip_y = 0; clip_x1 = 0; clip_y1 = 0; - if ((uint16)xp300 > min_x) { - if ((uint16)xp300 < (uint16)(min_x + 300)) - clip_x = min_x + 300 - xp300; - if ((uint16)yp300 > min_y) { - if ((uint16)yp300 < (uint16)(min_y + 300)) - clip_y = min_y + 300 - yp300; - if ((uint16)xp300 < (uint16)(max_x + 300)) { - clip_x1 = max_x + 300 - xp300; - if ((uint16)yp300 < (uint16)(max_y + 300)) { - clip_y1 = max_y + 300 - yp300; - dest1P = xp300 + _lineNbr2 * (yp300 - 300) - 300 + surface; - if (zoom2) { - Compteur_y = 0; - Agr_x = 0; - Agr_y = 0; - Agr_Flag_y = 0; + if ((xp300 <= min_x) || (yp300 <= min_y) || (xp300 >= max_x + 300) || (yp300 >= max_y + 300)) + return; + + if ((uint16)xp300 < (uint16)(min_x + 300)) + clip_x = min_x + 300 - xp300; + + if ((uint16)yp300 < (uint16)(min_y + 300)) + clip_y = min_y + 300 - yp300; + + clip_x1 = max_x + 300 - xp300; + clip_y1 = max_y + 300 - yp300; + dest1P = xp300 + _lineNbr2 * (yp300 - 300) - 300 + surface; + if (zoom2) { + Compteur_y = 0; + Agr_x = 0; + Agr_y = 0; + Agr_Flag_y = 0; + Agr_Flag_x = 0; + _width = spriteWidth; + int v20 = zoomIn(spriteWidth, zoom2); + int v22 = zoomIn(spriteHeight1, zoom2); + if (modeFlag) { + v29 = v20 + dest1P; + if (clip_y) { + if ((uint16)clip_y >= v22) + return; + int v30 = 0; + while (zoomIn(v30 + 1, zoom2) < (uint16)clip_y) + ; + spritePixelsP += _width * v30; + v29 += _lineNbr2 * (uint16)clip_y; + v22 = v22 - (uint16)clip_y; + } + if (v22 > (uint16)clip_y1) + v22 = (uint16)clip_y1; + if (clip_x) { + if ((uint16)clip_x >= v20) + return; + v20 -= (uint16)clip_x; + } + if (v20 > (uint16)clip_x1) { + int v32 = v20 - (uint16)clip_x1; + v29 -= v32; + int v62 = v22; + int v33 = 0; + while (zoomIn(v33 + 1, zoom2) < v32) + ; + int v34 = v33; + v22 = v62; + spritePixelsP += v34; + v20 = (uint16)clip_x1; + } + int v63; + do { + for (;;) { + v63 = v22; + byte *v53 = v29; + v46 = spritePixelsP; + Agr_Flag_x = 0; + Agr_x = 0; + for (int v35 = v20; v35; v35--) { + for (;;) { + if (*spritePixelsP) + *v29 = *spritePixelsP; + --v29; + ++spritePixelsP; + if (!Agr_Flag_x) + Agr_x = zoom2 + Agr_x; + if ((uint16)Agr_x < 100) + break; + Agr_x = Agr_x - 100; + --spritePixelsP; + Agr_Flag_x = 1; + --v35; + if (!v35) + goto R_Aff_Zoom_Larg_Cont1; + } Agr_Flag_x = 0; - _width = spriteWidth; - int v20 = zoomIn(spriteWidth, zoom2); - int v22 = zoomIn(spriteHeight1, zoom2); - if (modeFlag) { - v29 = v20 + dest1P; - if (clip_y) { - if ((uint16)clip_y >= v22) - return; - int v61 = v22; - int v52 = v20; - int v30 = 0; - int v31 = (uint16)clip_y; - while (zoomIn(v30 + 1, zoom2) < v31) - ; - v20 = v52; - spritePixelsP += _width * v30; - v29 += _lineNbr2 * (uint16)clip_y; - v22 = v61 - (uint16)clip_y; - } - if (v22 > (uint16)clip_y1) - v22 = (uint16)clip_y1; - if (clip_x) { - if ((uint16)clip_x >= v20) - return; - v20 -= (uint16)clip_x; - } - if (v20 > (uint16)clip_x1) { - int v32 = v20 - (uint16)clip_x1; - v29 -= v32; - int v62 = v22; - int v33 = 0; - while (zoomIn(v33 + 1, zoom2) < v32) - ; - int v34 = v33; - v22 = v62; - spritePixelsP += v34; - v20 = (uint16)clip_x1; - } - int v63; - do { - for (;;) { - v63 = v22; - byte *v53 = v29; - v46 = spritePixelsP; - Agr_Flag_x = 0; - Agr_x = 0; - for (int v35 = v20; v35; v35--) { - for (;;) { - if (*spritePixelsP) - *v29 = *spritePixelsP; - --v29; - ++spritePixelsP; - if (!Agr_Flag_x) - Agr_x = zoom2 + Agr_x; - if ((uint16)Agr_x < 100) - break; - Agr_x = Agr_x - 100; - --spritePixelsP; - Agr_Flag_x = 1; - --v35; - if (!v35) - goto R_Aff_Zoom_Larg_Cont1; - } - Agr_Flag_x = 0; - } + } R_Aff_Zoom_Larg_Cont1: - spritePixelsP = _width + v46; - v29 = _lineNbr2 + v53; - ++Compteur_y; - if (!Agr_Flag_y) - Agr_y = zoom2 + Agr_y; - if ((uint16)Agr_y < 100) - break; - Agr_y = Agr_y - 100; - spritePixelsP = v46; - Agr_Flag_y = 1; - v22 = v63 - 1; - if (v63 == 1) - return; - } - Agr_Flag_y = 0; - v22 = v63 - 1; - } while (v63 != 1); - } else { - if (clip_y) { - if ((uint16)clip_y >= v22) - return; - int v58 = v22; - int v49 = v20; - int v23 = 0; - int v24 = (uint16)clip_y; - while (zoomIn(v23 + 1, zoom2) < v24) - ; - v20 = v49; - spritePixelsP += _width * v23; - dest1P += _lineNbr2 * (uint16)clip_y; - v22 = v58 - (uint16)clip_y; - } - if (v22 > (uint16)clip_y1) - v22 = (uint16)clip_y1; - if (clip_x) { - if ((uint16)clip_x >= v20) - return; - int v59 = v22; - int v50 = v20; - int v25 = (uint16)clip_x; - int v26 = 0; - while (zoomIn(v26 + 1, zoom2) < v25) - ; - int v27 = v26; - v22 = v59; - spritePixelsP += v27; - dest1P += (uint16)clip_x; - v20 = v50 - (uint16)clip_x; - } - if (v20 > (uint16)clip_x1) - v20 = (uint16)clip_x1; - - int v60; - do { - for (;;) { - v60 = v22; - byte *v51 = dest1P; - v45 = spritePixelsP; - int v28 = v20; - Agr_Flag_x = 0; - Agr_x = 0; - do { - for (;;) { - if (*spritePixelsP) - *dest1P = *spritePixelsP; - ++dest1P; - ++spritePixelsP; - if (!Agr_Flag_x) - Agr_x = zoom2 + Agr_x; - if ((uint16)Agr_x < 100) - break; - Agr_x = Agr_x - 100; - --spritePixelsP; - Agr_Flag_x = 1; - --v28; - if (!v28) - goto Aff_Zoom_Larg_Cont1; - } - Agr_Flag_x = 0; - --v28; - } while (v28); -Aff_Zoom_Larg_Cont1: - spritePixelsP = _width + v45; - dest1P = _lineNbr2 + v51; - if (!Agr_Flag_y) - Agr_y = zoom2 + Agr_y; - if ((uint16)Agr_y < 100) - break; - Agr_y = Agr_y - 100; - spritePixelsP = v45; - Agr_Flag_y = 1; - v22 = v60 - 1; - if (v60 == 1) - return; - } - Agr_Flag_y = 0; - v22 = v60 - 1; - } while (v60 != 1); + spritePixelsP = _width + v46; + v29 = _lineNbr2 + v53; + ++Compteur_y; + if (!Agr_Flag_y) + Agr_y = zoom2 + Agr_y; + if ((uint16)Agr_y < 100) + break; + Agr_y = Agr_y - 100; + spritePixelsP = v46; + Agr_Flag_y = 1; + v22 = v63 - 1; + if (v63 == 1) + return; + } + Agr_Flag_y = 0; + v22 = v63 - 1; + } while (v63 != 1); + } else { + if (clip_y) { + if ((uint16)clip_y >= v22) + return; + int v58 = v22; + int v49 = v20; + int v23 = 0; + int v24 = (uint16)clip_y; + while (zoomIn(v23 + 1, zoom2) < v24) + ; + v20 = v49; + spritePixelsP += _width * v23; + dest1P += _lineNbr2 * (uint16)clip_y; + v22 = v58 - (uint16)clip_y; + } + if (v22 > (uint16)clip_y1) + v22 = (uint16)clip_y1; + if (clip_x) { + if ((uint16)clip_x >= v20) + return; + int v26 = 0; + while (zoomIn(v26 + 1, zoom2) < (uint16)clip_x) + ; + spritePixelsP += v26; + dest1P += (uint16)clip_x; + v20 = v20 - (uint16)clip_x; + } + if (v20 > (uint16)clip_x1) + v20 = (uint16)clip_x1; + + int v60; + do { + for (;;) { + v60 = v22; + byte *v51 = dest1P; + v45 = spritePixelsP; + int v28 = v20; + Agr_Flag_x = 0; + Agr_x = 0; + do { + for (;;) { + if (*spritePixelsP) + *dest1P = *spritePixelsP; + ++dest1P; + ++spritePixelsP; + if (!Agr_Flag_x) + Agr_x = zoom2 + Agr_x; + if ((uint16)Agr_x < 100) + break; + Agr_x = Agr_x - 100; + --spritePixelsP; + Agr_Flag_x = 1; + --v28; + if (!v28) + goto Aff_Zoom_Larg_Cont1; } - } else if (zoom1) { - Compteur_y = 0; + Agr_Flag_x = 0; + --v28; + } while (v28); +Aff_Zoom_Larg_Cont1: + spritePixelsP = _width + v45; + dest1P = _lineNbr2 + v51; + if (!Agr_Flag_y) + Agr_y = zoom2 + Agr_y; + if ((uint16)Agr_y < 100) + break; + Agr_y = Agr_y - 100; + spritePixelsP = v45; + Agr_Flag_y = 1; + v22 = v60 - 1; + if (v60 == 1) + return; + } + Agr_Flag_y = 0; + v22 = v60 - 1; + } while (v60 != 1); + } + } else if (zoom1) { + Compteur_y = 0; + Red_x = 0; + Red_y = 0; + _width = spriteWidth; + Red = zoom1; + if (zoom1 < 100) { + int v37 = zoomOut(spriteWidth, Red); + if (modeFlag) { + v40 = v37 + dest1P; + do { + int v65 = spriteHeight2; + byte *v55 = v40; + Red_y = Red + Red_y; + if ((uint16)Red_y < 100) { Red_x = 0; - Red_y = 0; - _width = spriteWidth; - Red = zoom1; - if (zoom1 < 100) { - int v37 = zoomOut(spriteWidth, Red); - if (modeFlag) { - v40 = v37 + dest1P; - do { - int v65 = spriteHeight2; - byte *v55 = v40; - Red_y = Red + Red_y; - if ((uint16)Red_y < 100) { - Red_x = 0; - int v42 = v37; - for (int v41 = _width; v41; v41--) { - Red_x = Red + Red_x; - if ((uint16)Red_x < 100) { - if (v42 >= clip_x && v42 < clip_x1 && *spritePixelsP) - *v40 = *spritePixelsP; - --v40; - ++spritePixelsP; - --v42; - } else { - Red_x = Red_x - 100; - ++spritePixelsP; - } - } - spriteHeight2 = v65; - v40 = _lineNbr2 + v55; - } else { - Red_y = Red_y - 100; - spritePixelsP += _width; - } - --spriteHeight2; - } while (spriteHeight2); + int v42 = v37; + for (int v41 = _width; v41; v41--) { + Red_x = Red + Red_x; + if ((uint16)Red_x < 100) { + if (v42 >= clip_x && v42 < clip_x1 && *spritePixelsP) + *v40 = *spritePixelsP; + --v40; + ++spritePixelsP; + --v42; } else { - do { - int v64 = spriteHeight2; - byte *v54 = dest1P; - Red_y = Red + Red_y; - if ((uint16)Red_y < 100) { - Red_x = 0; - int v39 = 0; - for (int v38 = _width; v38; v38--) { - Red_x = Red + Red_x; - if ((uint16)Red_x < 100) { - if (v39 >= clip_x && v39 < clip_x1 && *spritePixelsP) - *dest1P = *spritePixelsP; - ++dest1P; - ++spritePixelsP; - ++v39; - } else { - Red_x = Red_x - 100; - ++spritePixelsP; - } - } - spriteHeight2 = v64; - dest1P = _lineNbr2 + v54; - } else { - Red_y = Red_y - 100; - spritePixelsP += _width; - } - --spriteHeight2; - } while (spriteHeight2); + Red_x = Red_x - 100; + ++spritePixelsP; } } + spriteHeight2 = v65; + v40 = _lineNbr2 + v55; } else { - _width = spriteWidth; - Compteur_y = 0; - if (modeFlag) { - dest2P = spriteWidth + dest1P; - spec_largeur = spriteWidth; - if (clip_y) { - if ((uint16)clip_y >= (unsigned int)spriteHeight1) - return; - spritePixelsP += spriteWidth * (uint16)clip_y; - dest2P += _lineNbr2 * (uint16)clip_y; - spriteHeight1 -= (uint16)clip_y; - } - int xLeft = (uint16)clip_y1; - if (spriteHeight1 > clip_y1) - spriteHeight1 = clip_y1; - xLeft = clip_x; - if (clip_x) { - if (xLeft >= spriteWidth) - return; - spriteWidth -= xLeft; - } - if (spriteWidth > (uint16)clip_x1) { - int clippedWidth = spriteWidth - (uint16)clip_x1; - spritePixelsP += clippedWidth; - dest2P -= clippedWidth; - spriteWidth = (uint16)clip_x1; - } - int yCtr2; - do { - yCtr2 = spriteHeight1; - byte *destCopy2P = dest2P; - const byte *spritePixelsCopy2P = spritePixelsP; - for (int xCtr2 = spriteWidth; xCtr2; xCtr2--) { - if (*spritePixelsP) - *dest2P = *spritePixelsP; - ++spritePixelsP; - --dest2P; - } - spritePixelsP = spec_largeur + spritePixelsCopy2P; - dest2P = _lineNbr2 + destCopy2P; - spriteHeight1 = yCtr2 - 1; - } while (yCtr2 != 1); - } else { - spec_largeur = spriteWidth; - if (clip_y) { - if ((uint16)clip_y >= (unsigned int)spriteHeight1) - return; - spritePixelsP += spriteWidth * (uint16)clip_y; - dest1P += _lineNbr2 * (uint16)clip_y; - spriteHeight1 -= (uint16)clip_y; - } - if (spriteHeight1 > clip_y1) - spriteHeight1 = clip_y1; - if (clip_x) { - if ((uint16)clip_x >= spriteWidth) - return; - spritePixelsP += (uint16)clip_x; - dest1P += (uint16)clip_x; - spriteWidth -= (uint16)clip_x; + Red_y = Red_y - 100; + spritePixelsP += _width; + } + --spriteHeight2; + } while (spriteHeight2); + } else { + do { + int v64 = spriteHeight2; + byte *v54 = dest1P; + Red_y = Red + Red_y; + if ((uint16)Red_y < 100) { + Red_x = 0; + int v39 = 0; + for (int v38 = _width; v38; v38--) { + Red_x = Red + Red_x; + if ((uint16)Red_x < 100) { + if (v39 >= clip_x && v39 < clip_x1 && *spritePixelsP) + *dest1P = *spritePixelsP; + ++dest1P; + ++spritePixelsP; + ++v39; + } else { + Red_x = Red_x - 100; + ++spritePixelsP; } - if (spriteWidth > (uint16)clip_x1) - spriteWidth = (uint16)clip_x1; - int yCtr1; - do { - yCtr1 = spriteHeight1; - byte *dest1CopyP = dest1P; - const byte *spritePixelsCopyP = spritePixelsP; - for (int xCtr1 = spriteWidth; xCtr1; xCtr1--) { - if (*spritePixelsP) - *dest1P = *spritePixelsP; - ++dest1P; - ++spritePixelsP; - } - spritePixelsP = spec_largeur + spritePixelsCopyP; - dest1P = _lineNbr2 + dest1CopyP; - spriteHeight1 = yCtr1 - 1; - } while (yCtr1 != 1); } + spriteHeight2 = v64; + dest1P = _lineNbr2 + v54; + } else { + Red_y = Red_y - 100; + spritePixelsP += _width; } + --spriteHeight2; + } while (spriteHeight2); + } + } + } else { + _width = spriteWidth; + Compteur_y = 0; + if (modeFlag) { + dest2P = spriteWidth + dest1P; + spec_largeur = spriteWidth; + if (clip_y) { + if ((uint16)clip_y >= (unsigned int)spriteHeight1) + return; + spritePixelsP += spriteWidth * (uint16)clip_y; + dest2P += _lineNbr2 * (uint16)clip_y; + spriteHeight1 -= (uint16)clip_y; + } + int xLeft = (uint16)clip_y1; + if (spriteHeight1 > clip_y1) + spriteHeight1 = clip_y1; + xLeft = clip_x; + if (clip_x) { + if (xLeft >= spriteWidth) + return; + spriteWidth -= xLeft; + } + if (spriteWidth > (uint16)clip_x1) { + int clippedWidth = spriteWidth - (uint16)clip_x1; + spritePixelsP += clippedWidth; + dest2P -= clippedWidth; + spriteWidth = (uint16)clip_x1; + } + int yCtr2; + do { + yCtr2 = spriteHeight1; + byte *destCopy2P = dest2P; + const byte *spritePixelsCopy2P = spritePixelsP; + for (int xCtr2 = spriteWidth; xCtr2; xCtr2--) { + if (*spritePixelsP) + *dest2P = *spritePixelsP; + ++spritePixelsP; + --dest2P; } + spritePixelsP = spec_largeur + spritePixelsCopy2P; + dest2P = _lineNbr2 + destCopy2P; + spriteHeight1 = yCtr2 - 1; + } while (yCtr2 != 1); + } else { + spec_largeur = spriteWidth; + if (clip_y) { + if ((uint16)clip_y >= (unsigned int)spriteHeight1) + return; + spritePixelsP += spriteWidth * (uint16)clip_y; + dest1P += _lineNbr2 * (uint16)clip_y; + spriteHeight1 -= (uint16)clip_y; + } + if (spriteHeight1 > clip_y1) + spriteHeight1 = clip_y1; + if (clip_x) { + if ((uint16)clip_x >= spriteWidth) + return; + spritePixelsP += (uint16)clip_x; + dest1P += (uint16)clip_x; + spriteWidth -= (uint16)clip_x; } + if (spriteWidth > (uint16)clip_x1) + spriteWidth = (uint16)clip_x1; + int yCtr1; + do { + yCtr1 = spriteHeight1; + byte *dest1CopyP = dest1P; + const byte *spritePixelsCopyP = spritePixelsP; + for (int xCtr1 = spriteWidth; xCtr1; xCtr1--) { + if (*spritePixelsP) + *dest1P = *spritePixelsP; + ++dest1P; + ++spritePixelsP; + } + spritePixelsP = spec_largeur + spritePixelsCopyP; + dest1P = _lineNbr2 + dest1CopyP; + spriteHeight1 = yCtr1 - 1; + } while (yCtr1 != 1); } } } -// Display Speed +/** + * Fast Display + */ void GraphicsManager::fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex) { - int width, height; + int width = _vm->_objectsManager.getWidth(spriteData, spriteIndex); + int height = _vm->_objectsManager.getHeight(spriteData, spriteIndex); - width = _vm->_objectsManager.getWidth(spriteData, spriteIndex); - height = _vm->_objectsManager.getHeight(spriteData, spriteIndex); if (*spriteData == 78) { Affiche_Perfect(_vesaScreen, spriteData, xp + 300, yp + 300, spriteIndex, 0, 0, 0); Affiche_Perfect(_vesaBuffer, spriteData, xp + 300, yp + 300, spriteIndex, 0, 0, 0); @@ -1883,7 +1872,7 @@ void GraphicsManager::OPTI_INI(const Common::String &file, int mode) { if (ptr == g_PTRNUL) { _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename); - ptr = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (!mode) { filename = file + ".spr"; @@ -1895,7 +1884,7 @@ void GraphicsManager::OPTI_INI(const Common::String &file, int mode) { } else { _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "RES_SLI.RES"); } - _vm->_globals.SPRITE_ECRAN = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.SPRITE_ECRAN = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } } if (*ptr != 'I' || *(ptr + 1) != 'N' || *(ptr + 2) != 'I') { @@ -1930,7 +1919,7 @@ void GraphicsManager::OPTI_INI(const Common::String &file, int mode) { _vm->_globals.COUCOU = dataP; if (g_PTRNUL == dataP) { _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename); - dataP = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + dataP = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.COUCOU = dataP; } } diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 30d7f502dd..9c80f56f3f 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -180,7 +180,7 @@ bool HopkinsEngine::runWin95Demo() { _graphicsManager.FADE_OUTW(); _globals.iRegul = 1; _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 2000); @@ -489,7 +489,7 @@ bool HopkinsEngine::runLinuxDemo() { _globals.iRegul = 0; _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 2000); @@ -854,7 +854,7 @@ bool HopkinsEngine::runOS2Full() { _graphicsManager.FADE_INW(); _globals.iRegul = 0; _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 1996); @@ -1237,7 +1237,7 @@ bool HopkinsEngine::runOS2Full() { _soundManager.WSOUND(13); if (_globals._forestSprite == g_PTRNUL) { _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); - _globals._forestSprite = _objectsManager.loadSprite(_globals.NFICHIER); + _globals._forestSprite = _objectsManager.loadSprite(_globals._curFilename); _soundManager.loadSample(1, "SOUND41.WAV"); } _objectsManager.PERSONAGE2(im, im, "BANDIT", im, 13); @@ -1698,7 +1698,7 @@ bool HopkinsEngine::runOS2Full() { _globals._exitId = handleBaseMap(); // _soundManager.WSOUND_OFF(); _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; break; @@ -1741,7 +1741,7 @@ bool HopkinsEngine::runBeOSFull() { _graphicsManager.FADE_OUTW(); _globals.iRegul = 0; _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 1996); @@ -2127,7 +2127,7 @@ bool HopkinsEngine::runBeOSFull() { _soundManager.WSOUND(13); if (_globals._forestSprite == g_PTRNUL) { _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); - _globals._forestSprite = _objectsManager.loadSprite(_globals.NFICHIER); + _globals._forestSprite = _objectsManager.loadSprite(_globals._curFilename); _soundManager.loadSample(1, "SOUND41.WAV"); } @@ -2589,7 +2589,7 @@ bool HopkinsEngine::runBeOSFull() { _globals._exitId = handleBaseMap(); _soundManager.WSOUND_OFF(); _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; break; @@ -2627,7 +2627,7 @@ bool HopkinsEngine::runWin95full() { _globals.iRegul = 0; _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 2000); @@ -3014,7 +3014,7 @@ bool HopkinsEngine::runWin95full() { _soundManager.WSOUND(13); if (_globals._forestSprite == g_PTRNUL) { _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); - _globals._forestSprite = _objectsManager.loadSprite(_globals.NFICHIER); + _globals._forestSprite = _objectsManager.loadSprite(_globals._curFilename); _soundManager.loadSample(1, "SOUND41.WAV"); } _objectsManager.PERSONAGE2(im, im, "BANDIT", im, 13); @@ -3463,7 +3463,7 @@ bool HopkinsEngine::runWin95full() { _soundManager.WSOUND_OFF(); warning("TODO: heapshrink();"); _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; _graphicsManager._lineNbr = SCREEN_WIDTH; @@ -3505,7 +3505,7 @@ bool HopkinsEngine::runLinuxFull() { _globals.iRegul = 0; _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 2000); @@ -3891,7 +3891,7 @@ bool HopkinsEngine::runLinuxFull() { _soundManager.WSOUND(13); if (_globals._forestSprite == g_PTRNUL) { _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); - _globals._forestSprite = _objectsManager.loadSprite(_globals.NFICHIER); + _globals._forestSprite = _objectsManager.loadSprite(_globals._curFilename); _soundManager.loadSample(1, "SOUND41.WAV"); } _objectsManager.PERSONAGE2(im, im, "BANDIT", im, 13); @@ -4352,7 +4352,7 @@ bool HopkinsEngine::runLinuxFull() { _globals._exitId = handleBaseMap(); _soundManager.WSOUND_OFF(); _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; _graphicsManager._lineNbr = SCREEN_WIDTH; @@ -4407,31 +4407,31 @@ void HopkinsEngine::initializeSystem() { _eventsManager._mouseSizeX = 34; _eventsManager._mouseSizeY = 20; } - _eventsManager._mouseCursor = _fileManager.loadFile(_globals.NFICHIER); + _eventsManager._mouseCursor = _fileManager.loadFile(_globals._curFilename); _globals.clearAll(); _fileManager.constructFilename(_globals.HOPSYSTEM, "FONTE3.SPR"); - _globals.police = _fileManager.loadFile(_globals.NFICHIER); + _globals.police = _fileManager.loadFile(_globals._curFilename); _globals.police_l = 12; _globals.police_h = 21; _fileManager.constructFilename(_globals.HOPSYSTEM, "ICONE.SPR"); - _globals.ICONE = _fileManager.loadFile(_globals.NFICHIER); + _globals.ICONE = _fileManager.loadFile(_globals._curFilename); _fileManager.constructFilename(_globals.HOPSYSTEM, "TETE.SPR"); - _globals.TETE = _fileManager.loadFile(_globals.NFICHIER); + _globals.TETE = _fileManager.loadFile(_globals._curFilename); switch (_globals._language) { case LANG_EN: _fileManager.constructFilename(_globals.HOPLINK, "ZONEAN.TXT"); - _globals.BUF_ZONE = _fileManager.loadFile(_globals.NFICHIER); + _globals.BUF_ZONE = _fileManager.loadFile(_globals._curFilename); break; case LANG_FR: _fileManager.constructFilename(_globals.HOPLINK, "ZONE01.TXT"); - _globals.BUF_ZONE = _fileManager.loadFile(_globals.NFICHIER); + _globals.BUF_ZONE = _fileManager.loadFile(_globals._curFilename); break; case LANG_SP: _fileManager.constructFilename(_globals.HOPLINK, "ZONEES.TXT"); - _globals.BUF_ZONE = _fileManager.loadFile(_globals.NFICHIER); + _globals.BUF_ZONE = _fileManager.loadFile(_globals._curFilename); break; } @@ -5114,7 +5114,7 @@ void HopkinsEngine::playEnding() { _globals._exitId = 300; } _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; } @@ -5306,7 +5306,7 @@ void HopkinsEngine::loadCredits() { break; } - byte *bufPtr = _fileManager.loadFile(_globals.NFICHIER); + byte *bufPtr = _fileManager.loadFile(_globals._curFilename); byte *curPtr = bufPtr; int idxLines = 0; bool loopCond = false; @@ -5660,7 +5660,7 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in _globals._disableInventFl = true; _soundManager.WSOUND(soundId); _fileManager.constructFilename(_globals.HOPSYSTEM, "VAISSEAU.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); if (backgroundFilename.size()) _graphicsManager.loadImage(backgroundFilename); @@ -5747,7 +5747,7 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in _globals.AFFLI = false; _objectsManager.CLEAR_ECRAN(); _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); - _globals.PERSO = _fileManager.loadFile(_globals.NFICHIER); + _globals.PERSO = _fileManager.loadFile(_globals._curFilename); _globals.PERSO_TYPE = 0; } diff --git a/engines/hopkins/menu.cpp b/engines/hopkins/menu.cpp index aaf7f8be5a..9c9e66d5a2 100644 --- a/engines/hopkins/menu.cpp +++ b/engines/hopkins/menu.cpp @@ -93,7 +93,7 @@ int MenuManager::menu() { else if (_vm->_globals._language == LANG_SP) _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "MENUES.SPR"); - spriteData = _vm->_objectsManager.loadSprite(_vm->_globals.NFICHIER); + spriteData = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename); _vm->_eventsManager.mouseOn(); _vm->_eventsManager.changeMouseCursor(0); _vm->_eventsManager._mouseCursorId = 0; diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 5ea08150ed..c3d564600d 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -122,7 +122,7 @@ byte *ObjectsManager::CAPTURE_OBJET(int objIndex, int mode) { ObjectsManager::DEL_FICHIER_OBJ(); if (val1 == 1) { _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OBJET1.SPR"); - _vm->_globals.ADR_FICHIER_OBJ = ObjectsManager::loadSprite(_vm->_globals.NFICHIER); + _vm->_globals.ADR_FICHIER_OBJ = ObjectsManager::loadSprite(_vm->_globals._curFilename); } _vm->_globals.NUM_FICHIER_OBJ = val1; } @@ -2252,7 +2252,7 @@ void ObjectsManager::CHARGE_OBSTACLE(const Common::String &file) { _vm->_linesManager.TOTAL_LIGNES = 0; DERLIGNE = 0; _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file); - ptr = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); v4 = 0; v5 = 0; do { @@ -2311,10 +2311,10 @@ void ObjectsManager::loadZone(const Common::String &file) { _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file); Common::File f; - if (!f.exists(_vm->_globals.NFICHIER)) - error("File not found : %s", _vm->_globals.NFICHIER.c_str()); + if (!f.exists(_vm->_globals._curFilename)) + error("File not found : %s", _vm->_globals._curFilename.c_str()); - ptr = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); v4 = 0; v18 = 0; v17 = 0; @@ -2460,7 +2460,7 @@ void ObjectsManager::PLAN_BETA() { _vm->_globals.loadCache("PLAN.CA2"); loadZone("PLAN.ZO2"); _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "VOITURE.SPR"); - _spritePtr = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _spritePtr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_animationManager.loadAnim("PLAN"); _vm->_graphicsManager.VISU_ALL(); _vm->_graphicsManager.INI_ECRAN2("PLAN"); @@ -2935,7 +2935,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha loc = &_vm->_globals._saveData->_realHopkins; _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PERSO.SPR"); - _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _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); SPRITE_ON(0); @@ -2961,7 +2961,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha loc = &_vm->_globals._saveData->_samantha; _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PSAMAN.SPR"); - _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _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); SPRITE_ON(0); @@ -3957,7 +3957,7 @@ void ObjectsManager::OPTI_OBJET() { data = _vm->_fileManager.searchCat(file, 1); if (data == g_PTRNUL) { _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file); - data = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + data = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if ((data == g_PTRNUL) || *data != 'I' || *(data + 1) != 'N' || *(data + 2) != 'I') { @@ -4172,7 +4172,7 @@ void ObjectsManager::ACTION_DOS(int idx) { _vm->_globals.GESTE_FLAG = 1; _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "DOS.SPR"); - _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) ACTION(_vm->_globals.GESTE, "0,1,2,3,4,5,6,7,8,8,8,8,8,8,7,6,5,4,3,2,1,0,-1,", 0, 0, 8, 0); @@ -4207,7 +4207,7 @@ void ObjectsManager::ACTION_DROITE(int idx) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 3; _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PROFIL.SPR"); - _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) ACTION(_vm->_globals.GESTE, "20,19,18,17,16,15,14,13,13,13,13,13,14,15,16,17,18,19,20,-1,", 0, 0, 8, 0); @@ -4236,7 +4236,7 @@ void ObjectsManager::Q_DROITE(int idx) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 4; _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "3Q.SPR"); - _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) ACTION(_vm->_globals.GESTE, "0,1,2,3,4,5,6,7,8,8,8,8,8,7,6,5,4,3,2,1,0,-1,", 0, 0, 8, 0); @@ -4265,7 +4265,7 @@ void ObjectsManager::ACTION_FACE(int idx) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 2; _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "FACE.SPR"); - _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) ACTION(_vm->_globals.GESTE, "0,1,2,3,4,5,6,7,9,9,9,9,9,9,7,6,5,4,3,2,1,0,-1,", 0, 0, 8, 0); @@ -4282,7 +4282,7 @@ void ObjectsManager::Q_GAUCHE(int idx) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 4; _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "3Q.SPR"); - _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) ACTION(_vm->_globals.GESTE, "0,1,2,3,4,5,6,7,8,8,8,8,8,7,6,5,4,3,2,1,0,-1,", 0, 0, 8, 1); @@ -4311,7 +4311,7 @@ void ObjectsManager::ACTION_GAUCHE(int idx) { _vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE); _vm->_globals.GESTE_FLAG = 3; _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PROFIL.SPR"); - _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename); } if (idx == 1) ACTION(_vm->_globals.GESTE, "20,19,18,17,16,15,14,13,13,13,13,13,14,15,16,17,18,19,20,-1,", 0, 0, 8, 1); @@ -4466,8 +4466,8 @@ void ObjectsManager::INILINK(const Common::String &file) { if (ptr == g_PTRNUL) { _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename); - if (!f.open(_vm->_globals.NFICHIER)) - error("Error opening file - %s", _vm->_globals.NFICHIER.c_str()); + if (!f.open(_vm->_globals._curFilename)) + error("Error opening file - %s", _vm->_globals._curFilename.c_str()); nbytes = f.size(); ptr = _vm->_globals.allocMemory(nbytes); @@ -4492,7 +4492,7 @@ void ObjectsManager::INILINK(const Common::String &file) { _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "RES_SLI.RES"); } - _vm->_globals.CACHE_BANQUE[1] = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.CACHE_BANQUE[1] = _vm->_fileManager.loadFile(_vm->_globals._curFilename); v36 = 60; v37 = ptr + 1000; for (int v40 = 0; v40 <= 21; v40++) { @@ -5367,20 +5367,20 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm 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->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _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->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _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->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 2; } _vm->_globals.HOPKINS_DATA(); diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 4d98cfbcca..ae2dea2c25 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -921,7 +921,7 @@ LABEL_1141: case 56: _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "HOPFEM.SPR"); - _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 1; _vm->_globals._saveData->data[svField122] = 1; _vm->_globals.HOPKINS_DATA(); @@ -932,7 +932,7 @@ LABEL_1141: case 57: _vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PERSO.SPR"); - _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); + _vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename); _vm->_globals.PERSO_TYPE = 0; _vm->_globals._saveData->data[svField122] = 0; _vm->_globals.HOPKINS_DATA(); diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp index f09c89252a..eda7ea0b88 100644 --- a/engines/hopkins/sound.cpp +++ b/engines/hopkins/sound.cpp @@ -390,7 +390,7 @@ void SoundManager::PLAY_MOD(const Common::String &file) { MOD_FLAG = false; } - loadMusic(_vm->_globals.NFICHIER); + loadMusic(_vm->_globals._curFilename); playMusic(); MOD_FLAG = true; } @@ -652,9 +652,9 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode) { catLen = _vm->_globals._catalogSize; } else { _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, filename + ".WAV"); - if (!f.exists(_vm->_globals.NFICHIER)) { + if (!f.exists(_vm->_globals._curFilename)) { _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, filename + ".APC"); - if (!f.exists(_vm->_globals.NFICHIER)) + if (!f.exists(_vm->_globals._curFilename)) return false; } @@ -733,7 +733,7 @@ void SoundManager::MODSetMusicVolume(int volume) { void SoundManager::loadSample(int wavIndex, const Common::String &file) { _vm->_fileManager.constructFilename(_vm->_globals.HOPSOUND, file); - LOAD_SAMPLE2_SDL(wavIndex, _vm->_globals.NFICHIER, 0); + LOAD_SAMPLE2_SDL(wavIndex, _vm->_globals._curFilename, 0); SOUND[wavIndex]._active = true; } @@ -807,8 +807,8 @@ void SoundManager::stopVoice(int voiceIndex) { } void SoundManager::SDL_LVOICE(size_t filePosition, size_t entryLength) { - if (!SDL_LoadVoice(_vm->_globals.NFICHIER, filePosition, entryLength, Swav[20])) - error("Couldn't load the sample %s", _vm->_globals.NFICHIER.c_str()); + if (!SDL_LoadVoice(_vm->_globals._curFilename, filePosition, entryLength, Swav[20])) + error("Couldn't load the sample %s", _vm->_globals._curFilename.c_str()); Swav[20]._active = true; } @@ -865,7 +865,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); - LOAD_SAMPLE2_SDL(wavIndex, _vm->_globals.NFICHIER, 1); + LOAD_SAMPLE2_SDL(wavIndex, _vm->_globals._curFilename, 1); } void SoundManager::PLAY_NWAV(int wavIndex) { diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index 4bdc0d567d..9a28adbd8f 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -69,8 +69,8 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { _characterSize = _vm->_globals._catalogSize; if (_characterBuffer == g_PTRNUL) { _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename); - _characterBuffer = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); - _characterSize = _vm->_fileManager.fileSize(_vm->_globals.NFICHIER); + _characterBuffer = _vm->_fileManager.loadFile(_vm->_globals._curFilename); + _characterSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename); } _vm->_globals._saveData->data[svField4] = 0; getStringFromBuffer(40, spriteFilename, (const char *)_characterBuffer); @@ -91,13 +91,13 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { } else { _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, "RES_SAN.RES"); } - _characterSprite = _vm->_objectsManager.loadSprite(_vm->_globals.NFICHIER); + _characterSprite = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename); _vm->_fileManager.constructLinuxFilename("TEMP.SCR"); if (_vm->_graphicsManager._lineNbr == SCREEN_WIDTH) - _vm->_saveLoadManager.saveFile(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 307200); + _vm->_saveLoadManager.saveFile(_vm->_globals._curFilename, _vm->_graphicsManager._vesaScreen, 307200); else if (_vm->_graphicsManager._lineNbr == (SCREEN_WIDTH * 2)) - _vm->_saveLoadManager.saveFile(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 614400); + _vm->_saveLoadManager.saveFile(_vm->_globals._curFilename, _vm->_graphicsManager._vesaScreen, 614400); if (!_vm->_graphicsManager._lineNbr) _vm->_graphicsManager.ofscroll = 0; @@ -178,8 +178,8 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) { _characterSize = _vm->_globals._catalogSize; if (_characterBuffer == g_PTRNUL) { _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename); - _characterBuffer = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); - _characterSize = _vm->_fileManager.fileSize(_vm->_globals.NFICHIER); + _characterBuffer = _vm->_fileManager.loadFile(_vm->_globals._curFilename); + _characterSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename); } _vm->_globals._saveData->data[svField4] = 0; @@ -597,7 +597,7 @@ int TalkManager::VERIF_BOITE(int idx, const Common::String &file, int a3) { _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file); // Build up the filename - filename = dest = _vm->_globals.NFICHIER; + filename = dest = _vm->_globals._curFilename; while (filename.lastChar() != '.') filename.deleteLastChar(); filename += "IND"; @@ -1119,8 +1119,8 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { _characterSize = _vm->_globals._catalogSize; if (_characterBuffer == g_PTRNUL) { _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, a2); - _characterBuffer = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER); - _characterSize = _vm->_fileManager.fileSize(_vm->_globals.NFICHIER); + _characterBuffer = _vm->_fileManager.loadFile(_vm->_globals._curFilename); + _characterSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename); } getStringFromBuffer(40, v23, (const char *)_characterBuffer); getStringFromBuffer(0, v22, (const char *)_characterBuffer); @@ -1136,13 +1136,13 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { else _vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, "RES_SAN.RES"); - _characterSprite = _vm->_objectsManager.loadSprite(_vm->_globals.NFICHIER); + _characterSprite = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename); _vm->_fileManager.constructLinuxFilename("TEMP.SCR"); if (_vm->_graphicsManager._lineNbr == SCREEN_WIDTH) - _vm->_saveLoadManager.saveFile(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 307200); + _vm->_saveLoadManager.saveFile(_vm->_globals._curFilename, _vm->_graphicsManager._vesaScreen, 307200); else if (_vm->_graphicsManager._lineNbr == (SCREEN_WIDTH * 2)) - _vm->_saveLoadManager.saveFile(_vm->_globals.NFICHIER, _vm->_graphicsManager._vesaScreen, 614400); + _vm->_saveLoadManager.saveFile(_vm->_globals._curFilename, _vm->_graphicsManager._vesaScreen, 614400); if (!_vm->_graphicsManager._lineNbr) _vm->_graphicsManager.ofscroll = 0; -- cgit v1.2.3