From d274441e12e7112620747a5129bb2af77cdb852f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 11 Dec 2012 08:31:07 +0100 Subject: HOPKINS: Some more renaming --- engines/hopkins/anim.cpp | 84 +++++++-------- engines/hopkins/computer.cpp | 10 +- engines/hopkins/dialogs.cpp | 30 +++--- engines/hopkins/events.cpp | 74 +++++++------ engines/hopkins/events.h | 22 ++-- engines/hopkins/hopkins.cpp | 28 ++--- engines/hopkins/menu.cpp | 4 +- engines/hopkins/objects.cpp | 240 +++++++++++++++++++++---------------------- engines/hopkins/script.cpp | 2 +- engines/hopkins/sound.cpp | 2 +- engines/hopkins/talk.cpp | 22 ++-- 11 files changed, 259 insertions(+), 259 deletions(-) (limited to 'engines') diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index f9b47d4cbf..1558069e6b 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -106,7 +106,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui _vm->_graphicsManager.DD_Unlock(); _vm->_graphicsManager.DD_VBL(); } - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_eventsManager._escKeyFl = false; _vm->_soundManager.LOAD_ANM_SOUND(); @@ -116,11 +116,11 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui if (_vm->_eventsManager._escKeyFl) goto EXIT; - _vm->_eventsManager.CONTROLE_MES(); - } while (!_vm->shouldQuit() && _vm->_eventsManager.lItCounter < rate1); + _vm->_eventsManager.refreshEvents(); + } while (!_vm->shouldQuit() && _vm->_eventsManager._rateCounter < rate1); } - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; breakFlag = false; frameNumber = 0; while (!_vm->shouldQuit()) { @@ -143,12 +143,12 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui if (_vm->_eventsManager._escKeyFl) goto EXIT; - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - } while (!_vm->shouldQuit() && _vm->_eventsManager.lItCounter < rate2); + } while (!_vm->shouldQuit() && _vm->_eventsManager._rateCounter < rate2); } - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_graphicsManager.DD_Lock(); if (hasScreenCopy) { if (*screenP != kByteStop) { @@ -175,12 +175,12 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui if (_vm->_eventsManager._escKeyFl) break; - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - } while (_vm->_eventsManager.lItCounter < rate3); + } while (_vm->_eventsManager._rateCounter < rate3); } - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_soundManager.VERIF_SOUND(); EXIT: if (_vm->_graphicsManager.FADE_LINUX == 2 && !hasScreenCopy) { @@ -312,7 +312,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint _vm->_graphicsManager.DD_Unlock(); _vm->_graphicsManager.DD_VBL(); } - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_eventsManager._escKeyFl = false; _vm->_soundManager.LOAD_ANM_SOUND(); if (_vm->_globals.iRegul != 1) @@ -322,8 +322,8 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint goto LABEL_114; if (redrawAnim() == true) break; - _vm->_eventsManager.CONTROLE_MES(); - if (_vm->_eventsManager.lItCounter >= a2) + _vm->_eventsManager.refreshEvents(); + if (_vm->_eventsManager._rateCounter >= a2) goto LABEL_48; } if (_vm->_graphicsManager.NOLOCK == true) @@ -384,7 +384,7 @@ LABEL_112: _vm->_graphicsManager.FADE_INS(); } LABEL_48: - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; v5 = 0; v15 = 0; for (;;) { @@ -405,7 +405,7 @@ LABEL_48: if (_vm->_globals.iRegul == 1) break; LABEL_77: - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_graphicsManager.DD_Lock(); if (v8) { if (*v12 != kByteStop) { @@ -481,9 +481,9 @@ LABEL_88: } goto LABEL_112; } - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - if (_vm->_eventsManager.lItCounter >= a4) + if (_vm->_eventsManager._rateCounter >= a4) goto LABEL_114; } } @@ -544,9 +544,9 @@ LABEL_88: } goto LABEL_112; } - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - if (_vm->_eventsManager.lItCounter >= a3) + if (_vm->_eventsManager._rateCounter >= a3) goto LABEL_77; } LABEL_114: @@ -998,7 +998,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui _vm->_graphicsManager.DD_VBL(); } if (_vm->getIsDemo()) { - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_eventsManager._escKeyFl = false; _vm->_soundManager.LOAD_ANM_SOUND(); if (_vm->_globals.iRegul == 1) { @@ -1008,14 +1008,14 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui goto LABEL_59; _vm->_eventsManager._escKeyFl = false; } - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - } while (_vm->_eventsManager.lItCounter < rate1); + } while (_vm->_eventsManager._rateCounter < rate1); } } else { if (NO_COUL) _vm->_graphicsManager.FADE_INW_LINUX(v9); - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_eventsManager._escKeyFl = false; _vm->_soundManager.LOAD_ANM_SOUND(); if (_vm->_globals.iRegul == 1) { @@ -1025,12 +1025,12 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui goto LABEL_59; _vm->_eventsManager._escKeyFl = false; } - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - } while (_vm->_eventsManager.lItCounter < rate1); + } while (_vm->_eventsManager._rateCounter < rate1); } } - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; readError = false; soundNumber = 0; do { @@ -1051,11 +1051,11 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui goto LABEL_59; _vm->_eventsManager._escKeyFl = false; } - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - } while (_vm->_eventsManager.lItCounter < rate2); + } while (_vm->_eventsManager._rateCounter < rate2); } - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_graphicsManager.DD_Lock(); if (v7) { if (*v9 != kByteStop) { @@ -1084,11 +1084,11 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui goto LABEL_59; _vm->_eventsManager._escKeyFl = false; } - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - } while (_vm->_eventsManager.lItCounter < rate3); + } while (_vm->_eventsManager._rateCounter < rate3); } - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; LABEL_59: _vm->_graphicsManager.NOLOCK = false; f.close(); @@ -1171,7 +1171,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u _vm->_graphicsManager.DD_Unlock(); _vm->_graphicsManager.DD_VBL(); } - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_eventsManager._escKeyFl = false; _vm->_soundManager.LOAD_ANM_SOUND(); if (_vm->_globals.iRegul != 1) @@ -1181,9 +1181,9 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u goto LABEL_54; if (redrawAnim() == true) break; - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - if (_vm->_eventsManager.lItCounter >= rate1) + if (_vm->_eventsManager._rateCounter >= rate1) goto LABEL_23; } LABEL_48: @@ -1195,7 +1195,7 @@ LABEL_48: f.close(); } LABEL_23: - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; v4 = false; v13 = 0; while (!_vm->shouldQuit()) { @@ -1213,7 +1213,7 @@ LABEL_23: if (_vm->_globals.iRegul == 1) break; LABEL_33: - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; _vm->_graphicsManager.DD_Lock(); if (v7) { if (*v10 != kByteStop) { @@ -1238,23 +1238,23 @@ LABEL_44: while (_vm->_eventsManager._escKeyFl != true) { if (redrawAnim() == true) goto LABEL_48; - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.VERIF_SOUND(); - if (_vm->_eventsManager.lItCounter >= rate3) + if (_vm->_eventsManager._rateCounter >= rate3) goto LABEL_53; } } else { LABEL_53: - _vm->_eventsManager.lItCounter = 0; + _vm->_eventsManager._rateCounter = 0; } goto LABEL_54; } } while (_vm->_eventsManager._escKeyFl != true) { - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); if (redrawAnim() == true) goto LABEL_48; - if (_vm->_eventsManager.lItCounter >= rate2) + if (_vm->_eventsManager._rateCounter >= rate2) goto LABEL_33; } LABEL_54: diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp index 4f818770f7..1c8080aeef 100644 --- a/engines/hopkins/computer.cpp +++ b/engines/hopkins/computer.cpp @@ -236,7 +236,7 @@ void ComputerManager::showComputer(ComputerEnum mode) { bool numericFlag = false; char v12; do { - v12 = _vm->_eventsManager.keywin(); + v12 = _vm->_eventsManager.waitKeyPress(); if (_vm->shouldQuit()) return; @@ -366,7 +366,7 @@ void ComputerManager::TXT4(int xp, int yp, int textIdx) { _vm->_fontManager.TEXT_NOW(xp, yp, "_", -4); do { - curChar = _vm->_eventsManager.keywin(); + curChar = _vm->_eventsManager.waitKeyPress(); if (_vm->shouldQuit()) return; @@ -581,7 +581,7 @@ void ComputerManager::readText(int idx) { ++v10; } while (v4 != 37); - _vm->_eventsManager.keywin(); + _vm->_eventsManager.waitKeyPress(); _vm->_globals.dos_free2(ptr); } @@ -915,7 +915,7 @@ int ComputerManager::displayHiscores() { _vm->_graphicsManager.RESET_SEGMENT_VESA(); buttonIndex = 0; do { - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); xp = _vm->_eventsManager.getMouseX(); yp = _vm->_eventsManager.getMouseY(); @@ -951,7 +951,7 @@ void ComputerManager::getScoreName() { for (int strPos = 0; strPos <= 4; strPos++) { displayHiscoreLine(ptr, 9 * strPos + 140, 78, 1); - curChar = toupper(_vm->_eventsManager.keywin()); + curChar = toupper(_vm->_eventsManager.waitKeyPress()); if ((curChar <= '/') || (curChar > 'Z')) curChar = ' '; if ((uint16)(curChar - ':') <= 6u) diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 9b842a15c5..7ebcbc8953 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -315,8 +315,8 @@ void DialogsManager::showInventory() { _vm->_dialogsManager._inventWin1 = g_PTRNUL; LABEL_7: - _vm->_eventsManager.souris_bb = 0; - _vm->_eventsManager.souris_b = 0; + _vm->_eventsManager._curMouseButton = 0; + _vm->_eventsManager._mouseButton = 0; _vm->_globals._disableInventFl = true; _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); @@ -369,7 +369,7 @@ LABEL_7: v15 += 38; } _vm->_graphicsManager.Capture_Mem(_vm->_graphicsManager.VESA_BUFFER, _vm->_dialogsManager._inventWin1, _inventX, _inventY, _inventWidth, _inventHeight); - _vm->_eventsManager.souris_bb = 0; + _vm->_eventsManager._curMouseButton = 0; bool v20 = false; int v13 = 0; @@ -386,29 +386,29 @@ LABEL_7: v13 = v11; if (v11 != v10) _vm->_objectsManager.PARAMCADRE(v11); - if (_vm->_eventsManager.btsouris != 16) { - if ((uint16)(_vm->_eventsManager.btsouris - 1) > 1u) { - if (_vm->_eventsManager.btsouris != 3) { + if (_vm->_eventsManager._mouseCursorId != 16) { + if ((uint16)(_vm->_eventsManager._mouseCursorId - 1) > 1u) { + if (_vm->_eventsManager._mouseCursorId != 3) { if (v12 == 2) { _vm->_objectsManager.OBJETPLUS(v13); - if (_vm->_eventsManager.btsouris != 23) - _vm->_eventsManager.changeMouseCursor(_vm->_eventsManager.btsouris); + if (_vm->_eventsManager._mouseCursorId != 23) + _vm->_eventsManager.changeMouseCursor(_vm->_eventsManager._mouseCursorId); } } } } if (v12 == 1) { - if (_vm->_eventsManager.btsouris == 1 || _vm->_eventsManager.btsouris == 16 || !_vm->_eventsManager.btsouris || (uint16)(_vm->_eventsManager.btsouris - 2) <= 1u) + if (_vm->_eventsManager._mouseCursorId == 1 || _vm->_eventsManager._mouseCursorId == 16 || !_vm->_eventsManager._mouseCursorId || (uint16)(_vm->_eventsManager._mouseCursorId - 2) <= 1u) break; v9 = v13; _vm->_objectsManager.VALID_OBJET(_vm->_globals.INVENTAIRE[v13]); - if (_vm->_eventsManager.btsouris == 8) + if (_vm->_eventsManager._mouseCursorId == 8) v20 = true; if (!v20) { _vm->_scriptManager.TRAVAILOBJET = 1; _vm->_globals.SAUVEGARDE->data[svField3] = _vm->_globals.OBJET_EN_COURS; _vm->_globals.SAUVEGARDE->data[svField8] = _vm->_globals.INVENTAIRE[v13]; - _vm->_globals.SAUVEGARDE->data[svField9] = _vm->_eventsManager.btsouris; + _vm->_globals.SAUVEGARDE->data[svField9] = _vm->_eventsManager._mouseCursorId; _vm->_objectsManager.OPTI_OBJET(); _vm->_scriptManager.TRAVAILOBJET = 0; @@ -453,14 +453,14 @@ LABEL_7: _vm->_dialogsManager._inventWin1 = _vm->_globals.dos_free2(_vm->_dialogsManager._inventWin1); _inventBuf2 = _vm->_globals.dos_free2(_inventBuf2); - if (_vm->_eventsManager.btsouris == 1) + if (_vm->_eventsManager._mouseCursorId == 1) showOptionsDialog(); - else if (_vm->_eventsManager.btsouris == 3) + else if (_vm->_eventsManager._mouseCursorId == 3) _vm->_dialogsManager.showLoadGame(); - else if (_vm->_eventsManager.btsouris == 2) + else if (_vm->_eventsManager._mouseCursorId == 2) _vm->_dialogsManager.showSaveGame(); - _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager._mouseCursorId = 4; _vm->_eventsManager.changeMouseCursor(4); _vm->_objectsManager.old_cady = 0; _vm->_objectsManager.cady = 0; diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index f99c1bdb34..7976ba853d 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -38,15 +38,15 @@ EventsManager::EventsManager() { _mouseOffset.x = _mouseOffset.y = 0; _startPos.x = _startPos.y = 0; _breakoutFl = false; - souris_n = 0; - souris_bb = 0; - souris_b = 0; + _mouseSpriteId = 0; + _curMouseButton = 0; + _mouseButton = 0; _mouseCursor = NULL; _gameCounter = 0; - lItCounter = 0; + _rateCounter = 0; _escKeyFl = false; _gameKey = KEY_NONE; - btsouris = 0; + _mouseCursorId = 0; _oldIconId = 0; _objectBuf = NULL; @@ -116,8 +116,8 @@ int EventsManager::getMouseY() { * Get Mouse Button */ int EventsManager::getMouseButton() { - CONTROLE_MES(); - return souris_bb; + refreshEvents(); + return _curMouseButton; } /** @@ -143,23 +143,25 @@ void EventsManager::mouseOn() { void EventsManager::changeMouseCursor(int id) { int cursorId = id; - if (btsouris != 23) { - if (id == 4 && btsouris == 4 && _vm->_globals.NOMARCHE) - cursorId = 0; - if (cursorId == 25) - cursorId = 5; + if (_mouseCursorId != 23) { + if (id == 4 && _mouseCursorId == 4 && _vm->_globals.NOMARCHE) + _mouseCursorId = 0; + if (_mouseCursorId == 25) + _mouseCursorId = 5; - if (_oldIconId != cursorId || !cursorId) { - _oldIconId = cursorId; - souris_n = cursorId; + if (_oldIconId != _mouseCursorId || !_mouseCursorId) { + _oldIconId = _mouseCursorId; + _mouseCursorId = cursorId; updateCursor(); } } } -// Check Events -void EventsManager::CONTROLE_MES() { +/** + * Check Events + */ +void EventsManager::refreshEvents() { _vm->_soundManager.checkSounds(); pollEvents(); @@ -170,7 +172,7 @@ void EventsManager::checkForNextFrameCounter() { uint32 milli = g_system->getMillis(); while ((milli - _priorCounterTime) >= 10) { _priorCounterTime += 10; - lItCounter += 3; + _rateCounter += 3; } // Check for next game frame @@ -211,14 +213,14 @@ void EventsManager::pollEvents() { _keyState[(byte)toupper(event.kbd.ascii)] = false; return; case Common::EVENT_LBUTTONDOWN: - souris_b = 1; + _mouseButton = 1; return; case Common::EVENT_RBUTTONDOWN: - souris_b = 2; + _mouseButton = 2; return; case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONUP: - souris_b = 0; + _mouseButton = 0; return; default: break; @@ -253,7 +255,11 @@ void EventsManager::handleKey(Common::Event &event) { } -int EventsManager::keywin() { +/** + * Waits for a keypress, ignoring mouse events + * @return Keypress, or -1 if game quit was requested + */ +int EventsManager::waitKeyPress() { char foundChar = '\0'; while (!foundChar) { @@ -334,7 +340,7 @@ void EventsManager::VBL() { yp = _mousePos.y; v14 = _mouseSizeX; v13 = _mouseSizeY; - if (btsouris == 23) { + if (_mouseCursorId == 23) { v14 = _vm->_globals.OBJL; v13 = _vm->_globals.OBJH; goto LABEL_35; @@ -373,10 +379,10 @@ LABEL_35: updateCursor(); goto LABEL_54; } - if (btsouris == 23) + if (_mouseCursorId == 23) goto LABEL_45; if (yp >= _vm->_graphicsManager.max_y || v15 >= _vm->_graphicsManager.max_x || v14 <= 1 || v13 <= 1) { - if (btsouris != 23) + if (_mouseCursorId != 23) goto LABEL_54; LABEL_45: if (yp < _vm->_graphicsManager.max_y && v15 < _vm->_graphicsManager.max_x) { @@ -415,20 +421,20 @@ LABEL_54: if (_breakoutFl != true) goto LABEL_63; - if (lItCounter > 1) + if (_rateCounter > 1) goto LABEL_65; } if (_vm->_globals.vitesse != 2) break; - if (lItCounter > 9) + if (_rateCounter > 9) goto LABEL_65; } LABEL_63: ; - } while (!_vm->shouldQuit() && _vm->_globals.iRegul == 3 && lItCounter <= 15); + } while (!_vm->shouldQuit() && _vm->_globals.iRegul == 3 && _rateCounter <= 15); LABEL_65: _vm->_globals.vitesse = 2; - lItCounter = 0; + _rateCounter = 0; if (_vm->_graphicsManager.DOUBLE_ECRAN != true || _vm->_graphicsManager.no_scroll == 1) { _vm->_graphicsManager.Affiche_Segment_Vesa(); } else { @@ -495,8 +501,8 @@ LABEL_65: _startPos.x = v4; _vm->_graphicsManager.ofscroll = v4; } - souris_bb = souris_b; - souris_b = 0; + _curMouseButton = _mouseButton; + _mouseButton = 0; #if 0 // Commented by Strangerke. Looks completely useless. @@ -522,7 +528,7 @@ LABEL_65: LABEL_113: #endif _vm->_soundManager.VERIF_SOUND(); - CONTROLE_MES(); + refreshEvents(); } void EventsManager::updateCursor() { @@ -539,9 +545,9 @@ void EventsManager::updateCursor() { byte *cursorSurface = new byte[_vm->_globals.OBJH * _vm->_globals.OBJL]; Common::fill(cursorSurface, cursorSurface + _vm->_globals.OBJH * _vm->_globals.OBJL, 0); - if (btsouris != 23) { + if (_mouseCursorId != 23) { // Draw standard cursor - _vm->_graphicsManager.Sprite_Vesa(cursorSurface, _mouseCursor, 300, 300, souris_n); + _vm->_graphicsManager.Sprite_Vesa(cursorSurface, _mouseCursor, 300, 300, _mouseSpriteId); } else { // Draw the active inventory object _vm->_graphicsManager.Affiche_Perfect(cursorSurface, _objectBuf, 300, 300, 0, 0, 0, 0); diff --git a/engines/hopkins/events.h b/engines/hopkins/events.h index fef8c2a4c2..530a3f8121 100644 --- a/engines/hopkins/events.h +++ b/engines/hopkins/events.h @@ -53,25 +53,24 @@ public: Common::Point _mousePos; bool _breakoutFl; int _oldIconId; - int souris_n; - int souris_bb; - int souris_b; + int _mouseSpriteId; + int _curMouseButton; + int _mouseButton; byte *_mouseCursor; uint32 _gameCounter; - uint32 lItCounter; + uint32 _rateCounter; uint32 _priorCounterTime; uint32 _priorFrameTime; bool _escKeyFl; bool _disableEscKeyFl; DIALOG_KEY _gameKey; - int btsouris; + int _mouseCursorId; byte *_objectBuf; bool _keyState[256]; public: EventsManager(); ~EventsManager(); void setParent(HopkinsEngine *vm); - void setMouseOn(); void setMouseXY(int xp, int yp); int getMouseX(); @@ -80,16 +79,11 @@ public: void mouseOn(); void mouseOff(); void changeMouseCursor(int id); - - void CONTROLE_MES(); + void refreshEvents(); void delay(int delay); - void VBL(); + int waitKeyPress(); - /** - * Waits for a keypress, ignoring mouse events - * @return Keypress, or -1 if game quit was requested - */ - int keywin(); + void VBL(); }; } // End of namespace Hopkins diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index c1e7667340..ff2a0735a0 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -149,7 +149,7 @@ bool HopkinsEngine::runWin95Demo() { warning("TODO Fin_Interrupt()"); warning("TODO TEST = 1;"); warning("TODO no_vsync = 1;"); - _eventsManager.lItCounter = 0; + _eventsManager._rateCounter = 0; warning("TODO Init_Interrupt_();"); _globals.iRegul = 1; @@ -161,14 +161,14 @@ bool HopkinsEngine::runWin95Demo() { } _globals.iRegul = 0; - warning("TODO SPEEDJ = _globals.lItCounter;"); + warning("TODO SPEEDJ = _globals._rateCounter;"); warning("TODO no_vsync = 0;"); warning("TODO TEST = 0;"); // if (SPEEDJ > 475) - if (_eventsManager.lItCounter > 475) + if (_eventsManager._rateCounter > 475) _globals.vitesse = 2; // if (SPEEDJ > 700) - if (_eventsManager.lItCounter > 700) + if (_eventsManager._rateCounter > 700) _globals.vitesse = 3; warning("TODO Fin_Interrupt_();"); warning("TODO Init_Interrupt_();"); @@ -3026,7 +3026,7 @@ void HopkinsEngine::BOOM() { void HopkinsEngine::REST_SYSTEM() { quitGame(); - _eventsManager.CONTROLE_MES(); + _eventsManager.refreshEvents(); } void HopkinsEngine::PUBQUIT() { @@ -3041,8 +3041,8 @@ void HopkinsEngine::PUBQUIT() { _graphicsManager.FADE_INW(); _eventsManager.mouseOn(); _eventsManager.changeMouseCursor(0); - _eventsManager.btsouris = 0; - _eventsManager.souris_n = 0; + _eventsManager._mouseCursorId = 0; + _eventsManager._mouseSpriteId = 0; _globals.netscape = true; bool mouseClicked = false; @@ -3297,11 +3297,11 @@ void HopkinsEngine::JOUE_FIN() { _graphicsManager.LOAD_IMAGE("PLAN3"); _graphicsManager.FADE_INW(); - _eventsManager.lItCounter = 0; + _eventsManager._rateCounter = 0; if (!_eventsManager._escKeyFl) { do - _eventsManager.CONTROLE_MES(); - while (_eventsManager.lItCounter < 2000 / _globals.vitesse && !_eventsManager._escKeyFl); + _eventsManager.refreshEvents(); + while (_eventsManager._rateCounter < 2000 / _globals.vitesse && !_eventsManager._escKeyFl); } _eventsManager._escKeyFl = false; _graphicsManager.FADE_OUTW(); @@ -3698,7 +3698,7 @@ void HopkinsEngine::Credits() { void HopkinsEngine::BTOCEAN() { _fontManager.TEXTE_OFF(9); - if (_eventsManager.btsouris == 16) { + if (_eventsManager._mouseCursorId == 16) { _eventsManager.getMouseX(); if (_objectsManager.NUMZONE > 0) { int oldPosX = _eventsManager.getMouseX(); @@ -4009,14 +4009,14 @@ bool HopkinsEngine::ADULT() { _globals.FORET = false; _globals.FLAG_VISIBLE = false; _globals._disableInventFl = true; - _globals.SORTIE = false; + _globals.SORTIE = 0; _graphicsManager.LOAD_IMAGE("ADULT"); _graphicsManager.FADE_INW(); _eventsManager.mouseOn(); _eventsManager.changeMouseCursor(0); - _eventsManager.btsouris = false; - _eventsManager.souris_n = false; + _eventsManager._mouseCursorId = 0; + _eventsManager._mouseSpriteId = 0; do { xp = _eventsManager.getMouseX(); diff --git a/engines/hopkins/menu.cpp b/engines/hopkins/menu.cpp index 9228c6cb5f..9e5abf0c3e 100644 --- a/engines/hopkins/menu.cpp +++ b/engines/hopkins/menu.cpp @@ -93,8 +93,8 @@ int MenuManager::MENU() { spriteData = _vm->_objectsManager.CHARGE_SPRITE(_vm->_globals.NFICHIER); _vm->_eventsManager.mouseOn(); _vm->_eventsManager.changeMouseCursor(0); - _vm->_eventsManager.btsouris = 0; - _vm->_eventsManager.souris_n = 0; + _vm->_eventsManager._mouseCursorId = 0; + _vm->_eventsManager._mouseSpriteId = 0; for (;;) { for (;;) { diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 1da0420ac0..44123cb84f 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -1662,7 +1662,7 @@ void ObjectsManager::VERIFZONE() { } if (_vm->_globals.old_zone_68 != v4) { _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); - _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager._mouseCursorId = 4; _vm->_eventsManager.changeMouseCursor(4); if (_vm->_globals.zozo_73 == 1) { _vm->_fontManager.TEXTE_OFF(5); @@ -1695,17 +1695,17 @@ LABEL_54: _vm->_globals.force_to_data_0 = 0; _vm->_graphicsManager.SETCOLOR4(251, _vm->_globals.force_to_data_0, _vm->_globals.force_to_data_0, _vm->_globals.force_to_data_0); - if (_vm->_eventsManager.btsouris == 4) { + if (_vm->_eventsManager._mouseCursorId == 4) { v1 = 5 * v4; if (_vm->_globals.ZONEP[v4].field6 == 2) { _vm->_eventsManager.changeMouseCursor(16); - _vm->_eventsManager.btsouris = 16; + _vm->_eventsManager._mouseCursorId = 16; verbe = 16; } } } else { _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); - _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager._mouseCursorId = 4; _vm->_eventsManager.changeMouseCursor(4); } } @@ -1714,7 +1714,7 @@ LABEL_54: _vm->_globals.old_y_70 = v2; _vm->_globals.old_zone_68 = v4; if (_vm->_globals.NOMARCHE == true) { - if (_vm->_eventsManager.btsouris == 4) { + if (_vm->_eventsManager._mouseCursorId == 4) { v1 = v4 + 1; if ((uint16)(v4 + 1) > 1u) BTDROITE(); @@ -1722,7 +1722,7 @@ LABEL_54: } if ((_vm->_globals.PLAN_FLAG == true && v4 == -1) || !v4) { verbe = 0; - _vm->_eventsManager.btsouris = 0; + _vm->_eventsManager._mouseCursorId = 0; _vm->_eventsManager.changeMouseCursor(0); } } @@ -2635,7 +2635,7 @@ void ObjectsManager::PLAN_BETA() { _vm->_talkManager.PARLER_PERSO("APPEL2.pe2"); _vm->_globals.NOPARLE = false; v5 = 0; - _vm->_eventsManager.souris_bb = false; + _vm->_eventsManager._curMouseButton = 0; } if (v5 == 1) BTGAUCHE(); @@ -2693,14 +2693,14 @@ void ObjectsManager::BTGAUCHE() { destY = _vm->_eventsManager.getMouseY(); if (!_vm->_dialogsManager._inventFl && !_vm->_globals.PLAN_FLAG && destX > _vm->_graphicsManager.ofscroll - 30 && destX < _vm->_graphicsManager.ofscroll + 50 && (uint16)(destY + 29) <= 0x4Eu) { - v1 = _vm->_eventsManager.btsouris; + v1 = _vm->_eventsManager._mouseCursorId; _vm->_dialogsManager._inventFl = true; _vm->_dialogsManager.showInventory(); _vm->_dialogsManager._inventFl = false; _vm->_eventsManager._gameKey = KEY_NONE; if (!_vm->_globals.SORTIE) { _vm->_dialogsManager._inventFl = false; - _vm->_eventsManager.btsouris = v1; + _vm->_eventsManager._mouseCursorId = v1; } return; } @@ -2761,7 +2761,7 @@ void ObjectsManager::BTGAUCHE() { _vm->_globals.SAUVEGARDE->data[svField2] = 0; } LABEL_38: - if (_vm->_globals.PLAN_FLAG == true && (_vm->_eventsManager.btsouris != 4 || NUMZONE <= 0)) + if (_vm->_globals.PLAN_FLAG == true && (_vm->_eventsManager._mouseCursorId != 4 || NUMZONE <= 0)) return; if ((uint16)(NUMZONE + 1) > 1u) { zoneCount = NUMZONE; @@ -2833,7 +2833,7 @@ LABEL_65: } if ((uint16)(NUMZONE + 1) > 1u) { // TODO: Reformat the weird if statement generated by the decompiler - if (_vm->_eventsManager.btsouris == 23 || (_vm->_globals.SAUVEGARDE->data[svField1] = _vm->_eventsManager.btsouris, _vm->_eventsManager.btsouris == 23)) + if (_vm->_eventsManager._mouseCursorId == 23 || (_vm->_globals.SAUVEGARDE->data[svField1] = _vm->_eventsManager._mouseCursorId, _vm->_eventsManager._mouseCursorId == 23)) _vm->_globals.SAUVEGARDE->data[svField1] = 5; if (_vm->_globals.PLAN_FLAG == true) _vm->_globals.SAUVEGARDE->data[svField1] = 6; @@ -2844,13 +2844,13 @@ LABEL_65: _vm->_fontManager.TEXTE_OFF(5); _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); ARRET_PERSO_FLAG = 0; - if (_vm->_eventsManager.btsouris == 21 && _vm->_globals.BOBZONE[NUMZONE]) { + if (_vm->_eventsManager._mouseCursorId == 21 && _vm->_globals.BOBZONE[NUMZONE]) { ARRET_PERSO_FLAG = 1; ARRET_PERSO_NUM = _vm->_globals.BOBZONE[NUMZONE]; } if (_vm->_globals.ECRAN == 20 && _vm->_globals.SAUVEGARDE->data[svField132] == 1 && _vm->_globals.OBJET_EN_COURS == 20 && NUMZONE == 12 - && _vm->_eventsManager.btsouris == 23) { + && _vm->_eventsManager._mouseCursorId == 23) { // Special case for throwing darts at the switch in Purgatory - the player shouldn't move _vm->_globals.chemin = (int16 *)g_PTRNUL; XSPR(0); @@ -2937,29 +2937,29 @@ LABEL_64: FORCEZONE = 1; } if (NUMZONE != _vm->_globals.SAUVEGARDE->data[svField2] || (uint16)(NUMZONE + 1) <= 1u) { - _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager._mouseCursorId = 4; CHANGEVERBE = 0; } else { - _vm->_eventsManager.btsouris = _vm->_globals.SAUVEGARDE->data[svField1]; + _vm->_eventsManager._mouseCursorId = _vm->_globals.SAUVEGARDE->data[svField1]; if (CHANGEVERBE == 1) { VERBEPLUS(); CHANGEVERBE = 0; } - if (_vm->_eventsManager.btsouris == 5) - _vm->_eventsManager.btsouris = 4; + if (_vm->_eventsManager._mouseCursorId == 5) + _vm->_eventsManager._mouseCursorId = 4; } - if (_vm->_eventsManager.btsouris != 23) - _vm->_eventsManager.changeMouseCursor(_vm->_eventsManager.btsouris); + if (_vm->_eventsManager._mouseCursorId != 23) + _vm->_eventsManager.changeMouseCursor(_vm->_eventsManager._mouseCursorId); NUMZONE = 0; _vm->_globals.SAUVEGARDE->data[svField1] = 0; _vm->_globals.SAUVEGARDE->data[svField2] = 0; } if (_vm->_globals.PLAN_FLAG == true) { - _vm->_eventsManager.btsouris = 0; + _vm->_eventsManager._mouseCursorId = 0; _vm->_eventsManager.changeMouseCursor(0); } if (_vm->_globals.NOMARCHE == true) { - if (_vm->_eventsManager.btsouris == 4) { + if (_vm->_eventsManager._mouseCursorId == 4) { result = NUMZONE + 1; if ((uint16)(NUMZONE + 1) > 1u) BTDROITE(); @@ -2990,7 +2990,7 @@ void ObjectsManager::CLEAR_ECRAN() { _vm->_globals.BOBZONE_FLAG[v2] = false; ++v1; } while (v1 <= 48); - _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager._mouseCursorId = 4; verbe = 4; NUMZONE = 0; Vold_taille = 0; @@ -3008,7 +3008,7 @@ void ObjectsManager::CLEAR_ECRAN() { if (g_PTRNUL != _vm->_globals.SPRITE_ECRAN) _vm->_globals.SPRITE_ECRAN = _vm->_globals.LIBERE_FICHIER(_vm->_globals.SPRITE_ECRAN); _vm->_eventsManager._startPos.x = 0; - _vm->_eventsManager.souris_n = 0; + _vm->_eventsManager._mouseSpriteId = 0; Vold_taille = 200; _vm->_globals.SAUVEGARDE->data[svField1] = 0; _vm->_globals.SAUVEGARDE->data[svField2] = 0; @@ -3614,8 +3614,8 @@ LABEL_88: void ObjectsManager::VERBEPLUS() { int v; - v = _vm->_eventsManager.btsouris + 1; - _vm->_eventsManager.btsouris = v; + v = _vm->_eventsManager._mouseCursorId + 1; + _vm->_eventsManager._mouseCursorId = v; if (v == 4) goto LABEL_24; if (v == 5) @@ -3662,150 +3662,150 @@ void ObjectsManager::VERBEPLUS() { goto LABEL_67; do { do { - _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager._mouseCursorId = 4; LABEL_24: if (_vm->_globals.NOMARCHE != true || (v = NUMZONE + 1, (uint16)(NUMZONE + 1) <= 1u)) { - if (_vm->_eventsManager.btsouris == 4) + if (_vm->_eventsManager._mouseCursorId == 4) return; } else { - _vm->_eventsManager.btsouris = 5; + _vm->_eventsManager._mouseCursorId = 5; } LABEL_28: - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 6) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 6) { LABEL_29: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].field6 == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 7) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 7) { LABEL_31: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].field7 == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 8) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 8) { LABEL_33: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].field8 == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 9) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 9) { LABEL_35: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].field9 == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 10) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 10) { LABEL_37: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldA == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 11) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 11) { LABEL_39: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldB == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 12) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 12) { LABEL_41: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldC == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 13) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 13) { LABEL_43: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldD == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 14) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 14) { LABEL_45: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldE == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 15) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 15) { LABEL_47: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldF == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 16) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 16) { LABEL_49: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].field6 == 2) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 17) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 17) { LABEL_51: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].field9 == 2) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 18) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 18) { LABEL_53: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldA == 2) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 19) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 19) { LABEL_55: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldB == 2) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 20) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 20) { LABEL_57: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldC == 2) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 21) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 21) { LABEL_59: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldF == 2) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 22) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 22) { LABEL_61: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].fieldD == 2) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 23) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 23) { LABEL_63: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].field8 == 2) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 24) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 24) { LABEL_65: v = 5 * NUMZONE; if (_vm->_globals.ZONEP[NUMZONE].field9 == 3) return; } - v = _vm->_eventsManager.btsouris + 1; - _vm->_eventsManager.btsouris = v; + v = _vm->_eventsManager._mouseCursorId + 1; + _vm->_eventsManager._mouseCursorId = v; } while (v != 25); LABEL_67: v = 5 * NUMZONE; @@ -3815,9 +3815,9 @@ LABEL_67: void ObjectsManager::BTDROITE() { if ((uint16)(NUMZONE + 1) > 1u) { VERBEPLUS(); - if (_vm->_eventsManager.btsouris != 23) - _vm->_eventsManager.changeMouseCursor(_vm->_eventsManager.btsouris); - verbe = _vm->_eventsManager.btsouris; + if (_vm->_eventsManager._mouseCursorId != 23) + _vm->_eventsManager.changeMouseCursor(_vm->_eventsManager._mouseCursorId); + verbe = _vm->_eventsManager._mouseCursorId; } } @@ -4000,25 +4000,25 @@ void ObjectsManager::PARAMCADRE(int a1) { cadi = 0; } if (!a1) - _vm->_eventsManager.btsouris = 0; + _vm->_eventsManager._mouseCursorId = 0; if (a1 == 32) - _vm->_eventsManager.btsouris = 16; + _vm->_eventsManager._mouseCursorId = 16; if (a1 == 30) - _vm->_eventsManager.btsouris = 2; + _vm->_eventsManager._mouseCursorId = 2; if (a1 == 31) - _vm->_eventsManager.btsouris = 3; + _vm->_eventsManager._mouseCursorId = 3; if ((uint16)(a1 - 1) <= 0x1Cu) - _vm->_eventsManager.btsouris = 8; + _vm->_eventsManager._mouseCursorId = 8; if (a1 == 29) - _vm->_eventsManager.btsouris = 1; + _vm->_eventsManager._mouseCursorId = 1; if ((uint16)(a1 - 1) <= 0x1Bu && !_vm->_globals.INVENTAIRE[a1]) { - _vm->_eventsManager.btsouris = 0; + _vm->_eventsManager._mouseCursorId = 0; cadx = 0; cady = 0; cadi = 0; } - if (_vm->_eventsManager.btsouris != 23) - _vm->_eventsManager.changeMouseCursor(_vm->_eventsManager.btsouris); + if (_vm->_eventsManager._mouseCursorId != 23) + _vm->_eventsManager.changeMouseCursor(_vm->_eventsManager._mouseCursorId); _vm->_eventsManager.getMouseX(); _vm->_eventsManager.getMouseY(); } @@ -4028,79 +4028,79 @@ void ObjectsManager::OBJETPLUS(int idx) { int v2; int v3; - v1 = _vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris && _vm->_eventsManager.btsouris != 16 && (uint16)(_vm->_eventsManager.btsouris - 2) > 1u) { - v2 = _vm->_eventsManager.btsouris++ + 1; + v1 = _vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId && _vm->_eventsManager._mouseCursorId != 16 && (uint16)(_vm->_eventsManager._mouseCursorId - 2) > 1u) { + v2 = _vm->_eventsManager._mouseCursorId++ + 1; if (v1 == 5) goto LABEL_24; if (v2 == 7) goto LABEL_26; if (v2 != 8) { if (v2 == 9) - _vm->_eventsManager.btsouris = 10; - if (_vm->_eventsManager.btsouris == 10) + _vm->_eventsManager._mouseCursorId = 10; + if (_vm->_eventsManager._mouseCursorId == 10) goto LABEL_29; - if (_vm->_eventsManager.btsouris == 11) + if (_vm->_eventsManager._mouseCursorId == 11) goto LABEL_31; - if (_vm->_eventsManager.btsouris == 12) - _vm->_eventsManager.btsouris = 13; - if (_vm->_eventsManager.btsouris == 13) + if (_vm->_eventsManager._mouseCursorId == 12) + _vm->_eventsManager._mouseCursorId = 13; + if (_vm->_eventsManager._mouseCursorId == 13) goto LABEL_33; - if (_vm->_eventsManager.btsouris == 14) - _vm->_eventsManager.btsouris = 15; - if (_vm->_eventsManager.btsouris == 15) + if (_vm->_eventsManager._mouseCursorId == 14) + _vm->_eventsManager._mouseCursorId = 15; + if (_vm->_eventsManager._mouseCursorId == 15) goto LABEL_35; - if ((uint16)(_vm->_eventsManager.btsouris - 16) <= 6u) - _vm->_eventsManager.btsouris = 23; - if (_vm->_eventsManager.btsouris == 23) + if ((uint16)(_vm->_eventsManager._mouseCursorId - 16) <= 6u) + _vm->_eventsManager._mouseCursorId = 23; + if (_vm->_eventsManager._mouseCursorId == 23) goto LABEL_37; - if (_vm->_eventsManager.btsouris == 24) - _vm->_eventsManager.btsouris = 25; - if (_vm->_eventsManager.btsouris == 25) + if (_vm->_eventsManager._mouseCursorId == 24) + _vm->_eventsManager._mouseCursorId = 25; + if (_vm->_eventsManager._mouseCursorId == 25) goto LABEL_39; do { - _vm->_eventsManager.btsouris = 6; + _vm->_eventsManager._mouseCursorId = 6; LABEL_24: if (_vm->_globals.ObjetW[_vm->_globals.INVENTAIRE[idx]].field2 == 1) break; - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 7) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 7) { LABEL_26: if (_vm->_globals.ObjetW[_vm->_globals.INVENTAIRE[idx]].field3 == 1) return; } - v3 = _vm->_eventsManager.btsouris++; - if (_vm->_eventsManager.btsouris == 8) + v3 = _vm->_eventsManager._mouseCursorId++; + if (_vm->_eventsManager._mouseCursorId == 8) break; - _vm->_eventsManager.btsouris = v3 + 3; + _vm->_eventsManager._mouseCursorId = v3 + 3; if (v3 == 7) { LABEL_29: if (_vm->_globals.ObjetW[_vm->_globals.INVENTAIRE[idx]].field7 == 1) return; } - ++_vm->_eventsManager.btsouris; - if (_vm->_eventsManager.btsouris == 11) { + ++_vm->_eventsManager._mouseCursorId; + if (_vm->_eventsManager._mouseCursorId == 11) { LABEL_31: if (_vm->_globals.ObjetW[_vm->_globals.INVENTAIRE[idx]].field4 == 1) return; } - _vm->_eventsManager.btsouris += 2; - if (_vm->_eventsManager.btsouris == 13) { + _vm->_eventsManager._mouseCursorId += 2; + if (_vm->_eventsManager._mouseCursorId == 13) { LABEL_33: if (_vm->_globals.ObjetW[_vm->_globals.INVENTAIRE[idx]].field5 == 1) return; } - _vm->_eventsManager.btsouris += 2; - if (_vm->_eventsManager.btsouris == 15) { + _vm->_eventsManager._mouseCursorId += 2; + if (_vm->_eventsManager._mouseCursorId == 15) { LABEL_35: if (_vm->_globals.ObjetW[_vm->_globals.INVENTAIRE[idx]].field6 == 1) return; } - _vm->_eventsManager.btsouris = 23; + _vm->_eventsManager._mouseCursorId = 23; LABEL_37: if (_vm->_globals.ObjetW[_vm->_globals.INVENTAIRE[idx]].field6 == 2) break; - _vm->_eventsManager.btsouris = 25; + _vm->_eventsManager._mouseCursorId = 25; LABEL_39: ; } while (_vm->_globals.ObjetW[_vm->_globals.INVENTAIRE[idx]].field7 != 2); @@ -4109,7 +4109,7 @@ LABEL_39: } void ObjectsManager::VALID_OBJET(int a1) { - if (_vm->_eventsManager.btsouris == 8) + if (_vm->_eventsManager._mouseCursorId == 8) CHANGE_OBJET(a1); } @@ -4882,7 +4882,7 @@ void ObjectsManager::SPECIAL_INI(const Common::String &a1) { BOBANIM_ON(8); } if (_vm->_globals.ECRAN == 18 && _vm->_globals.OLD_ECRAN == 17) { - _vm->_eventsManager.souris_n = 4; + _vm->_eventsManager._mouseSpriteId = 4; _vm->_globals.BPP_NOAFF = true; v3 = 0; do { @@ -4968,8 +4968,8 @@ void ObjectsManager::OPTI_BOBON(int a1, int a2, int a3, int a4, int a5, int a6, } void ObjectsManager::SCI_OPTI_ONE(int a1, int a2, int a3, int a4) { - _vm->_eventsManager.souris_bb = 0; - _vm->_eventsManager.souris_b = 0; + _vm->_eventsManager._curMouseButton = 0; + _vm->_eventsManager._mouseButton = 0; if (a4 != 3) { BOBANIM_ON(a1); @@ -4978,7 +4978,7 @@ void ObjectsManager::SCI_OPTI_ONE(int a1, int a2, int a3, int a4) { do { _vm->_eventsManager.VBL(); - if (_vm->_eventsManager.souris_bb) + if (_vm->_eventsManager._curMouseButton) break; } while (a3 != BOBPOSI(a1)); if (!a4) @@ -5630,7 +5630,7 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm _vm->_graphicsManager.INI_ECRAN2(s4); } _vm->_eventsManager.mouseOn(); - _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager._mouseCursorId = 4; _vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); @@ -5671,7 +5671,7 @@ LABEL_70: _vm->_globals.chemin = (int16 *)g_PTRNUL; VERIFTAILLE(); SPECIAL_INI(linkFile); - _vm->_eventsManager.souris_n = 4; + _vm->_eventsManager._mouseSpriteId = 4; g_old_x = PERX; g_old_y = PERY; _vm->_globals.g_old_sens = -1; @@ -5697,7 +5697,7 @@ LABEL_70: mouseButtons = _vm->_eventsManager.getMouseButton(); if (mouseButtons) { if (mouseButtons == 1) { - if (verbe == 16 && _vm->_eventsManager.btsouris == 16) { + if (verbe == 16 && _vm->_eventsManager._mouseCursorId == 16) { xp = _vm->_eventsManager.getMouseX(); yp = _vm->_eventsManager.getMouseY(); diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 6478dcdc7f..6f3a06ab6b 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -690,7 +690,7 @@ LABEL_1141: if (v76 == 18) _vm->_talkManager.PARLER_PERSO("fjour.pe2"); if (v76 == 13) { - _vm->_eventsManager.souris_b = _vm->_eventsManager.souris_bb; + _vm->_eventsManager._mouseButton = _vm->_eventsManager._curMouseButton; _vm->_globals._disableInventFl = true; _vm->_graphicsManager.FADE_OUTW(); _vm->_globals.CACHE_OFF(); diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp index db1b072e95..01a977cfe4 100644 --- a/engines/hopkins/sound.cpp +++ b/engines/hopkins/sound.cpp @@ -615,7 +615,7 @@ bool SoundManager::VOICE_MIX(int voiceId, int voiceMode) { _vm->_eventsManager.VBL(); if (_vm->_eventsManager.getMouseButton()) break; - _vm->_eventsManager.CONTROLE_MES(); + _vm->_eventsManager.refreshEvents(); if (_vm->_eventsManager._escKeyFl) break; if (!VOICE_STAT(2)) diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index 2246ab3b50..a13f757d77 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -120,8 +120,8 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { PLIGNE2 = v2 + 1; PLIGNE3 = v2 + 2; PLIGNE4 = v2 + 3; - v14 = _vm->_eventsManager.btsouris; - _vm->_eventsManager.btsouris = 4; + v14 = _vm->_eventsManager._mouseCursorId; + _vm->_eventsManager._mouseCursorId = 4; _vm->_eventsManager.changeMouseCursor(0); if (!_vm->_globals.NOPARLE) { v4 = v2 + 3; @@ -152,7 +152,7 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { g_system->getSavefileManager()->removeSavefile("TEMP.SCR"); _vm->_objectsManager.PERSO_ON = false; - _vm->_eventsManager.btsouris = v14; + _vm->_eventsManager._mouseCursorId = v14; _vm->_eventsManager.changeMouseCursor(v14); _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); @@ -234,8 +234,8 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) { PLIGNE2 = v1 + 1; PLIGNE3 = v1 + 2; PLIGNE4 = v1 + 3; - int v8 = _vm->_eventsManager.btsouris; - _vm->_eventsManager.btsouris = 4; + int v8 = _vm->_eventsManager._mouseCursorId; + _vm->_eventsManager._mouseCursorId = 4; _vm->_eventsManager.changeMouseCursor(0); if (!_vm->_globals.NOPARLE) { @@ -259,7 +259,7 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) { } BUFFERPERSO = _vm->_globals.LIBERE_FICHIER(BUFFERPERSO); - _vm->_eventsManager.btsouris = v8; + _vm->_eventsManager._mouseCursorId = v8; _vm->_eventsManager.changeMouseCursor(v8); _vm->_graphicsManager.INIT_TABLE(145, 150, _vm->_graphicsManager.Palette); @@ -477,8 +477,8 @@ int TalkManager::DIALOGUE_REP(int idx) { } if (!_vm->_soundManager.VOICE_MIX(v22, 1)) { v14 = 0; - _vm->_eventsManager.souris_bb = false; - _vm->_eventsManager.souris_b = false; + _vm->_eventsManager._curMouseButton = 0; + _vm->_eventsManager._mouseButton = 0; if (_vm->getIsDemo()) { do { @@ -490,7 +490,7 @@ int TalkManager::DIALOGUE_REP(int idx) { do { _vm->_eventsManager.VBL(); ++v14; - if ( _vm->_eventsManager.souris_b || _vm->_eventsManager.souris_bb ) + if (_vm->_eventsManager._mouseButton || _vm->_eventsManager._curMouseButton) v14 = v6; if (_vm->_eventsManager.getMouseButton()) { i = 5; @@ -1217,7 +1217,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { _vm->_globals.BOBZONE[v2++] = 0; while (v2 <= 44); _vm->_objectsManager.NUMZONE = -1; - _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager._mouseCursorId = 4; _vm->_eventsManager.changeMouseCursor(0); BUFFERPERSO = _vm->_fileManager.searchCat(a2, 5); TAILLEPERSO = _vm->_globals.CAT_TAILLE; @@ -1320,7 +1320,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { g_system->getSavefileManager()->removeSavefile("TEMP.SCR"); _vm->_objectsManager.PERSO_ON = false; - _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager._mouseCursorId = 4; _vm->_eventsManager.changeMouseCursor(4); _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); -- cgit v1.2.3