aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/console.cpp35
-rw-r--r--engines/zvision/console.h42
-rw-r--r--engines/zvision/events.cpp7
-rw-r--r--engines/zvision/zvision.cpp11
-rw-r--r--engines/zvision/zvision.h7
5 files changed, 88 insertions, 14 deletions
diff --git a/engines/zvision/console.cpp b/engines/zvision/console.cpp
new file mode 100644
index 0000000000..a26dba9d6d
--- /dev/null
+++ b/engines/zvision/console.cpp
@@ -0,0 +1,35 @@
+/* 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.
+*
+*/
+
+#include "common/scummsys.h"
+
+#include "gui/debugger.h"
+
+#include "zvision/console.h"
+#include "zvision/zvision.h"
+
+namespace ZVision {
+
+ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) {
+ }
+
+} // End of namespace ZVision
diff --git a/engines/zvision/console.h b/engines/zvision/console.h
new file mode 100644
index 0000000000..c91b362451
--- /dev/null
+++ b/engines/zvision/console.h
@@ -0,0 +1,42 @@
+/* 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 ZVISION_CONSOLE_H
+#define ZVISION_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace ZVision {
+
+ class ZVision;
+
+ class Console : public GUI::Debugger {
+ public:
+ Console(ZVision *engine);
+ virtual ~Console() {}
+
+ private:
+ ZVision *_engine;
+ };
+
+} // End of namespace ZVision
+#endif
diff --git a/engines/zvision/events.cpp b/engines/zvision/events.cpp
index 8d10485ddf..cb1ef53248 100644
--- a/engines/zvision/events.cpp
+++ b/engines/zvision/events.cpp
@@ -22,7 +22,8 @@
#include "common/scummsys.h"
-#include "zvision.h"
+#include "zvision/zvision.h"
+#include "zvision/console.h"
#include "common/EventRecorder.h"
@@ -50,8 +51,8 @@ void ZVision::processEvents() {
case Common::KEYCODE_d:
if (_event.kbd.hasFlags(Common::KBD_CTRL)) {
// Start the debugger
- getDebugger()->attach();
- getDebugger()->onFrame();
+ _console->attach();
+ _console->onFrame();
}
break;
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 6fb94f8725..7a07b59b71 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -25,6 +25,7 @@
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/debug-channels.h"
+#include "common/textconsole.h"
#include "common/error.h"
#include "common/system.h"
#include "common/file.h"
@@ -32,11 +33,10 @@
#include "engines/util.h"
#include "zvision/zvision.h"
+#include "zvision/console.h"
#include "zvision/script_manager.h"
#include "zvision/zfs_archive.h"
-#include "graphics/decoders/tga.h"
-
#include "zvision/utility.h"
namespace ZVision {
@@ -73,6 +73,7 @@ ZVision::~ZVision() {
debug("ZVision::~ZVision");
// Dispose of resources
+ delete _console;
delete _scriptManager;
delete _rnd;
@@ -124,9 +125,11 @@ Common::Error ZVision::run() {
updateScripts();
updateAnimations(deltaTime);
- if (_needsScreenUpdate)
- {
+
+
+ if (_needsScreenUpdate || _console->isActive()) {
_system->updateScreen();
+ _needsScreenUpdate = false;
}
// Calculate the frame delay based off a desired frame rate
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index 0053fe5a9e..9dd36662f7 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -83,13 +83,6 @@ private:
void updateScripts();
void updateAnimations(uint32 detaTimeMillis);
};
-
-// Example console class
-class Console : public GUI::Debugger {
-public:
- Console(ZVision *vm) {}
- virtual ~Console(void) {}
-};
} // End of namespace ZVision