TUCKER: Added basic debugging console to engine

Tucker does not currently use Debug Channels, but this does provide a base for adding them along with any other debugging commands.

svn-id: r54141
This commit is contained in:
David Turner 2010-11-08 12:24:18 +00:00
parent cb734285a5
commit 71d0526834
5 changed files with 107 additions and 0 deletions

View 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 "tucker/console.h"
#include "tucker/tucker.h"
namespace Tucker {
TuckerConsole::TuckerConsole(TuckerEngine *vm) : GUI::Debugger(), _vm(vm) {
}
TuckerConsole::~TuckerConsole() {
}
void TuckerConsole::preEnter() {
}
void TuckerConsole::postEnter() {
}
} // End of namespace Tucker

50
engines/tucker/console.h Normal file
View 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 TUCKER_CONSOLE_H
#define TUCKER_CONSOLE_H
#include "gui/debugger.h"
namespace Tucker {
class TuckerEngine;
class TuckerConsole : public GUI::Debugger {
public:
TuckerConsole(TuckerEngine *vm);
virtual ~TuckerConsole(void);
protected:
virtual void preEnter();
virtual void postEnter();
private:
TuckerEngine *_vm;
};
} // End of namespace Tucker
#endif

View File

@ -1,6 +1,7 @@
MODULE := engines/tucker
MODULE_OBJS := \
console.o \
detection.o \
graphics.o \
locations.o \

View File

@ -38,9 +38,11 @@ namespace Tucker {
TuckerEngine::TuckerEngine(OSystem *system, Common::Language language, uint32 flags)
: Engine(system), _gameLang(language), _gameFlags(flags) {
_console = new TuckerConsole(this);
}
TuckerEngine::~TuckerEngine() {
delete _console;
}
bool TuckerEngine::hasFeature(EngineFeature f) const {
@ -628,6 +630,12 @@ void TuckerEngine::parseEvents() {
case Common::KEYCODE_ESCAPE:
_inputKeys[kInputKeyEscape] = true;
break;
case Common::KEYCODE_d:
if (ev.kbd.hasFlags(Common::KBD_CTRL)) {
this->getDebugger()->attach();
this->getDebugger()->onFrame();
}
break;
default:
break;
}

View File

@ -39,6 +39,8 @@
#include "engines/engine.h"
#include "tucker/console.h"
/**
* This is the namespace of the Tucker engine.
*
@ -275,6 +277,7 @@ public:
virtual Common::Error run();
virtual bool hasFeature(EngineFeature f) const;
virtual void syncSoundSettings();
GUI::Debugger *getDebugger() { return _console; }
protected:
@ -566,6 +569,8 @@ protected:
virtual bool canLoadGameStateCurrently();
virtual bool canSaveGameStateCurrently();
TuckerConsole *_console;
void handleIntroSequence();
void handleCreditsSequence();
void handleCongratulationsSequence();