CleanXFac, CleanYFac, CleanWidth, &c.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

CleanXFac, CleanYFac, CleanWidth, &c.

Postby Marrub » Wed Nov 14, 2018 1:30 pm

Can someone explain to me how these variables work?
Code: Select allExpand view
readonly int  CleanHeight;
readonly int  CleanHeight_1;
readonly int  CleanWidth;
readonly int  CleanWidth_1;
readonly int  CleanXFac;
readonly int  CleanXFac_1;
readonly int  CleanYFac;
readonly int  CleanYFac_1;

I don't really understand what they do at all, and there appears to be no documentation on what they do anywhere.
I'm mostly asking this to help write my documentation, so please be aware your answers will be used for a public domain work!
User avatar
Marrub
Xevv Va Rkvyr
 
 
 
Joined: 26 Feb 2013
Discord: Marrub#5455
Twitch ID: marrubdaskuleion

Re: CleanXFac, CleanYFac, CleanWidth, &c.

Postby Graf Zahl » Wed Nov 14, 2018 1:52 pm

They contain the closest full integer scaling factor from 320x200 to the actual screen size. Their purpose is to allow HUD graphics to be scaled so that all pixels are evenly scaled. I guess with HD screens or even larger most of their reason for existence no longer applies. When this code was written, screen sizes of 800x600 or 1024x768 were commonplace on which uneven scaling with the software renderer looked exceedinly bad.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: CleanXFac, CleanYFac, CleanWidth, &c.

Postby Marrub » Wed Nov 14, 2018 2:23 pm

Graf Zahl wrote:They contain the closest full integer scaling factor from 320x200 to the actual screen size. Their purpose is to allow HUD graphics to be scaled so that all pixels are evenly scaled. I guess with HD screens or even larger most of their reason for existence no longer applies. When this code was written, screen sizes of 800x600 or 1024x768 were commonplace on which uneven scaling with the software renderer looked exceedinly bad.

I see, so then:
CleanXFac would be the closest integer scaling for a `x` parameter from 320x200 to the virtual screen resolution, CleanYFac would be the closest integer scaling for a `y` parameter, and CleanWidth/CleanHeight are the screen width/height scaled to those.
What are the `_1` variables in that case?
Last edited by Marrub on Wed Nov 14, 2018 2:58 pm, edited 1 time in total.
User avatar
Marrub
Xevv Va Rkvyr
 
 
 
Joined: 26 Feb 2013
Discord: Marrub#5455
Twitch ID: marrubdaskuleion

Re: CleanXFac, CleanYFac, CleanWidth, &c.

Postby Graf Zahl » Wed Nov 14, 2018 2:46 pm

// if the width is between 800 and 960 the ratio between the screensize and CleanXFac-1 becomes too large.


That's all the info that is available. For any other screen sizes they are the same.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Scripting

Who is online

Users browsing this forum: Collegia Titanica and 1 guest