gammata / TA-Unofficial-Patch-Install

the TA Unofficial patch that incorporates FunkyFr3sh's cncddraw implementation to make TA run smoothly on modern systems (Windows 10 and later)
32 stars 3 forks source link

Fix screen resolution bigger than map resolution bug #15

Open KevinHake opened 1 year ago

KevinHake commented 1 year ago

For small maps and modern (e.g. 4k) screens, TA doesn't handle things well - the original code assumed the map always contains more vertical and horizontal length than the screen.

Background/existing behavior: All maps have a zone around the edge that was never intended to be drawn, or have user commands in them, but it helps avoid units getting stuck on edges while turning around etc (people use this to their advantage with planes). With a large screen and small map, that edge region may render, and if the game doesn't crash, scrolling can be sporadic, rapidly drawing the map first on the left, then the right, with screen poop in the remaining extra area (I've seen this on The Desert Triad and a 4k monitor).

Required behavior:

In the case a map is smaller than the display (minus size of menus), it's probably ideal to draw the map immediately adjacent to the menus/info bar, just from a UI perspective (put info/buttons as close to the action as possible). That might already be the default behavior. Probably fine to fill the extra space with black pixels (that's what the game draws under the menu when resolution is large already). Would be cool to fill extra space with a texture matching the rest of the UI, and for the case where there is extra vertical space, move the bottom info bar up to the bottom edge of the map (with empty texture underneath).

KevinHake commented 1 year ago

You'd want to test behavior for the following: both x/y size of the map < screen x/y: the normal case (regression test; we don't want to break that) both x/y of the map > screen x/y only x > screen x only y > screen y