aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-03-01 13:15:37 +0200
committerEugene Sandulenko2014-03-01 13:15:54 +0200
commit094a86e076473dfbbed6f8e35db9243817e0d3a8 (patch)
tree796f79d449f160b6b61f426c9ef79b52e9fa3327
parentafd21ac388e157238515b58f93f67aa9d4f3ac7c (diff)
downloadscummvm-rg350-094a86e076473dfbbed6f8e35db9243817e0d3a8.tar.gz
scummvm-rg350-094a86e076473dfbbed6f8e35db9243817e0d3a8.tar.bz2
scummvm-rg350-094a86e076473dfbbed6f8e35db9243817e0d3a8.zip
FULLPIPE: Implement scene18_initScene1()
-rw-r--r--engines/fullpipe/constants.h5
-rw-r--r--engines/fullpipe/scenes.cpp1
-rw-r--r--engines/fullpipe/scenes.h3
-rw-r--r--engines/fullpipe/scenes/scene18and19.cpp123
4 files changed, 132 insertions, 0 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index e2152003e7..cd0a38ebf3 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -877,6 +877,7 @@ namespace Fullpipe {
#define ANI_GIRL18 1484
#define ANI_KRESLO 1459
#define ANI_WHIRLIGIG_18 829
+#define MV_WHR18_SPIN 1300
#define PIC_SC18_DOMIN 5184
#define PIC_SC18_LADDER1 1471
#define PIC_SC18_LADDER2 1472
@@ -886,7 +887,11 @@ namespace Fullpipe {
#define SND_18_010 4994
// Scene 19
+#define ANI_WHIRLGIG_19 1302
+#define MV_WHR19_SPIN 1317
#define PIC_SC19_RTRUBA3 1515
+#define SND_19_015 3928
+#define SND_19_016 4995
// Scene 20
#define ANI_GRANDMA_20 2427
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index aadbe38db7..b7ef569bcc 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -279,6 +279,7 @@ Vars::Vars() {
scene18_var20 = 1032;
scene18_var04 = -318;
scene18_var08 = 0;
+ scene18_var09 = 0;
scene18_var03 = false;
scene18_var21 = 0;
scene18_var11 = 0;
diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h
index 5d6856fefe..56aa5019a6 100644
--- a/engines/fullpipe/scenes.h
+++ b/engines/fullpipe/scenes.h
@@ -32,6 +32,7 @@ class MGM;
class MctlLadder;
struct Ring;
class StaticANIObject;
+struct Swinger;
int defaultUpdateCursor();
@@ -466,9 +467,11 @@ public:
int scene18_var18;
int scene18_var19;
StaticANIObject *scene18_whirlgig;
+ Common::Array<Swinger *> scene18_var07;
int scene18_var20;
int scene18_var04;
int scene18_var08;
+ int scene18_var09;
bool scene18_var03;
int scene18_var21;
int scene18_var11;
diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp
index 4994a02b87..93bf00077c 100644
--- a/engines/fullpipe/scenes/scene18and19.cpp
+++ b/engines/fullpipe/scenes/scene18and19.cpp
@@ -36,6 +36,18 @@
namespace Fullpipe {
+struct Swinger {
+ StaticANIObject *ani;
+ int sfield_4;
+ double angle;
+ int sx;
+ int sy;
+ int ix;
+ int iy;
+ int sflags;
+ int sfield_24;
+};
+
void scene18_preload() {
warning("WARNING: scene18_preload()");
}
@@ -48,6 +60,117 @@ void scene18_sub2(StaticANIObject *ani, Scene *sc) {
warning("WARNING: scene18_sub2()");
}
+void scene18_initScene1(Scene *sc) {
+ PicAniInfo info;
+
+ int oldx = g_vars->scene18_var20;
+ int oldy = g_vars->scene18_var04;
+
+ g_vars->scene18_var03 = (g_fp->getObjectState(sO_Girl) == g_fp->getObjectEnumState(sO_Girl, sO_IsSwinging));
+
+ if (sc->_sceneId == SC_18) {
+ g_vars->scene18_whirlgig = sc->getStaticANIObject1ById(ANI_WHIRLIGIG_18, -1);
+ g_vars->scene18_var20 = 1032;
+ g_vars->scene18_var04 = -318;
+ } else {
+ g_vars->scene18_whirlgig = sc->getStaticANIObject1ById(ANI_WHIRLGIG_19, -1);
+ g_vars->scene18_var20 = 1024;
+ g_vars->scene18_var04 = 242;
+ }
+
+ int newx = g_vars->scene18_var20 - oldx;
+ int newy = g_vars->scene18_var04 - oldy;
+
+ g_vars->scene18_var29 += newx;
+ g_vars->scene18_var30 += newy;
+ g_vars->scene18_var05 += newx;
+ g_vars->scene18_var06 += newy;
+
+ for (uint i = 0; i < g_vars->scene18_var07.size(); i++) {
+ g_vars->scene18_var07[i]->ani->getPicAniInfo(&info);
+ sc->addStaticANIObject(g_vars->scene18_var07[i]->ani, 1);
+ g_vars->scene18_var07[i]->ani->setPicAniInfo(&info);
+
+ g_vars->scene18_var07[i]->sx += newx;
+ g_vars->scene18_var07[i]->sy += newy;
+ g_vars->scene18_var07[i]->ix += newx;
+ g_vars->scene18_var07[i]->iy += newy;
+
+ GameObject *go;
+
+ if (g_vars->scene18_var07[i]->ani->_movement)
+ go = g_vars->scene18_var07[i]->ani->_movement;
+ else
+ go = g_vars->scene18_var07[i]->ani;
+
+ go->setOXY(newx + go->_ox, newy + go->_oy);
+ }
+
+ if (g_vars->scene18_var08 && g_vars->scene18_var09 != -1) {
+ g_vars->scene18_whirlgig->startAnim(sc->_sceneId != SC_18 ? MV_WHR19_SPIN : MV_WHR18_SPIN, 0, -1);
+ g_vars->scene18_whirlgig->_movement->setDynamicPhaseIndex(g_vars->scene18_var09);
+ }
+
+ int sndid;
+
+ if (sc->_sceneId == SC_19) {
+ if (g_vars->scene18_var08)
+ sndid = SND_19_015;
+ else
+ sndid = SND_19_016;
+ } else {
+ if (g_vars->scene18_var08)
+ sndid = SND_18_006;
+ else
+ sndid = SND_18_010;
+ }
+
+ g_fp->playSound(sndid, 1);
+
+ g_vars->scene18_boy->getPicAniInfo(&info);
+ sc->addStaticANIObject(g_vars->scene18_boy, 1);
+ g_vars->scene18_boy->setPicAniInfo(&info);
+
+ int x, y;
+
+ if (g_vars->scene18_boy->_movement) {
+ x = g_vars->scene18_boy->_movement->_ox;
+ y = g_vars->scene18_boy->_movement->_oy;
+ } else {
+ x = g_vars->scene18_boy->_ox;
+ y = g_vars->scene18_boy->_oy;
+ }
+
+ g_vars->scene18_boy->setOXY(newx + x, newy + y);
+
+ g_vars->scene18_girl->getPicAniInfo(&info);
+ sc->addStaticANIObject(g_vars->scene18_girl, 1);
+ g_vars->scene18_girl->setPicAniInfo(&info);
+
+ if (g_vars->scene18_girl->_movement) {
+ x = g_vars->scene18_girl->_movement->_ox;
+ y = g_vars->scene18_girl->_movement->_oy;
+ } else {
+ x = g_vars->scene18_girl->_ox;
+ y = g_vars->scene18_girl->_oy;
+ }
+
+ g_vars->scene18_girl->setOXY(newx + x, newy + y);
+
+ g_vars->scene18_var12 = 0;
+ g_vars->scene18_var13 = -1;
+ g_vars->scene18_var14 = -1;
+
+ if (g_vars->scene18_var15) {
+ if (sc->_sceneId == SC_19)
+ g_fp->_aniMan2 = 0;
+ else
+ g_fp->_aniMan2 = g_vars->scene18_var07[g_vars->scene18_var27]->ani;
+ } else {
+ g_fp->_aniMan2 = g_fp->_aniMan;
+ }
+}
+
void scene18_initScene2(Scene *sc) {
g_vars->scene18_var16 = 200;
g_vars->scene18_var17 = 200;