The live window had been built on one thread. I found it sluggish, and it was split into interface, logic and drawing threads, with a rule to use threads wherever they pay.
Read the entry: The live window on three threads
I asked for frame and loop rates. Every step counted as a change, because Blizzard's code keeps setting the same values, so the whole scene was redrawn every step. Setters that change nothing no longer count.
Then I asked whether logic and drawing were properly separated. They weren't: one thread did everything. I was shocked it had been single-threaded at all. Now a logic thread owns the world and Lua, a drawing thread paints, and the window's thread only shows pictures and passes input on. When I still saw single-digit frame rates, the painting was split across all the cores too: 50 ms a scene became 9.
My rule since: use threads wherever they pay.
Link to this entry
Before text, the display window learned to behave like a real screen, with a set resolution, scroll bars, zoom and full screen. Then positions became the game's own 32-bit numbers.
Read the entry: A display window that mimics real screens, and one pixel rule
When I tried the zoom, it flickered. In a C++ Windows program I'd have hooked the erase and paint messages by then, and I said so. The view was rewritten so that nothing moves on screen, and then it was smooth.
Then I asked how fractional game coordinates were handled: at 4K a game unit is nearly three pixels. Positions are now kept as the game's own 32-bit values, so UIParent's scale of 0.6399999856948853 matches exactly, and one rule turns edges into pixels: a pixel is inside when its centre is. A probe run measured a strip of thin lines, and with pixel snapping on, every line lands where Lizzard puts it.
Not verified: how the game picks its scale at other resolutions, and drawing with pixel snapping off.
Link to this entry