diff --git a/Source/debug.cpp b/Source/debug.cpp index aef02fb1b..2446ba035 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -725,6 +725,12 @@ std::string DebugCmdPlayerInfo(const string_view parameter) player._pInvincible ? 1 : 0, player._pHitPoints); } +std::string DebugCmdToggleFPS(const string_view parameter) +{ + frameflag = !frameflag; + return ""; +} + std::vector DebugCmdList = { { "help", "Prints help overview or help for a specific command.", "({command})", &DebugCmdHelp }, { "give gold", "Fills the inventory with gold.", "", &DebugCmdGiveGoldCheat }, @@ -755,6 +761,7 @@ std::vector DebugCmdList = { { "iteminfo", "Shows info of currently selected item.", "", &DebugCmdItemInfo }, { "questinfo", "Shows info of quests.", "{id}", &DebugCmdQuestInfo }, { "playerinfo", "Shows info of player.", "{playerid}", &DebugCmdPlayerInfo }, + { "fps", "Toggles displaying FPS", "", &DebugCmdToggleFPS }, }; } // namespace @@ -817,7 +824,8 @@ bool CheckDebugTextCommand(const string_view text) parameter = text.substr(dbgCmd.text.length() + 1); const auto result = dbgCmd.actionProc(parameter); Log("DebugCmd: {} Result: {}", text, result); - InitDiabloMsg(result); + if (result != "") + InitDiabloMsg(result); return true; } diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 8e8537c79..1442e6316 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -74,6 +74,8 @@ int level_piece_id; // DevilutionX extension. extern void DrawControllerModifierHints(const Surface &out); +bool frameflag; + namespace { /** * @brief Hash algorithm for point @@ -202,7 +204,6 @@ uint32_t sgdwCursHgtOld; bool dRendered[MAXDUNX][MAXDUNY]; -bool frameflag; int frameend; int framerate; int framestart; diff --git a/Source/scrollrt.h b/Source/scrollrt.h index 195423aff..4e44b3458 100644 --- a/Source/scrollrt.h +++ b/Source/scrollrt.h @@ -37,6 +37,7 @@ extern bool cel_transparency_active; extern bool cel_foliage_active; extern int level_piece_id; extern bool AutoMapShowItems; +extern bool frameflag; /** * @brief Returns the offset for the walking animation