diff --git a/src/client/component/branding.cpp b/src/client/component/branding.cpp index 3caa515c..56578dc3 100644 --- a/src/client/component/branding.cpp +++ b/src/client/component/branding.cpp @@ -10,18 +10,6 @@ namespace branding { - namespace - { - void draw_brand() - { - const auto font = game::R_RegisterFont("fonts/defaultBold.otf", 22); - float color[4] = {0.9f, 0.9f, 0.5f, 1.f}; - - game::R_AddCmdDrawText("h2-mod", 0x7FFFFFFF, font, 15.f, 15.f + static_cast(font->pixelHeight), - 1.f, 1.f, 0.0f, color, 0); - } - } - class component final : public component_interface { public: @@ -29,12 +17,21 @@ namespace branding { localized_strings::override("MENU_SP_CAMPAIGN", "H2-Mod"); - scheduler::once([]() + scheduler::loop([]() { - scheduler::loop([]() - { - draw_brand(); - }, scheduler::pipeline::renderer); + const auto x = 15.f; + const auto y = 15.f; + const auto scale = 1.0f; + float color[4] = {0.9f, 0.9f, 0.5f, 1.f}; + const auto* text = "h2-mod"; + + auto* font = game::R_RegisterFont("fonts/defaultBold.otf", 22); + + if (!font) return; + + game::R_AddCmdDrawText(text, 0x7FFFFFFF, font, static_cast(x), + y + static_cast(font->pixelHeight) * scale, + scale, scale, 0.0f, color, 0); }, scheduler::pipeline::renderer); } }; diff --git a/src/client/component/fps.cpp b/src/client/component/fps.cpp index 56e78a2b..5a8c69bb 100644 --- a/src/client/component/fps.cpp +++ b/src/client/component/fps.cpp @@ -262,11 +262,6 @@ namespace fps public: void post_unpack() override { - scheduler::once([]() - { - scheduler::loop(draw, scheduler::pipeline::renderer); - }, scheduler::pipeline::renderer); - cg_drawSpeed = dvars::register_int("cg_drawSpeed", 0, 0, 2, game::DVAR_FLAG_SAVED); cg_drawFps = dvars::register_int("cg_drawFPS", 0, 0, 4, game::DVAR_FLAG_SAVED, false); @@ -282,6 +277,7 @@ namespace fps cg_speedGraphWidth = dvars::register_int("cg_speedGraphWidth", 200, 0, 1000, game::DVAR_FLAG_SAVED); cg_speedGraphHeight = dvars::register_int("cg_speedGraphHeight", 80, 0, 1000, game::DVAR_FLAG_SAVED); + scheduler::loop(draw, scheduler::pipeline::renderer); } }; } diff --git a/src/client/component/game_console.cpp b/src/client/component/game_console.cpp index eb267592..541d31b4 100644 --- a/src/client/component/game_console.cpp +++ b/src/client/component/game_console.cpp @@ -683,11 +683,7 @@ namespace game_console public: void post_unpack() override { - scheduler::once([]() - { - scheduler::loop(draw_console, scheduler::pipeline::renderer); - }, scheduler::pipeline::renderer); - + scheduler::loop(draw_console, scheduler::pipeline::renderer); con.cursor = 0; con.visible_line_count = 0;