mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 14:51:40 +00:00
TOON: Added basic debugging console to engine
Since Toon uses Debug Channels, this allows for the interactive setting of debugflags as well as providing a base for adding further debugging commands. However, the hotkey for this is currently disabled as it causes a segfault. Not sure why. svn-id: r54123
This commit is contained in:
parent
f9d311d1ef
commit
279a760c5a
43
engines/toon/console.cpp
Normal file
43
engines/toon/console.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
/* 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.
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "toon/console.h"
|
||||
#include "toon/toon.h"
|
||||
|
||||
namespace Toon {
|
||||
|
||||
ToonConsole::ToonConsole(ToonEngine *vm) : GUI::Debugger(), _vm(vm) {
|
||||
}
|
||||
|
||||
ToonConsole::~ToonConsole() {
|
||||
}
|
||||
|
||||
void ToonConsole::preEnter() {
|
||||
}
|
||||
|
||||
void ToonConsole::postEnter() {
|
||||
}
|
||||
|
||||
} // End of namespace Toon
|
50
engines/toon/console.h
Normal file
50
engines/toon/console.h
Normal file
@ -0,0 +1,50 @@
|
||||
/* 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.
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TOON_CONSOLE_H
|
||||
#define TOON_CONSOLE_H
|
||||
|
||||
#include "gui/debugger.h"
|
||||
|
||||
namespace Toon {
|
||||
|
||||
class ToonEngine;
|
||||
|
||||
class ToonConsole : public GUI::Debugger {
|
||||
public:
|
||||
ToonConsole(ToonEngine *vm);
|
||||
virtual ~ToonConsole(void);
|
||||
|
||||
protected:
|
||||
virtual void preEnter();
|
||||
virtual void postEnter();
|
||||
|
||||
private:
|
||||
ToonEngine *_vm;
|
||||
};
|
||||
|
||||
} // End of namespace Toon
|
||||
|
||||
#endif
|
@ -4,6 +4,7 @@ MODULE_OBJS := \
|
||||
anim.o \
|
||||
audio.o \
|
||||
character.o \
|
||||
console.o \
|
||||
conversation.o \
|
||||
detection.o \
|
||||
drew.o \
|
||||
|
@ -239,6 +239,11 @@ void ToonEngine::parseInput() {
|
||||
dialog.runModal();
|
||||
}
|
||||
}
|
||||
// FIXME - Triggering Debug Console currently causes a segfault.
|
||||
//if (event.kbd.keycode == Common::KEYCODE_d) {
|
||||
// this->getDebugger()->attach();
|
||||
// this->getDebugger()->onFrame();
|
||||
//}
|
||||
}
|
||||
break;
|
||||
// Strangerke - Commented (not used)
|
||||
@ -750,6 +755,8 @@ ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription)
|
||||
DebugMan.addDebugChannel(kDebugTools, "Tools", "Tools debug level");
|
||||
DebugMan.addDebugChannel(kDebugText, "Text", "Text debug level");
|
||||
|
||||
_console = new ToonConsole(this);
|
||||
|
||||
switch (_language) {
|
||||
case Common::EN_GRB:
|
||||
case Common::EN_USA:
|
||||
@ -776,7 +783,8 @@ ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription)
|
||||
}
|
||||
|
||||
ToonEngine::~ToonEngine() {
|
||||
|
||||
DebugMan.clearAllDebugChannels();
|
||||
delete _console;
|
||||
}
|
||||
|
||||
void ToonEngine::flushPalette() {
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "toon/font.h"
|
||||
#include "toon/text.h"
|
||||
#include "toon/audio.h"
|
||||
#include "toon/console.h"
|
||||
|
||||
#define TOON_DAT_VER_MAJ 0 // 1 byte
|
||||
#define TOON_DAT_VER_MIN 3 // 1 byte
|
||||
@ -417,6 +418,8 @@ protected:
|
||||
bool _firstFrame;
|
||||
bool _isDemo;
|
||||
bool _showConversationText;
|
||||
private:
|
||||
ToonConsole *_console;
|
||||
};
|
||||
|
||||
} // End of namespace Toon
|
||||
|
Loading…
x
Reference in New Issue
Block a user