aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2014-03-10 00:01:58 +0200
committerEugene Sandulenko2014-03-10 00:03:15 +0200
commitee9c03158bdfb974e544438f393e2adb44634caf (patch)
tree6f0cd94f17c028fd9b22527dab25eaefe7661f58 /engines/fullpipe
parent6de9af7eb637e51b8fd1db61f731d7a72c3fd980 (diff)
downloadscummvm-rg350-ee9c03158bdfb974e544438f393e2adb44634caf.tar.gz
scummvm-rg350-ee9c03158bdfb974e544438f393e2adb44634caf.tar.bz2
scummvm-rg350-ee9c03158bdfb974e544438f393e2adb44634caf.zip
FULLPIPE: Implement sceneHandler18and19_drawRiders()
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/constants.h7
-rw-r--r--engines/fullpipe/scenes.cpp2
-rw-r--r--engines/fullpipe/scenes.h2
-rw-r--r--engines/fullpipe/scenes/scene18and19.cpp124
4 files changed, 134 insertions, 1 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index b919ccdcb9..64f528a667 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -891,9 +891,13 @@ namespace Fullpipe {
#define MV_KSL_INBOY 1491
#define MV_KSL_INGIRL 1493
#define MV_KSL_INMAN 1504
+#define MV_KSL_JUMPBOY 1473
+#define MV_KSL_JUMPGIRL 1475
+#define MV_KSL_JUMPMAN 1509
#define MV_KSL_SWING 1460
#define MV_KSL_SWINGBOY 1462
#define MV_KSL_SWINGGIRL 1464
+#define MV_KSL_SWINGMAN 1502
#define MV_WHR18_SPIN 1300
#define PIC_SC18_DOMIN 5184
#define PIC_SC18_LADDER1 1471
@@ -902,9 +906,12 @@ namespace Fullpipe {
#define PIC_SC18_RTRUBA 1520
#define SND_18_006 3906
#define SND_18_010 4994
+#define ST_KSL_BOY 1463
+#define ST_KSL_GIRL 1465
#define ST_KSL_JUMPBOY 1492
#define ST_KSL_JUMPGIRL 1494
#define ST_KSL_JUMPMAN 1505
+#define ST_KSL_MAN 1503
// Scene 19
#define ANI_CORDIE 1529
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 09015937a5..763f142a38 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -295,6 +295,8 @@ Vars::Vars() {
scene18_var14 = -1;
scene18_var28 = 0;
scene18_var15 = 0;
+ scene18_var31 = 0;
+ scene18_var32 = 0;
scene18_boy = 0;
scene18_girl = 0;
scene18_domino = 0;
diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h
index 7d67aab61d..57f896a5ca 100644
--- a/engines/fullpipe/scenes.h
+++ b/engines/fullpipe/scenes.h
@@ -494,6 +494,8 @@ public:
int scene18_var25;
int scene18_var26;
int scene18_var27;
+ int scene18_var31;
+ int scene18_var32;
int scene18_var33;
int scene18_var13;
int scene18_var14;
diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp
index 8c03a8e078..29ee8ba211 100644
--- a/engines/fullpipe/scenes/scene18and19.cpp
+++ b/engines/fullpipe/scenes/scene18and19.cpp
@@ -448,8 +448,130 @@ void sceneHandler18and19_boyJumpTo() {
g_vars->scene18_boy->startAnim(MV_BOY18_JUMPTO, 0, -1);
}
+void sceneHandler18and19_girlJumpTo() {
+ warning("STUB: sceneHandler18and19_girlJumpTo()");
+}
+
+void sceneHandler18and19_manStandArmchair() {
+ warning("STUB: sceneHandler18and19_manStandArmchair()");
+}
+
void sceneHandler18and19_drawRiders() {
- warning("STUB: sceneHandler18and19_drawRiders()");
+ g_vars->scene18_var21++;
+
+ if (g_vars->scene18_var21 >= 359)
+ g_vars->scene18_var21 = 0;
+
+ for (int i = 0; i < g_vars->scene18_var07.size(); i++) {
+ Swinger *swinger = g_vars->scene18_var07[i];
+
+ double oldangle = swinger->angle;
+
+ swinger->angle += M_PI / 180;
+
+ if (swinger->angle > 2 * M_PI) {
+ swinger->angle -= 2 * M_PI;
+ oldangle -= 2 * M_PI;
+ }
+
+ int ix = g_vars->scene18_var20 - (int)(cos(swinger->angle) * -575.0);
+ int iy = g_vars->scene18_var04 - (int)(sin(swinger->angle) * -575.0) + 87;
+
+ if (!g_vars->scene18_var21) {
+ ix = swinger->sx;
+ iy = swinger->sy;
+ swinger->angle = (double)i * M_PI / 4;
+ }
+
+ if (swinger->ani->_movement)
+ swinger->ani->setOXY(ix - swinger->ix + swinger->ani->_movement->_ox, iy - swinger->iy + swinger->ani->_movement->_oy);
+ else
+ swinger->ani->setOXY(ix - swinger->ix + swinger->ani->_ox, iy - swinger->iy + swinger->ani->_oy);
+
+ swinger->ix = ix;
+ swinger->iy = iy;
+
+ if (!swinger->ani->_movement) {
+ int mv = 0;
+
+ if (swinger->sflags & 2) {
+ mv = MV_KSL_SWINGBOY;
+ } else if (swinger->sflags & 4) {
+ mv = MV_KSL_SWINGGIRL;
+ } else if (swinger->sflags & 0x20) {
+ mv = MV_KSL_SWINGMAN;
+ } else if (swinger->sflags & 1) {
+ mv = MV_KSL_SWING;
+ }
+
+ if (mv)
+ swinger->ani->startAnim(mv, 0, -1);
+
+ if (swinger->ani->_movement)
+ swinger->ani->_movement->_counter = 0;
+ }
+
+ if (g_vars->scene18_var22) {
+ if ((swinger->sflags & 2) && swinger->angle >= 2.792526803190933 && oldangle < 2.792526803190933) { // 8 pi / 9
+ swinger->sflags = 8;
+ swinger->ani->changeStatics2(ST_KSL_BOY);
+ swinger->ani->startAnim(MV_KSL_JUMPBOY, 0, -1);
+ g_vars->scene18_var32 = i;
+ } else if ((swinger->sflags & 4) && swinger->angle >= 2.82743338823082 && oldangle < 2.82743338823082) { // 9 pi / 10
+ swinger->sflags = 16;
+ swinger->ani->changeStatics2(ST_KSL_GIRL);
+ swinger->ani->startAnim(MV_KSL_JUMPGIRL, 0, -1);
+ g_vars->scene18_var32 = i;
+ } else if (g_vars->scene18_var23) {
+ if (g_vars->scene18_var24 > 0 && (swinger->sflags & 1) && swinger->angle >= 3.228859116189517 && oldangle < 3.228859116189517) { // 37 pi / 36
+ g_vars->scene18_var33 = i;
+ sceneHandler18and19_boyJumpTo();
+ }
+ } else if (g_vars->scene18_var25 > 0 && (swinger->sflags & 1) && swinger->angle >= 3.263765701229403 && oldangle < 3.263765701229403) { // 187 pi / 180
+ g_vars->scene18_var33 = i;
+ sceneHandler18and19_girlJumpTo();
+ }
+
+ if (swinger->angle >= 3.490658503988667 && oldangle < 3.490658503988667) { // 10 pi / 9
+ if (g_vars->scene18_var26)
+ g_vars->scene18_var24++;
+
+ g_vars->scene18_var26 = 0;
+ }
+ }
+
+ if (g_vars->scene18_var28 && (swinger->sflags & 1) && swinger->angle >= 1.448623279155297 && oldangle < 1.448623279155297) { // 83 pi / 180
+ g_vars->scene18_var27 = i;
+ sceneHandler18and19_manStandArmchair();
+ }
+
+ if (!g_vars->scene18_var15)
+ continue;
+
+ if (i == g_vars->scene18_var27) {
+ if (swinger->angle >= 2.967059728390367 && oldangle < 2.967059728390367) { // 17 pi / 18
+ g_fp->_gameLoader->preloadScene(SC_18, TrubaRight);
+ } else if (swinger->angle >= 0.4363323129985833 && oldangle < 0.4363323129985833) { // 5 pi / 36
+ g_fp->_gameLoader->preloadScene(SC_19, TrubaRight);
+ } else if (swinger->angle >= 4.1887902047864 && oldangle < 4.1887902047864) { // 4 pi / 3
+ g_fp->_sceneRect.translate(1200, 0);
+ }
+ }
+
+ if (g_vars->scene18_var13 > 0) {
+ if (swinger->sflags & 0x20) {
+ double newa = (double)g_vars->scene18_var14 * 0.01745329251994333;// pi / 180
+
+ if (newa <= swinger->angle && oldangle < newa) {
+ swinger->ani->changeStatics2(ST_KSL_MAN);
+ swinger->ani->startAnim(MV_KSL_JUMPMAN, 0, -1);
+ swinger->ani->_priority = 35;
+
+ g_vars->scene18_var31 = i;
+ }
+ }
+ }
+ }
}
void sceneHandler18and19_animateRiders() {