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

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: New graphical option: Black bands to keep aspect ratio
« Reply #30 on: September 01, 2013, 11:38:38 pm »
is it really that difficult? I would think that with the way it currently works (like in my example picture #1 above), the game already has to deal with two differently scaled systems - I would think that this would actually pose more problems than changing only the globe resolution while keeping the rest at the same relative coordinates?
The difference is everything is uniformly scaled in the first screenshot. The globe and battlescape map just get "bigger", they're not resized. There is no per-surface scaling.

But don't worry, I'm sure eventually someone will hack that in too and the code will have more options than a spaceship control panel. :P

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands to keep aspect ratio
« Reply #31 on: September 03, 2013, 09:32:42 pm »
My sample of code does letterbox for screen. Is this what you need?

I have tried your code. It seems to work but it is not really...
In most screens (battlescape, geoscape, introduction) the image is put on the left, it is ugly.
Change the size multiple times after the game start, and you are doomed.
Not speaking you consider there are only wide screens (I love my 5/4 secondary screen and play most games with it), and why the hell should fullscreen mode not be letterboxed if the user wish it?

I must admit your idea is a good base: this method handle mouse cursor very well. Increasing the size of the screen before enlarging it is probably the only way to draw the cursor in the black bands. But your ten lines of code are not enough at all.

Edit:
For GeoScape, I have tried using centerAllSurfaces(), but the globe does not like this. It's better using an offset for the surface, globe, and each button.
With Battlescape, centerAllSurfaces() works better, but the scrolling with mouse cursor does not function, it seems to uses coordinates relatives to the window rather than relative to the shown screen.
« Last Edit: September 03, 2013, 11:41:47 pm by Juju Dredd »

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: New graphical option: Black bands to keep aspect ratio
« Reply #32 on: September 05, 2013, 06:40:34 pm »
Yes, BattleScape and GeoScape specially designed for maintain wide screens.

For GeoScape, I have tried using centerAllSurfaces(), but the globe does not like this. It's better using an offset for the surface, globe, and each button.
With Battlescape, centerAllSurfaces() works better, but the scrolling with mouse cursor does not function, it seems to uses coordinates relatives to the window rather than relative to the shown screen.

If you have interest about solution this problem, this branch changes absolute coordinates to relative:
https://github.com/redv/OpenXcom/compare/fix_mouse_coord

But, in my opinion, maintain wide screen is much more important.
I like, how looks the game on wide screen)

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands to keep aspect ratio
« Reply #33 on: September 05, 2013, 07:18:45 pm »
Yes, BattleScape and GeoScape specially designed for maintain wide screens.

If you have interest about solution this problem, this branch changes absolute coordinates to relative:
https://github.com/redv/OpenXcom/compare/fix_mouse_coord

But, in my opinion, maintain wide screen is much more important.
I like, how looks the game on wide screen)

Is this branch going to be merged in the main one?
If it is, this means I should wait this before implementing letter boxing.
« Last Edit: September 05, 2013, 07:20:45 pm by Juju Dredd »

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: New graphical option: Black bands to keep aspect ratio
« Reply #34 on: September 05, 2013, 07:35:09 pm »
Is this branch going to be merged in the main one?

No. Of course, no. This is only for experiments.

Offline Tarvis

  • Colonel
  • ****
  • Posts: 111
    • View Profile
Re: New graphical option: Black bands to keep aspect ratio
« Reply #35 on: September 07, 2013, 05:42:03 pm »
I've done some work on OP's topic, but only for the OpenGL renderer. I stopped working on it because I couldn't figure out how to do it for the SDL mode and I couldn't build OpenXcom without it running extremely slowly (this has nothing to do with my patch, however, probably just my build environment isn't quite right)

It is completely finished though, for OpenGL. The only thing that hasn't been done is adding the option to the ingame menu.

You can shamelessly steal it, if you'd like: here's the original post of it

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands to keep aspect ratio
« Reply #36 on: September 07, 2013, 05:56:31 pm »
Does the way you made it permit the cursor to enter the black bands without turning invisible?

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands to keep aspect ratio
« Reply #37 on: September 08, 2013, 01:20:51 pm »
Yes, BattleScape and GeoScape specially designed for maintain wide screens.

If you have interest about solution this problem, this branch changes absolute coordinates to relative:
https://github.com/redv/OpenXcom/compare/fix_mouse_coord

But, in my opinion, maintain wide screen is much more important.
I like, how looks the game on wide screen)

I have tried setting the base X resoltion to 356 to see it. Geoscape is just ugly: the background and buttons are moved to the right, letting appear a wide black band on the left, and if you zoom once the globe exceed the black band. I don't understand the way it has been done. If you really wanted to do it this way, you should have changed the background picture to make it wider.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: New graphical option: Black bands to keep aspect ratio
« Reply #38 on: September 09, 2013, 11:51:51 pm »
slightly off-topic, but perhaps related (or at least the active guys here might know where to look for the problem):

I'm currently enjoying playing at  "baseXResolution: 640  baseYResolution: 400" with "displayHeight: 800  displayWidth: 1280" windowed mode, giving me large battlescape and geoscape globe while having a large-enough menu. all non-scaled screens are centered, which looks good, except for the battlescape "HIDDEN MOVEMENT" screen, which is... off. screenshot is attached.


screen001: "Press button to continue" looks fine, everything's centered

screen002: "HIDDEN MOVEMENT" has the pop-up window extending down to the bottom of the window, filled with grey space where the image ends, and the text centered vertically within that window, resulting in the text sitting too low on the screen - probably a secondary effect to the pop-up using the wrong Y coordinates.

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands to keep aspect ratio
« Reply #39 on: September 10, 2013, 12:02:38 am »
Ouch.
It hurts a bit...

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: New graphical option: Black bands to keep aspect ratio
« Reply #40 on: September 10, 2013, 12:04:54 am »
@juju dredd: what hurts? the huge screenshots? I'm sorry, but scaling them down wouldn't really make sense in this context, I'd think.

Offline Juju Dredd

  • Captain
  • ***
  • Posts: 68
    • View Profile
    • My gamer website (french)
Re: New graphical option: Black bands to keep aspect ratio
« Reply #41 on: September 10, 2013, 01:03:15 am »
@juju dredd: what hurts? the huge screenshots? I'm sorry, but scaling them down wouldn't really make sense in this context, I'd think.

No, the grey band, it looks rather ugly...

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: New graphical option: Black bands to keep aspect ratio
« Reply #42 on: September 10, 2013, 11:46:11 am »
screen002: "HIDDEN MOVEMENT" has the pop-up window extending down to the bottom of the window, filled with grey space where the image ends, and the text centered vertically within that window, resulting in the text sitting too low on the screen - probably a secondary effect to the pop-up using the wrong Y coordinates.

Added pull request https://github.com/SupSuper/OpenXcom/pull/627

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site

Offline Mr. Quiet

  • Commander
  • *****
  • Posts: 523
  • Likes: Quiet things. Dislikes: Loud things.
    • View Profile
    • =Open_X_Com= Mods
Re: New graphical option: Black bands to keep aspect ratio
« Reply #44 on: September 11, 2013, 10:21:25 am »
Great job ;)