From 7a2d7b9377cf75953614dd7889f1eb66890f9fdd Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Tue, 25 Jul 2023 22:50:52 +0200 Subject: [PATCH] Call engine_draw_text Instead of pfnDrawConsoleString --- src/features/esp.c | 5 ++--- src/hooks.c | 16 ++-------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/features/esp.c b/src/features/esp.c index a706bfa..044632a 100644 --- a/src/features/esp.c +++ b/src/features/esp.c @@ -100,8 +100,7 @@ void esp(void) { /* TODO: Instead of -5px, center the player name to the player origin. * I don't know how to get the text size before rendering. */ - i_engine->pfnDrawSetTextColor(1, 1, 1); - i_engine->pfnDrawConsoleString(s_top[0] - 5, s_top[1] - 2, - get_name(ent->index)); + engine_draw_text(s_top[0] - 5, s_top[1] - 2, get_name(ent->index), + (rgb_t){ 255, 255, 255 }); } } diff --git a/src/hooks.c b/src/hooks.c index 7a9274f..9456dbc 100644 --- a/src/hooks.c +++ b/src/hooks.c @@ -3,10 +3,8 @@ #include "include/sdk.h" #include "include/globals.h" #include "include/util.h" -#include "include/detour.h" /* 8dcc/detour-lib */ - -/* DELME */ #include "include/cvars.h" +#include "include/detour.h" /* 8dcc/detour-lib */ /* bhop(), esp(), etc. */ #include "features/features.h" @@ -66,17 +64,7 @@ int h_HUD_Redraw(float time, int intermission) { int ret = ORIGINAL(HUD_Redraw, time, intermission); /* Watermark */ - i_engine->pfnDrawSetTextColor(1, 1, 1); - i_engine->pfnDrawConsoleString(5, 5, "8dcc/hl-cheat"); - -#ifdef DEBUG - char pos[100]; - sprintf(pos, "x: %f, y: %f, z: %f", localplayer->origin[0], - localplayer->origin[1], localplayer->origin[2]); - - i_engine->pfnDrawSetTextColor(1, 1, 1); - i_engine->pfnDrawConsoleString(5, 20, pos); -#endif + engine_draw_text(5, 5, "8dcc/hl-cheat", (rgb_t){ 255, 255, 255 }); esp();