From af286d86fae92b6465d665dae8939afa313fc399 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 14 Sep 2016 10:57:41 +0200 Subject: FULLPIPE: Remove now unused BallChain class --- engines/fullpipe/scenes.cpp | 72 --------------------------------------------- engines/fullpipe/scenes.h | 27 ----------------- 2 files changed, 99 deletions(-) (limited to 'engines/fullpipe') diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index c7c303f2e0..d37f5dba39 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1436,76 +1436,4 @@ void FullpipeEngine::updateMap(PreloadItem *pre) { } } -void BallChain::init(Ball **ball) { - *ball = pTail; - pTail = (Ball *)ball; - numBalls--; - - if (!numBalls) { - for (Ball *i = pHead; i; i = i->p0 ) - ; - numBalls = 0; - pTail = 0; - field_8 = 0; - pHead = 0; - free(cPlex); - cPlex = 0; - } -} - -Ball *BallChain::sub04(Ball *ballP, Ball *ballN) { - if (!pTail) { - if (!cPlexLen) - error("BallChain::sub04: cPlexLen is 0"); - - cPlex = (byte *)calloc(cPlexLen, sizeof(Ball)); - - Ball *runPtr = (Ball *)&cPlex[(cPlexLen - 1) * sizeof(Ball)]; - - for (int i = 0; i < cPlexLen; i++) { - runPtr->p0 = pTail; - pTail = runPtr; - - runPtr--; - } - } - - Ball *res = pTail; - - pTail = res->p0; - res->p1 = ballP; - res->p0 = ballN; - numBalls++; - res->ani = 0; - - return res; -} - -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; - } -} - - } // End of namespace Fullpipe diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index 43bdb38191..fc593a6088 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -211,33 +211,6 @@ int sceneHandlerFinal(ExCommand *cmd); void sceneDbgMenu_initScene(Scene *sc); int sceneHandlerDbgMenu(ExCommand *cmd); -struct Ball { - Ball *p0; - Ball *p1; - StaticANIObject *ani; - - Ball() : p0(0), p1(0), ani(0) {} -}; - -typedef Common::Array BallArray; - -struct BallChain { - Ball *pHead; - Ball *field_8; - int numBalls; - Ball *pTail; - byte *cPlex; - int cPlexLen; - - BallChain() : pHead(0), field_8(0), pTail(0), numBalls(0), cPlex(0), cPlexLen(0) {} - ~BallChain() { free(cPlex); } - - void init(Ball **ball); - Ball *sub04(Ball *ballP, Ball *ballN); - void removeBall(Ball *ball); - void reset() { pHead = 0; pTail = 0; field_8 = 0; numBalls = 0; free(cPlex); cPlex = 0; cPlexLen = 0; } -}; - class Vars { public: Vars(); -- cgit v1.2.3