From 1f7c91905f69baba0aca8265c84deaba2ddac98a Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 3 Nov 2026 23:21:13 +0100 Subject: World: add world/sky material colour modulation Port Amalgam's modulation approach: obtain IMaterialSystem from the already loaded materialsystem.so (VMaterialSystem080) and walk materials with FirstMaterial/NextMaterial/GetMaterial. ColorModulate the "World textures" group (sky names excluded) and the "SkyBox textures"/sky-named group. The walk runs only when the enabled groups or colours change, restores white when disabled, and re-applies after level changes. Before touching materials, GetNumMaterials() and the first material's name/group are sanity-checked so a wrong vtable slot logs and aborts instead of walking garbage. GUI: "World tint" card with world/sky toggles and RGB sliders; config section [worldtint]. --- src/hl2h.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/hl2h.h') diff --git a/src/hl2h.h b/src/hl2h.h index 2824d3c..e90ba91 100644 --- a/src/hl2h.h +++ b/src/hl2h.h @@ -178,7 +178,8 @@ enum FeatureId { FEAT_SPREAD = 8, FEAT_ITEM_ESP = 9, FEAT_FULLBRIGHT = 10, - FEAT_COUNT = 11 + FEAT_WORLD_TINT = 11, + FEAT_COUNT = 12 }; enum EspOption { ESP_OPT_SHOW_NEUTRAL = 0, @@ -210,7 +211,10 @@ struct FeatureState { }; extern FeatureState g_bhop, g_abh, g_jumpbug, g_melee, g_spread, g_esp, - g_aimbot, g_triggerbot, g_silentaim, g_item_esp, g_fullbright; + g_aimbot, g_triggerbot, g_silentaim, g_item_esp, g_fullbright, + g_world_tint; +extern bool g_tint_world_on, g_tint_sky_on; +extern int g_tint_world_rgb[3], g_tint_sky_rgb[3]; extern bool g_bhop_autostrafe; extern bool g_jumpbug_assist; extern bool g_spread_no_spread; @@ -248,6 +252,8 @@ void resolve_netvars(); bool cvar_set_int(const char *name, int value); void fullbright_update(); void fullbright_invalidate(); +void world_tint_update(); +void world_tint_invalidate(); bool resolve_server_netvars(); int server_entity_health(int idx, int *maxhealth, int *lifestate, void **base_out); bool server_set_velocity_z(int idx, float vz); -- cgit v1.2.3