From 7352766582e140483ebcc1d8660a76e1bccbec0d Mon Sep 17 00:00:00 2001 From: salmonik Date: Fri, 6 Nov 2026 16:23:01 +0100 Subject: ESP: extract projectile ESP into its own translation unit First slice of the esp.cpp split. Shared helpers move to esp_internal.h (entity lookups, screen size, surf primitives, segment projection); esp.cpp keeps the definitions and drops their static qualifiers. --- src/esp_internal.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/esp_internal.h (limited to 'src/esp_internal.h') diff --git a/src/esp_internal.h b/src/esp_internal.h new file mode 100644 index 0000000..15178a7 --- /dev/null +++ b/src/esp_internal.h @@ -0,0 +1,34 @@ +#ifndef HL2H_ESP_INTERNAL_H +#define HL2H_ESP_INTERNAL_H + +// Helpers shared between the ESP translation units (esp.cpp, items.cpp, +// projectiles.cpp). Everything here has internal linkage semantics but is +// exported across those TUs, so it lives in the shared header instead of being +// repeated. + +#include "hl2h.h" +#include + +extern int g_scr_w, g_scr_h; + +double esp_now(); +bool esp_update_screen(); + +// entity helpers +void *entity_networkable(int idx); +const char *entity_class_name(void *net, void **out_cc); +const char *entity_model_name(void *ent); +bool entity_origin(void *ent, Vector &out); +bool entity_is_dormant(void *net); +bool active_weapon_contains(void *local_ent, const char *needle); +bool item_weapon_is_owned(void *ent); + +// drawing primitives +void surf_rect(int filled, int x0, int y0, int x1, int y1); +void surf_color(int r, int g, int b, int a); +void surf_line(int x0, int y0, int x1, int y1); +QAngle engine_view_angles(); +bool project_segment(const Vector &a, const Vector &b, int &x0, int &y0, + int &x1, int &y1); + +#endif -- cgit v1.2.3