aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-08-29 01:22:53 +0200
committerThierry Crozat2018-01-23 01:53:28 +0000
commitef14dfb7c301b4210770e95955b27e765b3353b2 (patch)
tree0fc73cae83b4aca058035e42ac1909dd9ee55f67 /engines
parent9b064e364f77fe114712c145fb094bc6fb0ea569 (diff)
downloadscummvm-rg350-ef14dfb7c301b4210770e95955b27e765b3353b2.tar.gz
scummvm-rg350-ef14dfb7c301b4210770e95955b27e765b3353b2.tar.bz2
scummvm-rg350-ef14dfb7c301b4210770e95955b27e765b3353b2.zip
SUPERNOVA: Adds engine pause
Diffstat (limited to 'engines')
-rw-r--r--engines/supernova/state.h5
-rw-r--r--engines/supernova/supernova.cpp23
-rw-r--r--engines/supernova/supernova.h3
3 files changed, 26 insertions, 5 deletions
diff --git a/engines/supernova/state.h b/engines/supernova/state.h
index 079e12641f..eb7c1e2d2d 100644
--- a/engines/supernova/state.h
+++ b/engines/supernova/state.h
@@ -124,8 +124,9 @@ public:
bool _waitEvent;
bool _newRoom;
bool _newOverlay;
- int _timer1;
- int _animationTimer;
+ int32 _oldTime;
+ int32 _timer1;
+ int32 _animationTimer;
int _inventoryScroll;
int _exitList[25];
GuiElement _guiCommandButton[10];
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index ed40af99e3..e1abc006ad 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -20,13 +20,17 @@
*
*/
+#include "audio/mods/protracker.h"
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/debug-channels.h"
+#include "common/endian.h"
#include "common/error.h"
#include "common/events.h"
#include "common/file.h"
#include "common/fs.h"
+#include "common/memstream.h"
+#include "common/savefile.h"
#include "common/str.h"
#include "common/system.h"
#include "engines/util.h"
@@ -34,9 +38,8 @@
#include "graphics/surface.h"
#include "graphics/screen.h"
#include "graphics/palette.h"
-#include "audio/mods/protracker.h"
-#include "common/memstream.h"
-#include "common/endian.h"
+#include "graphics/thumbnail.h"
+#include "gui/saveload.h"
#include "supernova/supernova.h"
#include "supernova/state.h"
@@ -213,6 +216,20 @@ bool SupernovaEngine::hasFeature(EngineFeature f) const {
}
}
+void SupernovaEngine::pauseEngineIntern(bool pause) {
+ _mixer->pauseAll(pause);
+ pauseTimer(pause);
+}
+
+void SupernovaEngine::pauseTimer(bool pause) {
+ if (pause) {
+ _timePaused = _gm->_state._time;
+ } else {
+ _gm->_state._time = _timePaused;
+ _gm->_oldTime = _system->getMillis();
+ }
+}
+
void SupernovaEngine::initData() {
// Images
for (int i = 0; i < 44; ++i)
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index 56c4ad68d9..1a81e0f17a 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -100,12 +100,14 @@ public:
byte _sectionIndex;
byte _menuBrightness;
byte _brightness;
+ uint _timePaused;
uint _delay;
bool _messageDisplayed;
int _textCursorX;
int _textCursorY;
int _textColor;
+ void pauseTimer(bool pause);
int textWidth(const char *text);
int textWidth(const uint16 key);
void initData();
@@ -135,6 +137,7 @@ public:
Common::MemoryReadStream *convertToMod(const char *filename, int version = 1);
virtual bool hasFeature(EngineFeature f) const;
+ virtual void pauseEngineIntern(bool pause);
};
}