HUGO: Add boundaries() to the console. God mode no longer shows boundaries, as in the original

This commit is contained in:
strangerke 2011-05-25 20:23:02 +02:00
parent be3306a9eb
commit fe41da83ad
5 changed files with 30 additions and 12 deletions

View File

@ -30,6 +30,7 @@ namespace Hugo {
HugoConsole::HugoConsole(HugoEngine *vm) : GUI::Debugger(), _vm(vm) {
DCmd_Register("listscreens", WRAP_METHOD(HugoConsole, Cmd_listScreens));
DCmd_Register("gotoscreen", WRAP_METHOD(HugoConsole, Cmd_gotoScreen));
DCmd_Register("Boundaries", WRAP_METHOD(HugoConsole, Cmd_boundaries));
}
HugoConsole::~HugoConsole() {
@ -79,4 +80,17 @@ bool HugoConsole::Cmd_listScreens(int argc, const char **argv) {
return true;
}
/**
* This command shows and hides boundaries
*/
bool HugoConsole::Cmd_boundaries(int argc, const char **argv) {
if (argc != 1) {
DebugPrintf("Usage: %s\n", argv[0]);
return true;
}
_vm->getGameStatus().showBoundariesFl = !_vm->getGameStatus().showBoundariesFl;
return false;
}
} // End of namespace Hugo

View File

@ -38,6 +38,7 @@ private:
HugoEngine *_vm;
bool Cmd_listScreens(int argc, const char **argv);
bool Cmd_gotoScreen(int argc, const char **argv);
bool Cmd_boundaries(int argc, const char **argv);
};
} // End of namespace Hugo

View File

@ -644,13 +644,13 @@ bool Screen::isOverlapping(const rect_t *rectA, const rect_t *rectB) const {
}
/**
* Display active boundaries in God Mode ('PPG')
* Display active boundaries (activated in the console)
* Light Red = Exit hotspots
* Light Green = Visible objects
* White = Fixed objects, parts of background
* White = Fix objects, parts of background
*/
void Screen::drawBoundaries() {
if (!_vm->getGameStatus().godModeFl)
if (!_vm->getGameStatus().showBoundariesFl)
return;
_vm->_mouse->drawHotspots();

View File

@ -527,15 +527,16 @@ void HugoEngine::initPlaylist(bool playlist[kMaxTunes]) {
*/
void HugoEngine::initStatus() {
debugC(1, kDebugEngine, "initStatus");
_status.storyModeFl = false; // Not in story mode
_status.gameOverFl = false; // Hero not knobbled yet
_status.lookFl = false; // Toolbar "look" button
_status.recallFl = false; // Toolbar "recall" button
_status.newScreenFl = false; // Screen not just loaded
_status.godModeFl = false; // No special cheats allowed
_status.doQuitFl = false;
_status.skipIntroFl = false;
_status.helpFl = false;
_status.storyModeFl = false; // Not in story mode
_status.gameOverFl = false; // Hero not knobbled yet
_status.lookFl = false; // Toolbar "look" button
_status.recallFl = false; // Toolbar "recall" button
_status.newScreenFl = false; // Screen not just loaded
_status.godModeFl = false; // No special cheats allowed
_status.showBoundariesFl = false; // No special cheats allowed
_status.doQuitFl = false; // Boundaries hidden by default
_status.skipIntroFl = false;
_status.helpFl = false;
// Initialize every start of new game
_status.tick = 0; // Tick count

View File

@ -177,6 +177,8 @@ struct status_t { // Game status (not saved)
bool recallFl; // Toolbar "recall" button pressed
bool newScreenFl; // New screen just loaded in dib_a
bool godModeFl; // Allow DEBUG features in live version
bool showBoundariesFl; // Flag used to show and hide boundaries,
// used by the console
bool doQuitFl;
bool skipIntroFl;
bool helpFl;