mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
`GetPhysicalScreenSize()` → (widthPixels, heightPixels). Modern WoW added this native in 7.0; FrameXML's PixelUtil builds its entire pixel↔UI-unit conversion on it (768/physicalHeight). 1.12 lacks it and has no pre-parsed pixel-dimension global — GetScreenWidth/Height are UI-space (UIParent aspect at [UIParent+0x7c]), and the engine only holds the current mode as the gxResolution CVar string, sscanf'd on demand by SetScreenResolution / display-init. So the native reads the gxResolution CVar directly (FUN_FIND_CVAR, value at +0x20) and parses "WIDTHxHEIGHT" — the same source pfUI's GetPerfectPixel uses. Verified in-game: 2560x1080. 7.0 was the only binary exposing the function, but retail .text is encrypted on disk so static decompilation yields garbage; derived the implementation from the 1.12 binary instead. Also backports FrameXML/PixelUtil.lua (SetPoint/SetSize/SetWidth/ SetHeight/SetStatusBarValue/Get*). Its math deps (Round/Lerp/ ClampedPercentageBetween) already live in MathUtil; it consumes the native GetPhysicalScreenSize (no Lua polyfill).