Merge branch 'SRB2-CHAT-FLOAT-FIX' into 'SRB2-CHAT'

Adjust vid.width floating point comparson for CHAT

See merge request SinnamonLat/SRB2!3
This commit is contained in:
Latapostrophe 2018-12-21 11:51:24 -05:00
commit d6c99a0133

View file

@ -845,14 +845,14 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
fw *= dupx; fw *= dupx;
fh *= dupy; fh *= dupy;
if (vid.width != BASEVIDWIDTH * vid.dupx) if (fabsf((float)vid.width - ((float)BASEVIDWIDTH * dupx)) > 1.0E-36f)
{ {
if (options & V_SNAPTORIGHT) if (options & V_SNAPTORIGHT)
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)); fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
else if (!(options & V_SNAPTOLEFT)) else if (!(options & V_SNAPTOLEFT))
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2; fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
} }
if (vid.height != BASEVIDHEIGHT * dupy) if (fabsf((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) > 1.0E-36f)
{ {
// same thing here // same thing here
if (options & V_SNAPTOBOTTOM) if (options & V_SNAPTOBOTTOM)