aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2013-11-21 21:04:24 -0800
committerEugene Sandulenko2013-11-22 00:45:32 -0700
commit8ae2cf1ed418cec0cd3dec6758900068ad173c02 (patch)
tree89d5b4cadae365f2d710192e1ece83fa9ed13512
parentdc2685ddef6466f462638e8e9d835651d94918d1 (diff)
downloadscummvm-rg350-8ae2cf1ed418cec0cd3dec6758900068ad173c02.tar.gz
scummvm-rg350-8ae2cf1ed418cec0cd3dec6758900068ad173c02.tar.bz2
scummvm-rg350-8ae2cf1ed418cec0cd3dec6758900068ad173c02.zip
FULLPIPE: Implement switchScene04
-rw-r--r--engines/fullpipe/constants.h30
-rw-r--r--engines/fullpipe/scenes.cpp5
-rw-r--r--engines/fullpipe/scenes.h6
-rw-r--r--engines/fullpipe/scenes/scene04.cpp300
4 files changed, 251 insertions, 90 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index a2e8121f8f..fd1a0112b0 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -48,6 +48,9 @@ namespace Fullpipe {
#define ANI_SC4_BOOT 1035
#define ANI_SPEAKER_4 3275
#define ANI_SPRING 542
+#define MSG_CLICKBOTTLE 569
+#define MSG_CLICKBUTTON 609
+#define MSG_CLICKPLANK 549
#define MSG_CMN_WINARCADE 4778
#define MSG_DISABLESAVES 5201
#define MSG_ENABLESAVES 5202
@@ -57,13 +60,16 @@ namespace Fullpipe {
#define MSG_INTR_GETUPMAN 5135
#define MSG_INTR_SWITCHTO1 5145
#define MSG_INTR_SWITCHTO2 5134
+#define MSG_KOZAWRESTART 546
#define MSG_LIFT_CLICKBUTTON 2780
#define MSG_LIFT_CLOSEDOOR 5194
#define MSG_LIFT_EXITLIFT 5187
#define MSG_LIFT_GO 1065
#define MSG_LIFT_STARTEXITQUEUE 5186
+#define MSG_LOWERPLANK 540
#define MSG_MANSHADOWSOFF 5196
#define MSG_MANSHADOWSON 5197
+#define MSG_RAISEPLANK 547
#define MSG_RESTARTGAME 4767
#define MSG_SC1_SHOWOSK 1019
#define MSG_SC1_SHOWOSK2 468
@@ -78,10 +84,30 @@ namespace Fullpipe {
#define MSG_SC3_TAKEEGG 1583
#define MSG_SC3_TESTFAT 1582
#define MSG_SC3_UTRUBACLICK 1103
+#define MSG_SC4_COINOUT 2895
+#define MSG_SC4_COINPUT 1032
+#define MSG_SC4_CLICKLADDER 1439
+#define MSG_SC4_DROPBOTTLE 2896
+#define MSG_SC4_HANDOVER 2960
+#define MSG_SC4_HIDEBOOT 4563
+#define MSG_SC4_KOZAWFALL 2858
+#define MSG_SC4_MANFROMBOTTLE 2854
+#define MSG_SC4_MANTOBOTTLE 2852
+#define PIC_SC4_LADDER 1438
+#define MSG_GOTOLADDER 618
+#define MSG_SHAKEBOTTLE 584
+#define MSG_SHOOTKOZAW 557
+#define MSG_SHOWCOIN 1033
+#define MSG_STARTHAND 612
+#define MSG_TAKEBOTTLE 614
+#define MSG_TAKEKOZAW 611
+#define MSG_TESTPLANK 538
+#define MSG_UPDATEBOTTLE 613
#define MV_EGTR_FATASK 5332
#define MV_IN1MAN_SLEEP 5111
#define MV_KZW_JUMP 558
#define MV_KZW_JUMPROTATE 561
+#define MV_MAN_GOD 481
#define MV_MAN_GOLADDER 451
#define MV_MAN_GOLADDER2 2844
#define MV_MAN_LOOKUP 4773
@@ -142,6 +168,7 @@ namespace Fullpipe {
#define PIC_SC4_BOTTLE 568
#define PIC_SC4_BOTTLE2 2936
#define PIC_SC4_DOWNTRUBA 619
+#define PIC_SC4_LADDER 1438
#define PIC_SC4_LRTRUBA 616
#define PIC_SC4_MASK 585
#define PIC_SC4_PLANK 5183
@@ -207,9 +234,12 @@ namespace Fullpipe {
#define SC_MAP 5222
#define SC_TEST 903
#define SC_TITLES 5166
+#define SND_4_010 3125
+#define SND_4_012 3127
#define SND_CMN_031 3516
#define SND_CMN_070 5199
#define SND_INTR_019 5220
+#define ST_CLK_CLOSED 590
#define ST_DYAS_LIES 318
#define ST_EGTR_MID1 2863
#define ST_EGTR_MID2 2869
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 801734eff8..6771fe8ec8 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -73,6 +73,9 @@ Vars::Vars() {
scene04_soundPlaying = false;
scene04_dynamicPhaseIndex = 0;
+ scene04_sceneClickX = 0;
+ scene04_sceneClickY = 0;
+
scene04_var01 = 0;
scene04_var02 = 0;
scene04_var04 = 0;
@@ -91,6 +94,8 @@ Vars::Vars() {
scene04_var17 = 0;
scene04_var18 = 0;
scene04_var19 = 0;
+ scene04_var20 = 0;
+ scene04_var24 = 0;
selector = 0;
}
diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h
index 0ed1b82a7e..4131fbb676 100644
--- a/engines/fullpipe/scenes.h
+++ b/engines/fullpipe/scenes.h
@@ -97,6 +97,10 @@ public:
bool scene04_coinPut;
bool scene04_soundPlaying;
int scene04_dynamicPhaseIndex;
+ int scene04_sceneClickX;
+ int scene04_sceneClickY;
+ int scene04_dudePosX;
+ int scene04_dudePosY;
int scene04_var01;
int scene04_var02;
@@ -116,6 +120,8 @@ public:
int scene04_var17;
int scene04_var18;
int scene04_var19;
+ int scene04_var20;
+ StaticANIObject *scene04_var24;
PictureObject *selector;
};
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index c51a6d7a11..119fed5041 100644
--- a/engines/fullpipe/scenes/scene04.cpp
+++ b/engines/fullpipe/scenes/scene04.cpp
@@ -32,6 +32,7 @@
#include "fullpipe/scene.h"
#include "fullpipe/interaction.h"
#include "fullpipe/gameloader.h"
+#include "fullpipe/behavior.h"
namespace Fullpipe {
@@ -211,14 +212,129 @@ int scene04_updateCursor() {
return g_fullpipe->_cursorId;
}
+void sceneHandlers_sub01(ExCommand *ex) {
+ warning("sceneHandlers_sub01()");
+}
+
+void sceneHandler04_clickBottle() {
+ warning("sceneHandler04_clickBottle()");
+}
+
+void sceneHandler04_clickButton() {
+ warning("sceneHandler04_clickButton()");
+}
+
+void sceneHandler04_clickLadder() {
+ warning("sceneHandler04_clickLadder()");
+}
+
+void sceneHandler04_clickPlank() {
+ warning("sceneHandler04_clickPlank()");
+}
+
+void sceneHandler04_dropBottle() {
+ warning("sceneHandler04_dropBottle()");
+}
+
+void sceneHandler04_gotoLadder(int par) {
+ warning("sceneHandler04_gotoLadder()");
+}
+
+void sceneHandler04_lowerPlank() {
+ warning("sceneHandler04_lowerPlank()");
+}
+
+void sceneHandler04_manFromBottle() {
+ warning("sceneHandler04_manFromBottle()");
+}
+
+void sceneHandler04_manToBottle() {
+ warning("sceneHandler04_manToBottle()");
+}
+
+void sceneHandler04_raisePlank() {
+ warning("sceneHandler04_raisePlank()");
+}
+
+void sceneHandler04_shootKozyawka() {
+ warning("sceneHandler04_shootKozyawka()");
+}
+
+void sceneHandler04_showCoin() {
+ warning("sceneHandler04_showCoin()");
+}
+
+void sceneHandler04_stopSound() {
+ warning("sceneHandler04_stopSound()");
+}
+
+void sceneHandler04_sub1(ExCommand *ex) {
+ warning("sceneHandler04_sub1()");
+}
+
+void sceneHandler04_sub3() {
+ warning("sceneHandler04_sub3()");
+}
+
+void sceneHandler04_sub4() {
+ warning("sceneHandler04_sub4()");
+}
+
+void sceneHandler04_sub5() {
+ warning("sceneHandler04_sub5()");
+}
+
+void sceneHandler04_sub6() {
+ warning("sceneHandler04_sub6()");
+}
+
+void sceneHandler04_sub7() {
+ warning("sceneHandler04_sub7()");
+}
+
+void sceneHandler04_sub8(ExCommand *ex) {
+ warning("sceneHandler04_sub8()");
+}
+
+void sceneHandler04_sub9(StaticANIObject *ani) {
+ warning("sceneHandler04_sub9()");
+}
+
+void sceneHandler04_sub15() {
+ warning("sceneHandler04_sub15()");
+}
+
+void sceneHandler04_sub17() {
+ warning("sceneHandler04_sub17()");
+}
+
+void sceneHandler04_takeBottle() {
+ warning("sceneHandler04_takeBottle()");
+}
+
+void sceneHandler04_takeKozyawka() {
+ warning("sceneHandler04_takeKozyawka()");
+}
+
+void sceneHandler04_testPlank(ExCommand *ex) {
+ warning("sceneHandler04_testPlank()");
+}
+
+void sceneHandler04_updateBottle() {
+ warning("sceneHandler04_updateBottle()");
+}
+
+void sceneHandler04_winArcade() {
+ warning("sceneHandler04_winArcade()");
+}
+
int sceneHandler04(ExCommand *ex) {
-#if 0
if (ex->_messageKind != 17)
return 0;
switch (ex->_messageNum) {
case MSG_UPDATEBOTTLE:
- sceneHandler04_msgUpdateBottle();
+ sceneHandler04_updateBottle();
break;
case MSG_CLICKBOTTLE:
@@ -226,7 +342,7 @@ int sceneHandler04(ExCommand *ex) {
break;
case MSG_SHOOTKOZAW:
- sceneHandler04_chootKozyawka();
+ sceneHandler04_shootKozyawka();
break;
case MSG_SHAKEBOTTLE:
@@ -277,120 +393,129 @@ int sceneHandler04(ExCommand *ex) {
break;
case MSG_TESTPLANK:
- sceneHandler04_testPlank((int)ex);
+ sceneHandler04_testPlank(ex);
break;
case 33:
- g_vars->scene04_dudePosX = g_fullpipe->_aniMan->_ox;
- g_vars->scene04_dudePosY = g_fullpipe->_aniMan->_oy;
+ {
+ g_vars->scene04_dudePosX = g_fullpipe->_aniMan->_ox;
+ g_vars->scene04_dudePosY = g_fullpipe->_aniMan->_oy;
- int res = 0;
+ int res = 0;
- if (g_fullpipe->_aniMan2) {
- if (g_fullpipe->_aniMan->_ox < g_fullpipe->_sceneRect.left + 200) {
- g_currentScene->_x = g_fullpipe->_aniMan->_ox - g_fullpipe->_sceneRect.left - 300;
- g_fullpipe->_aniMan->_ox = g_vars->scene04_dudePosX;
- }
- if (g_fullpipe->_aniMan->_ox > g_fullpipe->_sceneRect.right - 200) {
- g_currentScene->_x = g_fullpipe->_aniMan->_ox - g_fullpipe->_sceneRect.right + 300;
- }
+ if (g_fullpipe->_aniMan2) {
+ if (g_fullpipe->_aniMan->_ox < g_fullpipe->_sceneRect.left + 200) {
+ g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan->_ox - g_fullpipe->_sceneRect.left - 300;
+ g_fullpipe->_aniMan->_ox = g_vars->scene04_dudePosX;
+ }
+ if (g_fullpipe->_aniMan->_ox > g_fullpipe->_sceneRect.right - 200) {
+ g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan->_ox - g_fullpipe->_sceneRect.right + 300;
+ }
- res = 1;
+ res = 1;
- if (g_vars->scene04_soundPlaying) {
- if (g_fullpipe->_aniMan->_movement) {
- if (g_fullpipe->_aniMan->_movement->_id == MV_MAN_TOLADDER) {
- g_fullpipe->_aniMan2 = 0;
- if (g_fullpipe->_sceneRect.left > 380)
- g_currentScene->bg.x = 380 - g_fullpipe->_sceneRect.left;
+ if (g_vars->scene04_soundPlaying) {
+ if (g_fullpipe->_aniMan->_movement) {
+ if (g_fullpipe->_aniMan->_movement->_id == MV_MAN_TOLADDER) {
+ g_fullpipe->_aniMan2 = 0;
+
+ if (g_fullpipe->_sceneRect.left > 380)
+ g_fullpipe->_currentScene->_x = 380 - g_fullpipe->_sceneRect.left;
+ }
}
}
+ } else {
+ if (g_fullpipe->_aniMan->_movement && g_fullpipe->_aniMan->_movement->_id == MV_MAN_GOD)
+ g_fullpipe->_aniMan2 = g_fullpipe->_aniMan;
}
- } else {
- v7 = ;
- if (g_fullpipe->_aniMan->_movement && g_fullpipe->_aniMan->_movement->_id == MV_MAN_GOD)
- g_fullpipe->_aniMan2 = g_fullpipe->_aniMan;
- }
- sceneHandler04_sub4();
+ sceneHandler04_sub4();
- if (g_vars->scene04_var07 && !g_vars->scene04_var09)
- sceneHandler04_sub5();
+ if (g_vars->scene04_var07 && !g_vars->scene04_var09)
+ sceneHandler04_sub5();
- if (g_vars->scene04_var12)
- sceneHandler04_sub6();
+ if (g_vars->scene04_var12)
+ sceneHandler04_sub6();
- if (g_vars->scene04_var08)
- sceneHandler04_clickLadder();
+ if (g_vars->scene04_var08)
+ sceneHandler04_clickLadder();
- if (g_vars->scene04_var10 && g_vars->scene04_hand->_movement)
- sceneHandler04_sub1(0);
+ if (g_vars->scene04_var10 && g_vars->scene04_hand->_movement)
+ sceneHandler04_sub1(0);
- if (g_vars->scene04_coinPut && g_vars->scene04_var18 && !g_vars->scene04_var09 && !g_vars->scene04_soundPlaying)
- sceneHandler04_sub7();
+ if (g_vars->scene04_coinPut && g_vars->scene04_var18 && !g_vars->scene04_var09 && !g_vars->scene04_soundPlaying)
+ sceneHandler04_sub7();
- if (g_vars->scene04_var01) {
- if (!g_vars->scene04_soundPlaying) {
- startSceneTrack();
+ if (g_vars->scene04_var01) {
+ if (!g_vars->scene04_soundPlaying) {
+ g_fullpipe->startSceneTrack();
+ g_fullpipe->_behaviorManager->updateBehaviors();
+ return res;
+ }
+
+ g_vars->scene04_var14++;
+
+ if (g_vars->scene04_var14 > 600)
+ sceneHandler04_sub17();
+ }
+
+ if (g_vars->scene04_soundPlaying) {
g_fullpipe->_behaviorManager->updateBehaviors();
+
return res;
}
- v11 = __OFSUB__(g_vars->scene04_var14 + 1, 600);
- v9 = g_vars->scene04_var14 == 599;
- v10 = g_vars->scene04_var14++ - 599 < 0;
- if (!((unsigned __int8)(v10 ^ v11) | v9))
- sceneHandler04_sub17();
- }
+ g_fullpipe->startSceneTrack();
- if (g_vars->scene04_soundPlaying) {
g_fullpipe->_behaviorManager->updateBehaviors();
return res;
}
- startSceneTrack();
+ case 29:
+ {
+ int picid = g_fullpipe->_currentScene->getPictureObjectIdAtPos(ex->_sceneClickX, ex->_sceneClickY);
- g_fullpipe->_behaviorManager->updateBehaviors();
+ if (g_vars->scene04_var10) {
+ sceneHandler04_sub1(ex);
- return res;
+ break;
+ }
- case 29:
- v12 = Scene_getPictureObjectIdAtPos(g_currentScene, ex->msg.sceneClickX, ex->msg.sceneClickY);
- LOWORD(sceneHandler_pic) = v12;
- if (g_vars->scene04_var10) {
- sceneHandler04_sub1(ex);
- break;
- }
+ if (picid == PIC_SC4_LADDER) {
+ if (!g_vars->scene04_var04) {
+ g_vars->scene04_sceneClickX = ex->_sceneClickX;
+ g_vars->scene04_sceneClickY = ex->_sceneClickY;
- if (v12 == PIC_SC4_LADDER) {
- if (!g_vars->scene04_var04) {
- dword_476CB8 = ex->msg.sceneClickX;
- dword_476CBC = ex->msg.sceneClickY;
- sceneHandler04_clickLadder();
- ex->msg.messageKind = 0;
+ sceneHandler04_clickLadder();
+
+ ex->_messageKind = 0;
+
+ break;
+ }
+
+ sceneHandler04_gotoLadder(0);
break;
}
- sceneHandler04_gotoLadder(0);
- break;
- }
- v13 = Scene_getStaticANIObjectAtPos(g_currentScene, ex->msg.sceneClickX, ex->msg.sceneClickY);
- v14 = (GameObject *)v13;
- if (v13 && v13->GameObject.id == ANI_PLANK
- || Scene_getPictureObjectIdAtPos(g_currentScene, ex->msg.sceneClickX, ex->msg.sceneClickY) == PIC_SC4_PLANK) {
- sceneHandler04_clickPlank();
- ex->msg.messageKind = 0;
- } else if (g_vars->scene04_var01) {
- sceneHandler04_sub8(ex);
- } else if (!v14 || !canInteractAny(&g_fullpipe->_aniMan->GameObject, v14, LOWORD(ex->msg.keyCode))) {
- v15 = (GameObject *)Scene_getPictureObjectById(g_currentScene, sceneHandler_pic, 0);
- if (!v15 || !canInteractAny(&g_fullpipe->_aniMan->GameObject, v15, LOWORD(ex->msg.keyCode))) {
- if ((v16 = ex->msg.sceneClickX, g_fullpipe->_sceneRect.right - v16 < 47) && g_fullpipe->_sceneRect.right < g_sceneWidth - 1
- || v16 - g_fullpipe->_sceneRect.left < 47 && g_fullpipe->_sceneRect.left > 0)
- sceneHandlers_sub01(ex);
+ StaticANIObject *ani = g_fullpipe->_currentScene->getStaticANIObjectAtPos(ex->_sceneClickX, ex->_sceneClickY);
+
+ if ((ani && ani->_id == ANI_PLANK) || picid == PIC_SC4_PLANK) {
+ sceneHandler04_clickPlank();
+
+ ex->_messageKind = 0;
+ } else if (g_vars->scene04_var01) {
+ sceneHandler04_sub8(ex);
+ } else if (!ani || !canInteractAny(g_fullpipe->_aniMan, ani, ex->_keyCode)) {
+ PictureObject *pic = g_fullpipe->_currentScene->getPictureObjectById(picid, 0);
+
+ if (!pic || !canInteractAny(g_fullpipe->_aniMan, pic,ex->_keyCode)) {
+ if ((g_fullpipe->_sceneRect.right - ex->_sceneClickX < 47 && g_fullpipe->_sceneRect.right < g_fullpipe->_sceneWidth - 1)
+ || (ex->_sceneClickX - g_fullpipe->_sceneRect.left < 47 && g_fullpipe->_sceneRect.left > 0))
+ sceneHandlers_sub01(ex);
+ }
}
}
@@ -414,7 +539,7 @@ int sceneHandler04(ExCommand *ex) {
break;
case MSG_SC4_COINOUT:
- StaticANIObject_changeStatics2(g_vars->scene04_clock, ST_CLK_CLOSED);
+ g_vars->scene04_clock->changeStatics2(ST_CLK_CLOSED);
g_vars->scene04_coinPut = 0;
sceneHandler04_stopSound();
@@ -451,7 +576,7 @@ int sceneHandler04(ExCommand *ex) {
case MSG_SC4_MANFROMBOTTLE:
sceneHandler04_manFromBottle();
- return v2;
+ break;
case MSG_SC4_CLICKLADDER:
sceneHandler04_clickLadder();
@@ -463,11 +588,11 @@ int sceneHandler04(ExCommand *ex) {
case MSG_SHOWCOIN:
sceneHandler04_showCoin();
- return v2;
+ break;
case MSG_TAKEBOTTLE:
sceneHandler04_takeBottle();
- return v2;
+ break;
case MSG_GOTOLADDER:
sceneHandler04_gotoLadder(0);
@@ -479,11 +604,6 @@ int sceneHandler04(ExCommand *ex) {
}
return 0;
-
-#endif
- warning("STUB: sceneHandler04()");
-
- return 0;
}
} // End of namespace Fullpipe