project-navigation
Personal tools

Author Topic: Missing screen resolutions  (Read 9324 times)

Offline Eegxeta

  • Squad Leader
  • ****
  • Posts: 101
    • View Profile
Missing screen resolutions
« on: September 27, 2013, 07:36:33 pm »
Not sure if this is a bug or not but I used to be able to play this game in 1366x768 and now that resolution isn't there anymore.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Missing screen resolutions
« Reply #1 on: September 28, 2013, 06:22:57 pm »
you can run ufoai with

Code: [Select]
./ufo +set vid_mode -1 +set vid_width 1366 +set vid_height 768

Offline Eegxeta

  • Squad Leader
  • ****
  • Posts: 101
    • View Profile
Re: Missing screen resolutions
« Reply #2 on: September 30, 2013, 06:00:40 pm »
ok how do I run it with that.

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Missing screen resolutions
« Reply #3 on: November 11, 2013, 05:18:03 pm »
Any reason 1920x1080 (1080p) appears to be missing?

Surely that is the most common res these days. I only noticed as the recent build of 2.5-dev for Debian caused the game to load in a full-screen window, but as a tiny 320x240 in the bottom left corner of the 1920x1080 window. I had to manually specify the res as detailed above (I did it in the config file) to get it working correctly (using the full size of the screen).

I took a look at the code on GitHub and the list of resolutions available in the client matches the list in src/client/cl_video.cpp exactly. I presume that there is meant to be some form of auto-detection code which was working in 2.4 but appears to no-longer, possibly an SDL2 issue?

Out of interest, I assume that my Linux desktop (Xfce4 + Compiz) was holding the screen to its native resolution and UFOAI or SDL2 was fooled into thinking the window it created it was full screen.

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: Missing screen resolutions
« Reply #4 on: November 12, 2013, 04:19:39 pm »
Any reason 1920x1080 (1080p) appears to be missing?

Blame SDL ;)
-geever

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Missing screen resolutions
« Reply #5 on: November 14, 2013, 08:43:28 am »
Blame SDL ;)
Heh, indeed. However, would adding it to the hard-coded list make it available if SDL can't do the detection correctly?

On my system, the list of available resolutions is _exactly_ the same as the hard coded list.


I would grab the source and have a play but my internet connection won't allow it this month. :-(

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: Missing screen resolutions
« Reply #6 on: November 14, 2013, 05:33:45 pm »
Heh, indeed. However, would adding it to the hard-coded list make it available if SDL can't do the detection correctly?

On my system, the list of available resolutions is _exactly_ the same as the hard coded list.


I would grab the source and have a play but my internet connection won't allow it this month. :-(

you can start the game with parameters to set whatever screen resolution you want... look it up in the forum

-geever

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Missing screen resolutions
« Reply #7 on: November 15, 2013, 04:50:32 am »
you can start the game with parameters to set whatever screen resolution you want... look it up in the forum
(or at the top of this thread)

I was more meaning to help any newcomers to the game that might run into this problem. I'll have a play around and provide a patch (if it works) when I get decent net again.

Offline Szpak

  • Rookie
  • ***
  • Posts: 17
    • View Profile
Re: Missing screen resolutions
« Reply #8 on: November 23, 2013, 12:07:39 am »
Do you have more than one monitor? If yes try:
Code: [Select]
SDL_VIDEO_FULLSCREEN_HEAD=0 ufo
Btw, maybe this option should be set by default in a run script for Linux?

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Missing screen resolutions
« Reply #9 on: December 04, 2013, 03:25:35 pm »
Do you have more than one monitor?
Yes - 2 monitors. Primary is left.

If yes try:
Code: [Select]
SDL_VIDEO_FULLSCREEN_HEAD=0 ufo
.... and it didn't help. Still have a small area displayed in the bottom left of a full screen window.

I've now got the source down from git so when I have some time (hopefully this week) to get compiling working, I'll try adding 1080p to the list of resolutions and see if that helps.

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Missing screen resolutions
« Reply #10 on: December 12, 2013, 03:46:53 pm »
Ok... so an update:

The most recent Debian 2.5 packages seem to default to 1024x768 in the bottom left of a 1920x1080 screen.
2.6-dev correctly detects 1920x1080 but sets both monitors to shared output. It also gives the correct full screen resolutions (3840x1080 and 1920x1080) in the options. Using SDL_VIDEO_FULLSCREEN_HEAD=0 does limit it to only display on a single monitor.

My concern however was with the almost stable 2.5, especially if it will finally get an official release in Debian (and derivatives) and other distros. It might put people off if they get this odd sized and misaligned screen, especially as there is no way to fix it in the options, you need to edit the config file and specify the height & width manually.

So after adding my own definition (24) for 1080p to cl_video.cpp and compiling the code, it still defaults to 1024x768 in a bigger window (so there is no detection happening there), but the option does appear in the list of available modes in the Options, and when selecting it and restarting the game, it does restart at the correct res.

I think this little change would make life easier for newbies to get into the game if we can't fix the detection issue for 2.5

Code: [Select]
diff --git a/src/client/cl_video.cpp b/src/client/cl_video.cpp
index ed74f43..dab46fb 100644
--- a/src/client/cl_video.cpp
+++ b/src/client/cl_video.cpp
@@ -70,7 +70,8 @@ static const vidmode_t vid_modes[] =
        { 1400, 1050, 20 }, /* samsung x20 */
        { 1440,  900, 21 },
        { 1024,  600, 22 }, /* EEE PC */
-       {  800,  480, 23 }  /* OpenPandora */
+       {  800,  480, 23 }, /* OpenPandora */
+       { 1920, 1080, 24 }  /* 1080p */
 };
 
 /**

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Missing screen resolutions
« Reply #11 on: December 12, 2013, 10:07:50 pm »
Applied to master. Thanks, Grug :)

Hmm. Rereading your post, it sounds like this patch is even more important for 2.5, right ?

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Missing screen resolutions
« Reply #12 on: December 13, 2013, 02:19:32 am »
Hmm. Rereading your post, it sounds like this patch is even more important for 2.5, right ?
Yeah, it seems it isn't necessary for 2.6-dev as the resolution detection works. The problem is with 2.5 and so should be committed to the ufoai_2.5 branch.

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Missing screen resolutions
« Reply #13 on: December 13, 2013, 10:05:36 am »
Done.