Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Valathil on December 28, 2011, 09:01:26 pm

Title: Fix for font rendering at high resolutions
Post by: Valathil on December 28, 2011, 09:01:26 pm
annoying white lines from font rendering  :mad: couldnt stand them anymore, wrote fix

Code: [Select]
Index: code/graphics/gropengldraw.cpp
===================================================================
--- code/graphics/gropengldraw.cpp (revision 8115)
+++ code/graphics/gropengldraw.cpp (working copy)
@@ -477,10 +477,10 @@
  }
 
  u0 = u_scale * (i2fl(u+xd) / bw);
- v0 = v_scale * (i2fl(v+yd) / bh);
+ v0 = v_scale * (i2fl(v+yd) / bh)*(do_resize?0.99f:1.0f);
 
  u1 = u_scale * (i2fl((u+xd)+wc) / bw);
- v1 = v_scale * (i2fl((v+yd)+hc) / bh);
+ v1 = v_scale * (i2fl((v+yd)+hc) / bh)*(do_resize?0.99f:1.0f);
 
  glTexCoord2f(u0, v1);
  glVertex2i(x1, y2);

feedback plz. then commit. also nominate immediately for .14 inclusion.
Title: Re: Fix for font rendering at high resolutions
Post by: TwentyPercentCooler on December 28, 2011, 10:35:30 pm
Okay, idiot question, but I'm really not familiar with this kind of tweaking - how do I put this in?
Title: Re: Fix for font rendering at high resolutions
Post by: Rodo on December 28, 2011, 11:01:02 pm
YES
Title: Re: Fix for font rendering at high resolutions
Post by: sigtau on December 28, 2011, 11:25:55 pm
VALATHIL

I'd write something like "stop being so magical" but then it might actually happen so I won't

KEEP BEING MAGICAL  :nod:
Title: Re: Fix for font rendering at high resolutions
Post by: Valathil on December 29, 2011, 11:30:48 am
i changed the wrong line : this should be better and work with the original font and the new bluplanet one
Code: [Select]
Index: code/graphics/gropengldraw.cpp
===================================================================
--- code/graphics/gropengldraw.cpp (revision 8119)
+++ code/graphics/gropengldraw.cpp (working copy)
@@ -479,8 +479,8 @@
  u0 = u_scale * (i2fl(u+xd) / bw);
  v0 = v_scale * (i2fl(v+yd) / bh);
 
- u1 = u_scale * (i2fl((u+xd)+wc) / bw);
- v1 = v_scale * (i2fl((v+yd)+hc) / bh);
+ u1 = u_scale * (i2fl((u+xd)+wc) / bw)*(do_resize?0.99f:1.0f);
+ v1 = v_scale * (i2fl((v+yd)+hc) / bh)*(do_resize?0.99f:1.0f);
 
  glTexCoord2f(u0, v1);
  glVertex2i(x1, y2);
Title: Re: Fix for font rendering at high resolutions
Post by: chief1983 on December 29, 2011, 11:46:49 am
Is this more font-agnostic then?
Title: Re: Fix for font rendering at high resolutions
Post by: Valathil on December 29, 2011, 11:57:40 am
coming from me its more font-atheistic. it knows its not a font but just a texture.
Title: Re: Fix for font rendering at high resolutions
Post by: TwentyPercentCooler on December 29, 2011, 02:22:10 pm
There are no words to expres my joy and gratitude that those annoying little lines were gone. Those have been bugging me for years, YEARS I tell you.

Thank you Valathil. I bestow upon you the title of "Most Magical Sensational Powerful Super-Duper Wizard Savant Genius."
Title: Re: Fix for font rendering at high resolutions
Post by: Crybertrance on December 31, 2011, 06:43:47 am
Thank you Valathil. I bestow upon you the title of "Most Magical Sensational Powerful Super-Duper Wizard Savant Genius."

+1 to that!!