diff options
author | Eugene Sandulenko | 2014-02-21 21:37:02 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2014-02-21 21:37:55 +0200 |
commit | 7c69516c404b649136a59b9301e3740134536a23 (patch) | |
tree | e5396058fd3074e44e92104cddc5fc289f27319c | |
parent | 0caa3c0ab82c2868091ce28438bc1b8e8ced770d (diff) | |
download | scummvm-rg350-7c69516c404b649136a59b9301e3740134536a23.tar.gz scummvm-rg350-7c69516c404b649136a59b9301e3740134536a23.tar.bz2 scummvm-rg350-7c69516c404b649136a59b9301e3740134536a23.zip |
FULLPIPE: Implement sceneHandler09_checkHangerCollide()
-rw-r--r-- | engines/fullpipe/scenes.cpp | 10 | ||||
-rw-r--r-- | engines/fullpipe/scenes.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene09.cpp | 37 |
3 files changed, 45 insertions, 4 deletions
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 327167a422..6fd3989a3e 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -172,8 +172,14 @@ Vars::Vars() { scene09_var15 = 0; scene09_var17 = 0; scene09_var19 = 0; - scene09_var18.x = 0; - scene09_var18.y = -15; + scene09_var18[0].x = 0; + scene09_var18[0].y = -15; + scene09_var18[1].x = 15; + scene09_var18[1].y = 0; + scene09_var18[2].x = 0; + scene09_var18[2].y = 0; + scene09_var18[3].x = 0; + scene09_var18[3].y = 0; scene10_gum = 0; scene10_packet = 0; diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index 6971067b7d..32dfb96c3f 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -367,7 +367,7 @@ public: int scene09_var15; int scene09_var17; int scene09_var19; - Common::Point scene09_var18; + Common::Point scene09_var18[4]; StaticANIObject *scene10_gum; StaticANIObject *scene10_packet; diff --git a/engines/fullpipe/scenes/scene09.cpp b/engines/fullpipe/scenes/scene09.cpp index 7952985633..6743795d46 100644 --- a/engines/fullpipe/scenes/scene09.cpp +++ b/engines/fullpipe/scenes/scene09.cpp @@ -461,8 +461,43 @@ void sceneHandler09_collideBall(Ball *ball) { } } +void sceneHandler09_ballExplode(Ball *ball) { + warning("STUB: sceneHandler09_ballExplode()"); +} + void sceneHandler09_checkHangerCollide() { - warning("STUB: sceneHandler09_checkHangerCollide()"); + for (Ball *ball = g_vars->scene09_balls.pHead; ball; ball = ball->p0) { + int newx = ball->ani->_ox + 5; + + ball->ani->setOXY(newx, ball->ani->_oy); + + if (newx <= 1398 || g_vars->scene09_flyingBall) { + if (g_vars->scene09_var08) + goto LABEL_11; + } else if (g_vars->scene09_var08) { + sceneHandler09_collideBall(ball); + continue; + } + + if (newx > 1600) { + sceneHandler09_ballExplode(ball); + continue; + } + + LABEL_11: + int pixel; + + for (int i = 0; i < g_vars->scene09_numMovingHangers; i++) { + for (int j = 0; j < 4; j++) { + g_vars->scene09_hangers[i]->ani->getPixelAtPos(newx + g_vars->scene09_var18[j].x, ball->ani->_oy + g_vars->scene09_var18[j].y, &pixel); + + if (pixel) { + sceneHandler09_ballExplode(ball); + break; + } + } + } + } } void sceneHandler09_hangerStartCycle() { |