diff options
Diffstat (limited to 'engines/fullpipe/scenes.cpp')
-rw-r--r-- | engines/fullpipe/scenes.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 72d73a9cf8..b346bf3a17 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1454,9 +1454,28 @@ void BallChain::init(Ball **ball) { } Ball *BallChain::sub04(Ball *ballP, Ball *ballN) { - warning("STUB: BallChain::sub04"); + if (!pTail) { + cPlex = (byte *)calloc(cPlexLen, sizeof(Ball)); - return pTail; + Ball *runPtr = (Ball *)&cPlex[(cPlexLen - 1) * sizeof(Ball)]; + + for (int i = 0; i < cPlexLen; i++) { + runPtr->p0 = pTail; + pTail = runPtr; + + runPtr -= sizeof(Ball); + } + } + + Ball *res = pTail; + + pTail = res->p0; + res->p1 = ballP; + res->p0 = ballN; + numBalls++; + res->ani = 0; + + return res; } void BallChain::removeBall(Ball *ball) { |