aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2014-03-04 23:19:33 +0200
committerEugene Sandulenko2014-03-04 23:19:48 +0200
commitee3f26e4b6548b93419b9729645ae2c3c2b5ab81 (patch)
treee1d22c094c3e90da6c0d4f292c7759e1586867b6 /engines
parentbb290873320bcd87e1e0c915be03518a9ab0d355 (diff)
downloadscummvm-rg350-ee3f26e4b6548b93419b9729645ae2c3c2b5ab81.tar.gz
scummvm-rg350-ee3f26e4b6548b93419b9729645ae2c3c2b5ab81.tar.bz2
scummvm-rg350-ee3f26e4b6548b93419b9729645ae2c3c2b5ab81.zip
FULLPIPE: Implement scene18_setupSwingers()
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/constants.h3
-rw-r--r--engines/fullpipe/scenes/scene18and19.cpp56
2 files changed, 56 insertions, 3 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index 6f98e1a8d3..d84b6396ce 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -877,6 +877,9 @@ namespace Fullpipe {
#define ANI_GIRL18 1484
#define ANI_KRESLO 1459
#define ANI_WHIRLIGIG_18 829
+#define MV_KSL_SWING 1460
+#define MV_KSL_SWINGBOY 1462
+#define MV_KSL_SWINGGIRL 1464
#define MV_WHR18_SPIN 1300
#define PIC_SC18_DOMIN 5184
#define PIC_SC18_LADDER1 1471
diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp
index 759af9127b..8319c83d29 100644
--- a/engines/fullpipe/scenes/scene18and19.cpp
+++ b/engines/fullpipe/scenes/scene18and19.cpp
@@ -134,8 +134,58 @@ void scene19_preload() {
}
}
-void scene18_sub2(StaticANIObject *ani, Scene *sc) {
- warning("WARNING: scene18_sub2()");
+void scene18_setupSwingers(StaticANIObject *ani, Scene *sc) {
+ Swinger *swinger;
+
+ g_vars->scene18_var07.clear();
+
+ Scene *oldsc = g_fp->_currentScene;
+ g_fp->_currentScene = sc;
+
+ for (int i = 0; i < 8; i++) {
+ swinger = new Swinger;
+
+ swinger->angle = (double)i * M_PI / 4.0;
+ swinger->sx = g_vars->scene18_var20 - (int)(cos(swinger->angle) * -575.0);
+ swinger->sy = g_vars->scene18_var04 - (int)(sin(swinger->angle) * -575.0) + 87;
+ swinger->ix = swinger->sx;
+ swinger->iy = swinger->sy;
+
+ if (i) {
+ StaticANIObject *newani = new StaticANIObject(ani);
+
+ ani = newani;
+
+ swinger->ani = newani;
+ swinger->sflags = 2;
+
+ sc->addStaticANIObject(newani, 1);
+ } else {
+ swinger->ani = ani;
+ swinger->sflags = g_vars->scene18_var03 != 0 ? 4 : 1;
+ }
+
+ ani->_statics = ani->getStaticsById(ST_KSL_NORM);
+ ani->_movement = 0;
+ ani->setOXY(swinger->sx, swinger->sy);
+ ani->_priority = 30;
+ ani->_flags |= 4;
+
+ if (swinger->sflags & 2) {
+ ani->startAnim(MV_KSL_SWINGBOY, 0, -1);
+ } else {
+ if (swinger->sflags & 4)
+ ani->startAnim(MV_KSL_SWINGGIRL, 0, -1);
+ else
+ ani->startAnim(MV_KSL_SWING, 0, -1);
+ }
+
+ ani->_movement->setDynamicPhaseIndex(g_fp->_rnd->getRandomNumber(17));
+
+ g_vars->scene18_var07.push_back(swinger);
+ }
+
+ g_fp->_currentScene = oldsc;
}
void scene18_initScene1(Scene *sc) {
@@ -272,7 +322,7 @@ void scene18_initScene2(Scene *sc) {
g_fp->playSound(SND_18_010, 1);
}
- scene18_sub2(armchair, sc);
+ scene18_setupSwingers(armchair, sc);
g_vars->scene18_var21 = 0;
g_vars->scene18_var12 = 0;