mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-23 15:36:59 +00:00
added border between font letters to avoid rendering artifacts
This commit is contained in:
parent
0ceddf03a0
commit
69f16c45b1
@ -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<FONTTEXTURESIZE; y++)
|
||||
for(int x=0; x<FONTTEXTURESIZE; x++)
|
||||
fontdata[y][x] = 0;
|
||||
|
||||
#if CAP_TABFONT
|
||||
resetTabFont();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user