mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-23 23:47:00 +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;
|
int otheight = txt->h;
|
||||||
#endif
|
#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);
|
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.tx1 = (float) (curx+otwidth) / (float) FONTTEXTURESIZE;
|
||||||
c.ty0 = (float) cury;
|
c.ty0 = (float) cury;
|
||||||
c.ty1 = (float) (cury+otheight);
|
c.ty1 = (float) (cury+otheight);
|
||||||
curx += otwidth;
|
curx += otwidth+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EX void init_glfont(int size) {
|
EX void init_glfont(int size) {
|
||||||
@ -486,6 +486,10 @@ EX void init_glfont(int size) {
|
|||||||
white.r = white.g = white.b = 255;
|
white.r = white.g = white.b = 255;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
for(int y=0; y<FONTTEXTURESIZE; y++)
|
||||||
|
for(int x=0; x<FONTTEXTURESIZE; x++)
|
||||||
|
fontdata[y][x] = 0;
|
||||||
|
|
||||||
#if CAP_TABFONT
|
#if CAP_TABFONT
|
||||||
resetTabFont();
|
resetTabFont();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user