From 9c4455af43da34127864b09ad2a3d3e996c9dce1 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 3 Nov 2026 23:58:59 +0100 Subject: 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 /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. --- src/hl2h.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/hl2h.h') 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; extern int g_tint_world_rgb[3], g_tint_sky_rgb[3], g_tint_prop_rgb[3]; extern bool g_fog_skybox, g_fog_disable; extern int g_fog_rgb[3], g_fog_start, g_fog_end; -extern int g_skybox_choice; -int skybox_option_count(); -const char *skybox_option_name(int i); -const char *const *skybox_options(); +const char *config_file_cstr(const char *name); extern bool g_bhop_autostrafe; extern bool g_jumpbug_assist; extern bool g_spread_no_spread; @@ -267,6 +264,7 @@ void fog_update(); void fog_invalidate(); void skybox_update(); void skybox_invalidate(); +void skybox_reload_image(); 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