From 4949f52b58499dc82cf37291949b3af8be32a3c0 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 21 Jan 2023 02:57:05 +0900 Subject: [PATCH] [console] Move gib hud control into hud I don't know why it was ever in console. --- libs/client/hud.c | 15 +++++++++++++++ libs/console/client.c | 17 ----------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/libs/client/hud.c b/libs/client/hud.c index 580ffe45a..e1775ac6f 100644 --- a/libs/client/hud.c +++ b/libs/client/hud.c @@ -32,6 +32,7 @@ #include #include "QF/cvar.h" +#include "QF/gib.h" #include "QF/screen.h" #include "QF/render.h" #include "QF/plugin/vid_render.h" @@ -259,6 +260,17 @@ hud_scoreboard_gravity_f (void *data, const cvar_t *cvar) View_SetGravity (hud_overlay_view, hud_scoreboard_gravity); } } +static void +C_GIB_HUD_Enable_f (void) +{ + //hud_canvas_view->visible = 1; +} + +static void +C_GIB_HUD_Disable_f (void) +{ + //hud_canvas_view->visible = 0; +} void HUD_Init (void) @@ -274,6 +286,9 @@ HUD_Init (void) passage_components, passage_comp_count); ECS_CreateComponentPools (hud_system.reg); + // register GIB builtins + GIB_Builtin_Add ("HUD::enable", C_GIB_HUD_Enable_f); + GIB_Builtin_Add ("HUD::disable", C_GIB_HUD_Disable_f); } void diff --git a/libs/console/client.c b/libs/console/client.c index 99d7f9550..b2e39ee51 100644 --- a/libs/console/client.c +++ b/libs/console/client.c @@ -46,7 +46,6 @@ #include "QF/console.h" #include "QF/cvar.h" #include "QF/dstring.h" -#include "QF/gib.h" #include "QF/keys.h" #include "QF/qargs.h" #include "QF/quakefs.h" @@ -803,18 +802,6 @@ C_NewMap (void) dstring_copystr (old_gamedir, qfs_gamedir->gamedir); } -static void -C_GIB_HUD_Enable_f (void) -{ - //hud_view->visible = 1; -} - -static void -C_GIB_HUD_Disable_f (void) -{ - //hud_view->visible = 0; -} - static void exec_line (inputline_t *il) { @@ -1174,10 +1161,6 @@ C_Init (void) Cmd_AddCommand ("condump", Condump_f, "dump the console text to a " "file"); - // register GIB builtins - GIB_Builtin_Add ("HUD::enable", C_GIB_HUD_Enable_f); - GIB_Builtin_Add ("HUD::disable", C_GIB_HUD_Disable_f); - con_initialized = true; }