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/overlay.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 '')
0 files changed, 0 insertions, 0 deletions
