Author Topic: Unstretched Interface discussion  (Read 13026 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Unstretched Interface discussion
I ran into this while working on the HLPCoin builds.  Without the stretching, the FSO interface shrank to a regular 1024x768 block in the corner of my screen.  This should not be the default behavior.  Remember, FSO's Prime Directive is to remain compatible with retail, and this falls under that umbrella, from a conceptual and usability perspective if not a performance perspective.

If a new user plays GOG, and then later decides to play FSO, he will be presented with a shrunken offset interface.  He might conclude that there's something wrong with FSO and decide not to investigate further.  Without coming to HLP and browsing some obscure threads, he wouldn't know about the special command-line option to bring things back to the way he wants them.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Unstretched Interface discussion
Without the stretching, the FSO interface shrank to a regular 1024x768 block in the corner of my screen.

Just for the record, you seem to be referring to something no one's described so far, so a screenshot ought to be helpful.

 
Re: Unstretched Interface discussion
If a new user plays GOG, and then later decides to play FSO, he will be presented with a shrunken offset interface.  He might conclude that there's something wrong with FSO and decide not to investigate further.  Without coming to HLP and browsing some obscure threads, he wouldn't know about the special command-line option to bring things back to the way he wants them.

Wait a minute  :wtf:

If I launch the the retail GOG version of FS2, it has black borders on the left and on the right, because FS2 retail only supports 4:3 aspect ratio resolutions (and my GPU control panel keeps the original aspect ratio, but scales to the up-down edge of the monitor). Now that FSO has non-stretched menus, you get those EXACT same borders with 16:9 resolutions, which is good, because it resembles 100% the original behaviour.

Maybe you have some odd GPU control settings? Because what you say doesn't make any sense.

 
Re: Unstretched Interface discussion
What if I make animorphic mainhalls and the player wants to use that but also wants non-stretched rest of the interface?

Animorphic mainhalls seem to be a very specific and rare case. I haven't seen even one so far, even though I have played dozens of mods, many of them using custom mainhalls. To me, the case of animorphic mainhalls seems as a lame excuse, because they are practically non-existent.

Besides, what if a support for genuine 1920x1080 mainhalls is added in the future? Would you still insist making animorphic mainhalls?

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Unstretched Interface discussion
What if I make animorphic mainhalls and the player wants to use that but also wants non-stretched rest of the interface?

Animorphic mainhalls seem to be a very specific and rare case. I haven't seen even one so far, even though I have played dozens of mods, many of them using custom mainhalls. To me, the case of animorphic mainhalls seems as a lame excuse, because they are practically non-existent.

Besides, what if a support for genuine 1920x1080 mainhalls is added in the future? Would you still insist making animorphic mainhalls?

What are you trying to argue? Of course I wouldn't want to make animorphic mainhalls if we had true resolution support. The whole idea of animorphic mainhalls only came up after I started recreating the retail mainhalls, which in the life of FSO is still quite recent. My point is that mainhalls have always been a special interface case and should be treated as such. It doesn't make much sense to argue that rare examples should be excluded given this whole patch set came out of trying to support the rare triple monitor setups. As long as we are making changes to support rare and specific cases, we probably shouldn't implement a broad-strokes, all or nothing approach.

Essentially, I think we can do better than to add a choose-your-limitation toggle to an already highly limited part of the code.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 
Re: Unstretched Interface discussion
Well, my point in its simplicity is that when weighing the pros and cons of this non-stretch patch (which IMHO should have been implemented 7-8 years ago when widescreen monitors started to get more common), the pros outweigh the cons. The only "con" being that it messes up plans for animorphic mainhalls which didn't even exist in the first place.

What matters here is what the player sees. Stretching is ugly. It will always be ugly. When I play old games, I first try to find widescreen mods, and if they don't exist, I'll put a custom resolution of 1440x1080 and I'm totally fine with black bars. In FSO however there are two phases in the game. A 16:9 resolution gets a better fov in-game, but stretches menus, while 4:3 resolutions get smaller fov in-game but have correctly scaled menus. In-game is still more important than menus, so in the end players want to use their whole widescreen resolutions. Which means - sooner or later - something has to be done with the menus.

Anything that avoids a forced stretching is a MUST. Since FSO is a constantly evolving project, I DON'T expect that black bars are the final solution (since I sincerely hope for genuine high resolution / widescreen mainhall support implementation in the future), but as a temporal solution, it is million times better than stretching.

 

Offline The Dagger

  • 29
  • I like zod ships
Re: Unstretched Interface discussion
If you are working on anamorphic mainhalls maybe you should request the -stretched_menu flag to be supported as a mod.ini flag (like -ship_choice_3d), so it could be forced by default for your specific mod.
However I do find the non-stretched interface much better than the old one for retail.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Unstretched Interface discussion
Well, my point in its simplicity is that when weighing the pros and cons of this non-stretch patch (which IMHO should have been implemented 7-8 years ago when widescreen monitors started to get more common), the pros outweigh the cons. The only "con" being that it messes up plans for animorphic mainhalls which didn't even exist in the first place.

What matters here is what the player sees. Stretching is ugly. It will always be ugly. When I play old games, I first try to find widescreen mods, and if they don't exist, I'll put a custom resolution of 1440x1080 and I'm totally fine with black bars. In FSO however there are two phases in the game. A 16:9 resolution gets a better fov in-game, but stretches menus, while 4:3 resolutions get smaller fov in-game but have correctly scaled menus. In-game is still more important than menus, so in the end players want to use their whole widescreen resolutions. Which means - sooner or later - something has to be done with the menus.

Anything that avoids a forced stretching is a MUST. Since FSO is a constantly evolving project, I DON'T expect that black bars are the final solution (since I sincerely hope for genuine high resolution / widescreen mainhall support implementation in the future), but as a temporal solution, it is million times better than stretching.

I still don't understand what you are arguing for. It looks to me that you are actually arguing for no change to the behavior as-is and that people just deal with it until a better solution comes along. (Your reasoning seems to fall under your suggestion that all players everywhere agree with your distaste for stretching, but that is a whole separate point entirely.)

I could be misunderstanding, but your argument isn't adding anything to the discussion at hand. This is about tweaking the behavior, not removing it. This is about expanding it to be inclusive and not forcing it to exclusive. Surely you aren't saying you see harm in that.

If you are working on anamorphic mainhalls maybe you should request the -stretched_menu flag to be supported as a mod.ini flag (like -ship_choice_3d), so it could be forced by default for your specific mod.
However I do find the non-stretched interface much better than the old one for retail.

Given the complete lack of interest in expanding mainhalls at all except from a drive-by patch (seen here), I find myself thinking it would be a waste of time to make anymore mainhall requests, no matter what badass trickery I could come up with.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 
Re: Unstretched Interface discussion
Your reasoning seems to fall under your suggestion that all players everywhere agree with your distaste for stretching, but that is a whole separate point entirely.)

I'm pretty confident that majority of people prefer viewing audiovisual content as it was meant to be, whether we are talking about movies or video games. Stretching is a way of distorting original content. But yeah, as you said, this is a whole point entirely. Not going to continue arguing with this one.

Quote
I could be misunderstanding, but your argument isn't adding anything to the discussion at hand. This is about tweaking the behavior, not removing it. This is about expanding it to be inclusive and not forcing it to exclusive. Surely you aren't saying you see harm in that.

Well then, I must have misunderstood something. When I read this segment that you previously wrote...

Quote
I do realize that people with supermadawesometriplemonitor setup will still want non stretched mainhalls. And I don't know what to do about it except to reiterate that this whole idea is a limitation to a limitation. It does nothing to actually open FSO's super-limited interface code to the real future needs.

... I thought that you were opposing the patch in its entirety, because "it limits" the code. Players really don't care how limited or crude looking the code is; they only care about the end result.

But if you are not opposing this patch, but only debating about the default launch parameters, then there is really nothing to argue about :P

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Unstretched Interface discussion
I'm saying the patch as-is is a knee jerk band-aid to a legitimate problem and that it needs further in-depth thought to implement properly.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 
Re: Unstretched Interface discussion
Well, in that case, good luck for those attempting to enhance this patch  :)

 

Offline Yarn

  • 210
Re: Unstretched Interface discussion
Since very few things have hardcoded positions in main halls, it's not hard to add support for main halls of any resolution and aspect ratio; in fact, the patch below does just that. Just keep in mind that the size of text changes with the resolution, so think twice before you use any 4K main halls! (Maybe I should add support for definable fonts in main halls...)

(And don't forget to change the value of +Tooltip Y appropriately!)

This patch also does the same thing with the preload screen.

Code: [Select]
Index: code/freespace2/freespace.cpp
===================================================================
--- code/freespace2/freespace.cpp (revision 10550)
+++ code/freespace2/freespace.cpp (working copy)
@@ -8692,16 +8692,20 @@
  int width, height;
  bm_get_info(Game_title_bitmap, &width, &height);
 
+ gr_set_screen_scale(width, height);
+
  // draw it in the center of the screen
- gr_bitmap((gr_screen.max_w_unscaled - width)/2, (gr_screen.max_h_unscaled - height)/2, GR_RESIZE_MENU);
- }
+ gr_bitmap(0, 0, GR_RESIZE_MENU);
 
- if (Game_title_logo != -1)
- {
- gr_set_bitmap(Game_title_logo);
+ if (Game_title_logo != -1)
+ {
+ gr_set_bitmap(Game_title_logo);
 
- gr_bitmap(0, 0, GR_RESIZE_MENU);
+ gr_bitmap(0, 0, GR_RESIZE_MENU);
 
+ }
+
+ gr_reset_screen_scale();
  }
  }
 
Index: code/graphics/2d.cpp
===================================================================
--- code/graphics/2d.cpp (revision 10550)
+++ code/graphics/2d.cpp (working copy)
@@ -88,35 +88,39 @@
 static int GL_cursor_nframes = 0;
 
 // Pre-computed screen resize vars
-static float Gr_full_resize_X = 1.0f, Gr_full_resize_Y = 1.0f;
-static float Gr_resize_X = 1.0f, Gr_resize_Y = 1.0f;
-static float Gr_menu_offset_X = 0.0f, Gr_menu_offset_Y = 0.0f;
+static screen_scale Gr_resize;
+screen_scale Gr_save_resize;
 
-float Gr_save_full_resize_X = 1.0f, Gr_save_full_resize_Y = 1.0f;
-float Gr_save_resize_X = 1.0f, Gr_save_resize_Y = 1.0f;
-float Gr_save_menu_offset_X = 0.0f, Gr_save_menu_offset_Y = 0.0f;
-
 bool Save_custom_screen_size;
 
+void gr_set_screen_scale(screen_scale ss)
+{
+ Gr_resize = ss;
+
+ Save_custom_screen_size = gr_screen.custom_size;
+
+ gr_screen.custom_size = true;
+}
+
 void gr_set_screen_scale(int w, int h)
 {
- Gr_full_resize_X = (float)gr_screen.max_w / (float)w;
- Gr_full_resize_Y = (float)gr_screen.max_h / (float)h;
+ Gr_resize.full_resize_X = (float)gr_screen.max_w / (float)w;
+ Gr_resize.full_resize_Y = (float)gr_screen.max_h / (float)h;
 
  if (!Cmdline_stretch_menu) {
  float aspect_quotient = ((float)gr_screen.max_w / (float)gr_screen.max_h) / ((float)w / (float)h);
 
- Gr_resize_X = Gr_full_resize_X / ((aspect_quotient > 1.0f) ? aspect_quotient : 1.0f);
- Gr_resize_Y = Gr_full_resize_Y * ((aspect_quotient < 1.0f) ? aspect_quotient : 1.0f);
+ Gr_resize.resize_X = Gr_resize.full_resize_X / ((aspect_quotient > 1.0f) ? aspect_quotient : 1.0f);
+ Gr_resize.resize_Y = Gr_resize.full_resize_Y * ((aspect_quotient < 1.0f) ? aspect_quotient : 1.0f);
 
- Gr_menu_offset_X = (aspect_quotient > 1.0f) ? ((gr_screen.max_w - gr_screen.max_w / aspect_quotient) / 2.0f) : 0.0f;
- Gr_menu_offset_Y = (aspect_quotient < 1.0f) ? ((gr_screen.max_h - gr_screen.max_h * aspect_quotient) / 2.0f) : 0.0f;
+ Gr_resize.menu_offset_X = (aspect_quotient > 1.0f) ? ((gr_screen.max_w - gr_screen.max_w / aspect_quotient) / 2.0f) : 0.0f;
+ Gr_resize.menu_offset_Y = (aspect_quotient < 1.0f) ? ((gr_screen.max_h - gr_screen.max_h * aspect_quotient) / 2.0f) : 0.0f;
  } else {
- Gr_resize_X = Gr_full_resize_X;
- Gr_resize_Y = Gr_full_resize_Y;
+ Gr_resize.resize_X = Gr_resize.full_resize_X;
+ Gr_resize.resize_Y = Gr_resize.full_resize_Y;
 
- Gr_menu_offset_X = 0.0f;
- Gr_menu_offset_Y = 0.0f;
+ Gr_resize.menu_offset_X = 0.0f;
+ Gr_resize.menu_offset_Y = 0.0f;
  }
 
  Save_custom_screen_size = gr_screen.custom_size;
@@ -126,11 +130,11 @@
 
 void gr_set_screen_scale(int w, int h, int max_w, int max_h)
 {
- Gr_resize_X = Gr_full_resize_X = (float)max_w / (float)w;
- Gr_resize_Y = Gr_full_resize_Y = (float)max_h / (float)h;
+ Gr_resize.resize_X = Gr_resize.full_resize_X = (float)max_w / (float)w;
+ Gr_resize.resize_Y = Gr_resize.full_resize_Y = (float)max_h / (float)h;
 
- Gr_menu_offset_X = 0.0f;
- Gr_menu_offset_Y = 0.0f;
+ Gr_resize.menu_offset_X = 0.0f;
+ Gr_resize.menu_offset_Y = 0.0f;
 
  Save_custom_screen_size = gr_screen.custom_size;
 
@@ -137,16 +141,21 @@
  gr_screen.custom_size = true;
 }
 
+screen_scale gr_get_screen_scale()
+{
+ return Gr_resize;
+}
+
 void gr_reset_screen_scale()
 {
- Gr_full_resize_X = Gr_save_full_resize_X;
- Gr_full_resize_Y = Gr_save_full_resize_Y;
+ Gr_resize.full_resize_X = Gr_save_resize.full_resize_X;
+ Gr_resize.full_resize_Y = Gr_save_resize.full_resize_Y;
 
- Gr_resize_X = Gr_save_resize_X;
- Gr_resize_Y = Gr_save_resize_Y;
+ Gr_resize.resize_X = Gr_save_resize.resize_X;
+ Gr_resize.resize_Y = Gr_save_resize.resize_Y;
 
- Gr_menu_offset_X = Gr_save_menu_offset_X;
- Gr_menu_offset_Y = Gr_save_menu_offset_Y;
+ Gr_resize.menu_offset_X = Gr_save_resize.menu_offset_X;
+ Gr_resize.menu_offset_Y = Gr_save_resize.menu_offset_Y;
 
  gr_screen.custom_size = Save_custom_screen_size;
 }
@@ -171,22 +180,22 @@
  float xy_tmp = 0.0f;
 
  if ( x ) {
- xy_tmp = (*x) * ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_X : Gr_resize_X) + ((resize_mode == GR_RESIZE_MENU) ? Gr_menu_offset_X : 0.0f);
+ xy_tmp = (*x) * ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_X : Gr_resize.resize_X) + ((resize_mode == GR_RESIZE_MENU) ? Gr_resize.menu_offset_X : 0.0f);
  (*x) = fl2i(xy_tmp);
  }
 
  if ( y ) {
- xy_tmp = (*y) * ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_Y : Gr_resize_Y) + ((resize_mode == GR_RESIZE_MENU) ? Gr_menu_offset_Y : 0.0f);
+ xy_tmp = (*y) * ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_Y : Gr_resize.resize_Y) + ((resize_mode == GR_RESIZE_MENU) ? Gr_resize.menu_offset_Y : 0.0f);
  (*y) = fl2i(xy_tmp);
  }
 
  if ( w ) {
- xy_tmp = (*w) * ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_X : Gr_resize_X);
+ xy_tmp = (*w) * ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_X : Gr_resize.resize_X);
  (*w) = fl2i(xy_tmp);
  }
 
  if ( h ) {
- xy_tmp = (*h) * ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_Y : Gr_resize_Y);
+ xy_tmp = (*h) * ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_Y : Gr_resize.resize_Y);
  (*h) = fl2i(xy_tmp);
  }
 
@@ -211,22 +220,22 @@
  float xy_tmp = 0.0f;
 
  if ( x ) {
- xy_tmp = ((*x) - ((resize_mode == GR_RESIZE_MENU) ? Gr_menu_offset_X : 0.0f)) / ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_X : Gr_resize_X);
+ xy_tmp = ((*x) - ((resize_mode == GR_RESIZE_MENU) ? Gr_resize.menu_offset_X : 0.0f)) / ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_X : Gr_resize.resize_X);
  (*x) = fl2i(xy_tmp);
  }
 
  if ( y ) {
- xy_tmp = ((*y) - ((resize_mode == GR_RESIZE_MENU) ? Gr_menu_offset_Y : 0.0f)) / ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_Y : Gr_resize_Y);
+ xy_tmp = ((*y) - ((resize_mode == GR_RESIZE_MENU) ? Gr_resize.menu_offset_Y : 0.0f)) / ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_Y : Gr_resize.resize_Y);
  (*y) = fl2i(xy_tmp);
  }
 
  if ( w ) {
- xy_tmp = (*w) / ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_X : Gr_resize_X);
+ xy_tmp = (*w) / ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_X : Gr_resize.resize_X);
  (*w) = fl2i(xy_tmp);
  }
 
  if ( h ) {
- xy_tmp = (*h) / ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_Y : Gr_resize_Y);
+ xy_tmp = (*h) / ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_Y : Gr_resize.resize_Y);
  (*h) = fl2i(xy_tmp);
  }
 
@@ -253,22 +262,22 @@
  float xy_tmp = 0.0f;
 
  if ( x ) {
- xy_tmp = (*x) * ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_X : Gr_resize_X) + ((resize_mode == GR_RESIZE_MENU) ? Gr_menu_offset_X : 0.0f);
+ xy_tmp = (*x) * ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_X : Gr_resize.resize_X) + ((resize_mode == GR_RESIZE_MENU) ? Gr_resize.menu_offset_X : 0.0f);
  (*x) = xy_tmp;
  }
 
  if ( y ) {
- xy_tmp = (*y) * ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_Y : Gr_resize_Y) + ((resize_mode == GR_RESIZE_MENU) ? Gr_menu_offset_Y : 0.0f);
+ xy_tmp = (*y) * ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_Y : Gr_resize.resize_Y) + ((resize_mode == GR_RESIZE_MENU) ? Gr_resize.menu_offset_Y : 0.0f);
  (*y) = xy_tmp;
  }
 
  if ( w ) {
- xy_tmp = (*w) * ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_X : Gr_resize_X);
+ xy_tmp = (*w) * ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_X : Gr_resize.resize_X);
  (*w) = xy_tmp;
  }
 
  if ( h ) {
- xy_tmp = (*h) * ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_Y : Gr_resize_Y);
+ xy_tmp = (*h) * ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_Y : Gr_resize.resize_Y);
  (*h) = xy_tmp;
  }
 
@@ -293,22 +302,22 @@
  float xy_tmp = 0.0f;
 
  if ( x ) {
- xy_tmp = ((*x) - ((resize_mode == GR_RESIZE_MENU) ? Gr_menu_offset_X : 0.0f)) / ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_X : Gr_resize_X);
+ xy_tmp = ((*x) - ((resize_mode == GR_RESIZE_MENU) ? Gr_resize.menu_offset_X : 0.0f)) / ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_X : Gr_resize.resize_X);
  (*x) = xy_tmp;
  }
 
  if ( y ) {
- xy_tmp = ((*y) - ((resize_mode == GR_RESIZE_MENU) ? Gr_menu_offset_Y : 0.0f)) / ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_Y : Gr_resize_Y);
+ xy_tmp = ((*y) - ((resize_mode == GR_RESIZE_MENU) ? Gr_resize.menu_offset_Y : 0.0f)) / ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_Y : Gr_resize.resize_Y);
  (*y) = xy_tmp;
  }
 
  if ( w ) {
- xy_tmp = (*w) / ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_X : Gr_resize_X);
+ xy_tmp = (*w) / ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_X : Gr_resize.resize_X);
  (*w) = xy_tmp;
  }
 
  if ( h ) {
- xy_tmp = (*h) / ((resize_mode == GR_RESIZE_FULL) ? Gr_full_resize_Y : Gr_resize_Y);
+ xy_tmp = (*h) / ((resize_mode == GR_RESIZE_FULL) ? Gr_resize.full_resize_Y : Gr_resize.resize_Y);
  (*h) = xy_tmp;
  }
 
@@ -476,23 +485,23 @@
  mode = GR_OPENGL;
  }
 
- Gr_save_full_resize_X = Gr_full_resize_X = (float)width / ((res == GR_1024) ? 1024.0f : 640.0f);
- Gr_save_full_resize_Y = Gr_full_resize_Y = (float)height / ((res == GR_1024) ?  768.0f : 480.0f);
+ Gr_save_resize.full_resize_X = Gr_resize.full_resize_X = (float)width / ((res == GR_1024) ? 1024.0f : 640.0f);
+ Gr_save_resize.full_resize_Y = Gr_resize.full_resize_Y = (float)height / ((res == GR_1024) ?  768.0f : 480.0f);
 
  if (gr_screen.custom_size && !Cmdline_stretch_menu) {
  float aspect_quotient = ((float)width / (float)height) / (4.0f / 3.0f);
 
- Gr_save_resize_X = Gr_resize_X = Gr_full_resize_X / ((aspect_quotient > 1.0f) ? aspect_quotient : 1.0f);
- Gr_save_resize_Y = Gr_resize_Y = Gr_full_resize_Y * ((aspect_quotient < 1.0f) ? aspect_quotient : 1.0f);
+ Gr_save_resize.resize_X = Gr_resize.resize_X = Gr_resize.full_resize_X / ((aspect_quotient > 1.0f) ? aspect_quotient : 1.0f);
+ Gr_save_resize.resize_Y = Gr_resize.resize_Y = Gr_resize.full_resize_Y * ((aspect_quotient < 1.0f) ? aspect_quotient : 1.0f);
 
- Gr_save_menu_offset_X = Gr_menu_offset_X = (aspect_quotient > 1.0f) ? ((width - width / aspect_quotient) / 2.0f) : 0.0f;
- Gr_save_menu_offset_Y = Gr_menu_offset_Y = (aspect_quotient < 1.0f) ? ((height - height * aspect_quotient) / 2.0f) : 0.0f;
+ Gr_save_resize.menu_offset_X = Gr_resize.menu_offset_X = (aspect_quotient > 1.0f) ? ((width - width / aspect_quotient) / 2.0f) : 0.0f;
+ Gr_save_resize.menu_offset_Y = Gr_resize.menu_offset_Y = (aspect_quotient < 1.0f) ? ((height - height * aspect_quotient) / 2.0f) : 0.0f;
  } else {
- Gr_save_resize_X = Gr_resize_X = Gr_full_resize_X;
- Gr_save_resize_Y = Gr_resize_Y = Gr_full_resize_Y;
+ Gr_save_resize.resize_X = Gr_resize.resize_X = Gr_resize.full_resize_X;
+ Gr_save_resize.resize_Y = Gr_resize.resize_Y = Gr_resize.full_resize_Y;
 
- Gr_save_menu_offset_X = Gr_menu_offset_X = 0.0f;
- Gr_save_menu_offset_Y = Gr_menu_offset_Y = 0.0f;
+ Gr_save_resize.menu_offset_X = Gr_resize.menu_offset_X = 0.0f;
+ Gr_save_resize.menu_offset_Y = Gr_resize.menu_offset_Y = 0.0f;
  }
 
 
Index: code/graphics/2d.h
===================================================================
--- code/graphics/2d.h (revision 10550)
+++ code/graphics/2d.h (working copy)
@@ -59,6 +59,12 @@
  ubyte lookup[256];
 } shader;
 
+typedef struct screen_scale {
+ float full_resize_X = 1.0f, full_resize_Y = 1.0f;
+ float resize_X = 1.0f, resize_Y = 1.0f;
+ float menu_offset_X = 0.0f, menu_offset_Y = 0.0f;
+} screen_scale;
+
 #define AC_TYPE_NONE 0 // Not an alphacolor
 #define AC_TYPE_HUD 1 // Doesn't change hue depending on background.  Used for HUD stuff.
 #define AC_TYPE_BLEND 2 // Changes hue depending on background.  Used for stars, etc.
@@ -575,8 +581,10 @@
 #define GR_RESIZE_MENU 2
 #define GR_RESIZE_MENU_NO_OFFSET 3
 
+void gr_set_screen_scale(screen_scale ss);
 void gr_set_screen_scale(int x, int y);
 void gr_set_screen_scale(int x, int y, int max_x, int max_y);
+screen_scale gr_get_screen_scale();
 void gr_reset_screen_scale();
 bool gr_unsize_screen_pos(int *x, int *y, int *w = NULL, int *h = NULL, int resize_mode = GR_RESIZE_FULL);
 bool gr_resize_screen_pos(int *x, int *y, int *w = NULL, int *h = NULL, int resize_mode = GR_RESIZE_FULL);
Index: code/menuui/mainhallmenu.cpp
===================================================================
--- code/menuui/mainhallmenu.cpp (revision 10550)
+++ code/menuui/mainhallmenu.cpp (working copy)
@@ -74,6 +74,10 @@
 // background bitmap handle
 int Main_hall_bitmap;
 
+// background bitmap dimensions
+int Main_hall_bitmap_w;
+int Main_hall_bitmap_h;
+
 // background bitmap mask handle
 int Main_hall_mask;
 
@@ -350,6 +354,7 @@
 // blit some small color indicators to show whether ships.tbl and weapons.tbl are valid
 // green == valid, red == invalid.
 // ships.tbl will be on the left, weapons.tbl on the right
+/*
 int Mh_ship_table_status[GR_NUM_RESOLUTIONS][2] = {
  { 1, 479 },
  { 1, 767 }
@@ -358,15 +363,16 @@
  { 3, 479 },
  { 3, 767 }
 };
+*/
 void main_hall_blit_table_status()
 {
  // blit ship table status
  gr_set_color_fast(Game_ships_tbl_valid ? &Color_bright_green : &Color_bright_red);
- gr_line(Mh_ship_table_status[gr_screen.res][0], Mh_ship_table_status[gr_screen.res][1], Mh_ship_table_status[gr_screen.res][0], Mh_ship_table_status[gr_screen.res][1], GR_RESIZE_MENU);
+ gr_line(1, Main_hall_bitmap_h - 1, 1, Main_hall_bitmap_h - 1, GR_RESIZE_MENU);
 
  // blit weapon table status
  gr_set_color_fast(Game_weapons_tbl_valid ? &Color_bright_green : &Color_bright_red);
- gr_line(Mh_weapon_table_status[gr_screen.res][0], Mh_weapon_table_status[gr_screen.res][1], Mh_weapon_table_status[gr_screen.res][0], Mh_ship_table_status[gr_screen.res][1], GR_RESIZE_MENU);
+ gr_line(3, Main_hall_bitmap_h - 1, 3, Main_hall_bitmap_h - 1, GR_RESIZE_MENU);
 }
 
 /**
@@ -468,10 +474,15 @@
  }
  }
 
+ Main_hall_bitmap_w = -1;
+ Main_hall_bitmap_h = -1;
+
  // load the background bitmap
  Main_hall_bitmap = bm_load(Main_hall->bitmap);
  if (Main_hall_bitmap < 0) {
  nprintf(("General","WARNING! Couldn't load main hall background bitmap %s\n", Main_hall->bitmap.c_str()));
+ } else {
+ bm_get_info(Main_hall_bitmap, &Main_hall_bitmap_w, &Main_hall_bitmap_h);
  }
  bg_type = bm_get_type(Main_hall_bitmap);
 
@@ -620,6 +631,8 @@
 {
  int code, key, snazzy_action;
 
+ gr_set_screen_scale(Main_hall_bitmap_w, Main_hall_bitmap_h);
+
  // need to ensure ambient is playing, since it may be stopped by a playing movie
  main_hall_start_ambient();
 
@@ -834,6 +847,7 @@
 #endif
 
  gr_flip();
+ gr_reset_screen_scale();
 
  // see if we have a missing campaign and force the player to select a new campaign if so
  extern bool Campaign_room_no_campaigns;
@@ -1458,7 +1472,7 @@
  gr_set_color_fast(&Color_bright);
 
  gr_get_string_size(&w,&h,Main_hall_notify_text);
- gr_printf_menu((gr_screen.max_w_unscaled - w)/2, gr_screen.max_h_unscaled - 40, Main_hall_notify_text);
+ gr_printf_menu((Main_hall_bitmap_w - w)/2, Main_hall_bitmap_h - 40, Main_hall_notify_text);
  }
  }
 }
@@ -1526,7 +1540,7 @@
 
  // print the string near the lower left corner
  gr_set_color_fast(&Color_bright_white);
- gr_string(5, gr_screen.max_h_unscaled - 24, version_string, GR_RESIZE_MENU);
+ gr_string(5, Main_hall_bitmap_h - 24, version_string, GR_RESIZE_MENU);
 }
 
 /**
@@ -1563,7 +1577,7 @@
  gr_shade(0, shader_y, gr_screen.clip_width_unscaled, (gr_screen.clip_height_unscaled - shader_y), GR_RESIZE_MENU);
 
  gr_set_color_fast(&Color_bright_white);
- gr_string((gr_screen.max_w_unscaled - w)/2, Main_hall->region_yval, Main_hall->region_descript.at(text_index), GR_RESIZE_MENU);
+ gr_string((Main_hall_bitmap_w - w)/2, Main_hall->region_yval, Main_hall->region_descript.at(text_index), GR_RESIZE_MENU);
  }
 }
 
@@ -1603,7 +1617,7 @@
  gr_set_color_fast(&Color_bright_white);
  gr_set_shader(&Main_hall_tooltip_shader);
  gr_shade(0, 0, gr_screen.max_w_unscaled, (2*Main_hall_tooltip_padding[gr_screen.res]) + h - y_anim_offset, GR_RESIZE_MENU);
- gr_string((gr_screen.max_w_unscaled - w)/2, Main_hall_tooltip_padding[gr_screen.res] /*- y_anim_offset*/, str, GR_RESIZE_MENU);
+ gr_string((Main_hall_bitmap_w - w)/2, Main_hall_tooltip_padding[gr_screen.res] /*- y_anim_offset*/, str, GR_RESIZE_MENU);
 }
 
 /**
Index: code/popup/popup.cpp
===================================================================
--- code/popup/popup.cpp (revision 10550)
+++ code/popup/popup.cpp (working copy)
@@ -820,6 +820,9 @@
 
  screen_id = gr_save_screen();
 
+ screen_scale old_scale = gr_get_screen_scale();
+ gr_reset_screen_scale();
+
  while(!done) {
  int k;
 
@@ -871,6 +874,8 @@
  gr_flip();
  }
 
+ gr_set_screen_scale(old_scale);
+
  popup_close(pi,screen_id);
  return choice;
 }

"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Unstretched Interface discussion
Can you provide a little more documentation on what that does/how it works?
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Yarn

  • 210
Re: Unstretched Interface discussion
Can you provide a little more documentation on what that does/how it works?
Are you referring to code comments? If so, then I'll add more when I update the patch. (The fish tank cheat doesn't work correctly with custom-resolution main halls, so I need to fix that. I might end up changing the implementation a bit in the process.)
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Unstretched Interface discussion
I mean documentation for us non-coder types.

As the resident main hall expert, how would I make use of this? Just change the tooltip y to 1920 and then adjust my animation coords?

Would FSO choose between 1024 and 1920 like it would between 1024 and 640? When would it choose a wide screen version over a full screen? How would I maximize compatibility for the many screen resolutions out there?
« Last Edit: April 02, 2014, 06:57:07 pm by mjn.mixael »
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Yarn

  • 210
Re: Unstretched Interface discussion
With the patch above, you define your custom-resolution main hall in the 640x480 or 1024x768 section (usually the latter). The resolutions of the background bitmap and the mask should match each other, but they can otherwise be any resolution. Animation coordinates are based on the actual resolution of the background bitmap. +Tooltip Y should be about 13 pixels less than the main hall's height, assuming you're using the default font.

I understand that this isn't ideal, so I'll look into ways to define more resolutions, among other things. It will probably take some time, though.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Unstretched Interface discussion
If I launch the the retail GOG version of FS2, it has black borders on the left and on the right, because FS2 retail only supports 4:3 aspect ratio resolutions (and my GPU control panel keeps the original aspect ratio, but scales to the up-down edge of the monitor). Now that FSO has non-stretched menus, you get those EXACT same borders with 16:9 resolutions, which is good, because it resembles 100% the original behaviour.

Really? :wtf:  Because I agree, that is good -- resembling the original behavior is 100% what we want.  Perhaps I'm experiencing a build-specific problem.

Quote
Maybe you have some odd GPU control settings? Because what you say doesn't make any sense.

See the attached image.  This is on a 1920x1200 monitor, playing at 1024x768.  It's only with m!m's browser build (which is based on Antipodes); regular trunk builds display properly.

To be clear, I have no objection to pillarboxing or letterboxing around the main hall in order to get it to display properly in nonstandard resolutions.

[attachment deleted by an evil time traveler]

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Unstretched Interface discussion
Antipodes (r10488) doesn't have Yarns no-stretch-menus patch (trunk r10544) so it's probably a different issue.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline m!m

  • 211
Re: Unstretched Interface discussion
See the attached image.  This is on a 1920x1200 monitor, playing at 1024x768.  It's only with m!m's browser build (which is based on Antipodes); regular trunk builds display properly.

To be clear, I have no objection to pillarboxing or letterboxing around the main hall in order to get it to display properly in nonstandard resolutions.
:wtf: Is this also a problem with the antipodes builds or the standard chromium builds? Maybe I screwed something up when I hacked that webpage display in there.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Unstretched Interface discussion
I'd need an antipodes build to check.  I don't have an antipodes project currently set up on my machine and I need to dedicate my coding time to filling some of Mjn's overdue requests.

EDIT: The same shrunken bug occurs in your standard chromium build.
« Last Edit: April 04, 2014, 12:26:33 am by Goober5000 »