MrFlibble, on 15 June 2013 - 05:17 PM, said:
I've got a question to the tech savvy guys here about the DOS Build games (...). The SVGA modes for most of the games have a choice between 640x400 and 640x480 (...). What I'm interested in is how the engine handles the 640x480 mode. In the 640x400 mode, the entire output is stretched by the hardware. In the 640x480 mode, on the other hand, I assume that the game engine does the stretching to maintain aspect correction. Does it stretch the entire screen, or does it scale individual components of the image (sprites, textures, HUD) separately?
There's no special logic for drawing the scene with different aspect ratios at all. The engine maintains a variable
yxaspect which finds its way into the various rendering routines.
The key idea to keep in mind is that rendering proceeds in a "reverse" fashion: for each pixel on the screen
[1], you calculate coordinates for the texture you want to map, so it's just a question of a multiplication somewhere in the data flow chain. Ken had an informative post about that on the JonoF forums when they were online, maybe it has survived somehow?
Edit: by the way, you can check out the effects of
yxaspect interactively in Mapster32. When a.m32 is loaded, the keys [8] and [9] will "slide" it smoothly in 3D mode. Keys [7] and [0] change the related
viewingrange variable.
[1]More exactly, for that portion which was determined as necessary to be covered, of course.