Author Topic: New graphical option: Black bands to keep aspect ratio  (Read 36756 times)

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
New graphical option: Black bands to keep aspect ratio
« on: August 29, 2013, 11:34:14 pm »
Hi!
This being in the todo list of SupSuper and being usefull to me, I wanted to try and do it by myself.
I think I have found an easy way to do this, but the way I try to do it has a side effect. In fact I change the final stretch of the picture, which prevent the mouse cursor to appear in the black bands.
As the cursor is draw before this final stretch, it is impossible to prevent this.

I really don't know if this is a good thing. On the one side, this could be rather strange, particularly if the black bands are very large. On the other side, it makes sense not to draw the mouse cursor in those black bands.

Should I keep it this way?
Should I modify how the mouse cursor coordinates are calculated? (This way the cursor won't appear in the black bands but it will simply be invisible within them rather than "jumping" when the cursor go out the window).
Should I modify the picture before being draw by enlarging it and apply an offset to every draw in it? (painful I believe).
Should I modify how the mouse cursor coordinates are calculated, but only if fullscreen is not set?
« Last Edit: September 01, 2013, 11:37:36 am by Juju Dredd »

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands rather than derforming image
« Reply #1 on: August 31, 2013, 11:08:21 pm »
Since nobody gave me his wise advice, I am trying to change the way cursor position is calculated.
The development for OpenGL mode is close to be done.

I need some help.
Is there any way to test without OpenGL other than recompiling with __NO_OPENGL being set?
I have found no option regarding to that, is it normal?

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: New graphical option: Black bands rather than derforming image
« Reply #2 on: September 01, 2013, 02:10:11 am »
I didnt realy understand waht you were working on, images work great for me :)

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands rather than derforming image
« Reply #3 on: September 01, 2013, 02:36:11 am »
I didnt realy understand waht you were working on, images work great for me :)

Is is very simple: play with a resolution other other than 16/10, such as 16/9 or even worse 4/3 or 5/4.
The image will be stretched in a manner she covers all the resolution you asked. It will be deformed. Some people like, some people hates. Of course people who hates are right, it is highly ugly to deform a picture giving the impression Xcom agents are some fantasy elves or dwarves...

So, I'm currently developing an option to ensure black bands will be added, either at the top and the bottom or at the left and the right, to keep images aspect ratio. Do you understand the utility of this feature?

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: New graphical option: Black bands rather than derforming image
« Reply #4 on: September 01, 2013, 07:42:16 am »
now, i understand, sounds like a nice feature.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: New graphical option: Black bands rather than derforming image
« Reply #5 on: September 01, 2013, 09:06:16 am »
do you think it would be possible - at least for the battlescape - that the "extra space" is used for the battlescape itself, while the GUI stays as it is? it would be nice to have a widescreen battlescape (not stretched, but extended, of course), as long as the GUI stays in the bottom center and isn't deformed.

is it possible at all to "detach" the GUI bar from the actual battlefield in this way?

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: New graphical option: Black bands rather than derforming image
« Reply #6 on: September 01, 2013, 09:31:24 am »
do you think it would be possible - at least for the battlescape - that the "extra space" is used for the battlescape itself, while the GUI stays as it is? it would be nice to have a widescreen battlescape (not stretched, but extended, of course), as long as the GUI stays in the bottom center and isn't deformed.

is it possible at all to "detach" the GUI bar from the actual battlefield in this way?
That would be nice as i have been thinking of having a second GUI at the TOP for square controls plus some other features

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands rather than derforming image
« Reply #7 on: September 01, 2013, 11:37:15 am »
now, i understand, sounds like a nice feature.

I think the title of this topic is inadequate, I am fixing it.

do you think it would be possible - at least for the battlescape - that the "extra space" is used for the battlescape itself, while the GUI stays as it is? it would be nice to have a widescreen battlescape (not stretched, but extended, of course), as long as the GUI stays in the bottom center and isn't deformed.

is it possible at all to "detach" the GUI bar from the actual battlefield in this way?

I don't know, the space we have is not very big. You probably think of playing on a 16/9 screen, right? Extended 320x200 to this format means 356x200, you gain only 18 pixels on each side. Of course, you could add it at a better resolution but if you do that the cursor has to be drawn differently in this UI, seems pretty odd.

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: New graphical option: Black bands to keep aspect ratio
« Reply #8 on: September 01, 2013, 02:38:36 pm »
If you play on 16:9 screen (for example 1600x900), you can set the option baseXResolution: 356 (because 200/900*1600 = 355,555). As result - screen without distortions.

options.cfg:
Code: [Select]
  baseXResolution: 356
  baseYResolution: 200
  displayHeight: 900
  displayWidth: 1600
  fullscreen: true

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands to keep aspect ratio
« Reply #9 on: September 01, 2013, 02:52:14 pm »
If you play on 16:9 screen (for example 1600x900), you can set the option baseXResolution: 356 (because 200/900*1600 = 355,555). As result - screen without distortions.

options.cfg:
Code: [Select]
  baseXResolution: 356
  baseYResolution: 200
  displayHeight: 900
  displayWidth: 1600
  fullscreen: true

That seems a good alternative, even though the game just don't look the same. Not forgetting what have been written in ufopedia:

Quote from: ufopedia
WARNING: Changing this setting will cause serious UI and performance problems, as the game is not designed for flexible resolutions.
« Last Edit: September 01, 2013, 03:13:11 pm by Juju Dredd »

Offline Yankes

  • Commander
  • *****
  • Posts: 3240
    • View Profile
Re: New graphical option: Black bands to keep aspect ratio
« Reply #10 on: September 01, 2013, 03:25:03 pm »
If you use correct upscaling (1x 2x 4x) you will not see difference. base resolution is irrelevant (of course if you not set 1600x900 as base resolution :D ).

[ps]
this quote on wiki is mostly obsolete because most problems with UI was fixed.

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands to keep aspect ratio
« Reply #11 on: September 01, 2013, 03:38:10 pm »
this quote on wiki is mostly obsolete because most problems with UI was fixed.

So it should be corrected.
Anyway, as a purist, I prefer to keep the game the same, changing base resolution is evil! Do not be evil!

@code contributors

I have finished developing the feature, but there was a commit yesterday. Should I incorporate new sources before submitting mines? Please answer, I'm not regular at working with Git.
I'm pretty sure the way I handle zoom without OpenGL will have to be reworked because what I have done does not seem efficient to me. I get the correct result but I introduce a supplementary buffer...

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: New graphical option: Black bands to keep aspect ratio
« Reply #12 on: September 01, 2013, 04:49:03 pm »
Should I incorporate new sources before submitting mines?

As you want. In many cases this is not need. This is really need only if you have conflicts when merging.

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands to keep aspect ratio
« Reply #13 on: September 01, 2013, 05:15:15 pm »
What is the simplest way too check if this will be the case?
I have updated a branch of my own fork on GitHub with my development, but this branch is not up-to-date with the master branch of SupSuper. In the diff done with GitHub, how can I see if a merge will be necessary?

Edit: I see a rassuring "These branches can be automatically merged" message when trying to do my push request, so I think I am going to submit it.

Edit: Pull request sent.
« Last Edit: September 01, 2013, 05:42:19 pm by Juju Dredd »

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: New graphical option: Black bands to keep aspect ratio
« Reply #14 on: September 01, 2013, 05:41:49 pm »
Simplest way is try to merge SupSuper/master into your branch.
If merging was without conflicts, then could be not merge :)

PS
I don't know, how previous phrase sounds for native speaker)))