diff options
-rw-r--r-- | engines/hopkins/computer.cpp | 6 | ||||
-rw-r--r-- | engines/hopkins/dialogs.cpp | 68 | ||||
-rw-r--r-- | engines/hopkins/events.cpp | 6 | ||||
-rw-r--r-- | engines/hopkins/font.cpp | 6 | ||||
-rw-r--r-- | engines/hopkins/globals.cpp | 14 | ||||
-rw-r--r-- | engines/hopkins/globals.h | 20 | ||||
-rw-r--r-- | engines/hopkins/graphics.cpp | 16 | ||||
-rw-r--r-- | engines/hopkins/graphics.h | 5 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 28 | ||||
-rw-r--r-- | engines/hopkins/lines.cpp | 154 | ||||
-rw-r--r-- | engines/hopkins/lines.h | 2 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 273 | ||||
-rw-r--r-- | engines/hopkins/objects.h | 12 | ||||
-rw-r--r-- | engines/hopkins/script.cpp | 42 | ||||
-rw-r--r-- | engines/hopkins/talk.cpp | 4 |
15 files changed, 277 insertions, 379 deletions
diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp index b3accfa3e3..c243dc6261 100644 --- a/engines/hopkins/computer.cpp +++ b/engines/hopkins/computer.cpp @@ -424,13 +424,13 @@ void ComputerManager::TXT4(int xp, int yp, int textIdx) { x1 -= _vm->_globals.police_l; x2 = x1 + 2 * _vm->_globals.police_l; _vm->_graphicsManager.Copy_Mem(_vm->_graphicsManager._vesaScreen, x1, yp, 3 * _vm->_globals.police_l, 12, _vm->_graphicsManager._vesaBuffer, x1, yp); - _vm->_graphicsManager.Ajoute_Segment_Vesa(x1, yp, x2, yp + 12); + _vm->_graphicsManager.addVesaSegment(x1, yp, x2, yp + 12); _vm->_fontManager.displayTextVesa(x1, yp, "_", -4); } if (mappedChar != '*') { newChar = mappedChar; _vm->_graphicsManager.Copy_Mem(_vm->_graphicsManager._vesaScreen, x1, yp, _vm->_globals.police_l, 12, _vm->_graphicsManager._vesaBuffer, x1, yp); - _vm->_graphicsManager.Ajoute_Segment_Vesa(x1, yp, _vm->_globals.police_l + x1, yp + 12); + _vm->_graphicsManager.addVesaSegment(x1, yp, _vm->_globals.police_l + x1, yp + 12); _inputBuf[textIndex] = newChar; charString = Common::String::format("%c_", newChar); @@ -443,7 +443,7 @@ void ComputerManager::TXT4(int xp, int yp, int textIdx) { _vm->_graphicsManager.Copy_Mem(_vm->_graphicsManager._vesaScreen, x1, yp, _vm->_globals.police_l, 12, _vm->_graphicsManager._vesaBuffer, x1, yp); - _vm->_graphicsManager.Ajoute_Segment_Vesa(x1, yp, _vm->_globals.police_l + x1, yp + 12); + _vm->_graphicsManager.addVesaSegment(x1, yp, _vm->_globals.police_l + x1, yp + 12); _vm->_eventsManager.VBL(); _inputBuf[textIndex] = 0; diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 6f734f589d..77258a8274 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -290,7 +290,7 @@ void DialogsManager::showOptionsDialog() { _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_graphicsManager._scrollOffset + 164, 107, 335, 215, _vm->_graphicsManager._vesaBuffer, _vm->_graphicsManager._scrollOffset + 164, 107); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_graphicsManager._scrollOffset + 164, 107, + _vm->_graphicsManager.addVesaSegment(_vm->_graphicsManager._scrollOffset + 164, 107, _vm->_graphicsManager._scrollOffset + 498, 320); _vm->_globals.OPTION_SPR = _vm->_globals.freeMemory(_vm->_globals.OPTION_SPR); @@ -437,7 +437,7 @@ LABEL_7: if (_inventDisplayedFl) { _inventDisplayedFl = false; _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, v19, 114, v18, v17, _vm->_graphicsManager._vesaBuffer, v19, 114); - _vm->_graphicsManager.Ajoute_Segment_Vesa(v19, 114, v19 + v18, v18 + 114); + _vm->_graphicsManager.addVesaSegment(v19, 114, v19 + v18, v18 + 114); _vm->_objectsManager.BOBTOUS = true; } @@ -469,7 +469,7 @@ void DialogsManager::inventAnim() { if (_vm->_objectsManager.FLAG_VISIBLE_EFFACE && !_vm->_objectsManager._visibleFl) { _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_objectsManager.I_old_x, 27, 48, 38, _vm->_graphicsManager._vesaBuffer, _vm->_objectsManager.I_old_x, 27); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_objectsManager.I_old_x, 27, _vm->_objectsManager.I_old_x + 48, 65); + _vm->_graphicsManager.addVesaSegment(_vm->_objectsManager.I_old_x, 27, _vm->_objectsManager.I_old_x + 48, 65); --_vm->_objectsManager.FLAG_VISIBLE_EFFACE; } @@ -479,11 +479,11 @@ void DialogsManager::inventAnim() { _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_objectsManager.I_old_x, 27, 48, 38, _vm->_graphicsManager._vesaBuffer, _vm->_objectsManager.I_old_x, 27); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_objectsManager.I_old_x, 27, _vm->_objectsManager.I_old_x + 48, 65); + _vm->_graphicsManager.addVesaSegment(_vm->_objectsManager.I_old_x, 27, _vm->_objectsManager.I_old_x + 48, 65); int v0 = _vm->_graphicsManager._scrollOffset + 2; int v1 = _vm->_graphicsManager._scrollOffset + 2; _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals.ICONE, v1 + 300, 327, 0); - _vm->_graphicsManager.Ajoute_Segment_Vesa(v1, 27, v1 + 45, 62); + _vm->_graphicsManager.addVesaSegment(v1, 27, v1 + 45, 62); _vm->_objectsManager.I_old_x = v0; } @@ -492,17 +492,17 @@ void DialogsManager::inventAnim() { _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager._vesaBuffer, _vm->_globals.TETE, 832, 325, 0, 0, 0, 0); if (_vm->_globals._saveData->data[svField355] == 1) _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager._vesaBuffer, _vm->_globals.TETE, 866, 325, 1, 0, 0, 0); - _vm->_graphicsManager.Ajoute_Segment_Vesa(532, 25, 560, 60); - _vm->_graphicsManager.Ajoute_Segment_Vesa(566, 25, 594, 60); + _vm->_graphicsManager.addVesaSegment(532, 25, 560, 60); + _vm->_graphicsManager.addVesaSegment(566, 25, 594, 60); } if (_vm->_globals._saveData->data[svField356] == 1) { _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager._vesaBuffer, _vm->_globals.TETE, 832, 325, 0, 0, 0, 0); - _vm->_graphicsManager.Ajoute_Segment_Vesa(532, 25, 560, 60); + _vm->_graphicsManager.addVesaSegment(532, 25, 560, 60); } if (_vm->_globals._saveData->data[svField354] == 1) { _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager._vesaBuffer, _vm->_globals.TETE, 832, 325, 0, 0, 0, 0); - _vm->_graphicsManager.Ajoute_Segment_Vesa(532, 25, 560, 60); + _vm->_graphicsManager.addVesaSegment(532, 25, 560, 60); } } @@ -559,14 +559,14 @@ void DialogsManager::showLoadGame() { slotNumber = searchSavegames(); _vm->_eventsManager.VBL(); } while (!_vm->shouldQuit() && (!slotNumber || _vm->_eventsManager.getMouseButton() != 1)); - _vm->_objectsManager.SL_FLAG = false; + _vm->_objectsManager._saveLoadFl = false; _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x + 183, 60, 274, 353, _vm->_graphicsManager._vesaBuffer, _vm->_eventsManager._startPos.x + 183, 60); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_eventsManager._startPos.x + 183, 60, 457, 413); + _vm->_graphicsManager.addVesaSegment(_vm->_eventsManager._startPos.x + 183, 60, 457, 413); _vm->_objectsManager.BOBTOUS = true; _vm->_objectsManager.SL_SPR = _vm->_globals.freeMemory(_vm->_objectsManager.SL_SPR); _vm->_objectsManager.SL_SPR2 = _vm->_globals.freeMemory(_vm->_objectsManager.SL_SPR2); - _vm->_objectsManager.SL_X = 0; - _vm->_objectsManager.SL_Y = 0; + _vm->_objectsManager._saveLoadX = 0; + _vm->_objectsManager._saveLoadY = 0; if (slotNumber != 7) { _vm->_saveLoadManager.loadGame(slotNumber); @@ -590,14 +590,14 @@ void DialogsManager::showSaveGame() { _vm->_eventsManager.VBL(); } while (!_vm->shouldQuit() && (!slotNumber || _vm->_eventsManager.getMouseButton() != 1)); - _vm->_objectsManager.SL_FLAG = false; + _vm->_objectsManager._saveLoadFl = false; _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x + 183, 60, 274, 353, _vm->_graphicsManager._vesaBuffer, _vm->_eventsManager._startPos.x + 183, 60); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_eventsManager._startPos.x + 183, 60, _vm->_eventsManager._startPos.x + 457, 413); + _vm->_graphicsManager.addVesaSegment(_vm->_eventsManager._startPos.x + 183, 60, _vm->_eventsManager._startPos.x + 457, 413); _vm->_objectsManager.BOBTOUS = true; _vm->_objectsManager.SL_SPR = _vm->_globals.freeMemory(_vm->_objectsManager.SL_SPR); _vm->_objectsManager.SL_SPR2 = _vm->_globals.freeMemory(_vm->_objectsManager.SL_SPR2); - _vm->_objectsManager.SL_X = 0; - _vm->_objectsManager.SL_Y = 0; + _vm->_objectsManager._saveLoadX = 0; + _vm->_objectsManager._saveLoadY = 0; if (slotNumber != 7) { // Since the original GUI doesn't support save names, use a default name @@ -680,10 +680,10 @@ void DialogsManager::showSaveLoad(int a1) { } _vm->_graphicsManager.Capture_Mem(_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager.SL_SPR, _vm->_eventsManager._startPos.x + 183, 60, 274, 353); - _vm->_objectsManager.SL_FLAG = true; + _vm->_objectsManager._saveLoadFl = true; _vm->_objectsManager.SL_MODE = a1; - _vm->_objectsManager.SL_X = 0; - _vm->_objectsManager.SL_Y = 0; + _vm->_objectsManager._saveLoadX = 0; + _vm->_objectsManager._saveLoadY = 0; } /** @@ -718,33 +718,33 @@ int DialogsManager::searchSavegames() { switch (slotNumber) { case 1: - _vm->_objectsManager.SL_X = 189; - _vm->_objectsManager.SL_Y = 111; + _vm->_objectsManager._saveLoadX = 189; + _vm->_objectsManager._saveLoadY = 111; break; case 2: - _vm->_objectsManager.SL_X = 322; - _vm->_objectsManager.SL_Y = 111; + _vm->_objectsManager._saveLoadX = 322; + _vm->_objectsManager._saveLoadY = 111; break; case 3: - _vm->_objectsManager.SL_X = 189; - _vm->_objectsManager.SL_Y = 202; + _vm->_objectsManager._saveLoadX = 189; + _vm->_objectsManager._saveLoadY = 202; break; case 4: - _vm->_objectsManager.SL_X = 322; - _vm->_objectsManager.SL_Y = 202; + _vm->_objectsManager._saveLoadX = 322; + _vm->_objectsManager._saveLoadY = 202; break; case 5: - _vm->_objectsManager.SL_X = 189; - _vm->_objectsManager.SL_Y = 293; + _vm->_objectsManager._saveLoadX = 189; + _vm->_objectsManager._saveLoadY = 293; break; case 6: - _vm->_objectsManager.SL_X = 322; - _vm->_objectsManager.SL_Y = 293; + _vm->_objectsManager._saveLoadX = 322; + _vm->_objectsManager._saveLoadY = 293; break; case 0: case 7: - _vm->_objectsManager.SL_X = 0; - _vm->_objectsManager.SL_Y = 0; + _vm->_objectsManager._saveLoadX = 0; + _vm->_objectsManager._saveLoadY = 0; break; } return slotNumber; diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index 18f0aa420c..1b4e02a386 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -392,7 +392,7 @@ LABEL_45: } _vm->_eventsManager.updateCursor(); - _vm->_graphicsManager.Ajoute_Segment_Vesa(v15, yp, v12, v11); + _vm->_graphicsManager.addVesaSegment(v15, yp, v12, v11); LABEL_54: _vm->_globals._speed = 2; do { @@ -419,7 +419,7 @@ LABEL_65: _vm->_globals._speed = 2; _rateCounter = 0; if (!_vm->_graphicsManager._largeScreenFl || _vm->_graphicsManager.no_scroll == 1) { - _vm->_graphicsManager.Affiche_Segment_Vesa(); + _vm->_graphicsManager.displayVesaSegment(); } else { if (_vm->_graphicsManager.no_scroll != 2) { if (getMouseX() > _vm->_graphicsManager.SCROLL + 620) @@ -432,7 +432,7 @@ LABEL_65: if (_vm->_graphicsManager.SCROLL > SCREEN_WIDTH) _vm->_graphicsManager.SCROLL = SCREEN_WIDTH; if (_vm->_graphicsManager.OLD_SCROLL == _vm->_graphicsManager.SCROLL) { - _vm->_graphicsManager.Affiche_Segment_Vesa(); + _vm->_graphicsManager.displayVesaSegment(); } else { _vm->_fontManager.hideText(9); _vm->_graphicsManager.lockScreen(); diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index 0282e88cc4..069c9dc714 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -158,7 +158,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in yp, _text[idx]._width, _text[idx]._height); - _vm->_graphicsManager.Ajoute_Segment_Vesa(xp, yp, xp + width, yp + height); + _vm->_graphicsManager.addVesaSegment(xp, yp, xp + width, yp + height); } } else { int lineCount = 0; @@ -439,7 +439,7 @@ void FontManager::displayTextVesa(int xp, int yp, const Common::String &message, } } - _vm->_graphicsManager.Ajoute_Segment_Vesa(xp, yp, currentX, yp + 12); + _vm->_graphicsManager.addVesaSegment(xp, yp, currentX, yp + 12); } /** @@ -486,7 +486,7 @@ void FontManager::TEXT_COMPUT(int xp, int yp, const Common::String &msg, int col _vm->_graphicsManager.displayFont(_vm->_graphicsManager._vesaBuffer, _vm->_globals.police, v9, yp, v7 - 32, fontCol); v9 += _vm->_objectsManager.getWidth(_vm->_globals.police, v5); v6 = _vm->_objectsManager.getWidth(_vm->_globals.police, v5); - _vm->_graphicsManager.Ajoute_Segment_Vesa(v9 - v6, yp, v9, yp + 12); + _vm->_graphicsManager.addVesaSegment(v9 - v6, yp, v9, yp + 12); if (_vm->_eventsManager._escKeyFl) { _vm->_globals.iRegul = 1; _vm->_eventsManager.VBL(); diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index cef2f9686d..becb8a2767 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -111,7 +111,7 @@ Globals::Globals() { for (int i = 0; i < 36; ++i) _inventory[i] = 0; for (int i = 0; i < 51; ++i) - Common::fill((byte *)&Tri[i], (byte *)&Tri[i] + sizeof(TriItem), 0); + Common::fill((byte *)&_sortedDisplay[i], (byte *)&_sortedDisplay[i] + sizeof(SortItem), 0); // Initialise fields _language = LANG_EN; @@ -164,10 +164,8 @@ Globals::Globals() { _menuMusicOff = 0; _menuTextOff = 0; _menuDisplayType = 0; - NBTRI = 0; - AFFLI = false; - AFFIVBL = false; - NOT_VERIF = 0; + _sortedDisplayCount = 0; + NOT_VERIF = false; PERSO_TYPE = 0; GOACTION = false; NECESSAIRE = false; @@ -219,9 +217,7 @@ Globals::Globals() { // Reset flags _censorshipFl = false; GESTE_FLAG = 0; - BPP_NOAFF = false; _disableInventFl = false; - netscape = false; NOMARCHE = false; NO_VISU = false; _optionDialogFl = false; @@ -500,7 +496,7 @@ byte *Globals::freeMemory(byte *p) { } // Reset Cache -void Globals::RESET_CACHE() { +void Globals::resetCache() { for (int idx = 1; idx <= 5; ++idx) { CACHE_BANQUE[idx] = freeMemory(CACHE_BANQUE[idx]); @@ -546,7 +542,7 @@ void Globals::loadCache(const Common::String &file) { Common::String v16; Common::File f; - RESET_CACHE(); + resetCache(); _vm->_fileManager.constructFilename(HOPLINK, file); ptr = _vm->_fileManager.loadFile(_curFilename); v16 = Common::String((const char *)ptr); diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index 86524ea3e8..5dc5ef66d1 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -159,15 +159,15 @@ struct BlocItem { }; /** - * Mode for TriItem records + * Mode for SortItem records */ -enum TriMode { TRI_NONE = 0, TRI_BOB = 1, TRI_SPRITE = 2, TRI_CACHE = 3 }; +enum SortMode { SORT_NONE = 0, SORT_BOB = 1, SORT_SPRITE = 2, SORT_CACHE = 3 }; /** * Structure to represent a pending display of either a Bob, Sprite, or Cache Item. */ -struct TriItem { - TriMode _triMode; +struct SortItem { + SortMode _sortMode; int _index; int _priority; }; @@ -327,7 +327,7 @@ public: int Param[2100]; HopkinsItem Hopkins[70]; int _inventory[36]; - TriItem Tri[51]; + SortItem _sortedDisplay[51]; Language _language; int SVGA; bool _internetFl; @@ -396,7 +396,6 @@ public: uint32 _catalogPos; uint32 _catalogSize; int iRegul; - bool BPP_NOAFF; int _exitId; int PLANX, PLANY; int PLANI; @@ -409,7 +408,6 @@ public: int Max_Ligne_Long; int Max_Perso_Y; bool _disableInventFl; - bool netscape; // CHECKME: Useless variable? bool NOMARCHE; int NBBLOC; bool NO_VISU; @@ -423,10 +421,8 @@ public: int _menuVoiceOff; int _menuMusicOff; int _menuTextOff; - int NBTRI; - bool AFFLI; // CHECKME: Useless variable? - bool AFFIVBL; // CHECKME: Useless variable? - int NOT_VERIF; + int _sortedDisplayCount; + bool NOT_VERIF; bool _cacheFl; bool NOPARLE; bool PLAN_FLAG; @@ -481,7 +477,7 @@ public: byte *allocMemory(int count); byte *freeMemory(byte *p); - void RESET_CACHE(); + void resetCache(); void CACHE_ON(); void CACHE_OFF(int v1 = 0); void CACHE_SUB(int idx); diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 0d4073d67d..27d86d21a3 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -60,7 +60,6 @@ GraphicsManager::GraphicsManager() { clip_x = clip_y = 0; clip_x1 = clip_y1 = 0; clip_flag = false; - SDL_NBLOCS = 0; Red_x = Red_y = 0; Red = 0; _width = 0; @@ -1112,7 +1111,7 @@ void GraphicsManager::RESET_SEGMENT_VESA() { } // Add VESA Segment -void GraphicsManager::Ajoute_Segment_Vesa(int x1, int y1, int x2, int y2) { +void GraphicsManager::addVesaSegment(int x1, int y1, int x2, int y2) { int tempX; int blocCount; bool addFlag; @@ -1156,11 +1155,10 @@ void GraphicsManager::Ajoute_Segment_Vesa(int x1, int y1, int x2, int y2) { } // Display VESA Segment -void GraphicsManager::Affiche_Segment_Vesa() { +void GraphicsManager::displayVesaSegment() { if (_vm->_globals.NBBLOC == 0) return; - SDL_NBLOCS = _vm->_globals.NBBLOC; lockScreen(); for (int idx = 1; idx <= _vm->_globals.NBBLOC; ++idx) { @@ -1198,10 +1196,6 @@ void GraphicsManager::Affiche_Segment_Vesa() { _vm->_globals.NBBLOC = 0; unlockScreen(); - if (!_vm->_globals.BPP_NOAFF) { -// SDL_UpdateRects(LinuxScr, SDL_NBLOCS, dstrect); - } - SDL_NBLOCS = 0; } void GraphicsManager::AFFICHE_SPEEDVGA(const byte *objectData, int xp, int yp, int idx) { @@ -1217,7 +1211,7 @@ void GraphicsManager::AFFICHE_SPEEDVGA(const byte *objectData, int xp, int yp, i Sprite_Vesa(_vesaScreen, objectData, xp + 300, yp + 300, idx); } if (!_vm->_globals.NO_VISU) - Ajoute_Segment_Vesa(xp, yp, xp + width, yp + height); + addVesaSegment(xp, yp, xp + width, yp + height); } void GraphicsManager::CopyAsm(const byte *surface) { @@ -1713,7 +1707,7 @@ void GraphicsManager::fastDisplay(const byte *spriteData, int xp, int yp, int sp Sprite_Vesa(_vesaScreen, spriteData, xp + 300, yp + 300, spriteIndex); } if (!_vm->_globals.NO_VISU) - Ajoute_Segment_Vesa(xp, yp, xp + width, yp + height); + addVesaSegment(xp, yp, xp + width, yp + height); } void GraphicsManager::SCOPY(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY) { @@ -1747,7 +1741,7 @@ void GraphicsManager::SCOPY(const byte *surface, int x1, int y1, int width, int if (croppedWidth > 0 && croppedHeight > 0) { int height2 = croppedHeight; Copy_Mem(surface, left, top2, croppedWidth, croppedHeight, destSurface, destX, destY); - Ajoute_Segment_Vesa(left, top2, left + croppedWidth, top2 + height2); + addVesaSegment(left, top2, left + croppedWidth, top2 + height2); } } diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index f62fcb5026..ad05f1aa6b 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -87,7 +87,6 @@ public: int clip_x, clip_y; int clip_x1, clip_y1; bool clip_flag; - int SDL_NBLOCS; int Red_x, Red_y; int Red; int _width; @@ -151,8 +150,8 @@ public: void FIN_VISU(); void VISU_ALL(); void RESET_SEGMENT_VESA(); - void Ajoute_Segment_Vesa(int x1, int y1, int x2, int y2); - void Affiche_Segment_Vesa(); + void addVesaSegment(int x1, int y1, int x2, int y2); + void displayVesaSegment(); void AFFICHE_SPEEDVGA(const byte *objectData, int xp, int yp, int idx); void CopyAsm(const byte *surface); void CopyAsm16(const byte *surface); diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index efb1ce24fb..34bd068f18 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -4486,11 +4486,9 @@ void HopkinsEngine::playIntro() { _graphicsManager.SETCOLOR3(253, 100, 100, 100); _graphicsManager.SETCOLOR3(251, 100, 100, 100); _graphicsManager.SETCOLOR3(254, 0, 0, 0); - _globals.BPP_NOAFF = true; for (int i = 0; i <= 4; i++) _eventsManager.VBL(); - _globals.BPP_NOAFF = false; _globals.iRegul = 1; _graphicsManager.FADE_INW(); if (_graphicsManager._largeScreenFl) { @@ -4532,12 +4530,10 @@ void HopkinsEngine::playIntro() { _graphicsManager.SETCOLOR3(253, 100, 100, 100); _graphicsManager.SETCOLOR3(251, 100, 100, 100); _graphicsManager.SETCOLOR3(254, 0, 0, 0); - _globals.BPP_NOAFF = true; for (int i = 0; i <= 4; i++) _eventsManager.VBL(); - _globals.BPP_NOAFF = false; _globals.iRegul = 1; _graphicsManager.FADE_INW(); for (uint i = 0; i < 200 / _globals._speed; ++i) @@ -4577,12 +4573,10 @@ void HopkinsEngine::playIntro() { _graphicsManager.SETCOLOR3(253, 100, 100, 100); _graphicsManager.SETCOLOR3(251, 100, 100, 100); _graphicsManager.SETCOLOR3(254, 0, 0, 0); - _globals.BPP_NOAFF = true; for (int i = 0; i <= 3; i++) _eventsManager.VBL(); - _globals.BPP_NOAFF = false; _globals.iRegul = 1; _graphicsManager.setpal_vga256_linux(paletteData2, _graphicsManager._vesaBuffer); @@ -4750,13 +4744,11 @@ void HopkinsEngine::bombExplosion() { _animationManager.loadAnim("ANIM15"); _graphicsManager.VISU_ALL(); _objectsManager.stopBobAnimation(7); - _globals.BPP_NOAFF = true; for (int idx = 0; idx < 5; ++idx) { _eventsManager.VBL(); } - _globals.BPP_NOAFF = false; _graphicsManager.FADE_INW(); _eventsManager.mouseOff(); @@ -4797,15 +4789,10 @@ void HopkinsEngine::PUBQUIT() { _eventsManager.changeMouseCursor(0); _eventsManager._mouseCursorId = 0; _eventsManager._mouseSpriteId = 0; - _globals.netscape = true; bool mouseClicked = false; - // CHECKME: Useless variables ? - // int xp, yp; do { -// xp = _eventsManager.XMOUSE(); -// yp = _eventsManager.YMOUSE(); _eventsManager.VBL(); if (_eventsManager.getMouseButton() == 1) @@ -4813,7 +4800,7 @@ void HopkinsEngine::PUBQUIT() { } while (!mouseClicked && !g_system->getEventManager()->shouldQuit()); // Original tried to open a web browser link here. Since ScummVM doesn't support - // that, it's being skipped in favour of simply exitting + // that, it's being skipped in favor of simply exiting _graphicsManager.FADE_OUTW(); } @@ -4828,12 +4815,10 @@ void HopkinsEngine::handleConflagration() { _graphicsManager.SETCOLOR3(251, 100, 100, 100); _graphicsManager.SETCOLOR3(254, 0, 0, 0); _graphicsManager.VISU_ALL(); - _globals.BPP_NOAFF = true; for (int cpt = 0; cpt <= 4; cpt++) _eventsManager.VBL(); - _globals.BPP_NOAFF = false; _graphicsManager.FADE_INW(); _globals.iRegul = 1; @@ -4939,12 +4924,10 @@ void HopkinsEngine::BASED() { _animationManager.loadAnim("ANIM92"); _graphicsManager.VISU_ALL(); _objectsManager.INILINK("IM92"); - _globals.BPP_NOAFF = true; for (int cpt = 0; cpt <= 4; cpt++) _eventsManager.VBL(); - _globals.BPP_NOAFF = false; _graphicsManager.FADE_INW(); _globals.CACHE_ON(); @@ -4954,7 +4937,7 @@ void HopkinsEngine::BASED() { _graphicsManager.FADE_OUTW(); _graphicsManager.FIN_VISU(); - _globals.RESET_CACHE(); + _globals.resetCache(); _globals._disableInventFl = false; _globals._exitId = 93; _globals.iRegul = 0; @@ -4971,8 +4954,6 @@ void HopkinsEngine::playEnding() { _globals.chemin = (int16 *)g_PTRNUL; _globals.NOMARCHE = true; _globals._exitId = 0; - _globals.AFFLI = false; - _globals.AFFIVBL = false; _soundManager.loadSample(1, "SOUND90.WAV"); _graphicsManager.loadImage("IM100"); _animationManager.loadAnim("ANIM100"); @@ -4986,12 +4967,10 @@ void HopkinsEngine::playEnding() { _graphicsManager.SETCOLOR3(251, 100, 100, 100); _graphicsManager.SETCOLOR3(254, 0, 0, 0); _eventsManager.changeMouseCursor(0); - _globals.BPP_NOAFF = true; for (int cpt = 0; cpt <= 4; cpt++) _eventsManager.VBL(); - _globals.BPP_NOAFF = false; _graphicsManager.FADE_INW(); _globals.iRegul = 1; @@ -5652,8 +5631,6 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in _graphicsManager._noFadingFl = false; _globals.NOMARCHE = false; _globals._exitId = 0; - _globals.AFFLI = false; - _globals.AFFIVBL = true; _globals._disableInventFl = true; _soundManager.WSOUND(soundId); _fileManager.constructFilename(_globals.HOPSYSTEM, "VAISSEAU.SPR"); @@ -5741,7 +5718,6 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in _globals._exitId = exit4; _graphicsManager.FADE_OUTW(); _objectsManager.removeSprite(0); - _globals.AFFLI = false; _objectsManager.CLEAR_ECRAN(); _fileManager.constructFilename(_globals.HOPSYSTEM, "PERSO.SPR"); _globals.PERSO = _fileManager.loadFile(_globals._curFilename); diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp index fb15142dc1..710ff6c3ab 100644 --- a/engines/hopkins/lines.cpp +++ b/engines/hopkins/lines.cpp @@ -38,7 +38,7 @@ LinesManager::LinesManager() { } next_ligne = 0; - TOTAL_LIGNES = 0; + _linesNumb = 0; NV_LIGNEDEP = 0; NV_LIGNEOFS = 0; NV_POSI = 0; @@ -225,8 +225,8 @@ void LinesManager::AJOUTE_LIGNE(int idx, int a2, int a3, int a4, int a5, int a6, if (idx > 400) error("Attempting to add a line obstacle > MAX_LIGNE."); - if (TOTAL_LIGNES < idx) - TOTAL_LIGNES = idx; + if (_linesNumb < idx) + _linesNumb = idx; Ligne[idx].lineData = (int16 *)_vm->_globals.freeMemory((byte *)Ligne[idx].lineData); v7 = a3 - a5; @@ -463,9 +463,9 @@ void LinesManager::INIPARCOURS() { ++v0; } while (!v1); - _vm->_objectsManager.DERLIGNE = v0; + _vm->_objectsManager._lastLine = v0; v13 = _vm->_globals.Max_Ligne_Long; - v9 = _vm->_objectsManager.DERLIGNE + 1; + v9 = _vm->_objectsManager._lastLine + 1; for (int v8 = 1; v8 != 400; v8++) { v11 = v8; if (Ligne[v11].field0 < v13) { @@ -732,7 +732,7 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) { v6 = a2; v50 = a3; v7 = a5; - if (colision2_ligne(a1, a2, &v51, &v50, 0, TOTAL_LIGNES)) { + if (colision2_ligne(a1, a2, &v51, &v50, 0, _linesNumb)) { v8 = Ligne[v50].field4; if (v8 == 1) v6 = a2 - 2; @@ -764,7 +764,7 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) { v9 = 0; v10 = v40; for (i = v40; v40 + 200 > v10; i = v10) { - if (colision2_ligne(v41, i, &v49, &v48, 0, _vm->_objectsManager.DERLIGNE) == 1 && v48 <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(v41, i, &v49, &v48, 0, _vm->_objectsManager._lastLine) == 1 && v48 <= _vm->_objectsManager._lastLine) break; v49 = 0; v48 = -1; @@ -775,7 +775,7 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) { v12 = 0; v13 = v40; for (j = v40; v40 - 200 < v13; j = v13) { - if (colision2_ligne(v41, j, &v47, &v46, 0, _vm->_objectsManager.DERLIGNE) == 1 && v46 <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(v41, j, &v47, &v46, 0, _vm->_objectsManager._lastLine) == 1 && v46 <= _vm->_objectsManager._lastLine) break; v47 = 0; v46 = -1; @@ -786,7 +786,7 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) { v15 = 0; v16 = v41; for (k = v41; v41 + 200 > v16; k = v16) { - if (colision2_ligne(k, v40, &v45, &v44, 0, _vm->_objectsManager.DERLIGNE) == 1 && v44 <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(k, v40, &v45, &v44, 0, _vm->_objectsManager._lastLine) == 1 && v44 <= _vm->_objectsManager._lastLine) break; v45 = 0; v44 = -1; @@ -797,7 +797,7 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) { v18 = 0; v19 = v41; for (l = v41; v41 - 200 < v19; l = v19) { - if (colision2_ligne(l, v40, &v43, &v42, 0, _vm->_objectsManager.DERLIGNE) == 1 && v42 <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(l, v40, &v43, &v42, 0, _vm->_objectsManager._lastLine) == 1 && v42 <= _vm->_objectsManager._lastLine) break; v43 = 0; v42 = -1; @@ -889,8 +889,8 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) { } if (v21 == 1) { for (int v22 = 0; v22 < v39; v22++) { - if (colision2_ligne(v41, v40 - v22, &v47, &v46, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) - && _vm->_objectsManager.DERLIGNE < v46) { + if (colision2_ligne(v41, v40 - v22, &v47, &v46, _vm->_objectsManager._lastLine + 1, _linesNumb) + && _vm->_objectsManager._lastLine < v46) { v23 = GENIAL(v46, v47, v41, v40 - v22, v41, v40 - v39, v7, &_vm->_globals.super_parcours[0], 4); if (v23 == -1) return 0; @@ -913,8 +913,8 @@ LABEL_186: } if (v21 == 5) { for (int v25 = 0; v25 < v37; v25++) { - if (colision2_ligne(v41, v25 + v40, &v47, &v46, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) - && _vm->_objectsManager.DERLIGNE < v46) { + if (colision2_ligne(v41, v25 + v40, &v47, &v46, _vm->_objectsManager._lastLine + 1, _linesNumb) + && _vm->_objectsManager._lastLine < v46) { v26 = GENIAL(v46, v47, v41, v25 + v40, v41, v37 + v40, v7, &_vm->_globals.super_parcours[0], 4); if (v26 == -1) return 0; @@ -933,8 +933,8 @@ LABEL_186: } if (v21 == 7) { for (int v28 = 0; v28 < v18; v28++) { - if (colision2_ligne(v41 - v28, v40, &v47, &v46, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) - && _vm->_objectsManager.DERLIGNE < v46) { + if (colision2_ligne(v41 - v28, v40, &v47, &v46, _vm->_objectsManager._lastLine + 1, _linesNumb) + && _vm->_objectsManager._lastLine < v46) { v29 = GENIAL(v46, v47, v41 - v28, v40, v41 - v18, v40, v7, &_vm->_globals.super_parcours[0], 4); if (v29 == -1) return 0; @@ -953,8 +953,8 @@ LABEL_186: } if (v21 == 3) { for (int v31 = 0; v31 < v38; v31++) { - if (colision2_ligne(v31 + v41, v40, &v47, &v46, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) - && _vm->_objectsManager.DERLIGNE < v46) { + if (colision2_ligne(v31 + v41, v40, &v47, &v46, _vm->_objectsManager._lastLine + 1, _linesNumb) + && _vm->_objectsManager._lastLine < v46) { v32 = GENIAL(v46, v47, v31 + v41, v40, v38 + v41, v40, v7, &_vm->_globals.super_parcours[0], 4); if (v32 == -1) return 0; @@ -1004,7 +1004,7 @@ LABEL_112: break; while (v12[v11 - 2] != v98 || v97 != v12[v11 - 1]) { --v86; - if (_vm->_objectsManager.DERLIGNE - 1 != v86) { + if (_vm->_objectsManager._lastLine - 1 != v86) { v11 = 2 * Ligne[v86].field0; v12 = Ligne[v86].lineData; if (v12 != (int16 *)g_PTRNUL) @@ -1039,7 +1039,7 @@ LABEL_11: break; } ++v87; - if (v87 != TOTAL_LIGNES + 1) { + if (v87 != _linesNumb + 1) { v15 = 2 * Ligne[v87].field0; v16 = Ligne[v87].lineData; if (v16 != (int16 *)g_PTRNUL) @@ -1099,7 +1099,7 @@ LABEL_17: for (int v89 = v85 + 1; v89 > 0; v89--) { int v96 = _vm->_globals.BufLig[v25]; int v94 = _vm->_globals.BufLig[v25 + 1]; - if (colision2_ligne(v96, v94, &v101, &v100, v92, v91) && _vm->_objectsManager.DERLIGNE < v100) { + if (colision2_ligne(v96, v94, &v101, &v100, v92, v91) && _vm->_objectsManager._lastLine < v100) { v80 = v100; v77 = v101; v78 = v96; @@ -1290,7 +1290,7 @@ LABEL_17: v99 = CONTOURNE(a1, a2, v99, a1, v77, a8, a9); loopCond = false; do { - loopCond = colision2_ligne(NVPX, NVPY, &v101, &v100, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES); + loopCond = colision2_ligne(NVPX, NVPY, &v101, &v100, _vm->_objectsManager._lastLine + 1, _linesNumb); if (loopCond) { int v50 = v100; if (Ligne[v50].field4 == 1) @@ -1487,7 +1487,7 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { if (_vm->_globals.old_z_69 > 0 && _vm->_objectsManager.NUMZONE > 0 && _vm->_globals.old_z_69 == _vm->_objectsManager.NUMZONE) return (int16 *)g_PTRNUL; } - _vm->_globals.NOT_VERIF = 0; + _vm->_globals.NOT_VERIF = false; _vm->_globals.old_z_69 = _vm->_objectsManager.NUMZONE; _vm->_globals.old_x1_65 = srcX; _vm->_globals.old_x2_67 = destX; @@ -1530,7 +1530,7 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { do { v101 = v16; v16 = v101; - if (colision2_ligne(v123, v15, &v136[5], &v141[5], 0, _vm->_objectsManager.DERLIGNE) && v141[v101] <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(v123, v15, &v136[5], &v141[5], 0, _vm->_objectsManager._lastLine) && v141[v101] <= _vm->_objectsManager._lastLine) break; v136[v101] = 0; v141[v101] = -1; @@ -1546,7 +1546,7 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { do { v102 = v20; v20 = v102; - if (colision2_ligne(v123, v19, &v136[1], &v141[1], 0, _vm->_objectsManager.DERLIGNE) && v141[v102] <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(v123, v19, &v136[1], &v141[1], 0, _vm->_objectsManager._lastLine) && v141[v102] <= _vm->_objectsManager._lastLine) break; v136[v102] = 0; v141[v102] = -1; @@ -1566,7 +1566,7 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { do { v103 = v24; v24 = v103; - if (colision2_ligne(v23, v122, &v136[3], &v141[3], 0, _vm->_objectsManager.DERLIGNE) && v141[v103] <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(v23, v122, &v136[3], &v141[3], 0, _vm->_objectsManager._lastLine) && v141[v103] <= _vm->_objectsManager._lastLine) break; v136[v103] = 0; v141[v103] = -1; @@ -1588,7 +1588,7 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { do { v104 = v28; v28 = v104; - if (colision2_ligne(v27, v122, &v136[7], &v141[7], 0, _vm->_objectsManager.DERLIGNE) && v141[v104] <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(v27, v122, &v136[7], &v141[7], 0, _vm->_objectsManager._lastLine) && v141[v104] <= _vm->_objectsManager._lastLine) break; v136[v104] = 0; v141[v104] = -1; @@ -1605,13 +1605,13 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { } while (_vm->_graphicsManager.min_x < v27); } v131[7] = v26; - if (v141[1] < 0 || _vm->_objectsManager.DERLIGNE < v141[1]) + if (v141[1] < 0 || _vm->_objectsManager._lastLine < v141[1]) v141[1] = -1; - if (v141[3] < 0 || _vm->_objectsManager.DERLIGNE < v141[3]) + if (v141[3] < 0 || _vm->_objectsManager._lastLine < v141[3]) v141[3] = -1; - if (v141[5] < 0 || _vm->_objectsManager.DERLIGNE < v141[5]) + if (v141[5] < 0 || _vm->_objectsManager._lastLine < v141[5]) v141[5] = -1; - if (v141[7] < 0 || _vm->_objectsManager.DERLIGNE < v141[7]) + if (v141[7] < 0 || _vm->_objectsManager._lastLine < v141[7]) v141[7] = -1; if (v141[1] < 0) v131[1] = 1300; @@ -1658,7 +1658,7 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { do { v105 = v36; v36 = v105; - if (colision2_ligne(srcX, v35, &v136[5], &v141[5], 0, _vm->_objectsManager.DERLIGNE) && v141[v105] <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(srcX, v35, &v136[5], &v141[5], 0, _vm->_objectsManager._lastLine) && v141[v105] <= _vm->_objectsManager._lastLine) break; v136[v105] = 0; v141[v105] = -1; @@ -1674,7 +1674,7 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { do { v106 = v40; v40 = v106; - if (colision2_ligne(srcX, v39, &v136[1], &v141[1], 0, _vm->_objectsManager.DERLIGNE) && v141[v106] <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(srcX, v39, &v136[1], &v141[1], 0, _vm->_objectsManager._lastLine) && v141[v106] <= _vm->_objectsManager._lastLine) break; v136[v106] = 0; v141[v106] = -1; @@ -1694,7 +1694,7 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { do { v107 = v44; v44 = v107; - if (colision2_ligne(v43, srcY, &v136[3], &v141[3], 0, _vm->_objectsManager.DERLIGNE) && v141[v107] <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(v43, srcY, &v136[3], &v141[3], 0, _vm->_objectsManager._lastLine) && v141[v107] <= _vm->_objectsManager._lastLine) break; v136[v107] = 0; v141[v107] = -1; @@ -1714,7 +1714,7 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) { do { v108 = v48; v48 = v108; - if (colision2_ligne(v47, srcY, &v136[7], &v141[7], 0, _vm->_objectsManager.DERLIGNE) && v141[v108] <= _vm->_objectsManager.DERLIGNE) + if (colision2_ligne(v47, srcY, &v136[7], &v141[7], 0, _vm->_objectsManager._lastLine) && v141[v108] <= _vm->_objectsManager._lastLine) break; v136[v108] = 0; v141[v108] = -1; @@ -1797,8 +1797,8 @@ LABEL_201: v56 = 0; if (v111 > 0) { do { - if (colision2_ligne(srcX, srcY - v56, &v125, &v124, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) - && _vm->_objectsManager.DERLIGNE < v124) { + if (colision2_ligne(srcX, srcY - v56, &v125, &v124, _vm->_objectsManager._lastLine + 1, _linesNumb) + && _vm->_objectsManager._lastLine < v124) { v57 = v112; v58 = GENIAL(v124, v125, srcX, srcY - v56, srcX, srcY - v111, v112, &_vm->_globals.super_parcours[0], 4); if (v58 == -1) @@ -1821,8 +1821,8 @@ LABEL_201: v60 = 0; if (v111 > 0) { do { - if (colision2_ligne(srcX, v60 + srcY, &v125, &v124, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) - && _vm->_objectsManager.DERLIGNE < v124) { + if (colision2_ligne(srcX, v60 + srcY, &v125, &v124, _vm->_objectsManager._lastLine + 1, _linesNumb) + && _vm->_objectsManager._lastLine < v124) { v57 = v112; v61 = GENIAL(v124, v125, srcX, v60 + srcY, srcX, v111 + srcY, v112, &_vm->_globals.super_parcours[0], 4); if (v61 == -1) @@ -1845,8 +1845,8 @@ LABEL_201: v63 = 0; if (v111 > 0) { do { - if (colision2_ligne(srcX - v63, srcY, &v125, &v124, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) - && _vm->_objectsManager.DERLIGNE < v124) { + if (colision2_ligne(srcX - v63, srcY, &v125, &v124, _vm->_objectsManager._lastLine + 1, _linesNumb) + && _vm->_objectsManager._lastLine < v124) { v57 = v112; v64 = GENIAL(v124, v125, srcX - v63, srcY, srcX - v111, srcY, v112, &_vm->_globals.super_parcours[0], 4); if (v64 == -1) @@ -1869,8 +1869,8 @@ LABEL_201: v66 = 0; if (v111 > 0) { do { - if (colision2_ligne(v66 + srcX, srcY, &v125, &v124, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) - && _vm->_objectsManager.DERLIGNE < v124) { + if (colision2_ligne(v66 + srcX, srcY, &v125, &v124, _vm->_objectsManager._lastLine + 1, _linesNumb) + && _vm->_objectsManager._lastLine < v124) { v57 = v112; v67 = GENIAL(v124, v125, v66 + srcX, srcY, v111 + srcX, srcY, v112, &_vm->_globals.super_parcours[0], 4); if (v67 == -1) @@ -2210,7 +2210,7 @@ int LinesManager::PARC_PERS(int a1, int a2, int a3, int a4, int a5, int a6, int if (a5 == -1 && a6 == -1) v136 = 1; v144 = a5; - if (colision2_ligne(a1, a2, &v145, &v144, 0, TOTAL_LIGNES)) { + if (colision2_ligne(a1, a2, &v145, &v144, 0, _linesNumb)) { int v8 = Ligne[v144].field4; if (v8 == 1) v90 = a2 - 2; @@ -2416,7 +2416,7 @@ LABEL_103: v23 = 0; if (v108 + 1 <= 0) goto LABEL_149; - while (!colision2_ligne(v104, v103, &v143, &v142, 0, TOTAL_LIGNES)) { + while (!colision2_ligne(v104, v103, &v143, &v142, 0, _linesNumb)) { v25 = v115; v26 = _vm->_globals.essai0; v26[v25] = v104; @@ -2431,7 +2431,7 @@ LABEL_103: if (v23 >= v108 + 1) goto LABEL_149; } - if (_vm->_objectsManager.DERLIGNE >= v142) + if (_vm->_objectsManager._lastLine >= v142) goto LABEL_157; v24 = GENIAL(v142, v143, v104, v103, a3, a4, v115, _vm->_globals.essai0, 3); if (v24 == -1) @@ -2456,7 +2456,7 @@ LABEL_67: v126 = 1; goto LABEL_70; } - if (colision2_ligne(v15, v110, &v143, &v142, 0, TOTAL_LIGNES)) + if (colision2_ligne(v15, v110, &v143, &v142, 0, _linesNumb)) break; v16 = v115; @@ -2474,7 +2474,7 @@ LABEL_70: goto LABEL_72; } } - if (v142 > _vm->_objectsManager.DERLIGNE) + if (v142 > _vm->_objectsManager._lastLine) goto LABEL_67; LABEL_157: v31 = v115; @@ -2494,7 +2494,7 @@ LABEL_158: LABEL_165: if (v113 > a3) { v36 = v113; - while (!colision2_ligne(v36, v92, &v141, &v140, 0, TOTAL_LIGNES)) { + while (!colision2_ligne(v36, v92, &v141, &v140, 0, _linesNumb)) { v37 = v117; v38 = _vm->_globals.essai1; v38[v37] = v36; @@ -2513,8 +2513,8 @@ LABEL_181: if (v92 > a4) { v43 = v92; do { - if (colision2_ligne(a3, v43, &v141, &v140, 0, TOTAL_LIGNES)) { - if (_vm->_objectsManager.DERLIGNE < v140) { + if (colision2_ligne(a3, v43, &v141, &v140, 0, _linesNumb)) { + if (_vm->_objectsManager._lastLine < v140) { v44 = GENIAL(v140, v141, a3, v43, a3, a4, v117, _vm->_globals.essai1, 3); if (v44 == -1) goto LABEL_195; @@ -2523,12 +2523,12 @@ LABEL_181: if (NVPY != -1) { v33 = NVPX; v92 = NVPY; - v45 = colision2_ligne(NVPX, NVPY, &v141, &v140, 0, _vm->_objectsManager.DERLIGNE); + v45 = colision2_ligne(NVPX, NVPY, &v141, &v140, 0, _vm->_objectsManager._lastLine); goto LABEL_189; } } } - if (v140 <= _vm->_objectsManager.DERLIGNE) + if (v140 <= _vm->_objectsManager._lastLine) goto LABEL_202; } v46 = v117; @@ -2567,8 +2567,8 @@ LABEL_195: } v39 = v92; for (;;) { - if (colision2_ligne(a3, v39, &v141, &v140, 0, TOTAL_LIGNES)) { - if (_vm->_objectsManager.DERLIGNE < v140) { + if (colision2_ligne(a3, v39, &v141, &v140, 0, _linesNumb)) { + if (_vm->_objectsManager._lastLine < v140) { v40 = GENIAL(v140, v141, a3, v39, a3, a4, v117, _vm->_globals.essai1, 3); if (v40 == -1) goto LABEL_195; @@ -2577,15 +2577,15 @@ LABEL_195: if (NVPY != -1) { v33 = NVPX; v92 = NVPY; - v45 = colision2_ligne(NVPX, NVPY, &v141, &v140, 0, _vm->_objectsManager.DERLIGNE); + v45 = colision2_ligne(NVPX, NVPY, &v141, &v140, 0, _vm->_objectsManager._lastLine); LABEL_189: - if (v45 && v140 <= _vm->_objectsManager.DERLIGNE) + if (v45 && v140 <= _vm->_objectsManager._lastLine) goto LABEL_202; goto LABEL_158; } } } - if (v140 <= _vm->_objectsManager.DERLIGNE) + if (v140 <= _vm->_objectsManager._lastLine) goto LABEL_202; } v41 = v117; @@ -2600,7 +2600,7 @@ LABEL_189: goto LABEL_181; } } - while (!colision2_ligne(v33, v92, &v141, &v140, 0, TOTAL_LIGNES)) { + while (!colision2_ligne(v33, v92, &v141, &v140, 0, _linesNumb)) { v34 = v117; v35 = _vm->_globals.essai1; v35[v34] = v33; @@ -2612,7 +2612,7 @@ LABEL_189: goto LABEL_165; } LABEL_168: - if (v140 > _vm->_objectsManager.DERLIGNE) + if (v140 > _vm->_objectsManager._lastLine) v140 = -1; LABEL_202: v52 = v117; @@ -2629,7 +2629,7 @@ LABEL_203: goto LABEL_241; if (v93 < a4) { v55 = v93; - while (!colision2_ligne(v114, v55, &v139, &v138, 0, TOTAL_LIGNES)) { + while (!colision2_ligne(v114, v55, &v139, &v138, 0, _linesNumb)) { v56 = v117; v57 = _vm->_globals.essai2; v57[v56] = v114; @@ -2645,7 +2645,7 @@ LABEL_203: LABEL_211: if (v93 > a4) { v58 = v93; - while (!colision2_ligne(v114, v58, &v139, &v138, 0, TOTAL_LIGNES)) { + while (!colision2_ligne(v114, v58, &v139, &v138, 0, _linesNumb)) { v59 = v117; v60 = _vm->_globals.essai2; v60[v59] = v114; @@ -2657,7 +2657,7 @@ LABEL_211: goto LABEL_217; } LABEL_214: - if (v138 > _vm->_objectsManager.DERLIGNE) + if (v138 > _vm->_objectsManager._lastLine) v138 = -1; LABEL_249: v76 = v117; @@ -2811,8 +2811,8 @@ LABEL_217: if (v114 < a3) { v61 = v114; do { - if (colision2_ligne(v61, a4, &v139, &v138, 0, TOTAL_LIGNES)) { - if (_vm->_objectsManager.DERLIGNE < v138) { + if (colision2_ligne(v61, a4, &v139, &v138, 0, _linesNumb)) { + if (_vm->_objectsManager._lastLine < v138) { v62 = GENIAL(v138, v139, v61, a4, a3, a4, v117, _vm->_globals.essai2, 3); if (v62 == -1) goto LABEL_195; @@ -2821,15 +2821,15 @@ LABEL_217: if (NVPY != -1) { v54 = NVPX; v93 = NVPY; - colResult = colision2_ligne(NVPX, NVPY, &v139, &v138, 0, _vm->_objectsManager.DERLIGNE); + colResult = colision2_ligne(NVPX, NVPY, &v139, &v138, 0, _vm->_objectsManager._lastLine); LABEL_235: - if (colResult && v138 <= _vm->_objectsManager.DERLIGNE) + if (colResult && v138 <= _vm->_objectsManager._lastLine) goto LABEL_249; goto LABEL_203; } } } - if (v138 <= _vm->_objectsManager.DERLIGNE) + if (v138 <= _vm->_objectsManager._lastLine) goto LABEL_249; } v63 = v117; @@ -2845,8 +2845,8 @@ LABEL_235: if (v114 > a3) { v65 = v114; do { - if (colision2_ligne(v65, a4, &v139, &v138, 0, TOTAL_LIGNES)) { - if (_vm->_objectsManager.DERLIGNE < v138) { + if (colision2_ligne(v65, a4, &v139, &v138, 0, _linesNumb)) { + if (_vm->_objectsManager._lastLine < v138) { v66 = GENIAL(v138, v139, v65, a4, a3, a4, v117, _vm->_globals.essai2, 3); if (v66 == -1) goto LABEL_242; @@ -2855,12 +2855,12 @@ LABEL_235: if (NVPY != -1) { v54 = NVPX; v93 = NVPY; - colResult = colision2_ligne(NVPX, NVPY, &v139, &v138, 0, _vm->_objectsManager.DERLIGNE); + colResult = colision2_ligne(NVPX, NVPY, &v139, &v138, 0, _vm->_objectsManager._lastLine); goto LABEL_235; } } } - if (v138 <= _vm->_objectsManager.DERLIGNE) + if (v138 <= _vm->_objectsManager._lastLine) goto LABEL_249; } v68 = v117; @@ -2946,7 +2946,7 @@ int LinesManager::VERIF_SMOOTH(int a1, int a2, int a3, int a4) { v12 = 1000 * a2 / 1000; v14 = 0; if (v13 + 1 > 0) { - while (!colision2_ligne(v9, v12, &v18, &v17, 0, TOTAL_LIGNES) || v17 > _vm->_objectsManager.DERLIGNE) { + while (!colision2_ligne(v9, v12, &v18, &v17, 0, _linesNumb) || v17 > _vm->_objectsManager._lastLine) { v7 += v16; v8 += v15; v9 = v7 / 1000; @@ -3439,8 +3439,8 @@ int LinesManager::TEST_LIGNE(int a1, int a2, int *a3, int *a4, int *a5) { int v28; v26 = 0; - v25 = _vm->_objectsManager.DERLIGNE + 1; - for (i = (int)(_vm->_objectsManager.DERLIGNE + 1); i < _vm->_linesManager.TOTAL_LIGNES + 1; i = v25) { + v25 = _vm->_objectsManager._lastLine + 1; + for (i = (int)(_vm->_objectsManager._lastLine + 1); i < _vm->_linesManager._linesNumb + 1; i = v25) { v6 = i; v7 = Ligne[i].lineData; v8 = Ligne[v6].field0; @@ -3475,7 +3475,7 @@ LABEL_12: v16 = v24; if (Ligne[v16].field6 == 3 || Ligne[v16].field8 == 7) v13 += 2; - if (!colision2_ligne(v13, v14, &v28, &v27, 0, _vm->_objectsManager.DERLIGNE)) + if (!colision2_ligne(v13, v14, &v28, &v27, 0, _vm->_objectsManager._lastLine)) error("error"); *a4 = v27; *a5 = v28; @@ -3490,7 +3490,7 @@ LABEL_12: v21 = v24; if (Ligne[v21].field6 == 3 || Ligne[v21].field8 == 7) v18 -= 2; - if (!colision2_ligne(v18, v19, &v28, &v27, 0, _vm->_objectsManager.DERLIGNE)) + if (!colision2_ligne(v18, v19, &v28, &v27, 0, _vm->_objectsManager._lastLine)) error("erreure"); *a4 = v27; *a5 = v28; diff --git a/engines/hopkins/lines.h b/engines/hopkins/lines.h index ab32a28f8a..e951fcd4a2 100644 --- a/engines/hopkins/lines.h +++ b/engines/hopkins/lines.h @@ -58,7 +58,7 @@ public: LigneItem Ligne[400]; SmoothItem SMOOTH[4000]; int next_ligne; - int TOTAL_LIGNES; + int _linesNumb; int NV_LIGNEDEP; int NV_LIGNEOFS; int NV_POSI; diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 818f8c6535..8cc859be78 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -43,7 +43,7 @@ ObjectsManager::ObjectsManager() { _oldBorderSpriteIndex = 0; _borderPos = Common::Point(0, 0); _borderSpriteIndex = 0; - SL_X = SL_Y = 0; + _saveLoadX = _saveLoadY = 0; I_old_x = I_old_y = 0; g_old_x = g_old_y = 0; FLAG_VISIBLE_EFFACE = 0; @@ -52,15 +52,13 @@ ObjectsManager::ObjectsManager() { _spritePtr = g_PTRNUL; S_old_spr = g_PTRNUL; PERSO_ON = false; - SL_FLAG = false; + _saveLoadFl = false; SL_MODE = false; _visibleFl = false; _disableCursorFl = false; BOBTOUS = false; my_anim = 0; NUMZONE = 0; - ARRET_PERSO_FLAG = 0; - ARRET_PERSO_NUM = 0; _forceZoneFl = false; _changeVerbFl = false; _verb = 0; @@ -68,7 +66,7 @@ ObjectsManager::ObjectsManager() { SPEED_X = SPEED_Y = 0; SPEED_IMAGE = 0; SPEED_PTR = g_PTRNUL; - DERLIGNE = 0; + _lastLine = 0; A_ANIM = 0; MA_ANIM = 0; MA_ANIM1 = 0; @@ -308,50 +306,27 @@ int ObjectsManager::addObject(int objIndex) { * Display Sprite */ void ObjectsManager::displaySprite() { - int v1; - int v2; - int destX; - int destY; - int v6; - int v7; - int v8; - int v9; - int v11; - uint16 *v12; - int v13; - int y1_1; - int y1_2; - int v25; - int v27; - int x1_1; - int x1_2; + int clipX; + int clipY; + bool loopCondFl; uint16 arr[50]; // Handle copying any background areas that text are going to be drawn on - _vm->_globals.NBTRI = 0; + _vm->_globals._sortedDisplayCount = 0; for (int idx = 0; idx <= 10; ++idx) { if (_vm->_fontManager._textList[idx]._enabledFl && _vm->_fontManager._text[idx]._textType != 2) { - v1 = _vm->_fontManager._textList[idx]._pos.x; - x1_1 = v1 - 2; - - if ((int16)(v1 - 2) < _vm->_graphicsManager.min_x) - x1_1 = _vm->_graphicsManager.min_x; - v2 = _vm->_fontManager._textList[idx]._pos.y; - y1_1 = v2 - 2; - - if ((int16)(v2 - 2) < _vm->_graphicsManager.min_y) - y1_1 = _vm->_graphicsManager.min_y; - destX = v1 - 2; - if (destX < _vm->_graphicsManager.min_x) - destX = _vm->_graphicsManager.min_x; - destY = v2 - 2; - if (destY < _vm->_graphicsManager.min_y) - destY = _vm->_graphicsManager.min_y; - - _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, x1_1, y1_1, + clipX = _vm->_fontManager._textList[idx]._pos.x - 2; + + if (clipX < _vm->_graphicsManager.min_x) + clipX = _vm->_graphicsManager.min_x; + + clipY = _vm->_fontManager._textList[idx]._pos.y - 2; + if (clipY < _vm->_graphicsManager.min_y) + clipY = _vm->_graphicsManager.min_y; + + _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, clipX, clipY, _vm->_fontManager._textList[idx]._width + 4, _vm->_fontManager._textList[idx]._height + 4, - _vm->_graphicsManager._vesaBuffer, - destX, destY); + _vm->_graphicsManager._vesaBuffer, clipX, clipY); _vm->_fontManager._textList[idx]._enabledFl = false; } } @@ -359,24 +334,17 @@ void ObjectsManager::displaySprite() { if (!PERSO_ON) { for (int idx = 0; idx < MAX_SPRITE; ++idx) { if (_vm->_globals.Liste[idx].field0) { - v6 = _vm->_globals.Liste[idx].field2; - x1_2 = v6 - 2; - if ((int16)(v6 - 2) < _vm->_graphicsManager.min_x) - x1_2 = _vm->_graphicsManager.min_x; - v7 = _vm->_globals.Liste[idx].field4; - y1_2 = v7 - 2; - if ((int16)(v7 - 2) < _vm->_graphicsManager.min_y) - y1_2 = _vm->_graphicsManager.min_y; - v8 = v6 - 2; - if (v8 < _vm->_graphicsManager.min_x) - v8 = _vm->_graphicsManager.min_x; - v9 = v7 - 2; - if (v9 < _vm->_graphicsManager.min_y) - v9 = _vm->_graphicsManager.min_y; - - _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, x1_2, y1_2, + clipX = _vm->_globals.Liste[idx].field2 - 2; + if (clipX < _vm->_graphicsManager.min_x) + clipX = _vm->_graphicsManager.min_x; + + clipY = _vm->_globals.Liste[idx].field4 - 2; + if (clipY < _vm->_graphicsManager.min_y) + clipY = _vm->_graphicsManager.min_y; + + _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, clipX, clipY, _vm->_globals.Liste[idx]._width + 4, _vm->_globals.Liste[idx]._height + 4, - _vm->_graphicsManager._vesaBuffer, v8, v9); + _vm->_graphicsManager._vesaBuffer, clipX, clipY); _vm->_globals.Liste[idx].field0 = false; } } @@ -392,93 +360,89 @@ void ObjectsManager::displaySprite() { if (_sprite[idx]._animationType == 1) { computeSprite(idx); if (_sprite[idx].field2A) - AvantTri(TRI_SPRITE, idx, _sprite[idx]._height + _sprite[idx].field2E); + beforeSort(SORT_SPRITE, idx, _sprite[idx]._height + _sprite[idx].field2E); } } if (_vm->_globals._cacheFl) - VERIFCACHE(); + checkCache(); } - if (_priorityFl && _vm->_globals.NBTRI) { + if (_priorityFl && _vm->_globals._sortedDisplayCount) { for (int v33 = 1; v33 <= 48; v33++) arr[v33] = v33; - v25 = _vm->_globals.NBTRI; do { - v27 = 0; - if (v25 > 1) { - for (int v34 = 1; v34 < _vm->_globals.NBTRI; v34++) { - v11 = arr[v34]; - v12 = &arr[v34 + 1]; - if (_vm->_globals.Tri[arr[v34]]._priority > _vm->_globals.Tri[*v12]._priority) { - arr[v34] = *v12; - *v12 = v11; - ++v27; - } + loopCondFl = false; + for (int v34 = 1; v34 < _vm->_globals._sortedDisplayCount; v34++) { + if (_vm->_globals._sortedDisplay[arr[v34]]._priority > _vm->_globals._sortedDisplay[arr[v34 + 1]]._priority) { + int oldIdx = arr[v34]; + arr[v34] = arr[v34 + 1]; + arr[v34 + 1] = oldIdx; + loopCondFl = true; } } - } while (v27); + } while (loopCondFl); - for (int v35 = 1; v35 < _vm->_globals.NBTRI + 1; v35++) { - v13 = arr[v35]; - switch (_vm->_globals.Tri[v13]._triMode) { - case TRI_BOB: - DEF_BOB(_vm->_globals.Tri[v13]._index); + for (int sortIdx = 1; sortIdx < _vm->_globals._sortedDisplayCount + 1; sortIdx++) { + int idx = arr[sortIdx]; + switch (_vm->_globals._sortedDisplay[idx]._sortMode) { + case SORT_BOB: + DEF_BOB(_vm->_globals._sortedDisplay[idx]._index); break; - case TRI_SPRITE: - DEF_SPRITE(_vm->_globals.Tri[v13]._index); + case SORT_SPRITE: + DEF_SPRITE(_vm->_globals._sortedDisplay[idx]._index); break; - case TRI_CACHE: - DEF_CACHE(_vm->_globals.Tri[v13]._index); + case SORT_CACHE: + DEF_CACHE(_vm->_globals._sortedDisplay[idx]._index); break; default: break; } - _vm->_globals.Tri[v13]._triMode = TRI_NONE; + _vm->_globals._sortedDisplay[idx]._sortMode = SORT_NONE; } } else { - for (int idx = 1; idx < (_vm->_globals.NBTRI + 1); ++idx) { - switch (_vm->_globals.Tri[idx]._triMode) { - case TRI_BOB: - DEF_BOB(_vm->_globals.Tri[idx]._index); + for (int idx = 1; idx < (_vm->_globals._sortedDisplayCount + 1); ++idx) { + switch (_vm->_globals._sortedDisplay[idx]._sortMode) { + case SORT_BOB: + DEF_BOB(_vm->_globals._sortedDisplay[idx]._index); break; - case TRI_SPRITE: - DEF_SPRITE(_vm->_globals.Tri[idx]._index); + case SORT_SPRITE: + DEF_SPRITE(_vm->_globals._sortedDisplay[idx]._index); break; - case TRI_CACHE: - DEF_CACHE(_vm->_globals.Tri[idx]._index); + case SORT_CACHE: + DEF_CACHE(_vm->_globals._sortedDisplay[idx]._index); break; default: break; } - _vm->_globals.Tri[idx]._triMode = TRI_NONE; + _vm->_globals._sortedDisplay[idx]._sortMode = SORT_NONE; } } // Reset the Tri array for (int idx = 0; idx < 50; ++idx) { - _vm->_globals.Tri[idx]._triMode = TRI_NONE; - _vm->_globals.Tri[idx]._index = 0; - _vm->_globals.Tri[idx]._priority = 0; + _vm->_globals._sortedDisplay[idx]._sortMode = SORT_NONE; + _vm->_globals._sortedDisplay[idx]._index = 0; + _vm->_globals._sortedDisplay[idx]._priority = 0; } - _vm->_globals.NBTRI = 0; + _vm->_globals._sortedDisplayCount = 0; if (_vm->_dialogsManager._inventDisplayedFl) { _vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager._vesaBuffer, _vm->_dialogsManager._inventWin1, _vm->_dialogsManager._inventX, _vm->_dialogsManager._inventY, _vm->_dialogsManager._inventWidth, _vm->_dialogsManager._inventHeight); if (_oldBorderPos.x && _oldBorderPos.y) _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_dialogsManager._inventBuf2, _oldBorderPos.x + 300, _oldBorderPos.y + 300, _oldBorderSpriteIndex + 1); if (_borderPos.x && _borderPos.y) _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_dialogsManager._inventBuf2, _borderPos.x + 300, _borderPos.y + 300, _borderSpriteIndex); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_dialogsManager._inventX, _vm->_dialogsManager._inventY, _vm->_dialogsManager._inventX + _vm->_dialogsManager._inventWidth, _vm->_dialogsManager._inventY + _vm->_dialogsManager._inventHeight); + _vm->_graphicsManager.addVesaSegment(_vm->_dialogsManager._inventX, _vm->_dialogsManager._inventY, _vm->_dialogsManager._inventX + _vm->_dialogsManager._inventWidth, _vm->_dialogsManager._inventY + _vm->_dialogsManager._inventHeight); } - if (SL_FLAG) { + if (_saveLoadFl) { _vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager._vesaBuffer, SL_SPR, _vm->_eventsManager._startPos.x + 183, 60, 274, 353); - if (SL_X && SL_Y) - _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, SL_SPR2, SL_X + _vm->_eventsManager._startPos.x + 300, SL_Y + 300, 0); + if (_saveLoadX && _saveLoadY) + _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, SL_SPR2, _saveLoadX + _vm->_eventsManager._startPos.x + 300, _saveLoadY + 300, 0); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_eventsManager._startPos.x + 183, 60, _vm->_eventsManager._startPos.x + 457, 413); + _vm->_graphicsManager.addVesaSegment(_vm->_eventsManager._startPos.x + 183, 60, _vm->_eventsManager._startPos.x + 457, 413); } // If the Options dialog is activated, draw the elements @@ -499,7 +463,7 @@ void ObjectsManager::displaySprite() { _vm->_eventsManager._startPos.x + 600, 522, _vm->_globals._menuDisplayType); _vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_globals.OPTION_SPR, _vm->_eventsManager._startPos.x + 611, 502, _vm->_globals._menuScrollSpeed); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_eventsManager._startPos.x + 164, 107, _vm->_eventsManager._startPos.x + 498, 320); + _vm->_graphicsManager.addVesaSegment(_vm->_eventsManager._startPos.x + 164, 107, _vm->_eventsManager._startPos.x + 498, 320); } // Loop to draw any on-screen text @@ -624,7 +588,7 @@ void ObjectsManager::DEF_BOB(int idx) { _vm->_globals.Liste2[idx]._visibleFl = false; if (_vm->_globals.Liste2[idx]._visibleFl) - _vm->_graphicsManager.Ajoute_Segment_Vesa( + _vm->_graphicsManager.addVesaSegment( _vm->_globals.Liste2[idx]._xp, _vm->_globals.Liste2[idx]._yp, _vm->_globals.Liste2[idx]._xp + _vm->_globals.Liste2[idx]._width, @@ -821,7 +785,7 @@ void ObjectsManager::CALCUL_BOB(int idx) { _vm->_globals._bob[idx]._oldHeight = height; } -void ObjectsManager::VERIFCACHE() { +void ObjectsManager::checkCache() { for (int v8 = 0; v8 <= 19; v8++) { if (_vm->_globals.Cache[v8].fieldA <= 0) continue; @@ -872,7 +836,7 @@ void ObjectsManager::VERIFCACHE() { if (v5 > 440) v5 = 500; - AvantTri(TRI_CACHE, v8, v5); + beforeSort(SORT_CACHE, v8, v5); _vm->_globals.Cache[v8].fieldA = 1; _vm->_globals.Cache[v8].field10 = true; } @@ -913,7 +877,7 @@ void ObjectsManager::DEF_SPRITE(int idx) { _vm->_globals.Liste[idx].field0 = false; if (_vm->_globals.Liste[idx].field0) - _vm->_graphicsManager.Ajoute_Segment_Vesa( _vm->_globals.Liste[idx].field2, _vm->_globals.Liste[idx].field4, + _vm->_graphicsManager.addVesaSegment( _vm->_globals.Liste[idx].field2, _vm->_globals.Liste[idx].field4, _vm->_globals.Liste[idx].field2 + _vm->_globals.Liste[idx]._width, _vm->_globals.Liste[idx].field4 + _vm->_globals.Liste[idx]._height); } @@ -922,7 +886,7 @@ void ObjectsManager::DEF_CACHE(int idx) { _vm->_globals.Cache[idx]._x + 300, _vm->_globals.Cache[idx]._y + 300, _vm->_globals.Cache[idx]._spriteIndex); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_globals.Cache[idx]._x, _vm->_globals.Cache[idx]._y, + _vm->_graphicsManager.addVesaSegment(_vm->_globals.Cache[idx]._x, _vm->_globals.Cache[idx]._y, _vm->_globals.Cache[idx]._x + _vm->_globals.Cache[idx]._width, _vm->_globals.Cache[idx]._y + _vm->_globals.Cache[idx]._height); } @@ -1019,17 +983,17 @@ void ObjectsManager::computeSprite(int idx) { } // Before Sort -int ObjectsManager::AvantTri(TriMode triMode, int index, int priority) { +int ObjectsManager::beforeSort(SortMode triMode, int index, int priority) { int result; - ++_vm->_globals.NBTRI; - if (_vm->_globals.NBTRI > 48) + ++_vm->_globals._sortedDisplayCount; + if (_vm->_globals._sortedDisplayCount > 48) error("NBTRI too high"); - result = _vm->_globals.NBTRI; - _vm->_globals.Tri[result]._triMode = triMode; - _vm->_globals.Tri[result]._index = index; - _vm->_globals.Tri[result]._priority = priority; + result = _vm->_globals._sortedDisplayCount; + _vm->_globals._sortedDisplay[result]._sortMode = triMode; + _vm->_globals._sortedDisplay[result]._index = index; + _vm->_globals._sortedDisplay[result]._priority = priority; return result; } @@ -1198,7 +1162,7 @@ void ObjectsManager::displayBobAnim() { v19 = 600; if (_vm->_globals._bob[i]._activeFl) - AvantTri(TRI_BOB, i, v19); + beforeSort(SORT_BOB, i, v19); } } } @@ -1221,7 +1185,7 @@ void ObjectsManager::displayVBob() { _vm->_globals.VBob[idx]._xp, _vm->_globals.VBob[idx]._yp, width, height); - _vm->_graphicsManager.Ajoute_Segment_Vesa( + _vm->_graphicsManager.addVesaSegment( _vm->_globals.VBob[idx]._xp, _vm->_globals.VBob[idx]._yp, _vm->_globals.VBob[idx]._xp + width, height + _vm->_globals.VBob[idx]._yp); @@ -1251,7 +1215,7 @@ void ObjectsManager::displayVBob() { _vm->_globals.VBob[idx]._surface, _vm->_globals.VBob[idx]._oldX, _vm->_globals.VBob[idx]._oldY, width, height); - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_globals.VBob[idx]._oldX, + _vm->_graphicsManager.addVesaSegment(_vm->_globals.VBob[idx]._oldX, _vm->_globals.VBob[idx]._oldY, _vm->_globals.VBob[idx]._oldX + width, _vm->_globals.VBob[idx]._oldY + height); @@ -1299,7 +1263,7 @@ void ObjectsManager::displayVBob() { _vm->_globals.VBob[idx]._frameIndex); } - _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_globals.VBob[idx]._xp, + _vm->_graphicsManager.addVesaSegment(_vm->_globals.VBob[idx]._xp, _vm->_globals.VBob[idx]._yp , _vm->_globals.VBob[idx]._xp + width, _vm->_globals.VBob[idx]._yp + height); _vm->_globals.VBob[idx].field4 = 2; @@ -2111,8 +2075,8 @@ void ObjectsManager::CHARGE_OBSTACLE(const Common::String &file) { int16 v5; _vm->_linesManager.RESET_OBSTACLE(); - _vm->_linesManager.TOTAL_LIGNES = 0; - DERLIGNE = 0; + _vm->_linesManager._linesNumb = 0; + _lastLine = 0; _vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file); ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename); v4 = 0; @@ -2128,7 +2092,7 @@ void ObjectsManager::CHARGE_OBSTACLE(const Common::String &file) { (int16)READ_LE_UINT16((uint16 *)ptr + v4 + 3), (int16)READ_LE_UINT16((uint16 *)ptr + v4 + 4), 1); - ++_vm->_linesManager.TOTAL_LIGNES; + ++_vm->_linesManager._linesNumb; } v4 += 5; ++v5; @@ -2307,9 +2271,7 @@ void ObjectsManager::PLAN_BETA() { _vm->_globals.NOMARCHE = false; _spritePtr = g_PTRNUL; _vm->_globals._exitId = 0; - _vm->_globals.AFFLI = false; - _vm->_globals.AFFIVBL = false; - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_soundManager.WSOUND(31); _vm->_globals.iRegul = 1; _vm->_graphicsManager.loadImage("PLAN"); @@ -2345,12 +2307,10 @@ void ObjectsManager::PLAN_BETA() { _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0); - _vm->_globals.BPP_NOAFF = true; for (int v4 = 0; v4 <= 4; v4++) _vm->_eventsManager.VBL(); - _vm->_globals.BPP_NOAFF = false; _vm->_globals.iRegul = 1; _vm->_graphicsManager.FADE_INW(); _vm->_eventsManager.changeMouseCursor(4); @@ -2397,7 +2357,6 @@ void ObjectsManager::PLAN_BETA() { _vm->_globals.PLANY = getSpriteY(0); _vm->_globals.PLANI = 1; removeSprite(0); - _vm->_globals.AFFLI = false; _spritePtr = _vm->_globals.freeMemory(_spritePtr); CLEAR_ECRAN(); _vm->_globals.NOSPRECRAN = false; @@ -2582,11 +2541,6 @@ LABEL_65: } _vm->_fontManager.hideText(5); _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); - ARRET_PERSO_FLAG = 0; - if (_vm->_eventsManager._mouseCursorId == 21 && _vm->_globals.BOBZONE[NUMZONE]) { - ARRET_PERSO_FLAG = 1; - ARRET_PERSO_NUM = _vm->_globals.BOBZONE[NUMZONE]; - } if (_vm->_globals._screenId == 20 && _vm->_globals._saveData->data[svField132] == 1 && _vm->_globals._curObjectIndex == 20 && NUMZONE == 12 && _vm->_eventsManager._mouseCursorId == 23) { @@ -2604,8 +2558,6 @@ void ObjectsManager::PARADISE() { int v5; v1 = 0; - ARRET_PERSO_FLAG = 0; - ARRET_PERSO_NUM = 0; result = _vm->_globals._saveData->data[svField1]; if (result && _vm->_globals._saveData->data[svField2] && result != 4 && result > 3) { _vm->_fontManager.hideText(5); @@ -2717,7 +2669,7 @@ void ObjectsManager::CLEAR_ECRAN() { _vm->_animationManager.clearAnim(); _vm->_linesManager.CLEAR_ZONE(); _vm->_linesManager.RESET_OBSTACLE(); - _vm->_globals.RESET_CACHE(); + _vm->_globals.resetCache(); for (int v1 = 0; v1 <= 48; v1++) { _vm->_globals.BOBZONE[v1] = 0; @@ -2732,8 +2684,8 @@ void ObjectsManager::CLEAR_ECRAN() { SPEED_Y = 0; SPEED_IMAGE = 0; _forceZoneFl = true; - _vm->_linesManager.TOTAL_LIGNES = 0; - DERLIGNE = 0; + _vm->_linesManager._linesNumb = 0; + _lastLine = 0; _vm->_globals.chemin = (int16 *)g_PTRNUL; _vm->_globals.COUCOU = _vm->_globals.freeMemory(_vm->_globals.COUCOU); _vm->_globals.SPRITE_ECRAN = _vm->_globals.freeMemory(_vm->_globals.SPRITE_ECRAN); @@ -2766,8 +2718,8 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha CH_TETE = true; _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, 532, 25, 65, 40, _vm->_graphicsManager._vesaBuffer, 532, 25); - _vm->_graphicsManager.Ajoute_Segment_Vesa(532, 25, 597, 65); - _vm->_globals.NOT_VERIF = 1; + _vm->_graphicsManager.addVesaSegment(532, 25, 597, 65); + _vm->_globals.NOT_VERIF = true; _vm->_globals.chemin = (int16 *)g_PTRNUL; if (oldCharacter == CHARACTER_SAMANTHA && newCharacter == CHARACTER_HOPKINS @@ -3038,7 +2990,7 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) { do { v62 = v8; v8 = v62; - if (_vm->_linesManager.colision2_ligne(v75, v7, &v82[5], &v87[5], 0, DERLIGNE) && v87[v62] <= DERLIGNE) + if (_vm->_linesManager.colision2_ligne(v75, v7, &v82[5], &v87[5], 0, _lastLine) && v87[v62] <= _lastLine) break; v82[v62] = 0; v87[v62] = -1; @@ -3054,7 +3006,7 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) { do { v63 = v12; v12 = v63; - if (_vm->_linesManager.colision2_ligne(v75, v11, &v82[1], &v87[1], 0, DERLIGNE) && v87[v63] <= DERLIGNE) + if (_vm->_linesManager.colision2_ligne(v75, v11, &v82[1], &v87[1], 0, _lastLine) && v87[v63] <= _lastLine) break; v82[v63] = 0; v87[v63] = -1; @@ -3074,7 +3026,7 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) { do { v64 = v16; v16 = v64; - if (_vm->_linesManager.colision2_ligne(v15, v74, &v82[3], &v87[3], 0, DERLIGNE) && v87[v64] <= DERLIGNE) + if (_vm->_linesManager.colision2_ligne(v15, v74, &v82[3], &v87[3], 0, _lastLine) && v87[v64] <= _lastLine) break; v82[v64] = 0; v87[v64] = -1; @@ -3096,7 +3048,7 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) { do { v65 = v20; v20 = v65; - if (_vm->_linesManager.colision2_ligne(v19, v74, &v82[7], &v87[7], 0, DERLIGNE) && v87[v65] <= DERLIGNE) + if (_vm->_linesManager.colision2_ligne(v19, v74, &v82[7], &v87[7], 0, _lastLine) && v87[v65] <= _lastLine) break; v82[v65] = 0; v87[v65] = -1; @@ -3148,18 +3100,18 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) { v77[v24] = 1300; v76[v24] = 1300; } - if (_vm->_linesManager.colision2_ligne(a1, a2, &v82[1], &v87[1], 0, DERLIGNE)) { + if (_vm->_linesManager.colision2_ligne(a1, a2, &v82[1], &v87[1], 0, _lastLine)) { v69 = v87[1]; v68 = v82[1]; } else { - if (_vm->_linesManager.colision2_ligne(a1, a2, &v82[1], &v87[1], 0, _vm->_linesManager.TOTAL_LIGNES)) { + if (_vm->_linesManager.colision2_ligne(a1, a2, &v82[1], &v87[1], 0, _vm->_linesManager._linesNumb)) { v27 = 0; for (;;) { v28 = _vm->_globals.essai2[v27]; v29 = _vm->_globals.essai2[v27 + 1]; v66 = _vm->_globals.essai2[v27 + 2]; v27 += 4; - if (_vm->_linesManager.colision2_ligne(v28, v29, &v82[1], &v87[1], 0, DERLIGNE)) + if (_vm->_linesManager.colision2_ligne(v28, v29, &v82[1], &v87[1], 0, _lastLine)) break; v32 = v67; _vm->_globals.super_parcours[v32] = v28; @@ -4331,7 +4283,7 @@ void ObjectsManager::INILINK(const Common::String &file) { for (int idx = 0; idx < 500; ++idx) _vm->_globals.STAILLE[idx] = (int16)READ_LE_UINT16((uint16 *)ptr + idx); - _vm->_globals.RESET_CACHE(); + _vm->_globals.resetCache(); filename2 = Common::String((const char *)ptr + 1000); if (!filename2.empty()) { @@ -4385,7 +4337,7 @@ void ObjectsManager::INILINK(const Common::String &file) { v16 = ptr + idx + 4; v32 = 0; v34 = 0; - _vm->_linesManager.TOTAL_LIGNES = 0; + _vm->_linesManager._linesNumb = 0; do { v27 = (int16)READ_LE_UINT16(v16 + 2 * v32); if (v27 != -1) { @@ -4397,7 +4349,7 @@ void ObjectsManager::INILINK(const Common::String &file) { (int16)READ_LE_UINT16(v16 + 2 * v32 + 6), (int16)READ_LE_UINT16(v16 + 2 * v32 + 8), 1); - ++_vm->_linesManager.TOTAL_LIGNES; + ++_vm->_linesManager._linesNumb; } v32 += 5; ++v34; @@ -4488,10 +4440,8 @@ void ObjectsManager::SPECIAL_INI() { _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0); - _vm->_globals.BPP_NOAFF = true; for (int i = 0; i <= 4; i++) _vm->_eventsManager.VBL(); - _vm->_globals.BPP_NOAFF = false; _vm->_graphicsManager.FADE_INW(); SPRITE_ON(0); for (int i = 0; i <= 4; i++) @@ -4524,10 +4474,8 @@ void ObjectsManager::SPECIAL_INI() { case 18: if (_vm->_globals._prevScreenId == 17) { _vm->_eventsManager._mouseSpriteId = 4; - _vm->_globals.BPP_NOAFF = true; for (int i = 0; i <= 4; i++) _vm->_eventsManager.VBL(); - _vm->_globals.BPP_NOAFF = false; _vm->_graphicsManager.FADE_INW(); _vm->_globals.iRegul = 1; _vm->_globals._disableInventFl = false; @@ -5050,8 +4998,6 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo _vm->_globals.chemin = (int16 *)g_PTRNUL; _vm->_globals.NOMARCHE = true; _vm->_globals._exitId = 0; - _vm->_globals.AFFLI = false; - _vm->_globals.AFFIVBL = false; if (!backgroundFile.empty()) _vm->_graphicsManager.loadImage(backgroundFile); if (!linkFile.empty()) @@ -5077,15 +5023,13 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0); _vm->_eventsManager.changeMouseCursor(4); - _vm->_globals.BPP_NOAFF = true; for (int v6 = 0; v6 <= 4; v6++) _vm->_eventsManager.VBL(); - _vm->_globals.BPP_NOAFF = false; _vm->_graphicsManager.FADE_INW(); if (_vm->_globals._screenId == 61) { _vm->_animationManager.playSequence("OUVRE.SEQ", 10, 4, 10); stopBobAnimation(3); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; g_old_x = getSpriteX(0); _vm->_globals.g_old_sens = -1; _vm->_globals.Compteur = 0; @@ -5093,7 +5037,7 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo v7 = getSpriteY(0); v8 = getSpriteX(0); _vm->_globals.chemin = _vm->_linesManager.PARCOURS2(v8, v7, 330, 345); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; do { GOHOME(); _vm->_eventsManager.VBL(); @@ -5147,9 +5091,7 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm _vm->_graphicsManager._noFadingFl = false; _vm->_globals.NOMARCHE = false; _vm->_globals._exitId = 0; - _vm->_globals.AFFLI = false; - _vm->_globals.AFFIVBL = false; - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_soundManager.WSOUND(v); _vm->_globals.iRegul = 1; if (!backgroundFile.empty()) @@ -5217,12 +5159,10 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm g_old_y = _characterPos.y; _vm->_globals.g_old_sens = -1; _vm->_globals.Compteur = 0; - _vm->_globals.BPP_NOAFF = true; for (int idx = 0; idx < 5; ++idx) _vm->_eventsManager.VBL(); - _vm->_globals.BPP_NOAFF = false; _vm->_globals.iRegul = 1; if (!_vm->_graphicsManager._noFadingFl) _vm->_graphicsManager.FADE_INW(); @@ -5276,7 +5216,6 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm _vm->_graphicsManager.FADE_OUTW(); _vm->_graphicsManager._noFadingFl = false; removeSprite(0); - _vm->_globals.AFFLI = false; if (_twoCharactersFl) { removeSprite(1); _twoCharactersFl = false; diff --git a/engines/hopkins/objects.h b/engines/hopkins/objects.h index 7f50a20232..5067e8f0ec 100644 --- a/engines/hopkins/objects.h +++ b/engines/hopkins/objects.h @@ -68,7 +68,7 @@ public: int _oldBorderSpriteIndex; Common::Point _borderPos; int _borderSpriteIndex; - int SL_X, SL_Y; + int _saveLoadX, _saveLoadY; int I_old_x, I_old_y; int g_old_x, g_old_y; int FLAG_VISIBLE_EFFACE; @@ -77,15 +77,13 @@ public: byte *_spritePtr; const byte *S_old_spr; bool PERSO_ON; - bool SL_FLAG; + bool _saveLoadFl; int SL_MODE; bool _visibleFl; bool _disableCursorFl; bool BOBTOUS; int my_anim; int NUMZONE; - int ARRET_PERSO_FLAG; - int ARRET_PERSO_NUM; bool _forceZoneFl; bool _changeVerbFl; int _verb; @@ -93,7 +91,7 @@ public: int SPEED_X, SPEED_Y; int SPEED_IMAGE; byte *SPEED_PTR; - int DERLIGNE; + int _lastLine; int A_ANIM; int MA_ANIM; int MA_ANIM1; @@ -151,11 +149,11 @@ public: void SCBOB(int idx); void CALCUL_BOB(int idx); - void VERIFCACHE(); + void checkCache(); void DEF_SPRITE(int idx); void DEF_CACHE(int idx); void computeSprite(int idx); - int AvantTri(TriMode triMode, int index, int priority); + int beforeSort(SortMode triMode, int index, int priority); void displayBobAnim(); void displayVBob(); diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index e1e0ac70b6..1add672380 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -735,7 +735,7 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 46: { - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_globals.chemin = (int16 *)g_PTRNUL; int v13 = _vm->_objectsManager.getSpriteY(0); int v14 = _vm->_objectsManager.getSpriteX(0); @@ -749,7 +749,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager.VBL(); } while (_vm->_globals.chemin != (int16 *)g_PTRNUL); _vm->_objectsManager.removeSprite(0); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_soundManager.loadSample(1, "SOUND44.WAV"); _vm->_soundManager.loadSample(2, "SOUND45.WAV"); _vm->_objectsManager.OPTI_BOBON(9, 10, -1, 0, 0, 0, 0); @@ -948,7 +948,7 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 59: { - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_objectsManager.g_old_x = _vm->_objectsManager.getSpriteX(0); _vm->_globals.g_old_sens = -1; _vm->_globals.Compteur = 0; @@ -956,7 +956,7 @@ int ScriptManager::handleOpcode(byte *dataP) { int v16 = _vm->_objectsManager.getSpriteY(0); int v17 = _vm->_objectsManager.getSpriteX(0); _vm->_globals.chemin = _vm->_linesManager.PARCOURS2(v17, v16, 445, 332); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1050,7 +1050,7 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 81: { - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_objectsManager.g_old_x = _vm->_objectsManager.getSpriteX(0); _vm->_globals.g_old_sens = -1; _vm->_globals.Compteur = 0; @@ -1058,7 +1058,7 @@ int ScriptManager::handleOpcode(byte *dataP) { int v22 = _vm->_objectsManager.getSpriteY(0); int v23 = _vm->_objectsManager.getSpriteX(0); _vm->_globals.chemin = _vm->_linesManager.PARCOURS2(v23, v22, 119, 268); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1371,7 +1371,7 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 105: - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_objectsManager.g_old_x = _vm->_objectsManager.getSpriteX(0); _vm->_globals.g_old_sens = -1; _vm->_globals.Compteur = 0; @@ -1391,7 +1391,7 @@ int ScriptManager::handleOpcode(byte *dataP) { int v32 = _vm->_objectsManager.getSpriteX(0); _vm->_globals.chemin = _vm->_linesManager.PARCOURS2(v32, v31, 211, 393); } - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1624,16 +1624,16 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_globals.NOPARLE = true; _vm->_talkManager.PARLER_PERSO("gred1.pe2"); _vm->_globals.NOPARLE = false; - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_objectsManager.g_old_x = _vm->_objectsManager.getSpriteX(0); _vm->_globals.g_old_sens = -1; _vm->_globals.Compteur = 0; _vm->_globals.chemin = (int16 *)g_PTRNUL; - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; int v55 = _vm->_objectsManager.getSpriteY(0); int v56 = _vm->_objectsManager.getSpriteX(0); _vm->_globals.chemin = _vm->_linesManager.PARCOURS2(v56, v55, 361, 325); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_objectsManager.NUMZONE = -1; do { if (_vm->shouldQuit()) @@ -1654,16 +1654,16 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_globals.NOPARLE = true; _vm->_talkManager.PARLER_PERSO("gbleu1.pe2"); _vm->_globals.NOPARLE = false; - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_objectsManager.g_old_x = _vm->_objectsManager.getSpriteX(0); _vm->_globals.g_old_sens = -1; _vm->_globals.Compteur = 0; _vm->_globals.chemin = (int16 *)g_PTRNUL; - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; int v57 = _vm->_objectsManager.getSpriteY(0); int v58 = _vm->_objectsManager.getSpriteX(0); _vm->_globals.chemin = _vm->_linesManager.PARCOURS2(v58, v57, 361, 325); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_objectsManager.NUMZONE = -1; do { if (_vm->shouldQuit()) @@ -1837,12 +1837,12 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager._disableEscKeyFl = false; _vm->_soundManager.SPECIAL_SOUND = 0; } - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_globals.chemin = (int16 *)g_PTRNUL; int v37 = _vm->_objectsManager.getSpriteY(0); int v38 = _vm->_objectsManager.getSpriteX(0); _vm->_globals.chemin = _vm->_linesManager.PARCOURS2(v38, v37, 330, 418); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_objectsManager.NUMZONE = 0; do { if (_vm->shouldQuit()) @@ -1872,12 +1872,12 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.stopBobAnimation(1); _vm->_globals.NO_VISU = true; _vm->_globals.chemin = (int16 *)g_PTRNUL; - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; int v39 = _vm->_objectsManager.getSpriteY(0); int v40 = _vm->_objectsManager.getSpriteX(0); _vm->_globals.chemin = _vm->_linesManager.PARCOURS2(v40, v39, 330, 314); _vm->_objectsManager.NUMZONE = 0; - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; do { if (_vm->shouldQuit()) return -1; // Exiting game @@ -1968,16 +1968,16 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.INILINK("IM93a"); _vm->_objectsManager.OBSSEUL = 0; _vm->_globals.CACHE_ON(); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; _vm->_objectsManager.g_old_x = _vm->_objectsManager.getSpriteX(0); _vm->_globals.g_old_sens = -1; _vm->_globals.Compteur = 0; _vm->_globals.chemin = (int16 *)g_PTRNUL; - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; int v43 = _vm->_objectsManager.getSpriteY(0); int v44 = _vm->_objectsManager.getSpriteX(0); _vm->_globals.chemin = _vm->_linesManager.PARCOURS2(v44, v43, 488, 280); - _vm->_globals.NOT_VERIF = 1; + _vm->_globals.NOT_VERIF = true; do { if (_vm->shouldQuit()) return -1; // Exiting game diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index b2ead64e87..1a1778913e 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -1083,7 +1083,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { _vm->_graphicsManager.no_scroll = 1; _vm->_linesManager.CLEAR_ZONE(); _vm->_linesManager.RESET_OBSTACLE(); - _vm->_globals.RESET_CACHE(); + _vm->_globals.resetCache(); for (int i = 0; i <= 44; i++) _vm->_globals.BOBZONE[i] = 0; @@ -1166,7 +1166,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { _vm->_globals.NECESSAIRE = false; _vm->_linesManager.CLEAR_ZONE(); _vm->_linesManager.RESET_OBSTACLE(); - _vm->_globals.RESET_CACHE(); + _vm->_globals.resetCache(); for (int i = 0; i <= 44; i++) _vm->_globals.BOBZONE[i] = 0; |