aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/fullpipe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/fullpipe/fullpipe.cpp')
-rw-r--r--engines/fullpipe/fullpipe.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 8a9b323761..9c474d111b 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -28,6 +28,7 @@
#include "audio/mixer.h"
#include "engines/util.h"
+#include "graphics/surface.h"
#include "fullpipe/fullpipe.h"
#include "fullpipe/gameloader.h"
@@ -271,6 +272,7 @@ Common::Error FullpipeEngine::loadGameState(int slot) {
else
return Common::kUnknownError;
}
+
Common::Error FullpipeEngine::saveGameState(int slot, const Common::String &description) {
if (_gameLoader->writeSavegame(_currentScene, getSavegameFile(slot)))
return Common::kNoError;
@@ -284,7 +286,8 @@ Common::Error FullpipeEngine::run() {
// Initialize backend
initGraphics(800, 600, true, &format);
- _backgroundSurface.create(800, 600, format);
+ _backgroundSurface = new Graphics::Surface;
+ _backgroundSurface->create(800, 600, format);
_origFormat = new Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
@@ -501,7 +504,9 @@ void FullpipeEngine::cleanup() {
stopAllSoundStreams();
delete _origFormat;
- _backgroundSurface.free();
+ _backgroundSurface->free();
+
+ delete _backgroundSurface;
}
void FullpipeEngine::updateScreen() {
@@ -603,5 +608,19 @@ void FullpipeEngine::disableSaves(ExCommand *ex) {
}
}
+bool FullpipeEngine::isSaveAllowed() {
+ if (!g_fp->_isSaveAllowed)
+ return false;
+
+ bool allowed = true;
+
+ for (Common::Array<MessageQueue *>::iterator s = g_fp->_globalMessageQueueList->begin(); s != g_fp->_globalMessageQueueList->end(); ++s) {
+ if (!(*s)->_isFinished && ((*s)->getFlags() & 1))
+ allowed = false;
+ }
+
+ return allowed;
+}
+
} // End of namespace Fullpipe