diff options
Diffstat (limited to 'src/console_cmds.cpp')
-rw-r--r-- | src/console_cmds.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 3b65224de..f44809d76 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -1895,6 +1895,37 @@ static void IConsoleDebugLibRegister() } #endif +DEF_CONSOLE_CMD(ConFramerate) +{ + extern void ConPrintFramerate(); // framerate_gui.cpp + + if (argc == 0) { + IConsoleHelp("Show frame rate and game speed information"); + return true; + } + + ConPrintFramerate(); + return true; +} + +DEF_CONSOLE_CMD(ConFramerateWindow) +{ + extern void ShowFramerateWindow(); + + if (argc == 0) { + IConsoleHelp("Open the frame rate window"); + return true; + } + + if (_network_dedicated) { + IConsoleError("Can not open frame rate window on a dedicated server"); + return false; + } + + ShowFramerateWindow(); + return true; +} + /******************************* * console command registration *******************************/ @@ -2025,6 +2056,8 @@ void IConsoleStdLibRegister() #ifdef _DEBUG IConsoleDebugLibRegister(); #endif + IConsoleCmdRegister("fps", ConFramerate); + IConsoleCmdRegister("fps_wnd", ConFramerateWindow); /* NewGRF development stuff */ IConsoleCmdRegister("reload_newgrfs", ConNewGRFReload, ConHookNewGRFDeveloperTool); |