diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/input.cpp | 33 | ||||
-rw-r--r-- | engines/fullpipe/scenes.cpp | 4 |
2 files changed, 33 insertions, 4 deletions
diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp index 0678d15368..3d6f53c7f3 100644 --- a/engines/fullpipe/input.cpp +++ b/engines/fullpipe/input.cpp @@ -275,6 +275,8 @@ void FullpipeEngine::updateCursorCommon() { } void FullpipeEngine::initArcadeKeys(const char *varname) { + _arcadeKeys.clear(); + GameVar *var = getGameLoaderGameVar()->getSubVarByName(varname)->getSubVarByName("KEYPOS"); if (!var) @@ -294,6 +296,37 @@ void FullpipeEngine::initArcadeKeys(const char *varname) { } } +void FullpipeEngine::processArcade(ExCommand *cmd) { + if (!g_fp->_aniMan2) + return; + + int idx; + + if (cmd->_sceneClickX <= g_fp->_aniMan2->_ox) { + for (idx = _arcadeKeys.size() - 1; idx >= 0; idx--) { + if (_arcadeKeys[idx]->x < g_fp->_aniMan2->_ox) + break; + } + + if (idx < 0) + return; + } else { + for (idx = 0; idx < _arcadeKeys.size(); idx++) { + if (_arcadeKeys[idx]->x > g_fp->_aniMan2->_ox) + break; + } + + if (idx >= _arcadeKeys.size()) + return; + } + + cmd->_sceneClickX = _arcadeKeys[idx]->x; + cmd->_sceneClickY = _arcadeKeys[idx]->y; + + cmd->_x = cmd->_sceneClickX - g_fp->_sceneRect.left; + cmd->_y = cmd->_sceneClickY - g_fp->_sceneRect.top; +} + void FullpipeEngine::setArcadeOverlay(int picId) { Common::Point point; Common::Point point2; diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 47c6a3c8cd..7420c1b1cf 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1106,10 +1106,6 @@ int defaultUpdateCursor() { return g_fp->_cursorId; } -void FullpipeEngine::processArcade(ExCommand *ex) { - warning("STUB: FullpipeEngine::processArcade()"); -} - void FullpipeEngine::updateMapPiece(int mapId, int update) { for (int i = 0; i < 200; i++) { int hiWord = (_mapTable[i] >> 16) & 0xffff; |