diff options
author | Eugene Sandulenko | 2016-12-07 11:00:03 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-12-07 12:05:42 +0100 |
commit | a998a1b580f4285c5b0d8693db7ce472d5c0eea5 (patch) | |
tree | db5257b983771117e1b1ccd76cf62f2b4bf5cddf /engines | |
parent | c77407042fd0e7e6247db3f77cbb518b28bec8f5 (diff) | |
download | scummvm-rg350-a998a1b580f4285c5b0d8693db7ce472d5c0eea5.tar.gz scummvm-rg350-a998a1b580f4285c5b0d8693db7ce472d5c0eea5.tar.bz2 scummvm-rg350-a998a1b580f4285c5b0d8693db7ce472d5c0eea5.zip |
FULLPIPE: Implement ModalMap::checkScenePass()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/modal.cpp | 67 | ||||
-rw-r--r-- | engines/fullpipe/modal.h | 5 |
2 files changed, 72 insertions, 0 deletions
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index d1bda9dd40..862fb94bf4 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -30,6 +30,7 @@ #include "fullpipe/modal.h" #include "fullpipe/constants.h" +#include "fullpipe/objectnames.h" #include "graphics/palette.h" #include "video/avi_decoder.h" @@ -651,6 +652,72 @@ PictureObject *ModalMap::getSceneHPicture(PictureObject *obj) { } } +bool ModalMap::isSceneEnabled(int sceneId) { + warning("STUB: ModalMap::isSceneEnabled()"); + return false; +} + +bool ModalMap::checkScenePass(PreloadItem *item) { + bool res = true; + + switch (item->preloadId1) { + case SC_13: + if (!isSceneEnabled(SC_14)) + res = false; + break; + + case SC_27: + if (item->sceneId == SC_25) { + item->param = TrubaRight; + } else { + res = false; + } + break; + + case SC_25: + if (g_fp->getObjectState(sO_Board_25) != g_fp->getObjectEnumState(sO_Board_25, sO_NearDudesStairs)) { + res = false; + } + } + + switch (item->sceneId) { + case SC_13: + if (isSceneEnabled(SC_14)) { + item->param = TrubaLeft; + break; + } + item->param = TrubaUp; + break; + + case SC_27: + res = false; + break; + + case SC_25: + if (g_fp->getObjectState(sO_Pool) != g_fp->getObjectEnumState(sO_Pool, sO_Empty)) { + if (g_fp->getObjectState(sO_Pool) != g_fp->getObjectEnumState(sO_Pool, sO_HalfFull)) + res = false; + } + break; + + case SC_29: + if (isSceneEnabled(SC_30)) { + item->param = TrubaLeft; + break; + } + item->param = TrubaUp; + break; + } + + if ((item->sceneId != SC_37 && item->preloadId1 != SC_37) + || (g_fp->getObjectState(sO_Jawcrucnher) != g_fp->getObjectEnumState(sO_Jawcrucnher, sO_WithoutCarpet))) { + return res; + } else { + res = false; + } + return res; +} + void FullpipeEngine::openMap() { if (!_modalObject) { ModalMap *map = new ModalMap; diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index a8d8a811f5..4b26721fee 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -117,8 +117,13 @@ class ModalMap : public BaseModalObject { virtual void saveload() {} void initMap(); + +private: PictureObject *getScenePicture(); PictureObject *getSceneHPicture(PictureObject *obj); + bool checkScenePass(PreloadItem *item); + bool isSceneEnabled(int sceneId); + }; class ModalFinal : public BaseModalObject { |