aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/scenes.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2014-04-12 14:44:35 +0300
committerEugene Sandulenko2014-04-12 14:44:35 +0300
commit2e7ef9d78964ebb5a93a927330b98b1b77e225df (patch)
treeccdbc4c3193642d944c1cb2d54a9d010a60e6bbb /engines/fullpipe/scenes.cpp
parentaf06053d6bace6546cd9d500957eff8cf58b7a89 (diff)
downloadscummvm-rg350-2e7ef9d78964ebb5a93a927330b98b1b77e225df.tar.gz
scummvm-rg350-2e7ef9d78964ebb5a93a927330b98b1b77e225df.tar.bz2
scummvm-rg350-2e7ef9d78964ebb5a93a927330b98b1b77e225df.zip
FULLPIPE: Implement BallChain::removeBall()
Diffstat (limited to 'engines/fullpipe/scenes.cpp')
-rw-r--r--engines/fullpipe/scenes.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 3abb03d1ae..47c6a3c8cd 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -1465,8 +1465,30 @@ Ball *BallChain::sub04(Ball *ballP, Ball *ballN) {
return pTail;
}
-void BallChain::sub05(Ball *ball) {
- warning("STUB: BallChain::sub05");
+void BallChain::removeBall(Ball *ball) {
+ if (ball == pHead)
+ pHead = ball->p0;
+ else
+ ball->p1->p0 = ball->p0;
+
+ if (ball == field_8)
+ field_8 = ball->p1;
+ else
+ ball->p0->p1 = ball->p1;
+
+ ball->p0 = pTail;
+ pTail = ball;
+
+ numBalls--;
+
+ if (!numBalls) {
+ numBalls = 0;
+ pTail = 0;
+ field_8 = 0;
+ pHead = 0;
+ free(cPlex);
+ cPlex = 0;
+ }
}