aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek
diff options
context:
space:
mode:
authorFilippos Karapetis2019-05-28 21:44:07 +0300
committerFilippos Karapetis2019-05-28 21:44:07 +0300
commit33fb9809c3a1353d927a3c7dfa41e673d79a089e (patch)
tree71f1c0783423086bfeb4b23e4ff0b339c8b383a7 /engines/startrek
parente1416534e11cdac164949de228c17d27566845e3 (diff)
downloadscummvm-rg350-33fb9809c3a1353d927a3c7dfa41e673d79a089e.tar.gz
scummvm-rg350-33fb9809c3a1353d927a3c7dfa41e673d79a089e.tar.bz2
scummvm-rg350-33fb9809c3a1353d927a3c7dfa41e673d79a089e.zip
STARTREK: Start adding a console
We need to properly inject it to all inner screen update loops
Diffstat (limited to 'engines/startrek')
-rw-r--r--engines/startrek/events.cpp4
-rw-r--r--engines/startrek/graphics.cpp2
-rw-r--r--engines/startrek/module.mk1
-rw-r--r--engines/startrek/startrek.cpp7
-rw-r--r--engines/startrek/startrek.h4
5 files changed, 16 insertions, 2 deletions
diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp
index d8935bd432..c425b09050 100644
--- a/engines/startrek/events.cpp
+++ b/engines/startrek/events.cpp
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include "startrek/console.h"
#include "startrek/startrek.h"
namespace StarTrek {
@@ -61,6 +62,9 @@ void StarTrekEngine::pollEvents(bool queueEvents) {
break;
case Common::EVENT_KEYDOWN:
+ if (event.kbd.keycode == Common::KEYCODE_d && (event.kbd.flags & Common::KBD_CTRL))
+ _console->attach();
+
if (queueEvents) {
trekEvent.type = TREKEVENT_KEYDOWN;
addEventToQueue(trekEvent);
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 5c6a1441b6..c99d8866f1 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -20,6 +20,7 @@
*/
#include "startrek/common.h"
+#include "startrek/console.h"
#include "startrek/graphics.h"
#include "common/algorithm.h"
@@ -637,6 +638,7 @@ void Graphics::updateScreen() {
_mouseWarpY = -1;
}
+ //_vm->_console->onFrame();
_vm->_system->updateScreen();
_vm->_system->delayMillis(10);
}
diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk
index 0f82c852fc..db2a3fbe74 100644
--- a/engines/startrek/module.mk
+++ b/engines/startrek/module.mk
@@ -5,6 +5,7 @@ MODULE_OBJS = \
awaymission.o \
bitmap.o \
common.o \
+ console.o \
detection.o \
events.o \
filestream.o \
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 6160f9caf3..12680c6fd3 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -37,6 +37,7 @@
#include "engines/util.h"
#include "video/qt_decoder.h"
+#include "startrek/console.h"
#include "startrek/filestream.h"
#include "startrek/iwfile.h"
#include "startrek/lzss.h"
@@ -107,14 +108,18 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
StarTrekEngine::~StarTrekEngine() {
delete _activeMenu->nextMenu;
delete _activeMenu;
- delete _gfx;
+
+ delete _console;
delete _sound;
+ delete _gfx;
+
delete _macResFork;
}
Common::Error StarTrekEngine::run() {
_gfx = new Graphics(this);
_sound = new Sound(this);
+ _console = new Console(this);
if (getPlatform() == Common::kPlatformMacintosh) {
_macResFork = new Common::MacResManager();
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index bfc8266e45..a575aad26e 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -61,6 +61,7 @@ namespace StarTrek {
class StarTrekEngine;
class Room;
+class Console;
typedef String(StarTrekEngine::*TextGetterFunc)(int, uintptr, String *);
@@ -776,14 +777,15 @@ public:
Graphics *_gfx;
Sound *_sound;
+ Console *_console;
SharedPtr<IWFile> _iwFile;
+ SharedPtr<Room> _room;
private:
Common::RandomSource _randomSource;
Common::SineTable _sineTable;
Common::MacResManager *_macResFork;
- SharedPtr<Room> _room;
};
// Static function