mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
Every overlay of a zone regardless of exploration, replacing the hand-measured tables map-reveal addons ship (pfUI pfMapOverlayData). The engine's GetNumMapOverlays/GetMapOverlayInfo only expose DISCOVERED overlays -- the exploration gate is a server-fed ID list at 0x00B6E630 -- so unexplored areas were previously undrawable without per-server data. Reads WorldMapOverlay.dbc directly instead, scoped by the zone's WorldMapArea row (never by folder contents). No argument = the world map's currently viewed zone (same continent/zone resolution GetMapInfo performs, globals 0x0084506C / 0x00845070 / 0x00B6E668); numeric argument = AreaTable areaID, the same identity C_Map.GetBestMapForUnit returns. Tile grids are resolved in the DLL rather than left to consumers, because Octo's shipped data breaks the canonical ceil(w/256) layout three ways (mirroring the InkLab map generator's empirically-derived disambiguation): - sliver columns the DBC rect rounds away (Icepoint's Kaneq'nuun has a real 8px third column; DBC w=512 implies 2 -- naive layout shears the overlay into misplaced strips, the one visibly broken overlay); - foreign tiles appended to an overlay's number sequence (Kaneqnuun ships 12 tiles, the true grid is 3x2 = 6); - same-rect higher-resolution re-exports (Stonetalon's WindshearCrag: 4 real tiles for a 1-tile rect, kept and scaled). The true grid comes from the actual BLP header dimensions (width @ +0x0C, height @ +0x10, BLP1 and BLP2 alike) read through the engine's own VFS reader, since only a row's last tile may be narrower than 256. A sweep of all 707 overlays found 108 art/DBC mismatches; Kaneq'nuun is the only shear-class one, matching the single visible artifact. Resolution is cached per overlay per session. Each overlay returns the DBC fields plus a ready-to-draw `tiles` array (file / width / height / texCoordX / texCoordY / offsetX / offsetY) so consumers need no grid math at all. WorldMapArea.dbc and WorldMapOverlay.dbc schemas verified against fresh extractions and the engine's own Script_GetMapOverlayInfo (0x004A8A00).