summaryrefslogtreecommitdiffstats
path: root/src/hl2h.h
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-03 23:58:59 +0100
committersalmonik <salmonik@tuta.io>2026-11-03 23:58:59 +0100
commit9c4455af43da34127864b09ad2a3d3e996c9dce1 (patch)
treeeb3754763db7c00fe664b900f9a560057bcb9955 /src/hl2h.h
parentWorld: add skybox changer (diff)
downloadhl2h-9c4455af43da34127864b09ad2a3d3e996c9dce1.tar.gz
hl2h-9c4455af43da34127864b09ad2a3d3e996c9dce1.zip
World: replace skybox changer with a PNG skybox image
sv_skyname did not take effect at runtime in this build, so the Skybox card now replaces the skybox materials' textures with <config dir>/skybox.png. The PNG is decoded through libpng16's simplified API (dlopen'ed, so no new link dependency) and uploaded with IMaterialSystem::CreateTextureFromBits as an RGBA8888 texture. IMaterialVar::SetTextureValue assigns it to $basetexture and the HDR variants for every material in the SkyBox textures group (all six faces get the same image). Original textures are recorded per material/var (texture pointer plus string fallback) and restored when the feature is off. Records survive level changes so a reused sky material is still restorable; the override is re-applied to a new map automatically. The card shows the image path and has a Reload image button; a missing/unreadable PNG raises an error toast.
Diffstat (limited to '')
-rw-r--r--src/hl2h.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/hl2h.h b/src/hl2h.h
index 3cb131d..fd7a863 100644
--- a/src/hl2h.h
+++ b/src/hl2h.h
@@ -219,10 +219,7 @@ extern bool g_tint_world_on, g_tint_sky_on, g_tint_prop_on;
219extern int g_tint_world_rgb[3], g_tint_sky_rgb[3], g_tint_prop_rgb[3]; 219extern int g_tint_world_rgb[3], g_tint_sky_rgb[3], g_tint_prop_rgb[3];
220extern bool g_fog_skybox, g_fog_disable; 220extern bool g_fog_skybox, g_fog_disable;
221extern int g_fog_rgb[3], g_fog_start, g_fog_end; 221extern int g_fog_rgb[3], g_fog_start, g_fog_end;
222extern int g_skybox_choice; 222const char *config_file_cstr(const char *name);
223int skybox_option_count();
224const char *skybox_option_name(int i);
225const char *const *skybox_options();
226extern bool g_bhop_autostrafe; 223extern bool g_bhop_autostrafe;
227extern bool g_jumpbug_assist; 224extern bool g_jumpbug_assist;
228extern bool g_spread_no_spread; 225extern bool g_spread_no_spread;
@@ -267,6 +264,7 @@ void fog_update();
267void fog_invalidate(); 264void fog_invalidate();
268void skybox_update(); 265void skybox_update();
269void skybox_invalidate(); 266void skybox_invalidate();
267void skybox_reload_image();
270bool resolve_server_netvars(); 268bool resolve_server_netvars();
271int server_entity_health(int idx, int *maxhealth, int *lifestate, void **base_out); 269int server_entity_health(int idx, int *maxhealth, int *lifestate, void **base_out);
272bool server_set_velocity_z(int idx, float vz); 270bool server_set_velocity_z(int idx, float vz);