Browse Source

debug fps command (#3418)

pull/3427/head
qndel 4 years ago committed by GitHub
parent
commit
53f89fb9d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      Source/debug.cpp
  2. 3
      Source/scrollrt.cpp
  3. 1
      Source/scrollrt.h

10
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<DebugCmdItem> 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<DebugCmdItem> 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;
}

3
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;

1
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

Loading…
Cancel
Save