I'm interested in how ScummVM actually performs the aspect ratio stretch so each pixel is 1.2 tall. Is this done pre-upscale and then scaled up to full screen, or is it always performed on the up-scale? Otherwise, Guybrush would look like "forced aspect correction":
So how exactly is it done?
Aspect ratio stretch pre-upscale or post-upscale?
Moderator: ScummVM Team
Re: Aspect ratio stretch pre-upscale or post-upscale?
Thanks, but I can't read that. Can you tell me which order the stretching occurs?digitall wrote: ↑Tue Dec 11, 2018 9:48 pm Best to read the code...
https://github.com/scummvm/scummvm/blob ... aspect.cpp
https://github.com/scummvm/scummvm/blob ... aphics.cpp
- ezekiel000
- Posts: 443
- Joined: Mon Aug 25, 2008 5:17 pm
- Location: Surrey, England
Re: Aspect ratio stretch pre-upscale or post-upscale?
The comments in those two source files seem to explain what the process is, it's in plain English.
Comments are the lines that start with // or * (in between /** & */
Comments are the lines that start with // or * (in between /** & */
Re: Aspect ratio stretch pre-upscale or post-upscale?
Those two files will only give a partial answer (which I already gave here). This actually depends on the graphics mode and stretch mode selected in the options.
If you select the OpenGL graphics mode, then all the scaling and stretching, including the aspect ratio correction, is done in one pass (to go from original game size to final display size).
If you select any other graphics mode though, then it is done in three steps:
If you select the OpenGL graphics mode, then all the scaling and stretching, including the aspect ratio correction, is done in one pass (to go from original game size to final display size).
If you select any other graphics mode though, then it is done in three steps:
- First apply the graphics mode scaling (2x or 3x, unless the graphics mode is Normal).
- Then apply the aspect ratio correction stretch.
- And finally apply the stretch mode to fill the screen (if the stretch mode is Center there is no scaling or stretching in this step as it will only add black bars to fill the space, but otherwise there might be one).
Re: Aspect ratio stretch pre-upscale or post-upscale?
Thanks, that's very helpful! So, how do the mouse interactions such as clicks or hover highlights work after it's been scaled? If this is a post-processing stretch, how are the cursor interaction positions accounted for after the scaling?criezy wrote: ↑Wed Dec 12, 2018 8:19 am Those two files will only give a partial answer (which I already gave here). This actually depends on the graphics mode and stretch mode selected in the options.
If you select the OpenGL graphics mode, then all the scaling and stretching, including the aspect ratio correction, is done in one pass (to go from original game size to final display size).
If you select any other graphics mode though, then it is done in three steps:
- First apply the graphics mode scaling (2x or 3x, unless the graphics mode is Normal).
- Then apply the aspect ratio correction stretch.
- And finally apply the stretch mode to fill the screen (if the stretch mode is Center there is no scaling or stretching in this step as it will only add black bars to fill the space, but otherwise there might be one).
Re: Aspect ratio stretch pre-upscale or post-upscale?
Basically the game engine knows nothing about the stretch. All it knows about is the original game resolution, for example 320x200 pixels. So it will draw at that resolution and pass this to the backend. The backend is responsible for the interaction with the computer, phone or other device on which you are running ScummVM. It will handle the scaling, aspect ratio correction and stretching, and display the result on the screen. It also gets cursor position in the screen coordinates from the system and convert that back to the original game coordinates before passing the information to the game engine.