aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/fullpipe.cpp74
-rw-r--r--engines/fullpipe/fullpipe.h11
-rw-r--r--engines/fullpipe/gfx.cpp4
-rw-r--r--engines/fullpipe/modal.h38
4 files changed, 88 insertions, 39 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 27ccb29dcc..a8f9428809 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -31,6 +31,7 @@
#include "fullpipe/gameloader.h"
#include "fullpipe/messages.h"
#include "fullpipe/behavior.h"
+#include "fullpipe/modal.h"
namespace Fullpipe {
@@ -52,6 +53,8 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_scrollSpeed = 0;
_currSoundListCount = 0;
+ _updateTicks = 0;
+
_currArchive = 0;
_soundEnabled = true;
@@ -60,7 +63,10 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_inputController = 0;
_inputDisabled = false;
- _needQuit = false;
+ _modalObject = 0;
+
+ _gameContinue = true;
+ _needRestart = false;
_flgPlayIntro = true;
_musicAllowed = -1;
@@ -115,7 +121,8 @@ Common::Error FullpipeEngine::run() {
_isSaveAllowed = false;
- loadGam("fullpipe.gam");
+ if (!loadGam("fullpipe.gam"))
+ return Common::kNoGameDataFoundError;
EntranceInfo ent;
@@ -132,43 +139,30 @@ Common::Error FullpipeEngine::run() {
_currentScene->draw();
- while (!g_fullpipe->_needQuit) {
+ _gameContinue = true;
+
+ while (_gameContinue) {
updateEvents();
+
+ updateScreen();
+
+ if (_needRestart) {
+ if (_modalObject) {
+ delete _modalObject;
+ _modalObject = 0;
+ }
+
+ freeGameLoader();
+ _currentScene = 0;
+ _updateTicks = 0;
+
+ loadGam("fullpipe.gam");
+ _needRestart = false;
+ }
+
_system->delayMillis(10);
_system->updateScreen();
- switch (g_fullpipe->_keyState) {
- case Common::KEYCODE_q:
- g_fullpipe->_needQuit = true;
- break;
- case Common::KEYCODE_UP:
- _sceneRect.moveTo(_sceneRect.left, _sceneRect.top + 10);
- _currentScene->draw();
- g_fullpipe->_keyState = Common::KEYCODE_INVALID;
- break;
- case Common::KEYCODE_DOWN:
- _sceneRect.moveTo(_sceneRect.left, _sceneRect.top - 10);
- _currentScene->draw();
- g_fullpipe->_keyState = Common::KEYCODE_INVALID;
- break;
- case Common::KEYCODE_LEFT:
- _sceneRect.moveTo(_sceneRect.left + 10, _sceneRect.top);
- _currentScene->draw();
- g_fullpipe->_keyState = Common::KEYCODE_INVALID;
- break;
- case Common::KEYCODE_RIGHT:
- _sceneRect.moveTo(_sceneRect.left - 10, _sceneRect.top);
- _currentScene->draw();
- g_fullpipe->_keyState = Common::KEYCODE_INVALID;
- break;
- case Common::KEYCODE_z:
- _sceneRect.moveTo(0, 0);
- _currentScene->draw();
- g_fullpipe->_keyState = Common::KEYCODE_INVALID;
- break;
- default:
- break;
- }
}
@@ -192,7 +186,7 @@ void FullpipeEngine::updateEvents() {
_mouseY = event.mouse.y;
break;
case Common::EVENT_QUIT:
- _needQuit = true;
+ _gameContinue = false;
break;
default:
break;
@@ -200,6 +194,14 @@ void FullpipeEngine::updateEvents() {
}
}
+void FullpipeEngine::freeGameLoader() {
+ warning("STUB: FullpipeEngine::freeGameLoader()");
+}
+
+void FullpipeEngine::updateScreen() {
+ warning("STUB: FullpipeEngine::updateScreen()");
+}
+
int FullpipeEngine::getObjectEnumState(const char *name, const char *state) {
CGameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES");
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 760bd4e9cc..aa3b4d8df5 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -44,6 +44,7 @@ enum FullpipeGameFeatures {
};
class BehaviorManager;
+class CBaseModalObject;
class CGameLoader;
class CGameVar;
class CInputController;
@@ -138,8 +139,12 @@ public:
void initMap();
void updateMapPiece(int mapId, int update);
+ void updateScreen();
- bool _needQuit;
+ void freeGameLoader();
+
+ bool _gameContinue;
+ bool _needRestart;
bool _flgPlayIntro;
int _musicAllowed;
@@ -160,6 +165,10 @@ public:
Scene *_inventoryScene;
CInventory2 *_inventory;
+ int32 _updateTicks;
+
+ CBaseModalObject *_modalObject;
+
int (*_updateScreenCallback)(void *);
int (*_updateCursorCallback)();
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 88b86630b9..997c0b620b 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -406,7 +406,7 @@ void Picture::drawRotated(int x, int y, int angle) {
}
void Picture::displayPicture() {
- if (g_fullpipe->_needQuit)
+ if (!g_fullpipe->_gameContinue)
return;
getData();
@@ -424,7 +424,7 @@ void Picture::displayPicture() {
g_fullpipe->_system->delayMillis(10);
g_fullpipe->_system->updateScreen();
- while (!g_fullpipe->_needQuit) {
+ while (g_fullpipe->_gameContinue) {
g_fullpipe->updateEvents();
g_fullpipe->_system->delayMillis(10);
g_fullpipe->_system->updateScreen();
diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h
new file mode 100644
index 0000000000..86b166e317
--- /dev/null
+++ b/engines/fullpipe/modal.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef FULLPIPE_MODAL_H
+#define FULLPIPE_MODAL_H
+
+namespace Fullpipe {
+
+class CBaseModalObject {
+ int _parentObj;
+
+ public:
+ CBaseModalObject() : _parentObj(0) {}
+};
+
+
+} // End of namespace Fullpipe
+
+#endif /* FULLPIPE_MODAL_H */