From b3fccfa11f934d567b192a5168ea3d773081241d Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 13 Apr 2013 07:52:15 +0000 Subject: [PATCH] finally fix font corruption. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4313 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_font.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/gl/gl_font.c b/engine/gl/gl_font.c index 0118d69c4..576aad7e1 100644 --- a/engine/gl/gl_font.c +++ b/engine/gl/gl_font.c @@ -355,7 +355,7 @@ void Font_Shutdown(void) } //we got too many chars and switched to a new plane - purge the chars in that plane -void Font_FlushPlane(font_t *f) +void Font_FlushPlane(void) { /* assumption: @@ -365,6 +365,13 @@ void Font_FlushPlane(font_t *f) //we've not broken anything yet, flush while we can Font_Flush(); + if (fontplanes.planechanged) + { + R_Upload(fontplanes.texnum[fontplanes.activeplane], NULL, TF_RGBA32, (void*)fontplanes.plane, NULL, PLANEWIDTH, PLANEHEIGHT, IF_2D|IF_NEAREST|IF_NOPICMIP|IF_NOMIPMAP|IF_NOGAMMA); + + fontplanes.planechanged = false; + } + fontplanes.activeplane++; fontplanes.activeplane = fontplanes.activeplane % FONTPLANES; fontplanes.planerowh = 0; @@ -401,7 +408,7 @@ static struct charcache_s *Font_LoadGlyphData(font_t *f, CHARIDXTYPE charidx, in } if (fontplanes.planerowy+(int)bmh >= PLANEHEIGHT) - Font_FlushPlane(f); + Font_FlushPlane(); if (fontplanes.newestchar) fontplanes.newestchar->nextchar = c;