diff options
author | Eugene Sandulenko | 2014-02-03 15:11:51 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2014-02-03 15:46:39 +0200 |
commit | 8f9bc161f46b1b337c8a64254811b144dfebd9cd (patch) | |
tree | e63b816627cb48ab3df8b642f8c0089b80d94f69 | |
parent | fb14f656eebd529152f65a0e4672d4b3a1a3e7c0 (diff) | |
download | scummvm-rg350-8f9bc161f46b1b337c8a64254811b144dfebd9cd.tar.gz scummvm-rg350-8f9bc161f46b1b337c8a64254811b144dfebd9cd.tar.bz2 scummvm-rg350-8f9bc161f46b1b337c8a64254811b144dfebd9cd.zip |
FULLPIPE: Plug scene27 in
-rw-r--r-- | engines/fullpipe/constants.h | 10 | ||||
-rw-r--r-- | engines/fullpipe/module.mk | 1 | ||||
-rw-r--r-- | engines/fullpipe/scenes.cpp | 18 | ||||
-rw-r--r-- | engines/fullpipe/scenes.h | 42 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene27.cpp | 79 |
5 files changed, 120 insertions, 30 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index f22505ae78..cc09d9e4c9 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -1083,6 +1083,16 @@ namespace Fullpipe { #define ST_VNT26_RIGHT2 3348 #define ST_VNT26_UP2 1948 +// Scene 27 +#define ANI_BITA 2026 +#define ANI_BITAHANDLER 3349 +#define ANI_MAID 2015 +#define ANI_VODILLA 1994 +#define PIC_SC27_HITZONE2 4756 +#define ST_MID_BROOM 2022 +#define ST_MID_SPADE 3489 +#define ST_MID_SWAB2 2019 + // Scene 28 #define ANI_LIFT 982 #define ANI_LIFT_28 4238 diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk index f6a94de421..02999344e4 100644 --- a/engines/fullpipe/module.mk +++ b/engines/fullpipe/module.mk @@ -49,6 +49,7 @@ MODULE_OBJS = \ scenes/scene24.o \ scenes/scene25.o \ scenes/scene26.o \ + scenes/scene27.o \ scenes/scene28.o \ scenes/scene30.o \ scenes/scene31.o \ diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 71c8b1efb5..9075dba94a 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -300,6 +300,24 @@ Vars::Vars() { scene26_sock = 0; scene26_activeVent = 0; + scene27_var01 = 0; + scene27_var02 = 0; + scene27_var03 = 0; + scene27_var04 = 0; + scene27_hitZone = 0; + scene27_driver = 0; + scene27_maid = 0; + scene27_batHandler = 0; + scene27_var15 = 0; + scene27_bat = 0; + scene27_var08 = 0; + scene27_var09 = 0; + scene27_var10 = 0; + scene27_var11 = 0; + scene27_var12 = 0; + scene27_var13 = 0; + scene27_launchPhase = 0; + scene28_fliesArePresent = true; scene28_beardedDirection = true; scene28_darkeningObject = 0; diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index 5f77f74706..1f119b6712 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -25,6 +25,7 @@ namespace Fullpipe { +struct Bat; struct BehaviorEntryInfo; class MGM; class MctlLadder; @@ -183,6 +184,26 @@ 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) {} +}; + +struct BallChain { + Ball *pHead; + Ball *field_8; + int numBalls; + Ball *pTail; + Ball *cPlex; + int cPlexLen; + + BallChain() : pHead(0), field_8(0), pTail(0), numBalls(0), cPlex(0), cPlexLen(0) {} + ~BallChain() { free(cPlex); } +}; + class Vars { public: Vars(); @@ -461,6 +482,27 @@ public: StaticANIObject *scene26_sock; StaticANIObject *scene26_activeVent; + int scene27_var01; + int scene27_var02; + int scene27_var03; + int scene27_var04; + PictureObject *scene27_hitZone; + StaticANIObject *scene27_driver; + StaticANIObject *scene27_maid; + StaticANIObject *scene27_batHandler; + int scene27_var15; + StaticANIObject *scene27_bat; + int scene27_var08; + int scene27_var09; + int scene27_var10; + int scene27_var11; + int scene27_var12; + int scene27_var13; + int scene27_launchPhase; + BallChain scene27_balls; + Common::List<Bat *> scene27_bats; + Common::List<Bat *> scene27_var07; + bool scene28_fliesArePresent; bool scene28_beardedDirection; PictureObject *scene28_darkeningObject; diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp index 8d55a63193..2f00878f4f 100644 --- a/engines/fullpipe/scenes/scene27.cpp +++ b/engines/fullpipe/scenes/scene27.cpp @@ -36,6 +36,18 @@ namespace Fullpipe { +struct Bat { + StaticANIObject *ani; + int field_4; + double power; + int field_10; + int field_14; + double currX; + double currY; + double powerCos; + double powerSin; +}; + void scene27_initScene(Scene *sc) { g_vars->scene27_var01 = 200; g_vars->scene27_var02 = 200; @@ -50,10 +62,13 @@ void scene27_initScene(Scene *sc) { g_vars->scene27_balls.pTail = 0; g_vars->scene27_balls.field_8 = 0; g_vars->scene27_balls.pHead = 0; - CPlex::FreeDataChain(g_vars->scene27_balls.cPlex); + g_vars->scene27_balls.cPlexLen = 10; + + free(g_vars->scene27_balls.cPlex); g_vars->scene27_balls.cPlex = 0; - scene27_bats.clear(); - scene27_var07.clear(); + + g_vars->scene27_bats.clear(); + g_vars->scene27_var07.clear(); g_vars->scene27_var15 = 1; g_vars->scene27_bat = sc->getStaticANIObject1ById(ANI_BITA, -1); @@ -61,39 +76,43 @@ void scene27_initScene(Scene *sc) { for (int i = 0; i < 4; i++) { StaticANIObject *newbat = new StaticANIObject(g_vars->scene27_bat); - v5 = g_vars->scene27_balls.pTail; - v6 = g_vars->scene27_balls.field_8; + Ball *runPtr = g_vars->scene27_balls.pTail; + Ball *lastP = g_vars->scene27_balls.field_8; if (!g_vars->scene27_balls.pTail) { - v7 = CPlex::Create(&g_vars->scene27_balls.cPlex, g_vars->scene27_balls.cPlexLen, 12) + 4 + 12 * g_vars->scene27_balls.cPlexLen - 12; + g_vars->scene27_balls.cPlex = (Ball *)calloc(g_vars->scene27_balls.cPlexLen, sizeof(Ball)); + + Ball *p1 = g_vars->scene27_balls.cPlex + (g_vars->scene27_balls.cPlexLen - 1) * sizeof(Ball); + if (g_vars->scene27_balls.cPlexLen - 1 < 0) { - v5 = g_vars->scene27_balls.pTail; + runPtr = g_vars->scene27_balls.pTail; } else { - v8 = g_vars->scene27_balls.cPlexLen; - v5 = g_vars->scene27_balls.pTail; - do { - *(_DWORD *)v7 = v5; - v5 = (Ball *)v7; - v7 -= 12; - --v8; - } while (v8); - - g_vars->scene27_balls.pTail = v5; + runPtr = g_vars->scene27_balls.pTail; + + for (int j = 0; j < g_vars->scene27_balls.cPlexLen; j++) { + p1->p1 = runPtr; + runPtr = p1; + + p1 -= sizeof(Ball); + } + + g_vars->scene27_balls.pTail = runPtr; } } - g_vars->scene27_balls.pTail = v5->pNext; - v5->pPrev = v6; - v5->pNext = 0; - ++g_vars->scene27_balls.numBalls; - v5->ani = 0; - v5->ani = newbat; + g_vars->scene27_balls.pTail = runPtr->p0; + runPtr->p1 = lastP; + runPtr->p0 = 0; + runPtr->ani = newbat; + + g_vars->scene27_balls.numBalls++; if (g_vars->scene27_balls.field_8) - g_vars->scene27_balls.field_8->pNext = v5; + g_vars->scene27_balls.field_8->p0 = runPtr; else - g_vars->scene27_balls.pHead = v5; - g_vars->scene27_balls.field_8 = v5; + g_vars->scene27_balls.pHead = runPtr; + + g_vars->scene27_balls.field_8 = runPtr; sc->addStaticANIObject(newbat, 1); } @@ -106,15 +125,15 @@ void scene27_initScene(Scene *sc) { g_vars->scene27_var13 = 0; g_vars->scene27_launchPhase = 0; - oldsc = g_fp->_currentScene; + Scene *oldsc = g_fp->_currentScene; g_fp->_currentScene = sc; if (g_fp->getObjectState(sO_Maid) == g_fp->getObjectEnumState(sO_Maid, sO_WithSwab)) { - StaticANIObject_changeStatics2(g_vars->scene27_maid, ST_MID_SWAB2); + g_vars->scene27_maid->changeStatics2(ST_MID_SWAB2); } else if (g_fp->getObjectState(sO_Maid) == g_fp->getObjectEnumState(sO_Maid, sO_WithBroom)) { - StaticANIObject_changeStatics2(g_vars->scene27_maid, ST_MID_BROOM); + g_vars->scene27_maid->changeStatics2(ST_MID_BROOM); } else if (g_fp->getObjectState(sO_Maid) == g_fp->getObjectEnumState(sO_Maid, sO_WithSpade)) { - StaticANIObject_changeStatics2(g_vars->scene27_maid, ST_MID_SPADE); + g_vars->scene27_maid->changeStatics2(ST_MID_SPADE); } g_fp->_currentScene = oldsc; |