Quit confirmation fixes, phase 3: font effect save/restore
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1213 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -30,6 +30,7 @@ DrawConfirmationWindow (BOOLEAN answer)
|
||||
{
|
||||
COLOR oldfg = SetContextForeGroundColor (MENU_BACKGROUND_COLOR);
|
||||
FONT oldfont = SetContextFont (StarConFont);
|
||||
FONTEFFECT oldFontEffect = SetContextFontEffect (0, 0, 0);
|
||||
RECT r;
|
||||
TEXT t;
|
||||
BatchGraphics ();
|
||||
@@ -85,6 +86,7 @@ DrawConfirmationWindow (BOOLEAN answer)
|
||||
|
||||
UnbatchGraphics ();
|
||||
|
||||
SetContextFontEffect (oldFontEffect.type, oldFontEffect.from, oldFontEffect.to);
|
||||
SetContextFont (oldfont);
|
||||
SetContextForeGroundColor (oldfg);
|
||||
}
|
||||
|
||||
@@ -215,6 +215,14 @@ extern INTERSECT_CODE BoxIntersect (PRECT pr1, PRECT pr2, PRECT
|
||||
printer);
|
||||
extern void BoxUnion (PRECT pr1, PRECT pr2, PRECT punion);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BOOLEAN Use;
|
||||
DWORD from;
|
||||
DWORD to;
|
||||
BYTE type;
|
||||
} FONTEFFECT;
|
||||
|
||||
#endif /* _GFXLIB_H */
|
||||
|
||||
|
||||
@@ -266,7 +274,7 @@ extern DWORD LoadCelFile (PVOID pStr);
|
||||
extern DWORD LoadGraphicInstance (DWORD res);
|
||||
extern DWORD LoadGraphic (DWORD res);
|
||||
extern DRAWABLE LoadDisplayPixmap (PRECT area, FRAME frame);
|
||||
extern void SetContextFontEffect (BYTE type, DWORD from, DWORD to);
|
||||
extern FONTEFFECT SetContextFontEffect (BYTE type, DWORD from, DWORD to);
|
||||
extern FONT SetContextFont (FONT Font);
|
||||
extern BOOLEAN DestroyFont (FONT_REF FontRef);
|
||||
extern FONT CaptureFont (FONT_REF FontRef);
|
||||
|
||||
@@ -22,15 +22,14 @@
|
||||
extern FRAME Build_Font_Effect (FRAME FramePtr, DWORD from, DWORD to, BYTE type);
|
||||
|
||||
static BYTE char_delta_array[MAX_DELTAS];
|
||||
static struct {
|
||||
BOOLEAN Use;
|
||||
DWORD from;
|
||||
DWORD to;
|
||||
BYTE type;
|
||||
} FontEffect = {0,0,0,0};
|
||||
|
||||
void SetContextFontEffect (BYTE type, DWORD from, DWORD to)
|
||||
static FONTEFFECT FontEffect = {0,0,0,0};
|
||||
|
||||
FONTEFFECT
|
||||
SetContextFontEffect (BYTE type, DWORD from, DWORD to)
|
||||
{
|
||||
FONTEFFECT oldFontEffect = FontEffect;
|
||||
|
||||
if (from == to)
|
||||
FontEffect.Use = 0;
|
||||
else
|
||||
@@ -40,6 +39,13 @@ void SetContextFontEffect (BYTE type, DWORD from, DWORD to)
|
||||
FontEffect.to = to;
|
||||
FontEffect.type = type;
|
||||
}
|
||||
|
||||
if (!oldFontEffect.Use)
|
||||
// reset fields so that when struct passed back
|
||||
// the logic works correctly
|
||||
oldFontEffect.to = oldFontEffect.from = 0;
|
||||
|
||||
return oldFontEffect;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user