diff options
author | Bendegúz Nagy | 2016-07-29 15:13:38 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | 6e9fbffce30763f52c9634c5217ea96788904f6e (patch) | |
tree | a26809a621372cacade23b62738b76ffb8d907e1 | |
parent | 8540fdc800976e67039cfa253673b8a32a8879d2 (diff) | |
download | scummvm-rg350-6e9fbffce30763f52c9634c5217ea96788904f6e.tar.gz scummvm-rg350-6e9fbffce30763f52c9634c5217ea96788904f6e.tar.bz2 scummvm-rg350-6e9fbffce30763f52c9634c5217ea96788904f6e.zip |
DM: Add f352_processCommand71_clickOnEye, setting _g597_ignoreMouseMovements now prevents mouse movement
-rw-r--r-- | engines/dm/TODOs/todo.txt | 2 | ||||
-rw-r--r-- | engines/dm/eventman.cpp | 16 | ||||
-rw-r--r-- | engines/dm/eventman.h | 2 | ||||
-rw-r--r-- | engines/dm/gfx.cpp | 1 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 22 | ||||
-rw-r--r-- | engines/dm/inventory.h | 1 |
6 files changed, 42 insertions, 2 deletions
diff --git a/engines/dm/TODOs/todo.txt b/engines/dm/TODOs/todo.txt index 3bbcf6bdfe..3a9156458d 100644 --- a/engines/dm/TODOs/todo.txt +++ b/engines/dm/TODOs/todo.txt @@ -35,3 +35,5 @@ Finish stuff: Missing main loop methods Save file f433_processCommand140_saveGame fails silently +Refactoring + Places implementing mini mainloop and where input doesn't really matter should call discardInput instead of processInput diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 83e07eb1f7..16bfe4d3f9 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -596,12 +596,15 @@ Common::EventType EventManager::processInput(Common::Event *grabKey, Common::Eve case Common::EVENT_RBUTTONUP: { MouseButton button = (event.type == Common::EVENT_LBUTTONDOWN) ? k1_LeftMouseButton : k2_RightMouseButton; _g558_mouseButtonStatus &= ~button; + f544_resetPressingEyeOrMouth(); break; } default: break; } } + if (_g597_ignoreMouseMovements) + setMousePos(_mousePos); return Common::EVENT_INVALID; } @@ -722,7 +725,7 @@ void EventManager::f380_processCommandQueue() { return; } if (cmdType == k71_CommandClickOnEye) { - warning(false, "MISSING CODE: F0352_INVENTORY_ProcessCommand71_ClickOnEye();"); + _vm->_inventoryMan->f352_processCommand71_clickOnEye(); return; } if (cmdType == k80_CommandClickInDungeonView) { @@ -1523,4 +1526,15 @@ void EventManager::f371_commandProcessType111To115_ClickInActionArea(int16 posX, } } } + +void EventManager::f544_resetPressingEyeOrMouth() { + if (_vm->_g331_pressingEye) { + _g597_ignoreMouseMovements = false; + _vm->_g332_stopPressingEye = true; + } + if (_vm->_g333_pressingMouth) { + _g597_ignoreMouseMovements = false; + _vm->_g334_stopPressingMouth = true; + } +} } // end of namespace DM diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h index a12cc2e852..3cf54785f6 100644 --- a/engines/dm/eventman.h +++ b/engines/dm/eventman.h @@ -316,7 +316,7 @@ public: void f370_commandProcessType100_clickInSpellArea(uint16 posX, uint16 posY); // @ F0370_COMMAND_ProcessType100_ClickInSpellArea void f369_commandProcessTypes101To108_clickInSpellSymbolsArea(CommandType cmdType); // @ F0369_COMMAND_ProcessTypes101To108_ClickInSpellSymbolsArea_CPSE void f371_commandProcessType111To115_ClickInActionArea(int16 posX, int16 posY); // @ F0371_COMMAND_ProcessType111To115_ClickInActionArea_CPSE - + void f544_resetPressingEyeOrMouth();// @ F0544_INPUT_ResetPressingEyeOrMouth }; } diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index 38c1e5dd10..ef2118f92d 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -1235,6 +1235,7 @@ void DisplayMan::f97_drawViewport(int16 palSwitchingRequestedState) { } else { f565_viewportSetPalette(nullptr, nullptr); } + updateScreen(); } byte *DisplayMan::getCurrentVgaBuffer() { diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 52e70d4e62..9ecfed1f69 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -939,4 +939,26 @@ void InventoryMan::f348_adjustStatisticCurrentValue(Champion* champ, uint16 stat champ->_statistics[statIndex][k1_ChampionStatCurrent] += AL1077_i_Delta; } +void InventoryMan::f352_processCommand71_clickOnEye() { + _vm->_eventMan->_g597_ignoreMouseMovements = true; + _vm->_g331_pressingEye = true; + if (!_vm->_eventMan->isMouseButtonDown(k1_LeftMouseButton)) { + _vm->_eventMan->_g597_ignoreMouseMovements = false; + _vm->_g331_pressingEye = false; + _vm->_g332_stopPressingEye = false; + return; + } + _vm->_eventMan->f357_discardAllInput(); + _vm->_eventMan->f78_showMouse(); + _vm->f22_delay(8); + _vm->_inventoryMan->f332_drawIconToViewport(k203_IconIndiceEyeLooking, 12, 13); + if (_vm->_championMan->_g415_leaderEmptyHanded) { + f351_drawChampionSkillsAndStatistics(); + } else { + _vm->_objectMan->f35_clearLeaderObjectName(); + _vm->_inventoryMan->f342_drawPanelObject(_vm->_championMan->_g414_leaderHandObject, true); + } + _vm->_displayMan->f97_drawViewport(k0_viewportNotDungeonView); + +} } diff --git a/engines/dm/inventory.h b/engines/dm/inventory.h index a115c9819f..7617a9d77c 100644 --- a/engines/dm/inventory.h +++ b/engines/dm/inventory.h @@ -85,6 +85,7 @@ public: void f353_drawStopPressingEye();// @ F0353_INVENTORY_DrawStopPressingEye void f349_processCommand70_clickOnMouth(); // @ F0349_INVENTORY_ProcessCommand70_ClickOnMouth void f348_adjustStatisticCurrentValue(Champion *champ, uint16 statIndex, int16 valueDelta); // @ F0348_INVENTORY_AdjustStatisticCurrentValue + void f352_processCommand71_clickOnEye(); // @ F0352_INVENTORY_ProcessCommand71_ClickOnEye }; |