[Scummvm-git-logs] scummvm master -> a998a1b580f4285c5b0d8693db7ce472d5c0eea5

sev- sev at scummvm.org
Wed Dec 7 12:06:04 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a998a1b580 FULLPIPE: Implement ModalMap::checkScenePass()


Commit: a998a1b580f4285c5b0d8693db7ce472d5c0eea5
    https://github.com/scummvm/scummvm/commit/a998a1b580f4285c5b0d8693db7ce472d5c0eea5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-12-07T12:05:42+01:00

Commit Message:
FULLPIPE: Implement ModalMap::checkScenePass()

Changed paths:
    engines/fullpipe/modal.cpp
    engines/fullpipe/modal.h


diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index d1bda9d..862fb94 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 a8d8a81..4b26721 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 {





More information about the Scummvm-git-logs mailing list