Shifting in 16:10 (and 16:9) resolutions with SetHudSize

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Shifting in 16:10 (and 16:9) resolutions with SetHudSize

Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize

by skadoomer » Sat Feb 21, 2009 5:17 pm

Makes sense, it just makes things a little more complicated.

Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize

by Graf Zahl » Sat Feb 21, 2009 3:01 pm

SetHUDSize sets the virtual resolution for the center 4:3 area. It does not interpret the given values in any way, in particular what ratio they'd be numerically.

Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize

by skadoomer » Sat Feb 21, 2009 12:31 pm

Graf Zahl wrote:This is fully intentional to ensure that everything drawn with SetHUDSize is properly scaled and uses the proper aspect ratio. Otherwise you'd get distortion on at least some resolutions.
I understand that mapping a square resolution into a wide screen would cause this effect, but it seems odd that it would choose to do this using lesser resolutions of the same aspect ratio group. Your telling me its intentional that setting Sethudsize in 800 x 500 (a 16:10 resolution) would cause this offset if you set it to 720 x 480 (a lower resolution in 16:10)? Even in 5:4, using a lower resolution screen size works correctly. Does this have anything to do with they fact that they are more square? In almost every 4:3, setting the resolution to 320 x 200 or 640 x 480 (provided the resolution is 800 x 600 or something higher in the 4:3 resolution bracket), it draws to the top left corner of the screen.
Nash wrote:Use Blzut3's aspect ratio checker function
Already being used, its how I figured out what resolution to scale down to. I'm trying to make conscious effort to be full resolution aware or my larger aspects of hudmessage usage to have objects be placed in similar places.

Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize

by Nash » Sat Feb 21, 2009 10:51 am

Thanks for the code. It works beautifully!

Also, a little topic... have you stopped developement of your DoomCrap tools? Why? :(

Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize

by bagheadspidey » Sat Feb 21, 2009 8:53 am

Nash wrote:Use Blzut3's aspect ratio checker function
This. You can find his "getaspectratio" function on the wiki. Try this bit of code on top of that for an easy way to get the "real" leftmost and rightmost pixel position:

Code: Select all

function int GetHudRight(int w)
{
  int ar = getaspectratio();
  
  if (ar == ASPECT_16_10)
  {
    return w + (FixedDiv(w<<16,10.0)>>16);
  }
  if (ar == ASPECT_16_9)
  {
    return w + (FixedDiv(w<<16,5.9)>>16);
  }
  return w;
}

function int GetHudLeft(int w)
{
  return w - GetHudRight(w);
}
param w should be the same width passed to SetHudSize. At 4:3, GetHudRight(320) will return 320 and GetHudLeft(320) will return 0. At wider resolutions, GetHudRight(320) will return > 320 and GetHudLeft(320) will return < 0. I'm using this code to keep a radar lined up with the right edge of the screen in this demo mod. Let me know if you guys find any bugs with this.

Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize

by Nash » Sat Feb 21, 2009 4:41 am

I also ran into such a problem. I can only think of one ugly hack...

Use Blzut3's aspect ratio checker function (it's probably in one of his posts here, or maybe even on the wiki) and in your drawing functions, make special-case checks for widescreen modes that position the X coordinates of the graphic differently...

It's tedious but it's probably the only way to do it now. :( Even then, I'm not sure if this is 100% widescreen proof... IIRC, some unconventional widescreen modes behave really, REALLY differently in regards to HUDMessage positioning...

Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize

by Graf Zahl » Sat Feb 21, 2009 3:37 am

This is fully intentional to ensure that everything drawn with SetHUDSize is properly scaled and uses the proper aspect ratio. Otherwise you'd get distortion on at least some resolutions.

Shifting in 16:10 (and 16:9) resolutions with SetHudSize

by skadoomer » Mon Feb 16, 2009 12:21 pm

I've noticed that unlike 4:3 resolutions where you can scale down your resolution with SetHudSize, doing the same in 16:10 (and 16:9) dosn't start drawing from the left most edge of the screen. Instead, it sets the 0 of the x axis to an area not on the edge of the screen.

Included is an example wad. I set my resolution to 1440 x 900 in 16:10 and tried to scale it down to 720 x 480, but it indents the text so its not flush with the left edge of the screen. If this is intentional behavior, is there anything to set so the 0,0 to the top left corner like square resolutions (like 4:3 and 5:4)?

Top