From 69f16c45b18db377f5968e107fb737d37b70ce08 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 7 Mar 2021 21:12:12 +0100 Subject: [PATCH] added border between font letters to avoid rendering artifacts --- basegraph.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/basegraph.cpp b/basegraph.cpp index 757841c5..4f8deefd 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -436,7 +436,7 @@ void sdltogl(SDL_Surface *txt, glfont_t& f, int ch) { int otheight = txt->h; #endif - if(otwidth+curx > FONTTEXTURESIZE) curx = 0, cury += theight, theight = 0; + if(otwidth+curx+1 > FONTTEXTURESIZE) curx = 0, cury += theight+1, theight = 0; theight = max(theight, otheight); @@ -458,7 +458,7 @@ void sdltogl(SDL_Surface *txt, glfont_t& f, int ch) { c.tx1 = (float) (curx+otwidth) / (float) FONTTEXTURESIZE; c.ty0 = (float) cury; c.ty1 = (float) (cury+otheight); - curx += otwidth; + curx += otwidth+1; } EX void init_glfont(int size) { @@ -486,6 +486,10 @@ EX void init_glfont(int size) { white.r = white.g = white.b = 255; #endif + for(int y=0; y