Skip to content

Commit

Permalink
Refactor: Removed last remnants of font renderer state configuration …
Browse files Browse the repository at this point in the history
…from the

WI_DrawPatch* family of functions.
  • Loading branch information
danij-deng committed Jun 18, 2011
1 parent 5404c12 commit b1c333c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
4 changes: 2 additions & 2 deletions doomsday/plugins/common/src/gl_drawpatch.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/hu_lib.c
Expand Up @@ -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)
{
Expand Down
7 changes: 1 addition & 6 deletions doomsday/plugins/common/src/hu_stuff.c
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);

Expand Down
8 changes: 3 additions & 5 deletions doomsday/plugins/jdoom/src/wi_stuff.c
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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 <MapName>
patchId = pMapNames[mapNum];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions doomsday/plugins/jdoom64/src/wi_stuff.c
Expand Up @@ -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 <MapName>
patchId = pMapNames[mapNum];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b1c333c

Please sign in to comment.