aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2013-11-20 12:21:59 -0800
committerEugene Sandulenko2013-11-20 12:21:59 -0800
commitb255148097bc8a4daa214d28e734954c6a282011 (patch)
tree1813e1c036662feb2ec07851aa9723c580a88ad1
parentdf339806915a176fc57fa4ac1639949a876abd9d (diff)
downloadscummvm-rg350-b255148097bc8a4daa214d28e734954c6a282011.tar.gz
scummvm-rg350-b255148097bc8a4daa214d28e734954c6a282011.tar.bz2
scummvm-rg350-b255148097bc8a4daa214d28e734954c6a282011.zip
FULLPIPE: Move scene01 to separate file
-rw-r--r--engines/fullpipe/module.mk3
-rw-r--r--engines/fullpipe/scenes.cpp79
-rw-r--r--engines/fullpipe/scenes/scene01.cpp118
3 files changed, 120 insertions, 80 deletions
diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk
index 54b82a75a2..3d53320649 100644
--- a/engines/fullpipe/module.mk
+++ b/engines/fullpipe/module.mk
@@ -23,7 +23,8 @@ MODULE_OBJS = \
stateloader.o \
statics.o \
utils.o \
- scenes/sceneIntro.o
+ scenes/sceneIntro.o \
+ scenes/scene01.o
# This module can be built as a plugin
ifeq ($(ENABLE_FULLPIPE), DYNAMIC_PLUGIN)
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 39336431a7..27b8c29074 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -681,85 +681,6 @@ void FullpipeEngine::setSwallowedEggsState() {
g_vars->swallowedEgg3->_value.intValue = 0;
}
-void scene01_fixEntrance() {
- GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");
- if (var->getSubVarAsInt("Entrance") == TrubaLeft)
- var->setSubVarAsInt("Entrance", TrubaRight);
-}
-
-void scene01_initScene(Scene *sc, int entrance) {
- g_vars->scene01_picSc01Osk = sc->getPictureObjectById(PIC_SC1_OSK, 0);
- g_vars->scene01_picSc01Osk->_flags &= 0xFFFB;
-
- g_vars->scene01_picSc01Osk2 = sc->getPictureObjectById(PIC_SC1_OSK2, 0);
- g_vars->scene01_picSc01Osk2->_flags &= 0xFFFB;
-
- if (g_fullpipe->getObjectState(sO_EggCracker) == g_fullpipe->getObjectEnumState(sO_EggCracker, sO_DidNotCrackEgg)) {
- PictureObject *pic = sc->getPictureObjectById(PIC_SC1_KUCHKA, 0);
- if (pic)
- pic->_flags &= 0xFFFB;
- }
-
- if (entrance != TrubaLeft) {
- StaticANIObject *bootAnim = sc->getStaticANIObject1ById(ANI_BOOT_1, -1);
- if (bootAnim)
- bootAnim->_flags &= ~0x04;
- }
-
- g_fullpipe->lift_setButton(sO_Level2, ST_LBN_2N);
-}
-
-int sceneHandler01(ExCommand *cmd) {
- int res = 0;
-
- if (cmd->_messageKind != 17)
- return 0;
-
- if (cmd->_messageNum > MSG_SC1_SHOWOSK) {
- if (cmd->_messageNum == MSG_SC1_UTRUBACLICK)
- handleObjectInteraction(g_fullpipe->_aniMan, g_fullpipe->_currentScene->getPictureObjectById(PIC_SC1_LADDER, 0), 0);
-
- return 0;
- }
-
- if (cmd->_messageNum == MSG_SC1_SHOWOSK) {
- g_vars->scene01_picSc01Osk->_flags |= 4;
-
- g_vars->scene01_picSc01Osk->_priority = 20;
- g_vars->scene01_picSc01Osk2->_priority = 21;
-
- return 0;
- }
-
- if (cmd->_messageNum != 0x21) {
- if (cmd->_messageNum == MSG_SC1_SHOWOSK2) {
- g_vars->scene01_picSc01Osk2->_flags |= 4;
- g_vars->scene01_picSc01Osk2->_priority = 20;
- g_vars->scene01_picSc01Osk->_priority = 21;
-
- return 0;
- }
-
- return 0;
- }
-
- if (g_fullpipe->_aniMan2) {
- if (g_fullpipe->_aniMan2->_ox < g_fullpipe->_sceneRect.left + 200) {
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.left - 300;
- }
-
- if (g_fullpipe->_aniMan2->_ox > g_fullpipe->_sceneRect.right - 200)
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.right + 300;
-
- res = 1;
- }
- g_fullpipe->_behaviorManager->updateBehaviors();
-
- g_fullpipe->startSceneTrack();
-
- return res;
-}
-
void scene02_initScene(Scene *sc) {
g_vars->scene02_guvTheDrawer = sc->getStaticANIObject1ById(ANI_DADAYASHIK, -1);
diff --git a/engines/fullpipe/scenes/scene01.cpp b/engines/fullpipe/scenes/scene01.cpp
new file mode 100644
index 0000000000..f446dbb007
--- /dev/null
+++ b/engines/fullpipe/scenes/scene01.cpp
@@ -0,0 +1,118 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "fullpipe/fullpipe.h"
+
+//#include "fullpipe/objects.h"
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene01_fixEntrance() {
+ GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");
+ if (var->getSubVarAsInt("Entrance") == TrubaLeft)
+ var->setSubVarAsInt("Entrance", TrubaRight);
+}
+
+void scene01_initScene(Scene *sc, int entrance) {
+ g_vars->scene01_picSc01Osk = sc->getPictureObjectById(PIC_SC1_OSK, 0);
+ g_vars->scene01_picSc01Osk->_flags &= 0xFFFB;
+
+ g_vars->scene01_picSc01Osk2 = sc->getPictureObjectById(PIC_SC1_OSK2, 0);
+ g_vars->scene01_picSc01Osk2->_flags &= 0xFFFB;
+
+ if (g_fullpipe->getObjectState(sO_EggCracker) == g_fullpipe->getObjectEnumState(sO_EggCracker, sO_DidNotCrackEgg)) {
+ PictureObject *pic = sc->getPictureObjectById(PIC_SC1_KUCHKA, 0);
+ if (pic)
+ pic->_flags &= 0xFFFB;
+ }
+
+ if (entrance != TrubaLeft) {
+ StaticANIObject *bootAnim = sc->getStaticANIObject1ById(ANI_BOOT_1, -1);
+ if (bootAnim)
+ bootAnim->_flags &= ~0x04;
+ }
+
+ g_fullpipe->lift_setButton(sO_Level2, ST_LBN_2N);
+}
+
+int sceneHandler01(ExCommand *cmd) {
+ int res = 0;
+
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ if (cmd->_messageNum > MSG_SC1_SHOWOSK) {
+ if (cmd->_messageNum == MSG_SC1_UTRUBACLICK)
+ handleObjectInteraction(g_fullpipe->_aniMan, g_fullpipe->_currentScene->getPictureObjectById(PIC_SC1_LADDER, 0), 0);
+
+ return 0;
+ }
+
+ if (cmd->_messageNum == MSG_SC1_SHOWOSK) {
+ g_vars->scene01_picSc01Osk->_flags |= 4;
+
+ g_vars->scene01_picSc01Osk->_priority = 20;
+ g_vars->scene01_picSc01Osk2->_priority = 21;
+
+ return 0;
+ }
+
+ if (cmd->_messageNum != 0x21) {
+ if (cmd->_messageNum == MSG_SC1_SHOWOSK2) {
+ g_vars->scene01_picSc01Osk2->_flags |= 4;
+ g_vars->scene01_picSc01Osk2->_priority = 20;
+ g_vars->scene01_picSc01Osk->_priority = 21;
+
+ return 0;
+ }
+
+ return 0;
+ }
+
+ if (g_fullpipe->_aniMan2) {
+ if (g_fullpipe->_aniMan2->_ox < g_fullpipe->_sceneRect.left + 200) {
+ g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.left - 300;
+ }
+
+ if (g_fullpipe->_aniMan2->_ox > g_fullpipe->_sceneRect.right - 200)
+ g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.right + 300;
+
+ res = 1;
+ }
+ g_fullpipe->_behaviorManager->updateBehaviors();
+
+ g_fullpipe->startSceneTrack();
+
+ return res;
+}
+
+} // End of namespace Fullpipe