FULLPIPE: Implement ModalMap::checkScenePass()

This commit is contained in:
Eugene Sandulenko 2016-12-07 11:00:03 +01:00
parent c77407042f
commit a998a1b580
2 changed files with 72 additions and 0 deletions

View File

@ -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;

View File

@ -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 {