diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-03 23:58:59 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-03 23:58:59 +0100 |
| commit | 9c4455af43da34127864b09ad2a3d3e996c9dce1 (patch) | |
| tree | eb3754763db7c00fe664b900f9a560057bcb9955 /src/hl2h.h | |
| parent | World: add skybox changer (diff) | |
| download | hl2h-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 'src/hl2h.h')
| -rw-r--r-- | src/hl2h.h | 6 |
1 files changed, 2 insertions, 4 deletions
| @@ -219,10 +219,7 @@ extern bool g_tint_world_on, g_tint_sky_on, g_tint_prop_on; | |||
| 219 | extern int g_tint_world_rgb[3], g_tint_sky_rgb[3], g_tint_prop_rgb[3]; | 219 | extern int g_tint_world_rgb[3], g_tint_sky_rgb[3], g_tint_prop_rgb[3]; |
| 220 | extern bool g_fog_skybox, g_fog_disable; | 220 | extern bool g_fog_skybox, g_fog_disable; |
| 221 | extern int g_fog_rgb[3], g_fog_start, g_fog_end; | 221 | extern int g_fog_rgb[3], g_fog_start, g_fog_end; |
| 222 | extern int g_skybox_choice; | 222 | const char *config_file_cstr(const char *name); |
| 223 | int skybox_option_count(); | ||
| 224 | const char *skybox_option_name(int i); | ||
| 225 | const char *const *skybox_options(); | ||
| 226 | extern bool g_bhop_autostrafe; | 223 | extern bool g_bhop_autostrafe; |
| 227 | extern bool g_jumpbug_assist; | 224 | extern bool g_jumpbug_assist; |
| 228 | extern bool g_spread_no_spread; | 225 | extern bool g_spread_no_spread; |
| @@ -267,6 +264,7 @@ void fog_update(); | |||
| 267 | void fog_invalidate(); | 264 | void fog_invalidate(); |
| 268 | void skybox_update(); | 265 | void skybox_update(); |
| 269 | void skybox_invalidate(); | 266 | void skybox_invalidate(); |
| 267 | void skybox_reload_image(); | ||
| 270 | bool resolve_server_netvars(); | 268 | bool resolve_server_netvars(); |
| 271 | int server_entity_health(int idx, int *maxhealth, int *lifestate, void **base_out); | 269 | int server_entity_health(int idx, int *maxhealth, int *lifestate, void **base_out); |
| 272 | bool server_set_velocity_z(int idx, float vz); | 270 | bool server_set_velocity_z(int idx, float vz); |
