Skip to content

Commit

Permalink
Console Renderer|Fixed: Font renderer attribute stack was not pushed
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Feb 12, 2012
1 parent ef9fc12 commit 85dd9c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doomsday/engine/portable/src/rend_console.c
Expand Up @@ -463,6 +463,7 @@ void Rend_ConsoleFPS(const Point2Raw* origin)

sprintf(buf, "%.1f FPS", DD_GetFrameRate());
FR_SetFont(fontFixed);
FR_PushAttrib();
FR_LoadDefaultAttrib();
FR_SetShadowOffset(UI_SHADOW_OFFSET, UI_SHADOW_OFFSET);
FR_SetShadowStrength(UI_SHADOW_STRENGTH);
Expand All @@ -483,6 +484,8 @@ void Rend_ConsoleFPS(const Point2Raw* origin)
UI_SetColor(UI_Color(UIC_TEXT));
UI_TextOutEx2(buf, &labelOrigin, UI_Color(UIC_TITLE), 1, ALIGN_RIGHT, DTF_ONLY_SHADOW);

FR_PopAttrib();

glDisable(GL_TEXTURE_2D);
}

Expand Down Expand Up @@ -523,6 +526,7 @@ static void drawConsoleTitleBar(float alpha)
UI_Gradient(&origin, &size, UI_Color(UIC_BG_DARK), UI_Color(UIC_SHADOW), .2f * alpha, 0);

FR_SetFont(fontVariable[FS_BOLD]);
FR_PushAttrib();
FR_LoadDefaultAttrib();
FR_SetShadowOffset(UI_SHADOW_OFFSET, UI_SHADOW_OFFSET);
FR_SetShadowStrength(UI_SHADOW_STRENGTH);
Expand All @@ -546,6 +550,8 @@ static void drawConsoleTitleBar(float alpha)
UI_TextOutEx2(statusText, &origin, UI_Color(UIC_TEXT), .75f * alpha, ALIGN_RIGHT, DTF_ONLY_SHADOW);
}

FR_PopAttrib();

glDisable(GL_TEXTURE_2D);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
Expand Down Expand Up @@ -606,6 +612,7 @@ static void drawSideText(const char* text, int line, float alpha)
assert(inited);

FR_SetFont(Con_Font());
FR_PushAttrib();
FR_LoadDefaultAttrib();
Con_FontScale(&scale[0], &scale[1]);
fontScaledY = FR_SingleLineHeight("Con") * scale[1];
Expand All @@ -628,6 +635,8 @@ static void drawSideText(const char* text, int line, float alpha)
FR_SetColorAndAlpha(CcolYellow[0], CcolYellow[1], CcolYellow[2], alpha * .75f);
FR_DrawTextXY3(text, ssw - 3, y / scale[1], ALIGN_TOPRIGHT, DTF_NO_TYPEIN|DTF_NO_GLITTER|(!consoleTextShadow?DTF_NO_SHADOW:0));
}

FR_PopAttrib();
}

/**
Expand Down Expand Up @@ -659,6 +668,7 @@ static void drawConsole(float consoleAlpha)
LIBDENG_ASSERT_IN_MAIN_THREAD();

FR_SetFont(Con_Font());
FR_PushAttrib();
FR_LoadDefaultAttrib();
FR_SetTracking(Con_FontTracking());
FR_SetColorAndAlpha(1, 1, 1, consoleAlpha);
Expand Down Expand Up @@ -859,6 +869,8 @@ static void drawConsole(float consoleAlpha)
(int)width, MAX_OF(1, (int)(height / scale[1])));
}

FR_PopAttrib();

// Restore the original matrices.
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
Expand Down

0 comments on commit 85dd9c5

Please sign in to comment.