diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wintermute/debugger.cpp | 27 | ||||
-rw-r--r-- | engines/wintermute/debugger.h | 6 | ||||
-rw-r--r-- | engines/wintermute/wintermute.h | 2 |
3 files changed, 32 insertions, 3 deletions
diff --git a/engines/wintermute/debugger.cpp b/engines/wintermute/debugger.cpp index 22e7b1c37b..1160a16d37 100644 --- a/engines/wintermute/debugger.cpp +++ b/engines/wintermute/debugger.cpp @@ -20,4 +20,29 @@ * */ -#include "engines/wintermute/debugger.h"
\ No newline at end of file +#include "engines/wintermute/debugger.h" +#include "engines/wintermute/wintermute.h" +#include "engines/wintermute/base/base_game.h" + +namespace Wintermute { + +Console::Console(WintermuteEngine *vm) : GUI::Debugger(), _engineRef(vm) { + DCmd_Register("show_fps", WRAP_METHOD(Console, Cmd_ShowFps)); +} + +Console::~Console(void) { + +} + +bool Console::Cmd_ShowFps(int argc, const char **argv) { + if (argc > 1) { + if (Common::String(argv[1]) == "true") { + _engineRef->_game->_debugShowFPS = true; + } else if (Common::String(argv[1]) == "false") { + _engineRef->_game->_debugShowFPS = false; + } + } + return true; +} + +} // end of namespace Wintermute diff --git a/engines/wintermute/debugger.h b/engines/wintermute/debugger.h index 00dd8a3ac6..069980385e 100644 --- a/engines/wintermute/debugger.h +++ b/engines/wintermute/debugger.h @@ -30,8 +30,10 @@ namespace Wintermute { class WintermuteEngine; class Console : public GUI::Debugger { public: - Console(WintermuteEngine *vm) : GUI::Debugger(), _engineRef(vm) {} - virtual ~Console(void) {} + Console(WintermuteEngine *vm); + virtual ~Console(); + + bool Cmd_ShowFps(int argc, const char **argv); private: WintermuteEngine *_engineRef; }; diff --git a/engines/wintermute/wintermute.h b/engines/wintermute/wintermute.h index 1c5b902143..fcaa2840a9 100644 --- a/engines/wintermute/wintermute.h +++ b/engines/wintermute/wintermute.h @@ -68,6 +68,8 @@ private: GUI::Debugger *_debugger; BaseGame *_game; const ADGameDescription *_gameDescription; + + friend class Console; }; } // End of namespace Wintermute |