From b162493f608760c26caaa9237c271a00624d91bf Mon Sep 17 00:00:00 2001 From: danij Date: Mon, 13 Feb 2012 05:37:59 +0000 Subject: [PATCH] libcommon|HUD|Fixed: Font renderer attribute state mismanagement Manifested the symptom of Heretic's player message log being drawn with the tracking property set according to that of the previously drawn HUD widget. --- doomsday/plugins/common/src/hu_lib.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doomsday/plugins/common/src/hu_lib.c b/doomsday/plugins/common/src/hu_lib.c index 04fa785023..aac6942506 100644 --- a/doomsday/plugins/common/src/hu_lib.c +++ b/doomsday/plugins/common/src/hu_lib.c @@ -464,15 +464,18 @@ static void drawWidget2(uiwidget_t* obj, const Point2Raw* offset) Point2_Raw(Rect_Origin(obj->geometry), &origin); // Configure the page render state. - /// \todo Initial font renderer setup. uiRS.pageAlpha = obj->opacity; + FR_PushAttrib(); + DGL_MatrixMode(DGL_MODELVIEW); DGL_Translatef(origin.x, origin.y, 0); // Do not pass a zero length offset. obj->drawer(obj, ((offset && (offset->x || offset->y))? offset : NULL)); + FR_PopAttrib(); + DGL_MatrixMode(DGL_MODELVIEW); DGL_Translatef(-origin.x, -origin.y, 0); } @@ -526,6 +529,13 @@ void GUI_DrawWidget(uiwidget_t* obj, const Point2Raw* offset) updateWidgetGeometry(obj); + FR_PopAttrib(); + + // Draw. + FR_PushAttrib(); + FR_LoadDefaultAttrib(); + FR_SetLeading(0); + // Do not pass a zero length offset. drawWidget(obj, ((offset && (offset->x || offset->y))? offset : NULL));