diff options
author | Eugene Sandulenko | 2014-05-29 09:04:50 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-05-29 09:04:50 +0300 |
commit | 5903bacd2517a4f1e59b754baf5866b0d964ef65 (patch) | |
tree | 36e788d2cbf9ab55553dfe7e3bef4d3eee4c4054 /engines/fullpipe/scenes.cpp | |
parent | 5eaddc58633d6ed32ff145b3c5856143dc7ec827 (diff) | |
download | scummvm-rg350-5903bacd2517a4f1e59b754baf5866b0d964ef65.tar.gz scummvm-rg350-5903bacd2517a4f1e59b754baf5866b0d964ef65.tar.bz2 scummvm-rg350-5903bacd2517a4f1e59b754baf5866b0d964ef65.zip |
FULLPIPE: Implement BallChain::sub04()
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) { |