[Scummvm-cvs-logs] scummvm master -> 2e7ef9d78964ebb5a93a927330b98b1b77e225df
sev-
sev at scummvm.org
Sat Apr 12 13:45:35 CEST 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
2e7ef9d789 FULLPIPE: Implement BallChain::removeBall()
Commit: 2e7ef9d78964ebb5a93a927330b98b1b77e225df
https://github.com/scummvm/scummvm/commit/2e7ef9d78964ebb5a93a927330b98b1b77e225df
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-04-12T14:44:35+03:00
Commit Message:
FULLPIPE: Implement BallChain::removeBall()
Changed paths:
engines/fullpipe/scenes.cpp
engines/fullpipe/scenes.h
engines/fullpipe/scenes/scene29.cpp
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 3abb03d..47c6a3c 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;
+ }
}
diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h
index 517576c..0b7c4e7 100644
--- a/engines/fullpipe/scenes.h
+++ b/engines/fullpipe/scenes.h
@@ -232,7 +232,7 @@ struct BallChain {
void init(Ball **ball);
Ball *sub04(Ball *ballP, Ball *ballN);
- void sub05(Ball *ball);
+ void removeBall(Ball *ball);
void reset() { pHead = 0; pTail = 0; field_8 = 0; numBalls = 0; free(cPlex); cPlex = 0; cPlexLen = 0; }
};
diff --git a/engines/fullpipe/scenes/scene29.cpp b/engines/fullpipe/scenes/scene29.cpp
index dbd753a..2d51271 100644
--- a/engines/fullpipe/scenes/scene29.cpp
+++ b/engines/fullpipe/scenes/scene29.cpp
@@ -641,7 +641,7 @@ void sceneHandler29_ballHitCheck() {
g_vars->scene29_redBalls.field_8 = newball;
- g_vars->scene29_flyingRedBalls.sub05(ball);
+ g_vars->scene29_flyingRedBalls.removeBall(ball);
sceneHandler29_manHit();
More information about the Scummvm-git-logs
mailing list