From 136e947c43f1a8c8bc3dfc9979d04717fc9b9d9f Mon Sep 17 00:00:00 2001 From: danij Date: Tue, 27 Sep 2011 20:21:43 +0100 Subject: [PATCH] Fixed: Font renderer drawing of gitter fx Gitter for a fragment of a multipart text block was drawn with along the with each fragment rather than in a separate drawing pass. So any case scaled text (such as that used in DOOM's game menu) would see the glitter for the previous text fragment drawn over by the character patches for the current fragment. Clearly we need to start thinking about optimizing the font renderer... --- doomsday/engine/portable/src/rend_font.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doomsday/engine/portable/src/rend_font.c b/doomsday/engine/portable/src/rend_font.c index 42fbdc94ae..b740277094 100644 --- a/doomsday/engine/portable/src/rend_font.c +++ b/doomsday/engine/portable/src/rend_font.c @@ -1163,20 +1163,19 @@ void FR_DrawText3(const char* text, int x, int y, int alignFlags, short origText // We need to change the current color, so remember for restore. glGetFloatv(GL_CURRENT_COLOR, origColor); - for(pass = ((origTextFlags & DTF_NO_SHADOW) != 0? 1 : 0); pass < 2; ++pass) + for(pass = ((origTextFlags & DTF_NO_SHADOW) != 0? 1 : 0); + pass < ((origTextFlags & DTF_NO_GLITTER) != 0? 2 : 3); ++pass) { // Configure the next pass. cx = (float) x; cy = (float) y; curCase = -1; charCount = 0; - if(pass == 0) + switch(pass) { - textFlags = origTextFlags | (DTF_NO_GLITTER|DTF_NO_CHARACTER); - } - else - { - textFlags = origTextFlags | (DTF_NO_SHADOW); + case 0: textFlags = origTextFlags | (DTF_NO_GLITTER|DTF_NO_CHARACTER); break; + case 1: textFlags = origTextFlags | (DTF_NO_SHADOW |DTF_NO_GLITTER); break; + case 2: textFlags = origTextFlags | (DTF_NO_SHADOW |DTF_NO_CHARACTER); break; } // Apply defaults.