FULLPIPE: Add debug console.

This commit is contained in:
D G Turner 2013-12-07 00:16:56 +00:00
parent 907c053fca
commit 4e849da06d
5 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,31 @@
/* 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 "fullpipe/fullpipe.h"
namespace Fullpipe {
Console::Console(FullpipeEngine *vm) : GUI::Debugger() {
_vm = vm;
}
} // End of namespace Fullpipe

View File

@ -0,0 +1,40 @@
/* 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 FULLPIPE_CONSOLE_H
#define FULLPIPE_CONSOLE_H
namespace Fullpipe {
class FullpipeEngine;
class Console : public GUI::Debugger {
public:
Console(FullpipeEngine *vm);
private:
FullpipeEngine *_vm;
};
} // End of namespace Fullpipe
#endif /* FULLPIPE_CONSOLE_H */

View File

@ -35,6 +35,7 @@
#include "fullpipe/input.h"
#include "fullpipe/scenes.h"
#include "fullpipe/floaters.h"
#include "fullpipe/console.h"
namespace Fullpipe {
@ -51,6 +52,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_rnd = new Common::RandomSource("fullpipe");
_console = 0;
_gameProjectVersion = 0;
_pictureScale = 8;
@ -152,6 +154,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
FullpipeEngine::~FullpipeEngine() {
delete _rnd;
delete _console;
delete _globalMessageQueueList;
}
@ -174,6 +177,8 @@ Common::Error FullpipeEngine::run() {
_backgroundSurface.create(800, 600, format);
_console = new Console(this);
initialize();
_isSaveAllowed = false;
@ -272,6 +277,11 @@ void FullpipeEngine::updateEvents() {
return;
break;
default:
if (event.kbd.keycode == Common::KEYCODE_d && event.kbd.hasFlags(Common::KBD_CTRL)) {
// Start the debugger
getDebugger()->attach();
getDebugger()->onFrame();
}
ex = new ExCommand(0, 17, 36, 0, 0, 0, 1, 0, 0, 0);
ex->_keyCode = event.kbd.keycode;
ex->_excFlags |= 3;

View File

@ -36,6 +36,9 @@
#include "engines/engine.h"
#include "gui/debugger.h"
#include "fullpipe/console.h"
struct ADGameDescription;
namespace Fullpipe {
@ -80,6 +83,9 @@ public:
FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc);
virtual ~FullpipeEngine();
Console *_console;
GUI::Debugger *getDebugger() { return _console; }
void initialize();
void setMusicAllowed(int val) { _musicAllowed = val; }

View File

@ -2,6 +2,7 @@ MODULE := engines/fullpipe
MODULE_OBJS = \
behavior.o \
console.o \
detection.o \
floaters.o \
fullpipe.o \