diff options
-rw-r--r-- | engines/hopkins/anim.cpp | 9 | ||||
-rw-r--r-- | engines/hopkins/dialogs.cpp | 32 | ||||
-rw-r--r-- | engines/hopkins/font.cpp | 26 | ||||
-rw-r--r-- | engines/hopkins/globals.cpp | 23 | ||||
-rw-r--r-- | engines/hopkins/globals.h | 9 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 38 | ||||
-rw-r--r-- | engines/hopkins/hopkins.h | 2 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 6 | ||||
-rw-r--r-- | engines/hopkins/script.cpp | 88 | ||||
-rw-r--r-- | engines/hopkins/sound.cpp | 115 | ||||
-rw-r--r-- | engines/hopkins/sound.h | 18 | ||||
-rw-r--r-- | engines/hopkins/talk.cpp | 8 |
12 files changed, 183 insertions, 191 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index 83f039341c..763f19cd2f 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -805,7 +805,6 @@ void AnimationManager::searchAnim(const byte *data, int animIndex, int count) { */ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3) { bool readError; - int v7; byte *ptr = NULL; byte *v9; byte *v10; @@ -816,7 +815,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui if (_vm->shouldQuit()) return; - v7 = 0; + bool v7 = false; _vm->_eventsManager._mouseFl = false; if (!NO_COUL) { _vm->_eventsManager.VBL(); @@ -843,12 +842,12 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui f.read(v9, nbytes); if (_vm->_graphicsManager.WinScan / 2 > SCREEN_WIDTH) { - v7 = 1; + v7 = true; ptr = _vm->_globals.allocMemory(307200); memcpy(ptr, v9, 307200); } if (_vm->_animationManager.NO_SEQ) { - if (v7 == 1) + if (v7) memcpy(ptr, _vm->_graphicsManager._vesaBuffer, 307200); if (!_vm->getIsDemo()) { _vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100); @@ -962,7 +961,7 @@ LABEL_59: _vm->_eventsManager._mouseFl = true; } - if (v7 == 1) + if (v7) _vm->_globals.freeMemory(ptr); _vm->_globals.freeMemory(v10); } diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 7480d34523..0cd53bb9b0 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -75,14 +75,14 @@ void DialogsManager::showOptionsDialog() { mousePos.x = _vm->_eventsManager.getMouseX(); mousePos.y = _vm->_eventsManager.getMouseY(); - if (!_vm->_soundManager.MUSICOFF) { + if (!_vm->_soundManager._musicOff) { if (mousePos.x >= _vm->_graphicsManager.ofscroll + 300 && mousePos.y > 113 && mousePos.x <= _vm->_graphicsManager.ofscroll + 327 && mousePos.y <= 138) { // Change the music volume ++_vm->_soundManager.MUSICVOL; _vm->_soundManager.OLD_MUSICVOL = _vm->_soundManager.MUSICVOL; if (_vm->_soundManager.MUSICVOL <= 12) - _vm->_soundManager.PLAY_SOUND("bruit2.wav"); + _vm->_soundManager.playSound("bruit2.wav"); else _vm->_soundManager.MUSICVOL = 12; _vm->_soundManager.MODSetMusicVolume(_vm->_soundManager.MUSICVOL); @@ -90,10 +90,10 @@ void DialogsManager::showOptionsDialog() { _vm->_soundManager.updateScummVMSoundSettings(); } - if (!_vm->_soundManager.MUSICOFF && mousePos.x >= _vm->_graphicsManager.ofscroll + 331 && mousePos.y > 113 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 138) { + if (!_vm->_soundManager._musicOff && mousePos.x >= _vm->_graphicsManager.ofscroll + 331 && mousePos.y > 113 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 138) { --_vm->_soundManager.MUSICVOL; if (_vm->_soundManager.MUSICVOL >= 0) - _vm->_soundManager.PLAY_SOUND("bruit2.wav"); + _vm->_soundManager.playSound("bruit2.wav"); else _vm->_soundManager.MUSICVOL = 0; @@ -103,11 +103,11 @@ void DialogsManager::showOptionsDialog() { _vm->_soundManager.updateScummVMSoundSettings(); } } - if (!_vm->_soundManager.SOUNDOFF) { + if (!_vm->_soundManager._soundOffFl) { if (mousePos.x >= _vm->_graphicsManager.ofscroll + 300 && mousePos.y > 140 && mousePos.x <= _vm->_graphicsManager.ofscroll + 327 && mousePos.y <= 165) { ++_vm->_soundManager.SOUNDVOL; if (_vm->_soundManager.SOUNDVOL <= 16) - _vm->_soundManager.PLAY_SOUND("bruit2.wav"); + _vm->_soundManager.playSound("bruit2.wav"); else _vm->_soundManager.SOUNDVOL = 16; _vm->_soundManager.OLD_SOUNDVOL = _vm->_soundManager.SOUNDVOL; @@ -116,10 +116,10 @@ void DialogsManager::showOptionsDialog() { _vm->_soundManager.updateScummVMSoundSettings(); } - if (!_vm->_soundManager.SOUNDOFF && mousePos.x >= _vm->_graphicsManager.ofscroll + 331 && mousePos.y > 140 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 165) { + if (!_vm->_soundManager._soundOffFl && mousePos.x >= _vm->_graphicsManager.ofscroll + 331 && mousePos.y > 140 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 165) { --_vm->_soundManager.SOUNDVOL; if (_vm->_soundManager.SOUNDVOL >= 0) - _vm->_soundManager.PLAY_SOUND("bruit2.wav"); + _vm->_soundManager.playSound("bruit2.wav"); else _vm->_soundManager.SOUNDVOL = 0; _vm->_soundManager.OLD_SOUNDVOL = _vm->_soundManager.SOUNDVOL; @@ -134,7 +134,7 @@ void DialogsManager::showOptionsDialog() { ++_vm->_soundManager.VOICEVOL; if (_vm->_soundManager.VOICEVOL <= 16) - _vm->_soundManager.PLAY_SOUND("bruit2.wav"); + _vm->_soundManager.playSound("bruit2.wav"); else _vm->_soundManager.VOICEVOL = 16; _vm->_soundManager.OLD_VOICEVOL = _vm->_soundManager.VOICEVOL; @@ -146,7 +146,7 @@ void DialogsManager::showOptionsDialog() { if (!_vm->_soundManager._voiceOffFl && mousePos.x >= _vm->_graphicsManager.ofscroll + 331 && mousePos.y > 167 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 192) { --_vm->_soundManager.VOICEVOL; if (_vm->_soundManager.VOICEVOL >= 0) - _vm->_soundManager.PLAY_SOUND("bruit2.wav"); + _vm->_soundManager.playSound("bruit2.wav"); else _vm->_soundManager.VOICEVOL = 0; _vm->_soundManager.OLD_VOICEVOL = _vm->_soundManager.VOICEVOL; @@ -168,11 +168,11 @@ void DialogsManager::showOptionsDialog() { } if (mousePos.x >= _vm->_graphicsManager.ofscroll + 431) { if (mousePos.y > 113 && mousePos.x <= _vm->_graphicsManager.ofscroll + 489 && mousePos.y <= 138) { - if (_vm->_soundManager.MUSICOFF == 1) { - _vm->_soundManager.MUSICOFF = 0; + if (_vm->_soundManager._musicOff) { + _vm->_soundManager._musicOff = false; _vm->_soundManager.MODSetMusicVolume(_vm->_soundManager.MUSICVOL); } else { - _vm->_soundManager.MUSICOFF = 1; + _vm->_soundManager._musicOff = true; _vm->_soundManager.MODSetMusicVolume(0); } @@ -180,7 +180,7 @@ void DialogsManager::showOptionsDialog() { } if (mousePos.x >= _vm->_graphicsManager.ofscroll + 431 && mousePos.y > 140 && mousePos.x <= _vm->_graphicsManager.ofscroll + 489 && mousePos.y <= 165) { - _vm->_soundManager.SOUNDOFF = _vm->_soundManager.SOUNDOFF != 1; + _vm->_soundManager._soundOffFl = !_vm->_soundManager._soundOffFl; _vm->_soundManager.updateScummVMSoundSettings(); } @@ -254,8 +254,8 @@ void DialogsManager::showOptionsDialog() { _vm->_globals.opt_txt = !_vm->_soundManager._textOffFl ? 7 : 8; _vm->_globals.opt_voice = !_vm->_soundManager._voiceOffFl ? 7 : 8; - _vm->_globals.opt_sound = !_vm->_soundManager.SOUNDOFF ? 7 : 8; - _vm->_globals.opt_music = !_vm->_soundManager.MUSICOFF ? 7 : 8; + _vm->_globals.opt_sound = !_vm->_soundManager._soundOffFl ? 7 : 8; + _vm->_globals.opt_music = !_vm->_soundManager._musicOff ? 7 : 8; if (_vm->_globals.SVGA == 1) _vm->_globals.opt_anm = 10; diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index c5a580fab0..484745347e 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -141,7 +141,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in error("Bad number for text"); _vm->_globals.police_l = 11; - _vm->_globals.largeur_boite = 11 * _text[idx]._field3FE; + _vm->_globals._boxWidth = 11 * _text[idx]._field3FE; if (_text[idx]._textLoadedFl) { int textType = _text[idx]._textType; if (textType != 6 && textType != 1 && textType != 3 && textType != 5) { @@ -247,17 +247,17 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in goto LABEL_43; } _text[idx]._field3FE = v64; - _vm->_globals.largeur_boite = 0; + _vm->_globals._boxWidth = 0; for (int v15 = 0; v15 < v64 + 1; v15++) { byte v16 = *(v60 + v15); if (v16 <= 31) v16 = 32; - _vm->_globals.largeur_boite += _vm->_objectsManager.getWidth(_vm->_globals.police, v16 - 32); + _vm->_globals._boxWidth += _vm->_objectsManager.getWidth(_vm->_globals.police, v16 - 32); } - _vm->_globals.largeur_boite += 2; - int v17 = _vm->_globals.largeur_boite / 2; + _vm->_globals._boxWidth += 2; + int v17 = _vm->_globals._boxWidth / 2; if (v17 < 0) v17 = -v17; _text[idx]._pos.x = 320 - v17; @@ -268,15 +268,15 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in } } else { LABEL_43: - if (!_vm->_globals.largeur_boite) - _vm->_globals.largeur_boite = 240; + if (!_vm->_globals._boxWidth) + _vm->_globals._boxWidth = 240; int v65 = 0; byte *v61 = _tempText; int v21; int lineSize; do { int v19 = 0; - int ptrb = _vm->_globals.largeur_boite - 4; + int ptrb = _vm->_globals._boxWidth - 4; for (;;) { lineSize = v19; do @@ -338,22 +338,22 @@ LABEL_57: for (int i = 0; i <= 19; i++) { if (_textSortArray[i]) - _vm->_globals.largeur_boite = _textSortArray[i]; + _vm->_globals._boxWidth = _textSortArray[i]; } if ((_text[idx]._textType < 2) || (_text[idx]._textType > 3)) { int i; - for (i = xp - _vm->_eventsManager._startPos.x; _vm->_globals.largeur_boite + i > 638 && i > -2 && _text[idx]._textType; i -= 2) + for (i = xp - _vm->_eventsManager._startPos.x; _vm->_globals._boxWidth + i > 638 && i > -2 && _text[idx]._textType; i -= 2) ; _text[idx]._pos.x = i; v73 = _vm->_eventsManager._startPos.x + i; } else { if (_vm->_globals.nbrligne == (SCREEN_WIDTH - 1)) { - while (_vm->_globals.largeur_boite + v73 > 638 && v73 > -2) + while (_vm->_globals._boxWidth + v73 > 638 && v73 > -2) v73 -= 2; } if (_vm->_globals.nbrligne == (SCREEN_WIDTH * 2)) { - while (_vm->_globals.largeur_boite + v73 > 1278 && v73 > -2) + while (_vm->_globals._boxWidth + v73 > 1278 && v73 > -2) v73 -= 2; } _text[idx]._pos.x = v73; @@ -362,7 +362,7 @@ LABEL_57: _vm->_globals.hauteur_boite = (_vm->_globals.police_h + 1) * lineCount + 2; int v56 = v73; int v55 = yp; - int v53 = _vm->_globals.largeur_boite + 10; + int v53 = _vm->_globals._boxWidth + 10; int v51 = (_vm->_globals.police_h + 1) * lineCount + 12; if (_text[idx]._textType == 6) { int v27 = v53 / 2; diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index ee96b2a0f7..3abc7b7ada 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -134,7 +134,7 @@ Globals::Globals() { _curObjectIndex = 0; NUM_FICHIER_OBJ = 0; nbrligne = 0; - largeur_boite = 0; + _boxWidth = 0; hauteur_boite = 0; _forestFl = false; _objectWidth = _objectHeight = 0; @@ -147,7 +147,6 @@ Globals::Globals() { PLANX = PLANY = 0; PLANI = 0; PERSO = 0; - PASSWORD = false; _screenId = 0; NOSPRECRAN = false; OLD_ECRAN = 0; @@ -205,8 +204,8 @@ Globals::Globals() { essai2 = NULL; inventaire2 = NULL; GESTE = NULL; - INVENTAIRE_OBJET = NULL; - FORETSPR = NULL; + _inventoryObject = NULL; + _forestSprite = NULL; COUCOU = NULL; chemin = NULL; cache_souris = NULL; @@ -219,7 +218,7 @@ Globals::Globals() { // Reset flags CENSURE = false; - GESTE_FLAG = false; + GESTE_FLAG = 0; BPP_NOAFF = false; _disableInventFl = false; netscape = false; @@ -258,8 +257,8 @@ Globals::~Globals() { freeMemory(BUFFERTAPE); freeMemory(inventaire2); freeMemory(GESTE); - freeMemory(INVENTAIRE_OBJET); - freeMemory(FORETSPR); + freeMemory(_inventoryObject); + freeMemory(_forestSprite); freeMemory(COUCOU); freeMemory(cache_souris); freeMemory(Bufferdecor); @@ -346,7 +345,7 @@ void Globals::clearAll() { police_h = 0; police_l = 0; hauteur_boite = 0; - largeur_boite = 0; + _boxWidth = 0; _vm->_fontManager.clearAll(); @@ -402,18 +401,18 @@ void Globals::clearAll() { essai1 = (int16 *)(BUFFERTAPE + 25000); essai2 = (int16 *)(BUFFERTAPE + 50000); BufLig = (int16 *)(BUFFERTAPE + 75000); - largeur_boite = 240; + _boxWidth = 240; _vm->_eventsManager._objectBuf = allocMemory(2500); - INVENTAIRE_OBJET = allocMemory(2500); + _inventoryObject = allocMemory(2500); ADR_FICHIER_OBJ = g_PTRNUL; - FORETSPR = g_PTRNUL; + _forestSprite = g_PTRNUL; _forestFl = false; cache_souris = allocMemory(2500); GESTE = g_PTRNUL; - GESTE_FLAG = false; + GESTE_FLAG = 0; } void Globals::HOPKINS_DATA() { diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index 91486aa0a2..2689b59c01 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -376,12 +376,12 @@ public: byte *GESTE; int _curObjectIndex; int NUM_FICHIER_OBJ; - int nbrligne; - int largeur_boite; - byte *INVENTAIRE_OBJET; + int nbrligne; // Useless variable? + int _boxWidth; + byte *_inventoryObject; int hauteur_boite; int GESTE_FLAG; - byte *FORETSPR; + byte *_forestSprite; bool _forestFl; byte *COUCOU; int16 *chemin; @@ -400,7 +400,6 @@ public: int _exitId; int PLANX, PLANY; int PLANI; - bool PASSWORD; // CHECKME: Useless variable? bool NOSPRECRAN; int _screenId; int OLD_ECRAN; diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 1da267d896..ea67f57f63 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -185,7 +185,6 @@ bool HopkinsEngine::runWin95Demo() { _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 2000); _globals._exitId = 0; - _globals.PASSWORD = true; if (getLanguage() != Common::PL_POL) if (!displayAdultDisclaimer()) @@ -495,7 +494,6 @@ bool HopkinsEngine::runLinuxDemo() { _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 2000); _globals._exitId = 0; - _globals.PASSWORD = true; for (;;) { if (_globals._exitId == 300) @@ -1235,15 +1233,15 @@ bool HopkinsEngine::runOS2Full() { _globals.NOSPRECRAN = true; Common::String im = Common::String::format("IM%d", _globals._exitId); _soundManager.WSOUND(13); - if (_globals.FORETSPR == g_PTRNUL) { + if (_globals._forestSprite == g_PTRNUL) { _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); - _globals.FORETSPR = _objectsManager.loadSprite(_globals.NFICHIER); + _globals._forestSprite = _objectsManager.loadSprite(_globals.NFICHIER); _soundManager.loadSample(1, "SOUND41.WAV"); } _objectsManager.PERSONAGE2(im, im, "BANDIT", im, 13); _globals.NOSPRECRAN = false; if (_globals._exitId < 35 || _globals._exitId > 49 ) { - _globals.FORETSPR = _globals.freeMemory(_globals.FORETSPR); + _globals._forestSprite = _globals.freeMemory(_globals._forestSprite); _globals._forestFl = false; _soundManager.DEL_SAMPLE(1); } @@ -1336,7 +1334,7 @@ bool HopkinsEngine::runOS2Full() { case 61: if (_globals._saveData->data[311] == 1 && !_globals._saveData->data[312] ) - INCENDIE(); + handleConflagration(); _globals.NOSPRECRAN = true; _objectsManager.PERSONAGE("IM61", "IM61", "ANIM61", "IM61", 21); break; @@ -2123,16 +2121,16 @@ bool HopkinsEngine::runBeOSFull() { _globals.NOSPRECRAN = true; Common::String im = Common::String::format("IM%d", _globals._exitId); _soundManager.WSOUND(13); - if (_globals.FORETSPR == g_PTRNUL) { + if (_globals._forestSprite == g_PTRNUL) { _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); - _globals.FORETSPR = _objectsManager.loadSprite(_globals.NFICHIER); + _globals._forestSprite = _objectsManager.loadSprite(_globals.NFICHIER); _soundManager.loadSample(1, "SOUND41.WAV"); } _objectsManager.PERSONAGE2(im, im, "BANDIT", im, 13); _globals.NOSPRECRAN = false; if ((_globals._exitId < 35) || (_globals._exitId > 49)) { - _globals.FORETSPR = _globals.freeMemory(_globals.FORETSPR); + _globals._forestSprite = _globals.freeMemory(_globals._forestSprite); _globals._forestFl = false; _soundManager.DEL_SAMPLE(1); } @@ -2225,7 +2223,7 @@ bool HopkinsEngine::runBeOSFull() { case 61: if (_globals._saveData->data[svField311] == 1 && !_globals._saveData->data[svField312]) - INCENDIE(); + handleConflagration(); _globals.NOSPRECRAN = true; _objectsManager.PERSONAGE("IM61", "IM61", "ANIM61", "IM61", 21); break; @@ -2630,7 +2628,6 @@ bool HopkinsEngine::runWin95full() { _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 2000); _globals._exitId = 0; - _globals.PASSWORD = true; for (;;) { if (_globals._exitId == 300) _globals._exitId = 0; @@ -3011,15 +3008,15 @@ bool HopkinsEngine::runWin95full() { _globals.NOSPRECRAN = true; Common::String im = Common::String::format("IM%d", _globals._exitId); _soundManager.WSOUND(13); - if (_globals.FORETSPR == g_PTRNUL) { + if (_globals._forestSprite == g_PTRNUL) { _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); - _globals.FORETSPR = _objectsManager.loadSprite(_globals.NFICHIER); + _globals._forestSprite = _objectsManager.loadSprite(_globals.NFICHIER); _soundManager.loadSample(1, "SOUND41.WAV"); } _objectsManager.PERSONAGE2(im, im, "BANDIT", im, 13); _globals.NOSPRECRAN = false; if (_globals._exitId < 35 || _globals._exitId > 49) { - _globals.FORETSPR = _globals.freeMemory(_globals.FORETSPR); + _globals._forestSprite = _globals.freeMemory(_globals._forestSprite); _globals._forestFl = false; _soundManager.DEL_SAMPLE(1); } @@ -3111,7 +3108,7 @@ bool HopkinsEngine::runWin95full() { case 61: if (_globals._saveData->data[svField311] == 1 && !_globals._saveData->data[svField312]) - INCENDIE(); + handleConflagration(); _globals.NOSPRECRAN = true; _objectsManager.PERSONAGE("IM61", "IM61", "ANIM61", "IM61", 21); break; @@ -3509,7 +3506,6 @@ bool HopkinsEngine::runLinuxFull() { _globals.PLANX = _globals.PLANY = 0; memset(_globals._saveData, 0, 2000); _globals._exitId = 0; - _globals.PASSWORD = false; for (;;) { if (_globals._exitId == 300) @@ -3889,15 +3885,15 @@ bool HopkinsEngine::runLinuxFull() { _globals.NOSPRECRAN = true; Common::String im = Common::String::format("IM%d", _globals._exitId); _soundManager.WSOUND(13); - if (_globals.FORETSPR == g_PTRNUL) { + if (_globals._forestSprite == g_PTRNUL) { _fileManager.constructFilename(_globals.HOPSYSTEM, "HOPDEG.SPR"); - _globals.FORETSPR = _objectsManager.loadSprite(_globals.NFICHIER); + _globals._forestSprite = _objectsManager.loadSprite(_globals.NFICHIER); _soundManager.loadSample(1, "SOUND41.WAV"); } _objectsManager.PERSONAGE2(im, im, "BANDIT", im, 13); _globals.NOSPRECRAN = false; if (_globals._exitId < 35 || _globals._exitId > 49) { - _globals.FORETSPR = _globals.freeMemory(_globals.FORETSPR); + _globals._forestSprite = _globals.freeMemory(_globals._forestSprite); _globals._forestFl = false; _soundManager.DEL_SAMPLE(1); } @@ -3990,7 +3986,7 @@ bool HopkinsEngine::runLinuxFull() { case 61: if (_globals._saveData->data[svField311] == 1 && !_globals._saveData->data[svField312]) - INCENDIE(); + handleConflagration(); _globals.NOSPRECRAN = true; _objectsManager.PERSONAGE("IM61", "IM61", "ANIM61", "IM61", 21); break; @@ -4821,7 +4817,7 @@ void HopkinsEngine::PUBQUIT() { _graphicsManager.FADE_OUTW(); } -void HopkinsEngine::INCENDIE() { +void HopkinsEngine::handleConflagration() { _globals._disableInventFl = true; _globals.iRegul = 1; _graphicsManager.loadImage("IM71"); diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index 5b62bb28ab..ce73c6a0c2 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -87,7 +87,7 @@ private: void PUBQUIT(); void displayEndDemo(); void bombExplosion(); - void INCENDIE(); + void handleConflagration(); void BASE(); void BASED(); void playEnding(); diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 2d04998d5f..9ef7b5dd76 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -147,8 +147,8 @@ byte *ObjectsManager::CAPTURE_OBJET(int objIndex, int mode) { break; case 3: - capture_mem_sprite(_vm->_globals.ADR_FICHIER_OBJ, _vm->_globals.INVENTAIRE_OBJET, val2); - dataP = _vm->_globals.INVENTAIRE_OBJET; + capture_mem_sprite(_vm->_globals.ADR_FICHIER_OBJ, _vm->_globals._inventoryObject, val2); + dataP = _vm->_globals._inventoryObject; break; default: @@ -4086,7 +4086,7 @@ void ObjectsManager::SPECIAL_JEU() { setBobAnimation(6); _vm->_globals._saveData->data[svField261] = 2; ZONE_OFF(15); - _vm->_soundManager.PLAY_SOUND("SOUND75.WAV"); + _vm->_soundManager.playSound("SOUND75.WAV"); } if (_vm->_globals._saveData->data[svField261] == 2 && BOBPOSI(6) == 6) { stopBobAnimation(6); diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 7a336d00f0..89c6d531ac 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -125,12 +125,12 @@ int ScriptManager::handleOpcode(byte *dataP) { if (mesgId == 363) mesgId = 636; } - if (!_vm->_soundManager.SOUNDOFF && _vm->_soundManager.SOUND_FLAG == 1) { + if (!_vm->_soundManager._soundOffFl && _vm->_soundManager._soundFl) { do { if (_vm->shouldQuit()) return -1; // Exiting game _vm->_eventsManager.VBL(); - } while (_vm->_soundManager.SOUND_FLAG); + } while (_vm->_soundManager._soundFl); } if (!_vm->_soundManager._textOffFl) { _vm->_fontManager.initTextBuffers(9, mesgId, _vm->_globals.FICH_TEXTE, 2 * v67, 2 * v65 + 40, 20, 25, 6, v2, 253); @@ -545,7 +545,7 @@ LABEL_1141: if ((_vm->getPlatform() == Common::kPlatformWindows) && _vm->getIsDemo()) { _vm->_graphicsManager.FADE_OUTW(); } else { - _vm->_soundManager.PLAY_SOUND("SOUND17.WAV"); + _vm->_soundManager.playSound("SOUND17.WAV"); _vm->_graphicsManager.FADE_LINUX = 2; _vm->_animationManager.playSequence2("HELICO.SEQ", 10, 4, 10); } @@ -598,7 +598,7 @@ LABEL_1141: _vm->_graphicsManager.FIN_VISU(); if ((_vm->getPlatform() == Common::kPlatformWindows) && _vm->getIsDemo()) - _vm->_soundManager.PLAY_SOUND("SOUND17.WAV"); + _vm->_soundManager.playSound("SOUND17.WAV"); _vm->_soundManager.SPECIAL_SOUND = 14; _vm->_graphicsManager.FADE_LINUX = 2; @@ -666,13 +666,13 @@ LABEL_1141: break; case 35: - if (!_vm->_soundManager.SOUNDOFF) { + if (!_vm->_soundManager._soundOffFl) { do { if (_vm->shouldQuit()) return -1; // Exiting game _vm->_eventsManager.VBL(); - } while (_vm->_soundManager.SOUND_FLAG); + } while (_vm->_soundManager._soundFl); } _vm->_talkManager.PARLER_PERSO("PTLAB.pe2"); break; @@ -864,7 +864,7 @@ LABEL_1141: } case 50: - _vm->_soundManager.PLAY_SOUND("SOUND46.WAv"); + _vm->_soundManager.playSound("SOUND46.WAv"); _vm->_objectsManager.OPTI_ONE(11, 0, 23, 0); break; @@ -887,7 +887,7 @@ LABEL_1141: return -1; // Exiting game if (_vm->_objectsManager.BOBPOSI(12) == 5 && !v52) { - _vm->_soundManager.PLAY_WAV(1); + _vm->_soundManager.playWav(1); v52 = true; } _vm->_eventsManager.VBL(); @@ -1025,13 +1025,13 @@ LABEL_1141: return -1; // Exiting game if (_vm->_objectsManager.BOBPOSI(12) == 4 && !v21) { - _vm->_soundManager.PLAY_WAV(1); + _vm->_soundManager.playWav(1); v21 = 1; } if (_vm->_objectsManager.BOBPOSI(12) == 5) v21 = 0; if (_vm->_objectsManager.BOBPOSI(4) == 5 && !v21) { - _vm->_soundManager.PLAY_WAV(2); + _vm->_soundManager.playWav(2); v21 = 1; } if (_vm->_objectsManager.BOBPOSI(4) == 6) @@ -1085,13 +1085,13 @@ LABEL_1141: return -1; // Exiting game if (_vm->_objectsManager.BOBPOSI(11) == 4 && !v24) { - _vm->_soundManager.PLAY_WAV(1); + _vm->_soundManager.playWav(1); v24 = 1; } if (_vm->_objectsManager.BOBPOSI(11) == 5) v24 = 0; if (_vm->_objectsManager.BOBPOSI(8) == 11 && !v24) { - _vm->_soundManager.PLAY_WAV(2); + _vm->_soundManager.playWav(2); v24 = 1; } if (_vm->_objectsManager.BOBPOSI(8) == 12) @@ -1106,7 +1106,7 @@ LABEL_1141: _vm->_objectsManager.setBobAnimation(6); _vm->_objectsManager.SET_BOBPOSI(5, 0); _vm->_objectsManager.SET_BOBPOSI(6, 0); - _vm->_soundManager.PLAY_WAV(3); + _vm->_soundManager.playWav(3); do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1252,7 +1252,7 @@ LABEL_1141: break; case 90: - _vm->_soundManager.PLAY_SOUND("SOUND52.WAV"); + _vm->_soundManager.playSound("SOUND52.WAV"); if (!_vm->_globals._saveData->data[svField186]) { _vm->_animationManager.playSequence("CIB5A.SEQ", 1, 12, 1); _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 0); @@ -1265,7 +1265,7 @@ LABEL_1141: break; case 91: - _vm->_soundManager.PLAY_SOUND("SOUND52.WAV"); + _vm->_soundManager.playSound("SOUND52.WAV"); if (!_vm->_globals._saveData->data[svField186]) { _vm->_animationManager.playSequence("CIB5B.SEQ", 1, 12, 1); _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 5); @@ -1278,7 +1278,7 @@ LABEL_1141: break; case 92: - _vm->_soundManager.PLAY_SOUND("SOUND52.WAV"); + _vm->_soundManager.playSound("SOUND52.WAV"); if (!_vm->_globals._saveData->data[svField184]) { _vm->_animationManager.playSequence("CIB6A.SEQ", 1, 12, 1); _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 0); @@ -1291,7 +1291,7 @@ LABEL_1141: break; case 93: - _vm->_soundManager.PLAY_SOUND("SOUND52.WAV"); + _vm->_soundManager.playSound("SOUND52.WAV"); if (!_vm->_globals._saveData->data[svField184]) { _vm->_animationManager.playSequence("CIB6B.SEQ", 1, 12, 1); _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 155, 29, 5); @@ -1326,7 +1326,7 @@ LABEL_1141: } while (_vm->_objectsManager.BOBPOSI(9) != 15); _vm->_objectsManager.stopBobAnimation(9); _vm->_objectsManager.SPRITE_ON(0); - _vm->_soundManager.PLAY_SOUND("SOUND50.WAV"); + _vm->_soundManager.playSound("SOUND50.WAV"); do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1512,21 +1512,21 @@ LABEL_1141: _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.BOBPOSI(4) != 10); - _vm->_soundManager.PLAY_WAV(1); + _vm->_soundManager.playWav(1); do { if (_vm->shouldQuit()) return -1; // Exiting game _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.BOBPOSI(4) != 18); - _vm->_soundManager.PLAY_WAV(2); + _vm->_soundManager.playWav(2); do { if (_vm->shouldQuit()) return -1; // Exiting game _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.BOBPOSI(4) != 62); - _vm->_soundManager.PLAY_WAV(3); + _vm->_soundManager.playWav(3); do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1550,21 +1550,21 @@ LABEL_1141: _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.BOBPOSI(5) != 10); - _vm->_soundManager.PLAY_WAV(1); + _vm->_soundManager.playWav(1); do { if (_vm->shouldQuit()) return -1; // Exiting game _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.BOBPOSI(5) != 18); - _vm->_soundManager.PLAY_WAV(2); + _vm->_soundManager.playWav(2); do { if (_vm->shouldQuit()) return -1; // Exiting game _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.BOBPOSI(5) != 38); - _vm->_soundManager.PLAY_WAV(3); + _vm->_soundManager.playWav(3); do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1691,7 +1691,7 @@ LABEL_1141: _vm->_objectsManager.setBobAnimation(9); _vm->_objectsManager.setBobAnimation(10); _vm->_objectsManager.BOB_OFFSET(10, 300); - _vm->_soundManager.PLAY_SOUND("SOUND44.WAV"); + _vm->_soundManager.playSound("SOUND44.WAV"); do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1706,7 +1706,7 @@ LABEL_1141: _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.BOBPOSI(6) != 10); - _vm->_soundManager.PLAY_SOUND("SOUND71.WAV"); + _vm->_soundManager.playSound("SOUND71.WAV"); _vm->_objectsManager.setBobAnimation(7); _vm->_objectsManager.stopBobAnimation(4); do { @@ -1717,7 +1717,7 @@ LABEL_1141: } while (_vm->_objectsManager.BOBPOSI(7) != 15); _vm->_objectsManager.stopBobAnimation(5); _vm->_objectsManager.setBobAnimation(8); - _vm->_soundManager.PLAY_SOUND("SOUND70.WAV"); + _vm->_soundManager.playSound("SOUND70.WAV"); do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1795,7 +1795,7 @@ LABEL_1141: return -1; // Exiting game if (_vm->_objectsManager.BOBPOSI(3) == 10 && !v41) { - _vm->_soundManager.PLAY_WAV(1); + _vm->_soundManager.playWav(1); v41 = 1; } if (_vm->_objectsManager.BOBPOSI(3) == 11) @@ -1817,7 +1817,7 @@ LABEL_1141: return -1; // Exiting game if (_vm->_objectsManager.BOBPOSI(4) == 10 && !v42) { - _vm->_soundManager.PLAY_WAV(1); + _vm->_soundManager.playWav(1); v42 = 1; } if (_vm->_objectsManager.BOBPOSI(4) == 11) @@ -1892,7 +1892,7 @@ LABEL_1141: } while (_vm->_globals.chemin != (int16 *)g_PTRNUL); _vm->_objectsManager.setSpriteIndex(0, 64); _vm->_objectsManager.setBobAnimation(2); - _vm->_soundManager.PLAY_SOUND("SOUND66.WAV"); + _vm->_soundManager.playSound("SOUND66.WAV"); do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1999,7 +1999,7 @@ LABEL_1141: if (_vm->_objectsManager.BOBPOSI(7) == 9 && !v45) { v45 = 1; - _vm->_soundManager.PLAY_SOUND("SOUND81.WAV"); + _vm->_soundManager.playSound("SOUND81.WAV"); } _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.BOBPOSI(7) != 15); @@ -2080,7 +2080,7 @@ LABEL_1141: v70 = 4; if (v47 == 1) v70 = 6; - _vm->_soundManager.PLAY_SOUND("SOUND83.WAV"); + _vm->_soundManager.playSound("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(v70, 26, 50, 0); if (_vm->_globals._saveData->data[svField341] == 1) _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 0); @@ -2095,7 +2095,7 @@ LABEL_1141: if (_vm->_globals._saveData->data[svField341] == 3) _vm->_globals._saveData->data[svField340] = 0; } - _vm->_soundManager.PLAY_SOUND("SOUND83.WAV"); + _vm->_soundManager.playSound("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(6, 0, 23, 0); _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 1); break; @@ -2110,7 +2110,7 @@ LABEL_1141: v70 = 4; if (v48 == 1) v70 = 6; - _vm->_soundManager.PLAY_SOUND("SOUND83.WAV"); + _vm->_soundManager.playSound("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(v70, 26, 50, 0); if (_vm->_globals._saveData->data[svField341] == 1) _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 0); @@ -2125,7 +2125,7 @@ LABEL_1141: if (_vm->_globals._saveData->data[svField341] == 3) _vm->_globals._saveData->data[svField340] = 0; } - _vm->_soundManager.PLAY_SOUND("SOUND83.WAV"); + _vm->_soundManager.playSound("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(5, 0, 23, 0); _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 3); break; @@ -2140,7 +2140,7 @@ LABEL_1141: v70 = 4; if (v49 == 1) v70 = 6; - _vm->_soundManager.PLAY_SOUND("SOUND83.WAV"); + _vm->_soundManager.playSound("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(v70, 26, 50, 0); if (_vm->_globals._saveData->data[svField341] == 1) _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 0); @@ -2155,7 +2155,7 @@ LABEL_1141: if (_vm->_globals._saveData->data[svField341] == 3) _vm->_globals._saveData->data[svField340] = 0; } - _vm->_soundManager.PLAY_SOUND("SOUND83.WAV"); + _vm->_soundManager.playSound("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(4, 0, 23, 0); _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 5); break; @@ -2163,7 +2163,7 @@ LABEL_1141: case 239: _vm->_objectsManager.removeSprite(0); - _vm->_soundManager.PLAY_SOUND("SOUND84.WAV"); + _vm->_soundManager.playSound("SOUND84.WAV"); _vm->_objectsManager.OPTI_ONE(16, 0, 10, 0); break; @@ -2176,13 +2176,13 @@ LABEL_1141: _vm->_eventsManager.VBL(); if (_vm->_objectsManager.BOBPOSI(1) == 12 && !soundFlag) { - _vm->_soundManager.PLAY_SOUND("SOUND86.WAV"); + _vm->_soundManager.playSound("SOUND86.WAV"); soundFlag = true; } if (_vm->_objectsManager.BOBPOSI(1) == 13) soundFlag = false; if (_vm->_objectsManager.BOBPOSI(1) == 25 && !soundFlag) { - _vm->_soundManager.PLAY_SOUND("SOUND85.WAV"); + _vm->_soundManager.playSound("SOUND85.WAV"); soundFlag = true; } if (_vm->_objectsManager.BOBPOSI(1) == 25) @@ -2220,7 +2220,7 @@ LABEL_1141: break; case 242: { - _vm->_soundManager.PLAY_SOUND("SOUND87.WAV"); + _vm->_soundManager.playSound("SOUND87.WAV"); _vm->_animationManager.NO_SEQ = true; _vm->_animationManager.playSequence("RESUF.SEQ", 1, 24, 1); _vm->_animationManager.NO_SEQ = false; @@ -2246,7 +2246,7 @@ LABEL_1141: } case 243: - _vm->_soundManager.PLAY_SOUND("SOUND88.WAV"); + _vm->_soundManager.playSound("SOUND88.WAV"); if (_vm->_globals._saveData->data[svField341] == 2) { _vm->_animationManager.NO_SEQ = true; _vm->_animationManager.playSequence("RESU.SEQ", 2, 24, 2); @@ -2257,7 +2257,7 @@ LABEL_1141: break; case 245: - _vm->_soundManager.PLAY_SOUND("SOUND89.WAV"); + _vm->_soundManager.playSound("SOUND89.WAV"); _vm->_objectsManager.OPTI_ONE(5, 0, 6, 0); _vm->_globals.ZONEP[4]._destX = 276; _vm->_objectsManager.VERBE_ON(4, 19); @@ -2449,7 +2449,7 @@ LABEL_1141: int v60 = (int16)READ_LE_UINT16(dataP + 5); Common::String file = Common::String::format("SOUND%d.WAV", v60); - _vm->_soundManager.PLAY_SOUND(file); + _vm->_soundManager.playSound(file); opcodeType = 1; } else if (dataP[2] == 'V' && dataP[3] == 'O' && dataP[4] == 'F') { _vm->_objectsManager.VERBE_OFF((int16)READ_LE_UINT16(dataP + 5), (int16)READ_LE_UINT16(dataP + 7)); diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp index e6e17e8521..66de0356ac 100644 --- a/engines/hopkins/sound.cpp +++ b/engines/hopkins/sound.cpp @@ -78,11 +78,11 @@ SoundManager::SoundManager() { OLD_SOUNDVOL = 0; OLD_MUSICVOL = 0; OLD_VOICEVOL = 0; - SOUNDOFF = true; - MUSICOFF = true; + _soundOffFl = true; + _musicOff = true; _voiceOffFl = true; _textOffFl = false; - SOUND_FLAG = false; + _soundFl = false; VBL_MERDE = false; SOUND_NUM = 0; old_music = 0; @@ -100,8 +100,8 @@ SoundManager::SoundManager() { } SoundManager::~SoundManager() { - STOP_MUSIC(); - DEL_MUSIC(); + stopMusic(); + delMusic(); MOD_FLAG = false; } @@ -115,7 +115,7 @@ void SoundManager::WSOUND_INIT() { } void SoundManager::VERIF_SOUND() { - if (!SOUNDOFF && SOUND_FLAG) { + if (!_soundOffFl && _soundFl) { if (!VOICE_STAT(1)) { STOP_VOICE(1); DEL_NWAV(SOUND_NUM); @@ -188,13 +188,13 @@ void SoundManager::playAnim_SOUND(int soundNumber) { break; } } else if (SPECIAL_SOUND == 1 && soundNumber == 17) - PLAY_SOUND("SOUND42.WAV"); + playSound("SOUND42.WAV"); else if (SPECIAL_SOUND == 5 && soundNumber == 19) - PLAY_WAV(1); + playWav(1); else if (SPECIAL_SOUND == 14 && soundNumber == 625) - PLAY_WAV(1); + playWav(1); else if (SPECIAL_SOUND == 16 && soundNumber == 25) - PLAY_WAV(1); + playWav(1); else if (SPECIAL_SOUND == 17) { if (soundNumber == 6) PLAY_SAMPLE2(1); @@ -203,26 +203,26 @@ void SoundManager::playAnim_SOUND(int soundNumber) { else if (soundNumber == 67) PLAY_SAMPLE2(3); } else if (SPECIAL_SOUND == 198 && soundNumber == 15) - PLAY_WAV(1); + playWav(1); else if (SPECIAL_SOUND == 199 && soundNumber == 72) - PLAY_WAV(1); + playWav(1); else if (SPECIAL_SOUND == 208 && soundNumber == 40) - PLAY_WAV(1); + playWav(1); else if (SPECIAL_SOUND == 210 && soundNumber == 2) - PLAY_WAV(1); + playWav(1); else if (SPECIAL_SOUND == 211 && soundNumber == 22) - PLAY_WAV(1); + playWav(1); else if (SPECIAL_SOUND == 229) { if (soundNumber == 15) - PLAY_WAV(1); + playWav(1); else if (soundNumber == 91) - PLAY_WAV(2); + playWav(2); } } void SoundManager::WSOUND(int soundNumber) { if (old_music != soundNumber || !MOD_FLAG) { - if (MOD_FLAG == 1) + if (MOD_FLAG) WSOUND_OFF(); switch (soundNumber) { @@ -329,37 +329,37 @@ void SoundManager::WSOUND_OFF() { STOP_VOICE(0); STOP_VOICE(1); STOP_VOICE(2); - if (_vm->_soundManager.SOUND_FLAG) + if (_vm->_soundManager._soundFl) DEL_NWAV(SOUND_NUM); for (int i = 1; i <= 48; ++i) DEL_SAMPLE_SDL(i); if (MOD_FLAG) { - STOP_MUSIC(); - DEL_MUSIC(); + stopMusic(); + delMusic(); MOD_FLAG = false; } } void SoundManager::PLAY_MOD(const Common::String &file) { - if (!MUSICOFF) { - _vm->_fileManager.constructFilename(_vm->_globals.HOPMUSIC, file); - if (MOD_FLAG) { - STOP_MUSIC(); - DEL_MUSIC(); - MOD_FLAG = false; - } - - LOAD_MUSIC(_vm->_globals.NFICHIER); - PLAY_MUSIC(); - MOD_FLAG = true; + if (_musicOff) + return; + _vm->_fileManager.constructFilename(_vm->_globals.HOPMUSIC, file); + if (MOD_FLAG) { + stopMusic(); + delMusic(); + MOD_FLAG = false; } + + loadMusic(_vm->_globals.NFICHIER); + playMusic(); + MOD_FLAG = true; } -void SoundManager::LOAD_MUSIC(const Common::String &file) { +void SoundManager::loadMusic(const Common::String &file) { if (Music._active) - DEL_MUSIC(); + delMusic(); Common::File f; Common::String filename = Common::String::format("%s.TWA", file.c_str()); @@ -392,7 +392,6 @@ void SoundManager::LOAD_MUSIC(const Common::String &file) { Music._mwavIndexes[destIndex++] = mwavIndex; } } while (!breakFlag); - f.close(); Music._active = true; @@ -400,17 +399,17 @@ void SoundManager::LOAD_MUSIC(const Common::String &file) { Music._currentIndex = -1; } -void SoundManager::PLAY_MUSIC() { +void SoundManager::playMusic() { if (Music._active) Music._isPlaying = true; } -void SoundManager::STOP_MUSIC() { +void SoundManager::stopMusic() { if (Music._active) Music._isPlaying = false; } -void SoundManager::DEL_MUSIC() { +void SoundManager::delMusic() { if (Music._active) { for (int i = 0; i < 50; ++i) { DEL_MSAMPLE(i); @@ -468,8 +467,8 @@ void SoundManager::checkVoices() { hasActiveVoice |= Voice[i]._status != 0; } - if (!hasActiveVoice && SOUND_FLAG) { - SOUND_FLAG = false; + if (!hasActiveVoice && _soundFl) { + _soundFl = false; SOUND_NUM = 0; } } @@ -603,7 +602,7 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode) { SDL_LVOICE(catPos, catLen); oldMusicVol = MUSICVOL; - if (!MUSICOFF && MUSICVOL > 2) + if (!_musicOff && MUSICVOL > 2) MUSICVOL = (signed int)((long double)MUSICVOL - (long double)MUSICVOL / 100.0 * 45.0); PLAY_VOICE_SDL(); @@ -642,9 +641,9 @@ void SoundManager::DEL_SAMPLE(int soundIndex) { SOUND[soundIndex]._active = false; } -void SoundManager::PLAY_SOUND(const Common::String &file) { - if (!SOUNDOFF) { - if (SOUND_FLAG) +void SoundManager::playSound(const Common::String &file) { + if (!_soundOffFl) { + if (_soundFl) DEL_NWAV(SOUND_NUM); LOAD_NWAV(file, 1); PLAY_NWAV(1); @@ -652,7 +651,7 @@ void SoundManager::PLAY_SOUND(const Common::String &file) { } void SoundManager::PLAY_SOUND2(const Common::String &file) { - if (!SOUNDOFF) { + if (!_soundOffFl) { LOAD_NWAV(file, 1); PLAY_NWAV(1); } @@ -677,8 +676,8 @@ void SoundManager::loadSample(int wavIndex, const Common::String &file) { } void SoundManager::PLAY_SAMPLE(int wavIndex, int voiceMode) { - if (!SOUNDOFF && SOUND[wavIndex]._active) { - if (SOUND_FLAG) + if (!_soundOffFl && SOUND[wavIndex]._active) { + if (_soundFl) DEL_NWAV(SOUND_NUM); if (voiceMode == 5) { if (VOICE_STAT(1) == 1) @@ -704,8 +703,8 @@ void SoundManager::PLAY_SAMPLE(int wavIndex, int voiceMode) { } void SoundManager::PLAY_SAMPLE2(int idx) { - if (!SOUNDOFF && SOUND[idx]._active) { - if (SOUND_FLAG) + if (!_soundOffFl && SOUND[idx]._active) { + if (_soundFl) DEL_NWAV(SOUND_NUM); if (VOICE_STAT(1) == 1) STOP_VOICE(1); @@ -717,7 +716,7 @@ void SoundManager::LOAD_WAV(const Common::String &file, int wavIndex) { LOAD_NWAV(file, wavIndex); } -void SoundManager::PLAY_WAV(int wavIndex) { +void SoundManager::playWav(int wavIndex) { PLAY_NWAV(wavIndex); } @@ -808,8 +807,8 @@ void SoundManager::LOAD_NWAV(const Common::String &file, int wavIndex) { } void SoundManager::PLAY_NWAV(int wavIndex) { - if (!SOUND_FLAG && !SOUNDOFF) { - SOUND_FLAG = true; + if (!_soundFl && !_soundOffFl) { + _soundFl = true; SOUND_NUM = wavIndex; PLAY_SAMPLE_SDL(1, wavIndex); } @@ -821,7 +820,7 @@ void SoundManager::DEL_NWAV(int wavIndex) { STOP_VOICE(1); SOUND_NUM = 0; - SOUND_FLAG = false; + _soundFl = false; } } @@ -851,8 +850,8 @@ void SoundManager::syncSoundSettings() { muteAll = ConfMan.getBool("mute"); // Update the mute settings - MUSICOFF = muteAll || (ConfMan.hasKey("music_mute") && ConfMan.getBool("music_mute")); - SOUNDOFF = muteAll || (ConfMan.hasKey("sfx_mute") && ConfMan.getBool("sfx_mute")); + _musicOff = muteAll || (ConfMan.hasKey("music_mute") && ConfMan.getBool("music_mute")); + _soundOffFl = muteAll || (ConfMan.hasKey("sfx_mute") && ConfMan.getBool("sfx_mute")); _voiceOffFl = muteAll || (ConfMan.hasKey("speech_mute") && ConfMan.getBool("speech_mute")); // Update the volume levels @@ -875,9 +874,9 @@ void SoundManager::syncSoundSettings() { } void SoundManager::updateScummVMSoundSettings() { - ConfMan.setBool("mute", MUSICOFF && SOUNDOFF && _voiceOffFl); - ConfMan.setBool("music_mute", MUSICOFF); - ConfMan.setBool("sfx_mute", SOUNDOFF); + ConfMan.setBool("mute", _musicOff && _soundOffFl && _voiceOffFl); + ConfMan.setBool("music_mute", _musicOff); + ConfMan.setBool("sfx_mute", _soundOffFl); ConfMan.setBool("speech_mute", _voiceOffFl); ConfMan.setInt("music_volume", MUSICVOL * 255 / 16); diff --git a/engines/hopkins/sound.h b/engines/hopkins/sound.h index 7eb5cc600c..c67e9e0987 100644 --- a/engines/hopkins/sound.h +++ b/engines/hopkins/sound.h @@ -119,11 +119,11 @@ public: int OLD_SOUNDVOL; int OLD_MUSICVOL; int OLD_VOICEVOL; - bool SOUNDOFF; - bool MUSICOFF; + bool _soundOffFl; + bool _musicOff; bool _voiceOffFl; bool _textOffFl; - bool SOUND_FLAG; + bool _soundFl; bool VBL_MERDE; int SOUND_NUM; bool MOD_FLAG; @@ -147,15 +147,15 @@ public: void WSOUND(int soundNumber); void WSOUND_OFF(); void PLAY_MOD(const Common::String &file); - void LOAD_MUSIC(const Common::String &file); - void PLAY_MUSIC(); - void STOP_MUSIC(); - void DEL_MUSIC(); + void loadMusic(const Common::String &file); + void playMusic(); + void stopMusic(); + void delMusic(); bool mixVoice(int voiceId, int voiceMode); void DEL_SAMPLE(int soundIndex); - void PLAY_SOUND(const Common::String &file); + void playSound(const Common::String &file); void PLAY_SOUND2(const Common::String &file2); void MODSetSampleVolume(); void MODSetVoiceVolume(); @@ -163,7 +163,7 @@ public: void loadSample(int wavIndex, const Common::String &file); void PLAY_SAMPLE(int wavIndex, int voiceMode); void PLAY_SAMPLE2(int idx); - void PLAY_WAV(int wavIndex); + void playWav(int wavIndex); void syncSoundSettings(); void updateScummVMSoundSettings(); diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index 0209f0f737..e15beb3306 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -1041,7 +1041,7 @@ void TalkManager::REPONSE2(int a1, int a2) { if (a1 == 22 || a1 == 23) { _vm->_objectsManager.setFlipSprite(0, false); _vm->_objectsManager.setSpriteIndex(0, 62); - _vm->_objectsManager.SPACTION(_vm->_globals.FORETSPR, "2,3,4,5,6,7,8,9,10,11,12,-1,", 0, 0, 4, 0); + _vm->_objectsManager.SPACTION(_vm->_globals._forestSprite, "2,3,4,5,6,7,8,9,10,11,12,-1,", 0, 0, 4, 0); if (a1 == 22) { _vm->_objectsManager.BLOQUE_ANIMX(6, _vm->_objectsManager.getBobPosX(3)); _vm->_objectsManager.BLOQUE_ANIMX(8, _vm->_objectsManager.getBobPosX(3)); @@ -1053,7 +1053,7 @@ void TalkManager::REPONSE2(int a1, int a2) { _vm->_objectsManager.stopBobAnimation(4); _vm->_objectsManager.setBobAnimation(6); _vm->_soundManager.PLAY_SAMPLE2(1); - _vm->_objectsManager.SPACTION1(_vm->_globals.FORETSPR, "13,14,15,14,13,12,13,14,15,16,-1,", 0, 0, 4); + _vm->_objectsManager.SPACTION1(_vm->_globals._forestSprite, "13,14,15,14,13,12,13,14,15,16,-1,", 0, 0, 4); do _vm->_eventsManager.VBL(); while (_vm->_objectsManager.BOBPOSI(6) < 12); @@ -1089,7 +1089,7 @@ void TalkManager::REPONSE2(int a1, int a2) { } else if (a1 == 20 || a1 == 21) { _vm->_objectsManager.setFlipSprite(0, true); _vm->_objectsManager.setSpriteIndex(0, 62); - _vm->_objectsManager.SPACTION(_vm->_globals.FORETSPR, "2,3,4,5,6,7,8,9,10,11,12,-1,", 0, 0, 4, 1); + _vm->_objectsManager.SPACTION(_vm->_globals._forestSprite, "2,3,4,5,6,7,8,9,10,11,12,-1,", 0, 0, 4, 1); if (a1 == 20) { _vm->_objectsManager.BLOQUE_ANIMX(5, _vm->_objectsManager.getBobPosX(1)); _vm->_objectsManager.BLOQUE_ANIMX(7, _vm->_objectsManager.getBobPosX(1)); @@ -1101,7 +1101,7 @@ void TalkManager::REPONSE2(int a1, int a2) { _vm->_objectsManager.stopBobAnimation(2); _vm->_objectsManager.setBobAnimation(5); _vm->_soundManager.PLAY_SAMPLE2(1); - _vm->_objectsManager.SPACTION1(_vm->_globals.FORETSPR, "13,14,15,14,13,12,13,14,15,16,-1,", 0, 0, 4); + _vm->_objectsManager.SPACTION1(_vm->_globals._forestSprite, "13,14,15,14,13,12,13,14,15,16,-1,", 0, 0, 4); do _vm->_eventsManager.VBL(); while (_vm->_objectsManager.BOBPOSI(5) < 12); |