Force a resolution in OpenGL mode on Linux? (GIT Version)

Ask for help with ScummVM problems

Moderator: ScummVM Team

Post Reply
aubade
Posts: 3
Joined: Mon Feb 14, 2011 6:48 am

Force a resolution in OpenGL mode on Linux? (GIT Version)

Post by aubade »

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?
Mr_Nutz
Posts: 32
Joined: Sat Jun 23, 2007 7:14 pm

Post by Mr_Nutz »

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! :)
aubade
Posts: 3
Joined: Mon Feb 14, 2011 6:48 am

Post by aubade »

While i hope some time in the future, there's a more elegant way of accomplishing this, that worked perfectly for my current needs :D Thanks!
User avatar
LordHoto
ScummVM Developer
Posts: 1029
Joined: Sun Oct 30, 2005 3:58 pm
Location: Germany

Post by LordHoto »

aubade wrote:While i hope some time in the future, there's a more elegant way of accomplishing this, that worked perfectly for my current needs :D Thanks!
You can press Ctrl+Alt+Plus or Ctrl+Alt+Minus to change the display resolution when using an OpenGL mode.
aubade
Posts: 3
Joined: Mon Feb 14, 2011 6:48 am

Post by aubade »

....then it will be there in the future, and is there in the present. Sweet! Sorry to bother all of you. :)
User avatar
LordHoto
ScummVM Developer
Posts: 1029
Joined: Sun Oct 30, 2005 3:58 pm
Location: Germany

Post by LordHoto »

I checked again and it seems they real hotkeys for that are:

Ctrl+Shift+Enter and Ctrl+Shift+Backspace
efen3001
Posts: 9
Joined: Sun Jul 09, 2006 2:44 am

Post by efen3001 »

Worked like a charm, thanks!!!
hexaae
Posts: 51
Joined: Fri Jun 25, 2010 5:04 pm

Post by hexaae »

Great, exactly what I wanted! 1080p was very blurred, better 640x480.
'CTRL ALT -' and 'CTRL ALT +' work fine on Windows 10!

P.S.:
ScummVM in OpenGL (Options > Mode: OpenGL (no filter)) can also be streamed through Steam Broadcast :)
User avatar
almeath
Posts: 178
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Post by almeath »

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
User avatar
envisaged0ne
Posts: 159
Joined: Mon Nov 01, 2010 9:17 am
Location: United States

Post by envisaged0ne »

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
User avatar
almeath
Posts: 178
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Post by almeath »

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?
User avatar
criezy
ScummVM Developer
Posts: 949
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Post by criezy »

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"):

Code: Select all

&#91;scummvm&#93;
last_fullscreen_mode_height=900
last_fullscreen_mode_width=1600
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)
User avatar
almeath
Posts: 178
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Post by almeath »

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.
Post Reply