Skip to content

Commit

Permalink
FULLPIPE: Implement BallChain::removeBall()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Apr 12, 2014
1 parent af06053 commit 2e7ef9d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
26 changes: 24 additions & 2 deletions engines/fullpipe/scenes.cpp
Expand Up @@ -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;
}
}


Expand Down
2 changes: 1 addition & 1 deletion engines/fullpipe/scenes.h
Expand Up @@ -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; }
};

Expand Down
2 changes: 1 addition & 1 deletion engines/fullpipe/scenes/scene29.cpp
Expand Up @@ -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();

Expand Down

0 comments on commit 2e7ef9d

Please sign in to comment.