Force a resolution in OpenGL mode on Linux? (GIT Version)
Moderator: ScummVM Team
Force a resolution in OpenGL mode on Linux? (GIT Version)
Hi! I'm trying to get ScummVM to play a game fullscreen in a particular resolution (640x400), using the new OpenGL scalers in the Git version (current snapshot as of Feb 13 2011). This is on Ubuntu Maverick, Nvidia proprietary drivers.
It seems to always want to run at 1680x1050, my monitor's native resolution, even when i use xrandr to set my desktop to 640x400
Is there any way of getting past this, or just plain forcing ScummVM to use a particular resolution when it OpenGL mode?
It seems to always want to run at 1680x1050, my monitor's native resolution, even when i use xrandr to set my desktop to 640x400
Is there any way of getting past this, or just plain forcing ScummVM to use a particular resolution when it OpenGL mode?
You've to fiddle with the sources for that, but you CAN force any resolution you want for the SDL-OpenGL filters.
Take a look at the ::setupFullScreenMode method in backends/graphics/openglsdl/openglsdl_graphics.cpp
Leave the SDL_Rect* declaration (first line in the moethod's code), and you can delete the rest of it.
Now just add:
_videoMode.hardwareWidth = <your resolution width>
_videoMode.hardwareHeight = <your resolution height>
return true;
rebuild and there you go!
Take a look at the ::setupFullScreenMode method in backends/graphics/openglsdl/openglsdl_graphics.cpp
Leave the SDL_Rect* declaration (first line in the moethod's code), and you can delete the rest of it.
Now just add:
_videoMode.hardwareWidth = <your resolution width>
_videoMode.hardwareHeight = <your resolution height>
return true;
rebuild and there you go!
I am trying to produce a forced fullscreen resolution of 1920x1440 (4:3) in a MacOS build of ScummVM when using OpenGL graphics. However, I cannot find the same references in the openflsdl-graphics.cpp that Mr_Nutz mentions above.
Can anyone advise me on what edits I will need to make to achieve my desired resolution? I am using Xcode 8.2.1.
The background to this is that I cannot get a particular game (King's Quest V - Macintosh version) to adhere to a 4:3 ratio in fullscreen mode. The forced aspect ratio correction feature appears to be broken for this game only, despite other SCI games of the period working properly.
I know this is an obscure problem for a rarely used port of the game, but any suggestions would be welcome.
Original post:
http://forums.scummvm.org/viewtopic.php?t=14303
Can anyone advise me on what edits I will need to make to achieve my desired resolution? I am using Xcode 8.2.1.
The background to this is that I cannot get a particular game (King's Quest V - Macintosh version) to adhere to a 4:3 ratio in fullscreen mode. The forced aspect ratio correction feature appears to be broken for this game only, despite other SCI games of the period working properly.
I know this is an obscure problem for a rarely used port of the game, but any suggestions would be welcome.
Original post:
http://forums.scummvm.org/viewtopic.php?t=14303
- envisaged0ne
- Posts: 162
- Joined: Mon Nov 01, 2010 9:17 am
- Location: United States
It's probably not broken. Some games intentionally won't allow you to change aspect ratios because it can mess up the graphics. For example, the Windows CD version of KQ6 won't allow you to change resolutions either because it will mess up the high res character graphics So the ability to change resolutions is locked out
I guess that is possible, but I found that when the game is run natively in MacOS 7 at 640x480, the "expand window" setting compresses the graphics into a 4:3 ratio, as I detailed with comparative screen shots in my post linked above.
I suppose that proves the graphics are capable of being displayed in 4:3 mode without breaking anything, but it seems to be an ability specific to the original Mac application only.
This issue aside, I would still be interested if anyone knows about how to successfully edit the openflsdl-graphics.cpp in MacOS X to force a custom full screen resolution?
I suppose that proves the graphics are capable of being displayed in 4:3 mode without breaking anything, but it seems to be an ability specific to the original Mac application only.
This issue aside, I would still be interested if anyone knows about how to successfully edit the openflsdl-graphics.cpp in MacOS X to force a custom full screen resolution?
Without changing the source code and recompiling, you can set the preferred resolution in your config file (on MacOS X the file is "~/Library/Preferences/ScummVM Preferences"):
When ScummVM switches to fullscreen it tries to reuse the last resolution used if possible (i.e. if the OS, graphics card and driver allow it). So if the resolution you want can be used, it will be.
As mentionner above by LordHoto, you can also cycle between the available resolutions in fullscreen mode by using the following keyboard shortcuts: Ctrl+Alt+Plus or Ctrl+Alt+Minus
If you really want to change the source code, the relevant code is in OpenGLSdlGraphicsManager::setupMode(uint width, uint height). You could for example change the lines 467 and 468.
Note: All this is only valid if you use the OpenGL graphics mode in the ScummVM graphics option. For all the other modes (e.g. normal, 2x, HQ2x...) it works in a different way and the source code is in a different place (in surfacesdl-graphics.cpp)
Code: Select all
[scummvm]
last_fullscreen_mode_height=900
last_fullscreen_mode_width=1600
As mentionner above by LordHoto, you can also cycle between the available resolutions in fullscreen mode by using the following keyboard shortcuts: Ctrl+Alt+Plus or Ctrl+Alt+Minus
If you really want to change the source code, the relevant code is in OpenGLSdlGraphicsManager::setupMode(uint width, uint height). You could for example change the lines 467 and 468.
Note: All this is only valid if you use the OpenGL graphics mode in the ScummVM graphics option. For all the other modes (e.g. normal, 2x, HQ2x...) it works in a different way and the source code is in a different place (in surfacesdl-graphics.cpp)
Thanks. The config file settings work well, and I have been able to force various resolutions in fullscreen mode.
With that I can confirm that the issue I am experiencing with King's Quest V has nothing to do with the resolution or graphics settings. It is simply that the 'aspect ratio' command has no effect on the Mac port of this game, and is therefore something that cannot be resolved with any settings.
With that I can confirm that the issue I am experiencing with King's Quest V has nothing to do with the resolution or graphics settings. It is simply that the 'aspect ratio' command has no effect on the Mac port of this game, and is therefore something that cannot be resolved with any settings.