Rename a dvar
This commit is contained in:
parent
b01f02dfc7
commit
968b862d0d
@ -33,7 +33,7 @@ namespace fps
|
|||||||
|
|
||||||
game::dvar_t* cg_draw_game_time = nullptr;
|
game::dvar_t* cg_draw_game_time = nullptr;
|
||||||
|
|
||||||
game::dvar_t* com_accurate_max_fps = nullptr;
|
game::dvar_t* com_wait_end_frame_mode = nullptr;
|
||||||
|
|
||||||
float fps_color_good[4] = {0.6f, 1.0f, 0.0f, 1.0f};
|
float fps_color_good[4] = {0.6f, 1.0f, 0.0f, 1.0f};
|
||||||
float fps_color_ok[4] = {1.0f, 0.7f, 0.3f, 1.0f};
|
float fps_color_ok[4] = {1.0f, 0.7f, 0.3f, 1.0f};
|
||||||
@ -363,7 +363,7 @@ namespace fps
|
|||||||
|
|
||||||
void r_process_workers_with_timeout_stub(void* a1, void* a2)
|
void r_process_workers_with_timeout_stub(void* a1, void* a2)
|
||||||
{
|
{
|
||||||
if (com_accurate_max_fps->current.enabled)
|
if (com_wait_end_frame_mode->current.enabled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -373,7 +373,7 @@ namespace fps
|
|||||||
|
|
||||||
void com_frame_stub()
|
void com_frame_stub()
|
||||||
{
|
{
|
||||||
const auto value = com_accurate_max_fps->current.integer;
|
const auto value = com_wait_end_frame_mode->current.integer;
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
{
|
{
|
||||||
return com_frame_hook.invoke<void>();
|
return com_frame_hook.invoke<void>();
|
||||||
@ -445,7 +445,7 @@ namespace fps
|
|||||||
cg_draw_game_time = dvars::register_bool("cg_drawGameTime", false, game::DVAR_FLAG_SAVED, "Draw game time");
|
cg_draw_game_time = dvars::register_bool("cg_drawGameTime", false, game::DVAR_FLAG_SAVED, "Draw game time");
|
||||||
|
|
||||||
// Make fps capping accurate
|
// Make fps capping accurate
|
||||||
com_accurate_max_fps = dvars::register_int("com_accurateMaxFps", 0, 0, 2, game::DVAR_FLAG_SAVED, "Accurate fps capping");
|
com_wait_end_frame_mode = dvars::register_int("com_waitEndFrameMode", 0, 0, 2, game::DVAR_FLAG_SAVED, "Wait end frame mode (0 = default, 1 = sleep(n), 2 = loop sleep(0)");
|
||||||
utils::hook::call(0x1405A38B9, r_process_workers_with_timeout_stub);
|
utils::hook::call(0x1405A38B9, r_process_workers_with_timeout_stub);
|
||||||
com_frame_hook.create(0x1405A3740, com_frame_stub);
|
com_frame_hook.create(0x1405A3740, com_frame_stub);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user