aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2013-07-31 20:06:13 +0300
committerEugene Sandulenko2013-09-06 14:51:09 +0300
commit856eb1b0fa92068fd7b61a8c9a6350af596f3f00 (patch)
tree9a132846224ae8c03ca6ef2a31a296b61987a598
parent1c75ebcca93bd1eb260166e17adacdcfac721099 (diff)
downloadscummvm-rg350-856eb1b0fa92068fd7b61a8c9a6350af596f3f00.tar.gz
scummvm-rg350-856eb1b0fa92068fd7b61a8c9a6350af596f3f00.tar.bz2
scummvm-rg350-856eb1b0fa92068fd7b61a8c9a6350af596f3f00.zip
FULLPIPE: Implemented FullpipeEngine::updateScreen()
-rw-r--r--engines/fullpipe/fullpipe.cpp46
-rw-r--r--engines/fullpipe/fullpipe.h9
-rw-r--r--engines/fullpipe/gameloader.cpp25
-rw-r--r--engines/fullpipe/gameloader.h3
-rw-r--r--engines/fullpipe/input.cpp4
-rw-r--r--engines/fullpipe/input.h2
-rw-r--r--engines/fullpipe/inventory.cpp6
-rw-r--r--engines/fullpipe/inventory.h1
-rw-r--r--engines/fullpipe/messages.cpp21
-rw-r--r--engines/fullpipe/messages.h5
-rw-r--r--engines/fullpipe/modal.h12
-rw-r--r--engines/fullpipe/module.mk1
-rw-r--r--engines/fullpipe/scene.cpp5
-rw-r--r--engines/fullpipe/scene.h2
-rw-r--r--engines/fullpipe/statics.cpp4
-rw-r--r--engines/fullpipe/statics.h2
16 files changed, 142 insertions, 6 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 07a6651ad0..e762331acc 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -32,6 +32,7 @@
#include "fullpipe/messages.h"
#include "fullpipe/behavior.h"
#include "fullpipe/modal.h"
+#include "fullpipe/input.h"
namespace Fullpipe {
@@ -68,6 +69,9 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_gameContinue = true;
_needRestart = false;
_flgPlayIntro = true;
+ _flgSavegameMenuRequested = false;
+
+ _isProcessingMessages = false;
_musicAllowed = -1;
@@ -87,6 +91,8 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_msgY = 0;
_msgObjectId2 = 0;
_msgId = 0;
+ _mouseVirtX = 0;
+ _mouseVirtY = 0;
_behaviorManager = 0;
@@ -206,7 +212,45 @@ void FullpipeEngine::cleanup() {
}
void FullpipeEngine::updateScreen() {
- warning("STUB: FullpipeEngine::updateScreen()");
+ _mouseVirtX = _mouseX + _sceneRect.left;
+ _mouseVirtY = _mouseY + _sceneRect.top;
+
+ //if (inputArFlag)
+ // updateGame_inputArFlag();
+
+ if (_modalObject || _flgSavegameMenuRequested && (_gameLoader->updateSystems(42), _modalObject != 0)) {
+ if (_flgSavegameMenuRequested) {
+ if (_modalObject->init(42)) {
+ _modalObject->update();
+ } else {
+ _modalObject->saveload();
+ CBaseModalObject *tmp = _modalObject->_parentObj;
+
+ if (_modalObject)
+ delete _modalObject;
+
+ _modalObject = tmp;
+ }
+ }
+ } else if (_currentScene) {
+ _currentScene->draw();
+
+ if (_inventoryScene)
+ _inventory->draw();
+
+ if (_updateScreenCallback)
+ _updateScreenCallback();
+
+ //if (inputArFlag && _currentScene) {
+ // vrtTextOut(*(_DWORD *)g_vrtHandle, smallNftData, "DEMO", 4, 380, 580);
+ // vrtTextOut(*(_DWORD *)g_vrtHandle, smallNftData, "Alt+F4 - exit", 14, 695, 580);
+ //}
+ } else {
+ //vrtRectangle(*(_DWORD *)g_vrtHandle, 0, 0, 0, 800, 600);
+ }
+ _inputController->drawCursor(_mouseX, _mouseY);
+
+ ++_updateTicks;
}
int FullpipeEngine::getObjectEnumState(const char *name, const char *state) {
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 37dc8273aa..15bb28ff0e 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -108,6 +108,7 @@ public:
bool _savesEnabled;
bool _updateFlag;
bool _flgCanOpenMap;
+ bool _flgSavegameMenuRequested;
Common::Rect _sceneRect;
int _sceneWidth;
@@ -133,6 +134,12 @@ public:
int _msgObjectId2;
int _msgId;
+ Common::List<ExCommand *> _exCommandList;
+ bool _isProcessingMessages;
+
+ int _mouseVirtX;
+ int _mouseVirtY;
+
BehaviorManager *_behaviorManager;
MovTable *_movTable;
@@ -170,7 +177,7 @@ public:
CBaseModalObject *_modalObject;
- int (*_updateScreenCallback)(void *);
+ int (*_updateScreenCallback)();
int (*_updateCursorCallback)();
int _cursorId;
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index 1d53cd3e15..939da177f4 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -225,6 +225,12 @@ bool CGameLoader::gotoScene(int sceneId, int entranceId) {
return true;
}
+bool CGameLoader::preloadScene(int sceneId, int entranceId) {
+ warning("STUB: preloadScene(%d, %d), ", sceneId, entranceId);
+
+ return true;
+}
+
int CGameLoader::getSceneTagBySceneId(int sceneId, SceneTag **st) {
if (_sc2array.size() > 0 && _gameProject->_sceneTagList->size() > 0) {
for (uint i = 0; i < _sc2array.size(); i++) {
@@ -248,6 +254,25 @@ void CGameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAn
warning("STUB: CGameLoader::applyPicAniInfo()");
}
+void CGameLoader::updateSystems(int counterdiff) {
+ if (g_fullpipe->_currentScene) {
+ g_fullpipe->_currentScene->update(counterdiff);
+
+ _exCommand._messageKind = 17;
+ _updateCounter++;
+ _exCommand._messageNum = 33;
+ _exCommand._excFlags = 0;
+ postMessage(&_exCommand);
+ }
+
+ processMessages();
+
+ if (_preloadId1) {
+ processMessages();
+ preloadScene(_preloadId1, _preloadId2);
+ }
+}
+
CGameVar *FullpipeEngine::getGameLoaderGameVar() {
if (_gameLoader)
return _gameLoader->_gameVar;
diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h
index 36c99f20dc..4ba48297af 100644
--- a/engines/fullpipe/gameloader.h
+++ b/engines/fullpipe/gameloader.h
@@ -41,6 +41,9 @@ class CGameLoader : public CObject {
virtual bool load(MfcArchive &file);
bool loadScene(int sceneId);
bool gotoScene(int sceneId, int entranceId);
+ bool preloadScene(int sceneId, int entranceId);
+
+ void updateSystems(int counterdiff);
int getSceneTagBySceneId(int sceneId, SceneTag **st);
void applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAniInfoCount);
diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp
index bb6d8baae5..78c6e50a49 100644
--- a/engines/fullpipe/input.cpp
+++ b/engines/fullpipe/input.cpp
@@ -78,6 +78,10 @@ void CInputController::setCursorMode(bool enabled) {
_inputFlags &= ~1;
}
+void CInputController::drawCursor(int x, int y) {
+ warning("STUB: CInputController::drawCursor(%d, %d)", x, y);
+}
+
CursorInfo::CursorInfo() {
pictureId = 0;
picture = 0;
diff --git a/engines/fullpipe/input.h b/engines/fullpipe/input.h
index 72742b04b6..06013ab0c1 100644
--- a/engines/fullpipe/input.h
+++ b/engines/fullpipe/input.h
@@ -63,6 +63,8 @@ class CInputController {
void setInputDisabled(bool state);
void addCursor(CursorInfo *cursor);
void setCursorMode(bool mode);
+
+ void drawCursor(int x, int y);
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index 8df06e617e..c88d6f9cdc 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -97,7 +97,7 @@ bool CInventory2::loadPartial(MfcArchive &file) { // CInventory2_SerializePartia
}
void CInventory2::addItem(int itemId, int value) {
- warning("STUB: CInventory2::addItem");
+ warning("STUB: CInventory2::addItem(%d, %d)", itemId, value);
}
void CInventory2::rebuildItemRects() {
@@ -106,4 +106,8 @@ void CInventory2::rebuildItemRects() {
warning("STUB: CInventory2::rebuildItemRects()");
}
+void CInventory2::draw() {
+ warning("STUB: CInventory2::draw()");
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h
index 36170b86bf..a61df385a5 100644
--- a/engines/fullpipe/inventory.h
+++ b/engines/fullpipe/inventory.h
@@ -101,6 +101,7 @@ class CInventory2 : public CInventory {
Scene *getScene() { return _scene; }
+ void draw();
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index 69b29dcef8..ee9210f066 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -79,6 +79,10 @@ bool ExCommand::load(MfcArchive &file) {
return true;
}
+void ExCommand::handleMessage() {
+ warning("STUB: ExCommand::handleMessage()");
+}
+
Message::Message() {
_messageKind = 0;
_parentId = 0;
@@ -416,4 +420,21 @@ void clearMessageHandlers() {
}
}
+void postMessage(ExCommand *ex) {
+ g_fullpipe->_exCommandList.push_back(ex);
+}
+
+void processMessages() {
+ if (!g_fullpipe->_isProcessingMessages) {
+ g_fullpipe->_isProcessingMessages = true;
+
+ while (g_fullpipe->_exCommandList.size()) {
+ ExCommand *ex = g_fullpipe->_exCommandList.front();
+ ex->handleMessage();
+ g_fullpipe->_exCommandList.pop_front();
+ }
+ g_fullpipe->_isProcessingMessages = false;
+ }
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index c8fe264da3..0ae11ff244 100644
--- a/engines/fullpipe/messages.h
+++ b/engines/fullpipe/messages.h
@@ -69,6 +69,8 @@ class ExCommand : public Message {
virtual ~ExCommand() {}
virtual bool load(MfcArchive &file);
+
+ void handleMessage();
};
class CObjstateCommand : public CObject {
@@ -138,7 +140,8 @@ int getMessageHandlersCount();
bool addMessageHandlerByIndex(int (*callback)(ExCommand *), int index, int16 id);
bool insertMessageHandler(int (*callback)(ExCommand *), int index, int16 id);
void clearMessageHandlers();
-
+void postMessage(ExCommand *ex);
+void processMessages();
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h
index 86b166e317..fb2279825e 100644
--- a/engines/fullpipe/modal.h
+++ b/engines/fullpipe/modal.h
@@ -26,12 +26,20 @@
namespace Fullpipe {
class CBaseModalObject {
- int _parentObj;
+ public:
+
+ CBaseModalObject *_parentObj;
public:
CBaseModalObject() : _parentObj(0) {}
-};
+ virtual ~CBaseModalObject() {}
+ virtual bool handleMessage(ExCommand *message);
+ virtual bool init(int counterdiff);
+ virtual bool update();
+
+ void saveload();
+};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk
index 1771036749..602478cbb7 100644
--- a/engines/fullpipe/module.mk
+++ b/engines/fullpipe/module.mk
@@ -10,6 +10,7 @@ MODULE_OBJS = \
input.o \
inventory.o \
messages.o \
+ modal.o \
motion.o \
ngiarchive.o \
scene.o \
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index bb0d632186..146cd6e305 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -406,6 +406,11 @@ void Scene::updateScrolling() {
warning("STUB Scene::updateScrolling()");
}
+void Scene::update(int counterdiff) {
+ for (CPtrList::iterator s = _staticANIObjectList2.begin(); s != _staticANIObjectList2.end(); ++s)
+ ((StaticANIObject *)*s)->update(counterdiff);
+}
+
void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
if (!_picObjList.size() && !_bigPictureArray1Count)
return;
diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h
index b3dbdcc605..2a6fafd037 100644
--- a/engines/fullpipe/scene.h
+++ b/engines/fullpipe/scene.h
@@ -54,6 +54,8 @@ class Scene : public Background {
void drawContent(int minPri, int maxPri, bool drawBG);
void updateScrolling();
+ void update(int counterdiff);
+
StaticANIObject *getAniMan();
StaticANIObject *getStaticANIObject1ById(int obj, int a3);
StaticANIObject *getStaticANIObject1ByName(char *name, int a3);
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 6c3ba3ff17..5d0ba0d7a6 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -352,6 +352,10 @@ Common::Point *StaticANIObject::getCurrDimensions(Common::Point &p) {
return &p;
}
+void StaticANIObject::update(int counterdiff) {
+ warning("STUB: StaticANIObject::update(%d)", counterdiff);
+}
+
Statics::Statics() {
_staticsId = 0;
_picture = 0;
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index bfd7e70f99..ccac7dea11 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -195,6 +195,8 @@ class StaticANIObject : public GameObject {
void initMovements();
void loadMovementsPixelData();
+ void update(int counterdiff);
+
Statics *addReverseStatics(Statics *ani);
void draw();
void draw2();