Repository navigation
fix(render): show water on latest-Reforged maps - #37
Merged
Merged
Conversation
The Terrain Cell inspector could say Has water: yes while the viewport drew none. Two causes, both hit by maps from current Reforged WE: - water.ts used 16-bit indices and returned null on maps with more than 65535 corners (around 256x256 and up). Use uint32 indices like terrain and pathing. - CASC ReadFile never tried the per-tileset _tilesets/<letter>.w3mod: mounts that 2.0.3+ stores animated water under. Wire SetTileset from the loaded map and request water frames as .dds. Closes #35.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #35 — maps from current Reforged WE could report Has water: yes in the Terrain Cell inspector while the viewport drew none.
Two independent causes, both hit by latest-patch maps:
water.tsusedUNSIGNED_SHORTand returnednullwhenwidth * height > 65535(anything around 256x256 and up). Terrain and pathing already promote to uint32; water now does the same.war3.w3mod:_hd.w3mod:_tilesets/<letter>.w3mod:(and the SD_tilesets/<letter>.w3mod:sibling).ReadFilenever tried those prefixes, so frames 404'd and the leftover color-only plane was nearly invisible (Water.slk shallow alpha is 10/255). Lookups now follow HiveWE's tileset-mount order, driven by the loaded map's w3e tileset letter. Water frames are requested as.dds(Classic.blpstill works via the sibling swap).Test plan
go test ./internal/casc— prefix order, tileset letter, Water00.dds with tilesets A/X/Lgo test ./internal/...[water] loaded N/45 frame textures)