diff options
author | Eugene Sandulenko | 2014-04-26 14:02:04 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-26 14:02:04 +0300 |
commit | fd8eb9a0e39ebeaa8f0bc69577e1d0cd4e94b8a6 (patch) | |
tree | d14ecc47bc9756f59db391e5ce352691997a1574 | |
parent | aad1d556d657bdb39c1cd0b896f90cd09d5dd5aa (diff) | |
download | scummvm-rg350-fd8eb9a0e39ebeaa8f0bc69577e1d0cd4e94b8a6.tar.gz scummvm-rg350-fd8eb9a0e39ebeaa8f0bc69577e1d0cd4e94b8a6.tar.bz2 scummvm-rg350-fd8eb9a0e39ebeaa8f0bc69577e1d0cd4e94b8a6.zip |
FULLPIPE: Implement FullpipeEngine::processArcade()
-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; |