summaryrefslogtreecommitdiffstats
path: root/src/combat.cpp
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/combat.cpp
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 'src/combat.cpp')
0 files changed, 0 insertions, 0 deletions