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)?
Shifting in 16:10 (and 16:9) resolutions with SetHudSize
Moderator: GZDoom Developers
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.
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize
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.
Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize
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...
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...
- bagheadspidey
- Posts: 1490
- Joined: Sat Oct 20, 2007 10:31 pm
- Contact:
Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize
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:Nash wrote:Use Blzut3's aspect ratio checker function
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);
}
Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize
Thanks for the code. It works beautifully!
Also, a little topic... have you stopped developement of your DoomCrap tools? Why? :(
Also, a little topic... have you stopped developement of your DoomCrap tools? Why? :(
Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize
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.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.
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.Nash wrote:Use Blzut3's aspect ratio checker function
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Shifting in 16:10 (and 16:9) resolutions with SetHudSize
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
Makes sense, it just makes things a little more complicated.