Opened 4 years ago
Last modified 6 months ago
#13073 new defect
BACKENDS: SDL: Strange initSizeHint() behavior
Reported by: | eriktorbjorn | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | Graphics |
Version: | Keywords: | ||
Cc: | Game: | Zork Nemesis |
Description (last modified by )
I have the current setup:
I'm using the "SDL Surface" graphics mode with the Normal 4x scaler. This means the launcher opens at a resolution of 1280x800 pixels.
Since I haven't specified scale factor for any other games, they try to open at as close as possible to 1280x800. E.g. The Secret of Monkey Island (320x200) starts at 1280x800, FM-Towns Loom (320x240) at 1280x960, Touché (640x400) at 1280x800, Curse of Monkey Island (640x480) at 1280x960, etc.
Basically, most games will start in either Normal 4x or 2x mode.
But the ZVision engine uses initGraphicsModes(), which calls initSizeHint(), to support different resolutions.
Zork Nemesis has a native resolution of 640x480, and that's what _hintedHeight and _hintedWidth are set to. So even though ScummVM thinks the game is running with a Normal 2x scaler, the window it creates is 640x480 pixels. (This also affects the look of the ScummVM GUI if you press Ctrl+F5.)
This does not feel like the intended behavior, but I don't understand the purpose of _hintedHeight and _hintedWidth so I don't dare messing with it.
If I explicitly set Zork Nemesis to use a 2x scaler, the hinted dimensions are set to 2560x1920 pixels, which is larger than my screen.
Change History (2)
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
This sounds like the same issue we saw with OpenGL graphics mode recently (where games calling
initGraphicsModes()
were started using a 1x scaler, which for Gobliiins for example means 320x200 (or 320x240 with aspect ratio correction enabled).This was fixed in https://github.com/scummvm/scummvm/pull/6254, which has been merged. Can you check that this fixes your issue as well?
I think the issue when you explicitly set a 2x scaler for the game, with a 4x scaler in global settings should have been fixed as well by https://github.com/scummvm/scummvm/commit/a14c5a4a53
Before that commit initSizeHint() was getting the scale factor from the graphics manager, but at that point it had not been updated yet with the one from the game (since that is updated when the game calls
initGraphics()
which is done after callinginitGraphicsModes()
. Thus it was getting the one from the launcher.However you will have to wait to test this as there is a regression from two days ago that means scaler (and some other graphics settings) set in game options are currently ignored.