aboutsummaryrefslogtreecommitdiff
path: root/engines/groovie/script.cpp
diff options
context:
space:
mode:
authorJordi Vilalta Prat2008-11-15 18:56:39 +0000
committerJordi Vilalta Prat2008-11-15 18:56:39 +0000
commit9671b3a5143aeedca734a3700ac5d9d3486001b8 (patch)
tree4a6d2618c0a6db046d79bfa70d796be8bfe16867 /engines/groovie/script.cpp
parente3928f69a2de5448dee8b75f9290eb8456e3cdcf (diff)
downloadscummvm-rg350-9671b3a5143aeedca734a3700ac5d9d3486001b8.tar.gz
scummvm-rg350-9671b3a5143aeedca734a3700ac5d9d3486001b8.tar.bz2
scummvm-rg350-9671b3a5143aeedca734a3700ac5d9d3486001b8.zip
Simplify error debugging by implementing GroovieEngine::errorString()
svn-id: r35087
Diffstat (limited to 'engines/groovie/script.cpp')
-rw-r--r--engines/groovie/script.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 4e5c0386c3..5ecb398957 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -60,7 +60,7 @@ void debugScript(int level, bool nl, const char *s, ...) {
Script::Script(GroovieEngine *vm) :
_code(NULL), _savedCode(NULL), _stacktop(0),
- _debugger(NULL), _error(false), _vm(vm),
+ _debugger(NULL), _vm(vm),
_videoFile(NULL), _videoRef(0), _font(NULL) {
// Initialize the random source
_vm->_system->getEventManager()->registerRandomSource(_random, "GroovieScripts");
@@ -145,9 +145,6 @@ void Script::directGameLoad(int slot) {
}
void Script::step() {
- // Reset the error status
- _error = false;
-
// Prepare the base debug string
char debugstring[10];
sprintf(debugstring, "@0x%04X: ", _currentInstruction);
@@ -182,22 +179,8 @@ void Script::setKbdChar(uint8 c) {
_eventKbdChar = c;
}
-bool Script::haveError() {
- return _error;
-}
-
-void Script::error(const char *msg) {
- // Prepend the debugging info to the error
- Common::String msg2 = _debugString + msg;
-
- // Print the error message
- ::error("ERROR: %s\n", msg2.c_str());
-
- // Show it in the debugger
- _debugger->attach(msg2.c_str());
-
- // Set the error state
- _error = true;
+Common::String &Script::getContext() {
+ return _debugString;
}
uint8 Script::readScript8bits() {
@@ -946,7 +929,7 @@ void Script::o_stopmidi() {
void Script::o_endscript() {
debugScript(1, true, "END OF SCRIPT");
- _error = true;
+ _vm->quitGame();
}
void Script::o_sethotspottop() {