Make DoPopupWindow() work over faded out screens.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3235 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2009-10-23 19:51:33 +00:00
parent 62c7422918
commit 6774ad2a9b
7 changed files with 22 additions and 6 deletions
+1
View File
@@ -1,4 +1,5 @@
Changes towards version 0.7:
- Make DoPopupWindow() work over faded out screens. - SvdB
- Trackplayer rewrite; fixed many bugs - Alex
- Source tree reorg: libs/ moved out of sc2code/, msvc++/ moved to
build/msvc6/, src/sc2code/ renamed to src/uqm/ - Coredev
+1 -1
View File
@@ -246,7 +246,7 @@ extern void FlushColorXForms (void);
#define GetColorMapAddress GetStringAddress
#define GetColorMapContents GetStringContents
void SetSystemRect (RECT *pRect);
void SetSystemRect (const RECT *pRect);
void ClearSystemRect (void);
#endif /* _GFXLIB_H */
+1 -1
View File
@@ -221,7 +221,7 @@ static BOOLEAN system_box_active = 0;
static SDL_Rect system_box;
void
SetSystemRect (RECT *r)
SetSystemRect (const RECT *r)
{
system_box_active = TRUE;
system_box.x = r->corner.x;
+13 -1
View File
@@ -79,8 +79,10 @@ DrawShadowedBox (RECT *r, COLOR bg, COLOR dark, COLOR medium)
UnbatchGraphics ();
}
// windowRect, if not NULL, will be filled with the dimensions of the
// window drawn.
void
DrawLabelAsWindow (WIDGET_LABEL *label)
DrawLabelAsWindow (WIDGET_LABEL *label, RECT *windowRect)
{
COLOR oldfg = SetContextForeGroundColor (WIDGET_DIALOG_TEXT_COLOR);
FONT oldfont = 0;
@@ -129,6 +131,16 @@ DrawLabelAsWindow (WIDGET_LABEL *label)
if (oldfont)
SetContextFont (oldfont);
SetContextForeGroundColor (oldfg);
if (windowRect != NULL) {
// Add the outer border added by DrawShadowedBox.
// XXX: It may be nicer to add a border size parameter to
// DrawShadowedBox, instead of assuming 2 here.
windowRect->corner.x = r.corner.x - 2;
windowRect->corner.y = r.corner.y - 2;
windowRect->extent.width = r.extent.width + 4;
windowRect->extent.height = r.extent.height + 4;
}
}
void
+1 -1
View File
@@ -176,7 +176,7 @@ typedef struct _widget_controlentry {
} WIDGET_CONTROLENTRY;
void DrawShadowedBox (RECT *r, COLOR bg, COLOR dark, COLOR medium);
void DrawLabelAsWindow (WIDGET_LABEL *label);
void DrawLabelAsWindow (WIDGET_LABEL *label, RECT *windowRect);
void Widget_SetWindowColors (COLOR bg, COLOR dark, COLOR medium);
FONT Widget_SetFont (FONT newFont);
+4 -1
View File
@@ -211,6 +211,7 @@ DoPopupWindow (const char *msg)
FRAME F;
CONTEXT oldContext;
RECT oldRect;
RECT windowRect;
POPUP_STATE state;
MENU_SOUND_FLAGS s0, s1;
@@ -250,7 +251,8 @@ DoPopupWindow (const char *msg)
Widget_SetFont (StarConFont);
Widget_SetWindowColors (SHADOWBOX_BACKGROUND_COLOR, SHADOWBOX_DARK_COLOR,
SHADOWBOX_MEDIUM_COLOR);
DrawLabelAsWindow (&label);
DrawLabelAsWindow (&label, &windowRect);
SetSystemRect (&windowRect);
GetMenuSounds (&s0, &s1);
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
@@ -258,6 +260,7 @@ DoPopupWindow (const char *msg)
state.InputFunc = DoPopup;
DoInput (&state, TRUE);
ClearSystemRect ();
DrawStamp (&s);
DestroyDrawable (ReleaseDrawable (s.frame));
SetContextClipRect (&oldRect);
+1 -1
View File
@@ -586,7 +586,7 @@ rebind_control (WIDGET_CONTROLENTRY *widget)
int index = widget->highlighted;
FlushInput ();
DrawLabelAsWindow (&labels[3]);
DrawLabelAsWindow (&labels[3], NULL);
RebindInputState (template, control, index);
populate_editkeys (template);
FlushInput ();