From b1c333c51965578fd1fa2731f2c4d919b1d5d6a6 Mon Sep 17 00:00:00 2001 From: danij Date: Sat, 18 Jun 2011 13:50:06 +0100 Subject: [PATCH] Refactor: Removed last remnants of font renderer state configuration from the WI_DrawPatch* family of functions. --- doomsday/plugins/common/src/gl_drawpatch.c | 4 ++-- doomsday/plugins/common/src/hu_lib.c | 2 +- doomsday/plugins/common/src/hu_stuff.c | 7 +------ doomsday/plugins/jdoom/src/wi_stuff.c | 8 +++----- doomsday/plugins/jdoom64/src/wi_stuff.c | 6 +++--- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/doomsday/plugins/common/src/gl_drawpatch.c b/doomsday/plugins/common/src/gl_drawpatch.c index f3bf10250b..8d38c2eecd 100644 --- a/doomsday/plugins/common/src/gl_drawpatch.c +++ b/doomsday/plugins/common/src/gl_drawpatch.c @@ -31,10 +31,10 @@ void GL_DrawPatch3(patchid_t id, int posX, int posY, int alignFlags, int patchFl float x = (float) posX, y = (float) posY, w, h; patchinfo_t info; - if(DD_GetInteger(DD_NOVIDEO) || DD_GetInteger(DD_DEDICATED)) + if(id == 0 || DD_GetInteger(DD_NOVIDEO) || DD_GetInteger(DD_DEDICATED)) return; - if(id == 0 || !R_GetPatchInfo(id, &info)) + if(!R_GetPatchInfo(id, &info)) return; DGL_SetPatch(id, DGL_CLAMP_TO_EDGE, DGL_CLAMP_TO_EDGE); diff --git a/doomsday/plugins/common/src/hu_lib.c b/doomsday/plugins/common/src/hu_lib.c index 518f8ab885..9d3db305a9 100644 --- a/doomsday/plugins/common/src/hu_lib.c +++ b/doomsday/plugins/common/src/hu_lib.c @@ -1078,9 +1078,9 @@ void MNText_Drawer(mn_object_t* obj, int x, int y) color[CB] += cfg.menuTextFlashColor[CB] * (1 - t); } + DGL_Color4f(1, 1, 1, color[CA]); FR_SetFont(fontId); FR_SetColorAndAlphav(color); - DGL_Color4f(1, 1, 1, color[CA]); if(txt->patch != NULL) { diff --git a/doomsday/plugins/common/src/hu_stuff.c b/doomsday/plugins/common/src/hu_stuff.c index 99f4885c1b..617f97982b 100644 --- a/doomsday/plugins/common/src/hu_stuff.c +++ b/doomsday/plugins/common/src/hu_stuff.c @@ -1211,15 +1211,10 @@ void WI_DrawPatch3(patchid_t patchId, const char* replacement, int x, int y, int if(NULL != replacement && replacement[0]) { // Use the replacement string. - FR_SetLeading(.5f); - FR_SetTracking(0); FR_DrawText3(replacement, x, y, alignFlags, textFlags); return; } - if(patchId == 0) - return; - // Use the original patch. GL_DrawPatch3(patchId, x, y, alignFlags, patchFlags); } @@ -1501,7 +1496,7 @@ void Hu_Drawer(void) DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, 1); FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, 1); + FR_LoadDefaultAttrib(); WI_DrawPatch3(m_pause, Hu_ChoosePatchReplacement(m_pause), 0, 0, ALIGN_TOP, DPF_NO_OFFSET, 0); diff --git a/doomsday/plugins/jdoom/src/wi_stuff.c b/doomsday/plugins/jdoom/src/wi_stuff.c index 05df597987..930738d342 100644 --- a/doomsday/plugins/jdoom/src/wi_stuff.c +++ b/doomsday/plugins/jdoom/src/wi_stuff.c @@ -247,7 +247,6 @@ static void drawBackground(void) FR_SetFont(FID(GF_FONTB)); FR_LoadDefaultAttrib(); - FR_SetColorAndAlpha(1, 1, 1, 1); for(i = 0; i < animCounts[wbs->episode]; ++i) { @@ -291,7 +290,7 @@ static void drawFinishedTitle(void) DGL_Color4f(1, 1, 1, 1); FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, 1); + FR_LoadDefaultAttrib(); // Draw patchId = pMapNames[mapNum]; @@ -340,7 +339,7 @@ static void drawEnteringTitle(void) DGL_Color4f(1, 1, 1, 1); FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, 1); + FR_LoadDefaultAttrib(); // Draw "Entering" WI_DrawPatch3(pEntering, Hu_ChoosePatchReplacement(pEntering), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN); @@ -548,7 +547,7 @@ static void drawLocationMarks(void) DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, 1); FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, 1); + FR_LoadDefaultAttrib(); // Draw a splat on taken cities. { int i, last = (wbs->currentMap == 8) ? wbs->nextMap-1 : wbs->currentMap; @@ -686,7 +685,6 @@ static void drawDeathmatchStats(void) DGL_Color4f(1, 1, 1, 1); FR_SetFont(FID(GF_FONTB)); FR_LoadDefaultAttrib(); - FR_SetColorAndAlpha(1, 1, 1, 1); // Draw stat titles (top line). { patchinfo_t info; diff --git a/doomsday/plugins/jdoom64/src/wi_stuff.c b/doomsday/plugins/jdoom64/src/wi_stuff.c index 711d39b2d0..350482f331 100644 --- a/doomsday/plugins/jdoom64/src/wi_stuff.c +++ b/doomsday/plugins/jdoom64/src/wi_stuff.c @@ -140,7 +140,7 @@ static void drawFinishedTitle(void) DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, 1); FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, 1); + FR_LoadDefaultAttrib(); // Draw patchId = pMapNames[mapNum]; @@ -183,7 +183,7 @@ static void drawEnteringTitle(void) DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, 1); FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(1, 1, 1, 1); + FR_LoadDefaultAttrib(); // Draw "Entering" WI_DrawPatch2(pEntering, Hu_ChoosePatchReplacement(pEntering), x, y, ALIGN_TOP); @@ -373,8 +373,8 @@ static void drawDeathmatchStats(void) DGL_Enable(DGL_TEXTURE_2D); DGL_Color4f(1, 1, 1, 1); FR_SetFont(FID(GF_FONTB)); - FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1); FR_LoadDefaultAttrib(); + FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1); // Draw stat titles (top line). { patchinfo_t info;