aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2016-12-07 18:38:55 +0100
committerEugene Sandulenko2016-12-07 18:38:55 +0100
commit000a68cf7900ee2388c6d3b53fd6ca62a6c53ae3 (patch)
tree15419f67e906f8d400c2b6cad89c48dcdc3c2af8 /engines
parent95c94780a44441dab888622e4e9790be7b1ad0eb (diff)
downloadscummvm-rg350-000a68cf7900ee2388c6d3b53fd6ca62a6c53ae3.tar.gz
scummvm-rg350-000a68cf7900ee2388c6d3b53fd6ca62a6c53ae3.tar.bz2
scummvm-rg350-000a68cf7900ee2388c6d3b53fd6ca62a6c53ae3.zip
FULLPIPE: Implement ModalMap::isSceneEnabled()
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/modal.cpp18
-rw-r--r--engines/fullpipe/modal.h2
2 files changed, 15 insertions, 5 deletions
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index 862fb94bf4..34cdfbf4ff 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -395,7 +395,7 @@ void ModalMap::initMap() {
pic->_flags &= 0xfffb;
}
- pic = getScenePicture();
+ pic = getScenePicture(g_fp->_currentScene->_sceneId);
Common::Point point;
Common::Point point2;
@@ -438,10 +438,10 @@ void ModalMap::initMap() {
g_fp->setArcadeOverlay(PIC_CSR_MAP);
}
-PictureObject *ModalMap::getScenePicture() {
+PictureObject *ModalMap::getScenePicture(int sceneId) {
int picId = 0;
- switch (g_fp->_currentScene->_sceneId) {
+ switch (sceneId) {
case SC_1:
picId = PIC_MAP_S01;
break;
@@ -653,7 +653,17 @@ PictureObject *ModalMap::getSceneHPicture(PictureObject *obj) {
}
bool ModalMap::isSceneEnabled(int sceneId) {
- warning("STUB: ModalMap::isSceneEnabled()");
+ int id = getScenePicture(sceneId)->_id;
+
+ for (int i = 0; i < 200; i++) {
+ int mapPic = g_fp->_mapTable[i] >> 16;
+ if (!mapPic)
+ return false;
+
+ if (mapPic == id)
+ return (g_fp->_mapTable[i] & 0xffff) == 1;
+ }
+
return false;
}
diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h
index 4b26721fee..ebbe1f1935 100644
--- a/engines/fullpipe/modal.h
+++ b/engines/fullpipe/modal.h
@@ -119,7 +119,7 @@ class ModalMap : public BaseModalObject {
void initMap();
private:
- PictureObject *getScenePicture();
+ PictureObject *getScenePicture(int sceneId);
PictureObject *getSceneHPicture(PictureObject *obj);
bool checkScenePass(PreloadItem *item);
bool isSceneEnabled(int sceneId);