diff options
author | Eugene Sandulenko | 2013-06-19 14:46:25 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2013-09-06 14:48:13 +0300 |
commit | 249c4bd118527b33e9bc9ef0ed3eee3bff88a8b7 (patch) | |
tree | 703db8740c1893ff132ea9bd0a96019e4c735b37 /engines | |
parent | 2e6bad888e02952e980dfc33978673bda0349030 (diff) | |
download | scummvm-rg350-249c4bd118527b33e9bc9ef0ed3eee3bff88a8b7.tar.gz scummvm-rg350-249c4bd118527b33e9bc9ef0ed3eee3bff88a8b7.tar.bz2 scummvm-rg350-249c4bd118527b33e9bc9ef0ed3eee3bff88a8b7.zip |
FULLPIPE: implement initObjectStates()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 151 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 18 | ||||
-rw-r--r-- | engines/fullpipe/objectnames.h | 41 | ||||
-rw-r--r-- | engines/fullpipe/objects.h | 12 | ||||
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 87 | ||||
-rw-r--r-- | engines/fullpipe/utils.h | 1 |
6 files changed, 285 insertions, 25 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index f4d502d6a7..c5099f57cb 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -29,12 +29,16 @@ #include "fullpipe/fullpipe.h" #include "fullpipe/ngiarchive.h" +#include "fullpipe/objectnames.h" +#include "fullpipe/utils.h" +#include "fullpipe/objects.h" namespace Fullpipe { int g_gameProjectVersion = 0; int g_gameProjectValue = 0; int g_scrollSpeed = 0; +int g_currSoundListCount = 0; FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { // Setup mixer @@ -88,4 +92,151 @@ void FullpipeEngine::updateEvents() { } } +void FullpipeEngine::initObjectStates() { + setLevelStates(); + + setObjectState(sO_Dude, getObjectEnumState(sO_Dude, sO_NotCarryingEgg)); + setObjectState(sO_EggCracker, getObjectEnumState(sO_EggCracker, sO_NotCrackedEggs)); + setObjectState(sO_GuvTheDrawer, getObjectEnumState(sO_GuvTheDrawer, sO_Awaken)); + setObjectState(sO_EggGulper, getObjectEnumState(sO_EggGulper, sO_First)); + setObjectState(sO_EggGulperGaveCoin, getObjectEnumState(sO_EggGulperGaveCoin, sO_No)); + setObjectState(sO_Jar_4, getObjectEnumState(sO_Jar_4, sO_OnTheSpring)); + setObjectState(sO_GulpedEggs, getObjectEnumState(sO_GulpedEgg, sO_NotPresent)); + + setSwallowedEggsState(); + + setObjectState(sO_WeirdWacko, getObjectEnumState(sO_WeirdWacko, sO_InGlasses)); + setObjectState(sO_TumyTrampie, getObjectEnumState(sO_TumyTrampie, sO_Drinking)); + setObjectState(sO_StairsUp_8, getObjectEnumState(sO_StairsUp_8, sO_NotBroken)); + setObjectState(sO_HareTheNooksiter, getObjectEnumState(sO_HareTheNooksiter, sO_WithHandle)); + setObjectState(sO_Elephantine, getObjectEnumState(sO_Elephantine, sO_WithBoot)); + setObjectState(sO_Fly_12, 0); + setObjectState(sO_ClockAxis, getObjectEnumState(sO_ClockAxis, sO_NotAvailable)); + setObjectState(sO_ClockHandle, getObjectEnumState(sO_ClockHandle, sO_In_7)); + setObjectState(sO_BigMumsy, getObjectEnumState(sO_BigMumsy, sO_Sleeping)); + setObjectState(sO_CoinSlot_1, getObjectEnumState(sO_CoinSlot_1, sO_Empty)); + setObjectState(sO_FriesPit, getObjectEnumState(sO_FriesPit, sO_WithApple)); + setObjectState(sO_Jug, getObjectEnumState(sO_Jug, sO_Blocked)); + setObjectState(sO_RightStairs_9, getObjectEnumState(sO_RightStairs_9, sO_ClosedShe)); + setObjectState(sO_Pipe_9, getObjectEnumState(sO_Pipe_9, sO_WithJug)); + setObjectState(sO_Inflater, getObjectEnumState(sO_Inflater, sO_WithGum)); + setObjectState(sO_Swingie, getObjectEnumState(sO_Swingie, sO_Swinging)); + setObjectState(sO_DudeJumped, getObjectEnumState(sO_DudeJumped, sO_No)); + setObjectState(sO_Bridge, getObjectEnumState(sO_Bridge, sO_Convoluted)); + setObjectState(sO_Guardian, getObjectEnumState(sO_Guardian, sO_OnRight)); + setObjectState(sO_Grandma, getObjectEnumState(sO_Grandma, sO_In_14)); + setObjectState(sO_Boot_15, getObjectEnumState(sO_Boot_15, sO_NotPresent)); + setObjectState(sO_LeftPipe_15, getObjectEnumState(sO_LeftPipe_15, sO_OpenedShe)); + setObjectState(sO_Pedestal_16, getObjectEnumState(sO_Pedestal_16, sO_IsFree)); + setObjectState(sO_Cup, getObjectEnumState(sO_Cup, sO_InSmokeRoom)); + setObjectState(sO_Pedestal_17, getObjectEnumState(sO_Pedestal_17, sO_IsFree)); + setObjectState(sO_UsherHand, getObjectEnumState(sO_UsherHand, sO_WithoutCoin)); + setObjectState(sO_RightPipe_17, getObjectEnumState(sO_RightPipe_17, sO_ClosedShe)); + setObjectState(sO_Fly_17, 1); + setObjectState(sO_DudeSwinged, 0); + setObjectState(sO_Girl, getObjectEnumState(sO_Girl, sO_Swinging)); + setObjectState(sO_Sugar, getObjectEnumState(sO_Sugar, sO_Present)); + setObjectState(sO_Janitors, getObjectEnumState(sO_Janitors, sO_Together)); + setObjectState(sO_Bag_22, getObjectEnumState(sO_Bag_22, sO_NotFallen)); + setObjectState(sO_Grandpa, getObjectEnumState(sO_Grandpa, sO_InSock)); + setObjectState(sO_CoinSlot_22, getObjectEnumState(sO_CoinSlot_22, sO_Empty)); + setObjectState(sO_UpperHatch_23, getObjectEnumState(sO_UpperHatch_23, sO_Closed)); + setObjectState(sO_LowerHatch_23, getObjectEnumState(sO_LowerHatch_23, sO_Closed)); + setObjectState(sO_Lever_23, getObjectEnumState(sO_Lever_23, sO_NotTaken)); + setObjectState(sO_LeverHandle_23, getObjectEnumState(sO_LeverHandle_23, sO_WithoutStool)); + setObjectState(sO_LowerPipe_21, getObjectEnumState(sO_LowerPipe_21, sO_ClosedShe)); + setObjectState(sO_StarsDown_24, getObjectEnumState(sO_StarsDown_24, sO_OpenedShe)); + setObjectState(sO_Hatch_26, getObjectEnumState(sO_Hatch_26, sO_Closed)); + setObjectState(sO_Sock_26, getObjectEnumState(sO_Sock_26, sO_NotHanging)); + setObjectState(sO_LeftPipe_26, getObjectEnumState(sO_LeftPipe_26, sO_ClosedShe)); + setObjectState(sO_Valve1_26, getObjectEnumState(sO_Valve1_26, sO_Opened)); + setObjectState(sO_Valve2_26, getObjectEnumState(sO_Valve2_26, sO_Closed)); + setObjectState(sO_Valve3_26, getObjectEnumState(sO_Valve3_26, sO_Closed)); + setObjectState(sO_Valve4_26, getObjectEnumState(sO_Valve4_26, sO_Closed)); + setObjectState(sO_Valve5_26, getObjectEnumState(sO_Valve5_26, sO_Opened)); + setObjectState(sO_Pool, getObjectEnumState(sO_Pool, sO_Overfull)); + setObjectState(sO_Plank_25, getObjectEnumState(sO_Plank_25, sO_NearDudesStairs)); + setObjectState(sO_Driver, getObjectEnumState(sO_Driver, sO_WithSteering)); + setObjectState(sO_Janitress, getObjectEnumState(sO_Janitress, sO_WithMop)); + setObjectState(sO_LeftPipe_29, getObjectEnumState(sO_LeftPipe_29, sO_ClosedShe)); + setObjectState(sO_LeftPipe_30, getObjectEnumState(sO_LeftPipe_30, sO_ClosedShe)); + setObjectState(sO_Leg, getObjectEnumState(sO_Leg, sO_ShowingHeel)); + setObjectState(sO_Tub, getObjectEnumState(sO_Tub, sO_EmptyShe)); + setObjectState(sO_Cactus, getObjectEnumState(sO_Cactus, sO_NotGrown)); + setObjectState(sO_Fireman, getObjectEnumState(sO_Fireman, sO_WithHose)); + setObjectState(sO_Cube, getObjectEnumState(sO_Cube, sO_In_33)); + setObjectState(sO_MommyOfHandle_32, getObjectEnumState(sO_MommyOfHandle_32, sO_WithoutHandle)); + setObjectState(sO_Pedestal_33, getObjectEnumState(sO_Pedestal_33, sO_IsFree)); + setObjectState(sO_Valve_34, getObjectEnumState(sO_Valve_34, sO_WithNothing)); + setObjectState(sO_Stool_34, getObjectEnumState(sO_Stool_34, sO_WithoutDrawer)); + setObjectState(sO_Plank_34, getObjectEnumState(sO_Plank_34, sO_Passive)); + setObjectState(sO_Hatch_34, getObjectEnumState(sO_Hatch_34, sO_Closed)); + setObjectState(sO_Valve_35, getObjectEnumState(sO_Valve_35, sO_TurnedOff)); + setObjectState(sO_Carpet_35, getObjectEnumState(sO_Carpet_35, sO_CannotTake)); + setObjectState(sO_CoinSlot_35, getObjectEnumState(sO_CoinSlot_35, sO_WithCoin)); + setObjectState(sO_BellyInflater, getObjectEnumState(sO_BellyInflater, sO_WithCork)); + setObjectState(sO_Jawcrucnher, getObjectEnumState(sO_Jawcrucnher, sO_WithoutCarpet)); + setObjectState(sO_Guard_1, getObjectEnumState(sO_Guard_1, sO_On)); + setObjectState(sO_Gurad_2, getObjectEnumState(sO_Gurad_2, sO_On)); + setObjectState(sO_Guard_3, getObjectEnumState(sO_Guard_3, sO_On)); + setObjectState(sO_Bottle_38, getObjectEnumState(sO_Bottle_38, sO_OnTheTable)); + setObjectState(sO_Boss, getObjectEnumState(sO_Boss, sO_WithHammer)); +} + +void FullpipeEngine::setLevelStates() { + CGameVar *v = _gameLoader->_gameVar->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons); + + if (v) { + v->setSubVarAsInt(sO_Level0, 2833); + v->setSubVarAsInt(sO_Level1, 2754); + v->setSubVarAsInt(sO_Level2, 2757); + v->setSubVarAsInt(sO_Level3, 2760); + v->setSubVarAsInt(sO_Level4, 2763); + v->setSubVarAsInt(sO_Level5, 2766); + v->setSubVarAsInt(sO_Level6, 2769); + v->setSubVarAsInt(sO_Level7, 2772); + v->setSubVarAsInt(sO_Level8, 2775); + v->setSubVarAsInt(sO_Level9, 2778); + } +} + +void FullpipeEngine::setSwallowedEggsState() { + CGameVar *v = _gameLoader->_gameVar->getSubVarByName("OBJSTATES")->getSubVarByName(sO_GulpedEggs); + + _swallowedEgg1 = v->getSubVarByName(sO_Egg1); + _swallowedEgg2 = v->getSubVarByName(sO_Egg2); + _swallowedEgg3 = v->getSubVarByName(sO_Egg3); + + _swallowedEgg1->_value.intValue = 0; + _swallowedEgg2->_value.intValue = 0; + _swallowedEgg3->_value.intValue = 0; +} + +int FullpipeEngine::getObjectEnumState(const char *name, const char *state) { + CGameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); + + if (!var) { + var = _gameLoader->_gameVar->addSubVarAsInt("OBJSTATES", 0); + } + + var = var->getSubVarByName(name); + if (var) { + var = var->getSubVarByName("ENUMSTATES"); + if (var) + return var->getSubVarAsInt(state); + } + + return 0; +} + +void FullpipeEngine::setObjectState(const char *name, int state) { + CGameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); + + if (!var) { + var = _gameLoader->_gameVar->addSubVarAsInt("OBJSTATES", 0); + } + + var->setSubVarAsInt(name, state); +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index a6a58ffb1b..92c0052d68 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -44,11 +44,12 @@ enum FullpipeGameFeatures { }; class CGameLoader; +class CGameVar; extern int g_gameProjectVersion; extern int g_gameProjectValue; extern int g_scrollSpeed; - +extern int g_currSoundListCount; class FullpipeEngine : public ::Engine { protected: @@ -71,15 +72,26 @@ public: Common::KeyCode _keyState; uint16 _buttonState; - void updateEvents(); + void updateEvents(); - CGameLoader *g_gameLoader; + CGameLoader *_gameLoader; bool loadGam(const char *fname); int _gameProjectVersion; int _gameProjectValue; int _scrollSpeed; + void initObjectStates(); + void setLevelStates(); + void setSwallowedEggsState(); + + CGameVar *_swallowedEgg1; + CGameVar *_swallowedEgg2; + CGameVar *_swallowedEgg3; + + void setObjectState(const char *name, int state); + int getObjectEnumState(const char *name, const char *state); + public: bool _isSaveAllowed; diff --git a/engines/fullpipe/objectnames.h b/engines/fullpipe/objectnames.h index 75c382bb66..39c4e5dd76 100644 --- a/engines/fullpipe/objectnames.h +++ b/engines/fullpipe/objectnames.h @@ -23,6 +23,7 @@ // This file is used in order to avoid usage of constants in Russian accross the code #define sO_Grandma "\xc1\xe0\xe1\xf3\xeb\xff" // "Бабуля" +#define sO_Jar_4 "\xc1\xe0\xed\xea\xe0_4" // "Банка_4" #define sO_Pool "\xc1\xe0\xf1\xf1\xe5\xe9\xed" // "Бассейн" #define sO_TumyTrampie "\xc1\xe0\xf2\xf3\xf2\xe0" // "Батута" #define sO_WithoutBoot "\xc1\xe5\xe7 \xe1\xee\xf2\xe8\xed\xea\xe0" // "Без ботинка" @@ -41,21 +42,24 @@ #define sO_InSmokeRoom "\xc2 \xea\xf3\xf0\xe8\xeb\xea\xe5" // "В курилке" #define sO_InSock "\xc2 \xed\xee\xf1\xea\xe5" // "В носке" #define sO_InGlasses "\xc2 \xee\xf7\xea\xe0\xf5" // "В очках" -#define sO_V_14 "\xc2_14" // "В_14" -#define sO_V_32_Lies "\xc2_32 \xeb\xe5\xe6\xe8\xf2" // "В_32 лежит" -#define sO_V_32_Stands "\xc2_32 \xf2\xee\xf0\xf7\xe8\xf2" // "В_32 торчит" -#define sO_V_7 "\xc2_7" // "В_7" -#define sO_Valve1_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc1_26" // "Вентиль1_26" -#define sO_Valve2_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc2_26" // "Вентиль2_26" -#define sO_Valve3_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc3_26" // "Вентиль3_26" -#define sO_Valve4_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc4_26" // "Вентиль4_26" -#define sO_Valve5_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc5_26" // "Вентиль5_26" +#define sO_In_14 "\xc2_14" // "В_14" +#define sO_In_32_Lies "\xc2_32 \xeb\xe5\xe6\xe8\xf2" // "В_32 лежит" +#define sO_In_32_Stands "\xc2_32 \xf2\xee\xf0\xf7\xe8\xf2" // "В_32 торчит" +#define sO_In_33 "\xc2_33" // "В_33" +#define sO_In_7 "\xc2_7" // "В_7" +#define sO_Together "\xc2\xe4\xe2\xee\xe5\xec" // "Вдвоем" +#define sO_Valve1_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc\x31_26" // "Вентиль1_26" +#define sO_Valve2_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc\x32_26" // "Вентиль2_26" +#define sO_Valve3_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc\x33_26" // "Вентиль3_26" +#define sO_Valve4_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc\x34_26" // "Вентиль4_26" +#define sO_Valve5_26 "\xc2\xe5\xed\xf2\xe8\xeb\xfc\x35_26" // "Вентиль5_26" #define sO_Valve_34 "\xc2\xe5\xed\xf2\xe8\xeb\xfc_34" // "Вентиль_34" #define sO_UpperHatch_23 "\xc2\xe5\xf0\xf5\xed\xe8\xe9 \xeb\xfe\xea_23" // "Верхний люк_23" #define sO_Taken "\xc2\xe7\xff\xf2" // "Взят" #define sO_HangsOnPipe "\xc2\xe8\xf1\xe8\xf2 \xed\xe0 \xf2\xf0\xf3\xe1\xe5" // "Висит на трубе" #define sO_On "\xc2\xea\xeb" // "Вкл" #define sO_TurnedOn "\xc2\xea\xeb\xfe\xf7\xe5\xed" // "Включен" +#define sO_Driver "\xc2\xee\xe4\xe8\xeb\xe0" // "Водила" #define sO_HareTheNooksiter "\xc2\xf3\xe3\xeb\xf3\xf1\xe5\xe4" // "Вуглусед" #define sO_Off "\xc2\xfb\xea\xeb" // "Выкл" #define sO_TurnedOff "\xc2\xfb\xea\xeb\xfe\xf7\xe5\xed" // "Выключен" @@ -86,6 +90,7 @@ #define sO_Full "\xc7\xe0\xef\xee\xeb\xed\xe5\xed \xf6\xe5\xeb\xe8\xea\xee\xec" // "Заполнен целиком" #define sO_MirroredTo "\xc7\xe5\xf0\xea\xe0\xeb\xfc\xed\xe0\xff \xea" // "Зеркальная к" #define sO_Playing "\xc8\xe3\xf0\xe0\xe5\xf2" // "Играет" +#define sO_Tub "\xca\xe0\xe4\xea\xe0" // "Кадка" #define sO_Cactus "\xca\xe0\xea\xf2\xf3\xf1" // "Кактус" #define sO_SwingingWithBoot "\xca\xe0\xf2\xe0\xe5\xf2\xf1\xff \xf1 \xe1\xee\xf2\xe8\xed\xea\xee\xec" // "Катается с ботинком" #define sO_Swinging "\xca\xe0\xf2\xe0\xe5\xf2\xf1\xff" // "Катается" @@ -106,7 +111,7 @@ #define sO_Fliers "\xcb\xe5\xf2\xf3\xed\xfb" // "Летуны" #define sO_Hatch_26 "\xcb\xfe\xea_26" // "Люк_26" #define sO_Hatch_34 "\xcb\xfe\xea_34" // "Люк_34" -#define sO_MommyOfHand_32 "\xcc\xe0\xec\xe0 \xf0\xf3\xf7\xea\xe8_32" // "Мама ручки_32" +#define sO_MommyOfHandle_32 "\xcc\xe0\xec\xe0 \xf0\xf3\xf7\xea\xe8_32" // "Мама ручки_32" #define sO_BigMumsy "\xcc\xe0\xec\xe0\xf8\xe0" // "Мамаша" #define sO_Bag_22 "\xcc\xe5\xf8\xee\xea_22" // "Мешок_22" #define sO_CoinSlot_1 "\xcc\xee\xed\xe5\xf2\xee\xef\xf0\xe8\xe5\xec\xed\xe8\xea 1" // "Монетоприемник 1" @@ -124,6 +129,7 @@ #define sO_NotHanging "\xcd\xe5 \xe2\xe8\xf1\xe8\xf2" // "Не висит" #define sO_NotGrown "\xcd\xe5 \xe2\xfb\xf0\xee\xf1" // "Не вырос" #define sO_NotCrackedEggs "\xcd\xe5 \xea\xee\xeb\xee\xeb \xff\xe9\xf6\xee" // "Не колол яйцо" +#define sO_NotFallen "\xcd\xe5 \xef\xe0\xe4\xe0\xeb" // "Не падал" #define sO_NotAvailable "\xcd\xe5\xe4\xee\xf1\xf2\xf3\xef\xed\xe0" // "Недоступна" #define sO_CannotTake "\xcd\xe5\xeb\xfc\xe7\xff \xe2\xe7\xff\xf2\xfc" // "Нельзя взять" #define sO_No "\xcd\xe5\xf2" // "Нет" @@ -131,6 +137,7 @@ #define sO_LowerPipe "\xcd\xe8\xe6\xed\xff\xff \xf2\xf0\xf3\xe1\xe0" // "Нижняя труба" #define sO_LowerPipe_21 "\xcd\xe8\xe6\xed\xff\xff \xf2\xf0\xf3\xe1\xe0_21" // "Нижняя труба_21" #define sO_WantsNothing "\xcd\xe8\xf7\xe5\xe3\xee \xed\xe5 \xf5\xee\xf7\xe5\xf2" // "Ничего не хочет" +#define sO_Leg "\xcd\xee\xe3\xe0" // "Нога" #define sO_FriesPit "\xcd\xee\xf0\xea\xe0 \xea\xee\xe7\xff\xe2\xea\xe8" // "Норка козявки" #define sO_Sock_26 "\xcd\xee\xf1\xee\xea_26" // "Носок_26" #define sO_ClockAxis "\xce\xf1\xfc \xf7\xe0\xf1\xee\xe2" // "Ось часов" @@ -138,7 +145,7 @@ #define sO_OpenedWithBoot "\xce\xf2\xea\xf0\xfb\xf2\xe0 \xf1 \xe1\xee\xf2\xe8\xed\xea\xee\xec" // "Открыта с ботинком" #define sO_OpenedShe "\xce\xf2\xea\xf0\xfb\xf2\xe0" // "Открыта" #define sO_WeirdWacko "\xce\xf2\xec\xee\xf0\xee\xe6\xe5\xed\xed\xfb\xe9" // "Отмороженный" -#define sO_NotFound "\xce\xf2\xf1\xf3\xf2\xf1\xf2\xe2\xf3\xe5\xf2" // "Отсутствует" +#define sO_NotPresent "\xce\xf2\xf1\xf3\xf2\xf1\xf2\xe2\xf3\xe5\xf2" // "Отсутствует" #define sO_Error "\xce\xf8\xe8\xe1\xea\xe0" // "Ошибка" #define sO_Passive "\xcf\xe0\xf1\xf1\xe8\xe2\xed\xe0" // "Пассивна" #define sO_First "\xcf\xe5\xf0\xe2\xfb\xe9" // "Первый" @@ -149,7 +156,7 @@ #define sO_FullPipe "\xcf\xee\xeb\xed\xe0\xff \xd2\xf0\xf3\xe1\xe0" // "Полная Труба" #define sO_RightStairs_9 "\xcf\xf0\xe0\xe2\xe0\xff \xeb\xe5\xf1\xf2\xed\xe8\xf6\xe0_9" // "Правая лестница_9" #define sO_RightPipe_17 "\xcf\xf0\xe0\xe2\xe0\xff \xf2\xf0\xf3\xe1\xe0_17" // "Правая труба_17" -#define sO_Present "\xcf\xf0\xe8\xf1\xf3\xf2\xf1\xf2\xe2\xf3\xe5\xf2" // "Присутствует" +#define sO_Available "\xcf\xf0\xe8\xf1\xf3\xf2\xf1\xf2\xe2\xf3\xe5\xf2" // "Присутствует" #define sO_GulpedEgg "\xcf\xf0\xee\xe3\xeb\xee\xf7\xe5\xed\xed\xee\xe5 \xff\xe9\xf6\xee" // "Проглоченное яйцо" #define sO_GulpedEggs "\xcf\xf0\xee\xe3\xeb\xee\xf7\xe5\xed\xed\xfb\xe5 \xff\xe9\xf6\xe0" // "Проглоченные яйца" #define sO_BellyInflater "\xcf\xf3\xe7\xee\xe4\xf3\xe2" // "Пузодув" @@ -184,6 +191,7 @@ #define sO_WithDrawer "\xd1 \xff\xf9\xe8\xea\xee\xec" // "С ящиком" #define sO_Sugar "\xd1\xe0\xf5\xe0\xf0\xee\xea" // "Сахарок" #define sO_Convoluted "\xd1\xe2\xe5\xf0\xed\xf3\xf2" // "Свернут" +#define sO_IsFree "\xd1\xe2\xee\xe1\xee\xe4\xed\xe0" // "Свободна" #define sO_Sitting "\xd1\xe8\xe4\xe8\xf2" // "Сидит" #define sO_Laughing "\xd1\xec\xe5\xe5\xf2\xf1\xff" // "Смеется" #define sO_WithEveryone "\xd1\xee \xe2\xf1\xe5\xec\xe8" // "Со всеми" @@ -212,6 +220,7 @@ #define sO_Gone "\xd3\xe5\xf5\xe0\xeb\xe0" // "Уехала" #define sO_FallenOnce "\xd3\xef\xe0\xeb \xf0\xe0\xe7" // "Упал раз" #define sO_FallenBrush "\xd3\xef\xe0\xeb\xe0 \xf9\xe5\xf2\xea\xe0" // "Упала щетка" +#define sO_NotBroken "\xd6\xe5\xeb\xe0" // "Цела" #define sO_ScratchingBelly "\xd7\xe5\xf8\xe5\xf2 \xef\xf3\xe7\xee" // "Чешет пузо" #define sO_Level0 "\xdd\xf2\xe0\xe6 0" // "Этаж 0" #define sO_Level1 "\xdd\xf2\xe0\xe6 1" // "Этаж 1" @@ -226,7 +235,7 @@ #define sO_EggGulperGaveCoin "\xdf\xe9\xf6\xe5\xe3\xeb\xee\xf2 \xee\xf2\xe4\xe0\xeb \xec\xee\xed\xe5\xf2\xf3" // "Яйцеглот отдал монету" #define sO_EggGulper "\xdf\xe9\xf6\xe5\xe3\xeb\xee\xf2" // "Яйцеглот" #define sO_EggCracker "\xdf\xe9\xf6\xe5\xea\xee\xeb" // "Яйцекол" -#define sO_NotLayingEgg "\xdf\xe9\xf6\xee \xed\xe5 \xed\xe5\xf1\xe5\xf2" // "Яйцо не несет" -#define sO_Egg1 "\xdf\xe9\xf6\xee1" // "Яйцо1" -#define sO_Egg2 "\xdf\xe9\xf6\xee2" // "Яйцо2" -#define sO_Egg3 "\xdf\xe9\xf6\xee3" // "Яйцо3" +#define sO_NotCarryingEgg "\xdf\xe9\xf6\xee \xed\xe5 \xed\xe5\xf1\xe5\xf2" // "Яйцо не несет" +#define sO_Egg1 "\xdf\xe9\xf6\xee\x31" // "Яйцо1" +#define sO_Egg2 "\xdf\xe9\xf6\xee\x32" // "Яйцо2" +#define sO_Egg3 "\xdf\xe9\xf6\xee\x33" // "Яйцо3" diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h index 34d117bc24..be12424a33 100644 --- a/engines/fullpipe/objects.h +++ b/engines/fullpipe/objects.h @@ -315,7 +315,8 @@ class ExCommand : public CObject { virtual bool load(MfcArchive &file); }; - class CGameVar : public CObject { +class CGameVar : public CObject { + public: CGameVar *_nextVarObj; CGameVar *_prevVarObj; CGameVar *_parentVarObj; @@ -328,6 +329,12 @@ class ExCommand : public CObject { public: CGameVar(); virtual bool load(MfcArchive &file); + CGameVar *getSubVarByName(const char *name); + bool setSubVarAsInt(const char *name, int value); + int getSubVarAsInt(const char *name); + CGameVar *addSubVarAsInt(const char *name, int value); + bool addSubVar(CGameVar *subvar); + }; class InventoryPoolItem { @@ -435,6 +442,8 @@ class CGameLoader : public CObject { virtual bool load(MfcArchive &file); + CGameVar *_gameVar; + private: GameProject *_gameProject; CInteractionController *_interactionController; @@ -456,7 +465,6 @@ class CGameLoader : public CObject { int16 _field_F8; int16 _field_FA; PreloadItems _preloadItems; - CGameVar *_gameVar; char *_gameName; ExCommand _exCommand; int _updateCounter; diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 7501f2baca..781fab2662 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -32,9 +32,11 @@ namespace Fullpipe { bool FullpipeEngine::loadGam(const char *fname) { - g_gameLoader = new CGameLoader(); + _gameLoader = new CGameLoader(); - if (g_gameLoader->loadFile(fname)) { + if (_gameLoader->loadFile(fname)) { + g_currSoundListCount = 0; + initObjectStates(); // TODO } else return false; @@ -45,8 +47,6 @@ bool FullpipeEngine::loadGam(const char *fname) { CGameLoader::CGameLoader() { _interactionController = new CInteractionController(); - // g_gameLoader = this; // FIXME - _gameProject = 0; //_gameName = "untitled"; @@ -483,6 +483,85 @@ bool CGameVar::load(MfcArchive &file) { return true; } +CGameVar *CGameVar::getSubVarByName(const char *name) { + CGameVar *sv = 0; + + if (_subVars != 0) { + sv = _subVars; + for (;sv && scumm_stricmp(sv->_stringObj, name); sv = sv->_nextVarObj) + ; + } + return sv; +} + +bool CGameVar::setSubVarAsInt(const char *name, int value) { + CGameVar *var = getSubVarByName(name); + + if (var) { + if (var->_varType == 0) { + var->_value.intValue = value; + + return true; + } + return false; + } + + var = new CGameVar(); + var->_varType = 0; + var->_value.intValue = value; + var->_stringObj = (char *)calloc(strlen(name) + 1, 1); + strcpy(var->_stringObj, name); + + return addSubVar(var); +} + +int CGameVar::getSubVarAsInt(const char *name) { + CGameVar *var = getSubVarByName(name); + + if (var) + return var->_value.intValue; + else + return 0; +} + +CGameVar *CGameVar::addSubVarAsInt(const char *name, int value) { + if (getSubVarByName(name)) { + return 0; + } else { + CGameVar *var = new CGameVar(); + + var->_varType = 0; + var->_value.intValue = value; + + var->_stringObj = (char *)calloc(strlen(name) + 1, 1); + strcpy(var->_stringObj, name); + + return (addSubVar(var) != 0) ? var : 0; + } +} + +bool CGameVar::addSubVar(CGameVar *subvar) { + CGameVar *var = _subVars; + + if (var) { + for (CGameVar *i = var->_nextVarObj; i; i = i->_nextVarObj) + var = i; + + var->_nextVarObj = subvar; + subvar->_prevVarObj = var; + subvar->_parentVarObj = var; + + return true; + } else { + var->_subVars = subvar; + subvar->_parentVarObj = var; + + return true; + } + + return false; +} + Sc2::Sc2() { _sceneId = 0; _field_2 = 0; diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index c46fe38620..9af7d14f67 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -25,6 +25,7 @@ #include "common/hash-str.h" #include "common/array.h" +#include "common/file.h" namespace Fullpipe { |