Fix for load/save screen glitches (bug #163), from chmmravatar
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@903 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
+30
-19
@@ -29,6 +29,8 @@ BOOLEAN SaveProblem (void);
|
|||||||
//End Added by Chris
|
//End Added by Chris
|
||||||
|
|
||||||
#define MAX_SAVED_GAMES 10
|
#define MAX_SAVED_GAMES 10
|
||||||
|
#define SUMMARY_X_OFFS 14
|
||||||
|
#define SUMMARY_SIDE_OFFS 7
|
||||||
|
|
||||||
static PMENU_STATE pLocMenuState;
|
static PMENU_STATE pLocMenuState;
|
||||||
|
|
||||||
@@ -532,7 +534,7 @@ DrawCargo (COUNT redraw_state)
|
|||||||
if (redraw_state == 2)
|
if (redraw_state == 2)
|
||||||
{
|
{
|
||||||
SetContextForeGroundColor (BLACK_COLOR);
|
SetContextForeGroundColor (BLACK_COLOR);
|
||||||
r.corner.x = 1;
|
r.corner.x = 1 + SUMMARY_X_OFFS;
|
||||||
r.corner.y = 12;
|
r.corner.y = 12;
|
||||||
r.extent.width = ((SIS_SCREEN_WIDTH - STATUS_WIDTH) >> 1) - r.corner.x;
|
r.extent.width = ((SIS_SCREEN_WIDTH - STATUS_WIDTH) >> 1) - r.corner.x;
|
||||||
r.extent.height = 62 - r.corner.y;
|
r.extent.height = 62 - r.corner.y;
|
||||||
@@ -540,16 +542,19 @@ DrawCargo (COUNT redraw_state)
|
|||||||
GetFrameRect (SetRelFrameIndex (
|
GetFrameRect (SetRelFrameIndex (
|
||||||
pLocMenuState->ModuleFrame, MAX_SAVED_GAMES * 2 + 1
|
pLocMenuState->ModuleFrame, MAX_SAVED_GAMES * 2 + 1
|
||||||
), &r);
|
), &r);
|
||||||
|
r.extent.width += SUMMARY_X_OFFS + SUMMARY_SIDE_OFFS;
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s.origin.x = s.origin.y = 0;
|
s.origin.x = 0;
|
||||||
|
s.origin.y = 0;
|
||||||
s.frame = SetAbsFrameIndex (pLocMenuState->ModuleFrame,
|
s.frame = SetAbsFrameIndex (pLocMenuState->ModuleFrame,
|
||||||
GetFrameCount (pLocMenuState->ModuleFrame) - 1);
|
GetFrameCount (pLocMenuState->ModuleFrame) - 1);
|
||||||
if (!pLocMenuState->Initialized)
|
if (!pLocMenuState->Initialized)
|
||||||
{
|
{
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
|
s.origin.x = SUMMARY_X_OFFS + 1;
|
||||||
s.frame = DecFrameIndex (s.frame);
|
s.frame = DecFrameIndex (s.frame);
|
||||||
if (pLocMenuState->delta_item == SAVE_GAME)
|
if (pLocMenuState->delta_item == SAVE_GAME)
|
||||||
s.frame = DecFrameIndex (s.frame);
|
s.frame = DecFrameIndex (s.frame);
|
||||||
@@ -575,10 +580,10 @@ DrawCargo (COUNT redraw_state)
|
|||||||
);
|
);
|
||||||
if (redraw_state == 2
|
if (redraw_state == 2
|
||||||
|| (redraw_state == 1
|
|| (redraw_state == 1
|
||||||
&& !(((SUMMARY_DESC *)pLocMenuState->CurString)
|
/*&& !(((SUMMARY_DESC *)pLocMenuState->CurString)
|
||||||
[pLocMenuState->CurState].Flags & AFTER_BOMB_INSTALLED)))
|
[pLocMenuState->CurState].Flags & AFTER_BOMB_INSTALLED)*/))
|
||||||
{
|
{
|
||||||
s.origin.x = 7;
|
s.origin.x = 7 + SUMMARY_X_OFFS - SUMMARY_SIDE_OFFS + 3;
|
||||||
s.origin.y = 17;
|
s.origin.y = 17;
|
||||||
for (i = 0; i < NUM_ELEMENT_CATEGORIES; ++i)
|
for (i = 0; i < NUM_ELEMENT_CATEGORIES; ++i)
|
||||||
{
|
{
|
||||||
@@ -592,7 +597,7 @@ DrawCargo (COUNT redraw_state)
|
|||||||
s.origin.y += 12;
|
s.origin.y += 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s.origin.x = 24;
|
s.origin.x = 24 + SUMMARY_X_OFFS - SUMMARY_SIDE_OFFS;
|
||||||
s.origin.y = 68;
|
s.origin.y = 68;
|
||||||
s.frame = SetAbsFrameIndex (s.frame, 68);
|
s.frame = SetAbsFrameIndex (s.frame, 68);
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
@@ -617,7 +622,7 @@ DrawCargo (COUNT redraw_state)
|
|||||||
r.extent.width = 23;
|
r.extent.width = 23;
|
||||||
r.extent.height = SHIP_NAME_HEIGHT;
|
r.extent.height = SHIP_NAME_HEIGHT;
|
||||||
SetContextFont (StarConFont);
|
SetContextFont (StarConFont);
|
||||||
t.baseline.x = 33;
|
t.baseline.x = 33 + SUMMARY_X_OFFS - SUMMARY_SIDE_OFFS + 3;
|
||||||
t.baseline.y = 20;
|
t.baseline.y = 20;
|
||||||
t.align = ALIGN_RIGHT;
|
t.align = ALIGN_RIGHT;
|
||||||
t.pStr = buf;
|
t.pStr = buf;
|
||||||
@@ -638,7 +643,7 @@ DrawCargo (COUNT redraw_state)
|
|||||||
font_DrawText (&t);
|
font_DrawText (&t);
|
||||||
t.baseline.y += 12;
|
t.baseline.y += 12;
|
||||||
}
|
}
|
||||||
t.baseline.x = 50;
|
t.baseline.x = 50 + SUMMARY_X_OFFS;
|
||||||
t.baseline.y = 71;
|
t.baseline.y = 71;
|
||||||
SetContextForeGroundColor (BLACK_COLOR);
|
SetContextForeGroundColor (BLACK_COLOR);
|
||||||
r.corner.x = t.baseline.x - r.extent.width + 1;
|
r.corner.x = t.baseline.x - r.extent.width + 1;
|
||||||
@@ -689,7 +694,7 @@ ShowSummary (SUMMARY_DESC *pSD)
|
|||||||
GetContextClipRect (&OldRect);
|
GetContextClipRect (&OldRect);
|
||||||
|
|
||||||
r.corner.x = SIS_ORG_X + ((SIS_SCREEN_WIDTH - STATUS_WIDTH) >> 1) +
|
r.corner.x = SIS_ORG_X + ((SIS_SCREEN_WIDTH - STATUS_WIDTH) >> 1) +
|
||||||
SAFE_X - 16;
|
SAFE_X - 16 + SUMMARY_X_OFFS;
|
||||||
// r.corner.x = SIS_ORG_X + ((SIS_SCREEN_WIDTH - STATUS_WIDTH) >> 1);
|
// r.corner.x = SIS_ORG_X + ((SIS_SCREEN_WIDTH - STATUS_WIDTH) >> 1);
|
||||||
r.corner.y = SIS_ORG_Y;
|
r.corner.y = SIS_ORG_Y;
|
||||||
r.extent.width = STATUS_WIDTH;
|
r.extent.width = STATUS_WIDTH;
|
||||||
@@ -717,7 +722,7 @@ ShowSummary (SUMMARY_DESC *pSD)
|
|||||||
{
|
{
|
||||||
BYTE j;
|
BYTE j;
|
||||||
|
|
||||||
s.origin.x = 140;
|
s.origin.x = 140 + SUMMARY_X_OFFS + SUMMARY_SIDE_OFFS;
|
||||||
for (j = 0; j < 4; ++j)
|
for (j = 0; j < 4; ++j)
|
||||||
{
|
{
|
||||||
if ((i << 2) + j >= pSD->NumDevices)
|
if ((i << 2) + j >= pSD->NumDevices)
|
||||||
@@ -741,17 +746,19 @@ ShowSummary (SUMMARY_DESC *pSD)
|
|||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
|
|
||||||
SetContextFont (StarConFont);
|
SetContextFont (StarConFont);
|
||||||
t.baseline.x = 173;
|
t.baseline.x = 173 + SUMMARY_X_OFFS + SUMMARY_SIDE_OFFS;
|
||||||
t.align = ALIGN_CENTER;
|
t.align = ALIGN_CENTER;
|
||||||
t.CharCount = (COUNT)~0;
|
t.CharCount = (COUNT)~0;
|
||||||
t.pStr = buf;
|
t.pStr = buf;
|
||||||
if (pSD->Flags & AFTER_BOMB_INSTALLED)
|
if (pSD->Flags & AFTER_BOMB_INSTALLED)
|
||||||
{
|
{
|
||||||
s.origin.x = s.origin.y = 0;
|
s.origin.x = SUMMARY_X_OFFS - SUMMARY_SIDE_OFFS + 6;
|
||||||
|
s.origin.y = 0;
|
||||||
s.frame = SetRelFrameIndex (
|
s.frame = SetRelFrameIndex (
|
||||||
pLocMenuState->ModuleFrame, MAX_SAVED_GAMES * 2
|
pLocMenuState->ModuleFrame, MAX_SAVED_GAMES * 2
|
||||||
);
|
);
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
|
s.origin.x = SUMMARY_X_OFFS + SUMMARY_SIDE_OFFS;
|
||||||
s.frame = IncFrameIndex (s.frame);
|
s.frame = IncFrameIndex (s.frame);
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
}
|
}
|
||||||
@@ -759,7 +766,7 @@ ShowSummary (SUMMARY_DESC *pSD)
|
|||||||
{
|
{
|
||||||
SetContext (RadarContext);
|
SetContext (RadarContext);
|
||||||
GetContextClipRect (&OldRect);
|
GetContextClipRect (&OldRect);
|
||||||
r.corner.x = SIS_ORG_X + 10;
|
r.corner.x = SIS_ORG_X + 10 + SUMMARY_X_OFFS - SUMMARY_SIDE_OFFS;
|
||||||
r.corner.y = SIS_ORG_Y + 84;
|
r.corner.y = SIS_ORG_Y + 84;
|
||||||
r.extent = OldRect.extent;
|
r.extent = OldRect.extent;
|
||||||
SetContextClipRect (&r);
|
SetContextClipRect (&r);
|
||||||
@@ -798,9 +805,9 @@ ShowSummary (SUMMARY_DESC *pSD)
|
|||||||
r.extent.height = 7;
|
r.extent.height = 7;
|
||||||
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01));
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01));
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
t.baseline.x = r.corner.x + (SIS_MESSAGE_WIDTH >> 1);
|
t.baseline.x = /*r.corner.x + (SIS_MESSAGE_WIDTH >> 1)*/ 6;
|
||||||
t.baseline.y = r.corner.y + (r.extent.height - 1);
|
t.baseline.y = r.corner.y + (r.extent.height - 1);
|
||||||
t.align = ALIGN_CENTER;
|
t.align = ALIGN_LEFT;
|
||||||
t.pStr = buf;
|
t.pStr = buf;
|
||||||
r.corner.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x));
|
r.corner.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x));
|
||||||
r.corner.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y));
|
r.corner.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y));
|
||||||
@@ -840,6 +847,7 @@ ShowSummary (SUMMARY_DESC *pSD)
|
|||||||
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33));
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33));
|
||||||
t.CharCount = (COUNT)~0;
|
t.CharCount = (COUNT)~0;
|
||||||
font_DrawText (&t);
|
font_DrawText (&t);
|
||||||
|
t.align = ALIGN_CENTER;
|
||||||
t.baseline.x = SIS_SCREEN_WIDTH - 57 + 1 + (SIS_TITLE_WIDTH >> 1);
|
t.baseline.x = SIS_SCREEN_WIDTH - 57 + 1 + (SIS_TITLE_WIDTH >> 1);
|
||||||
if (pSD->Activity == IN_STARBASE)
|
if (pSD->Activity == IN_STARBASE)
|
||||||
wstrcpy (buf, GAME_STRING (STARBASE_STRING_BASE));
|
wstrcpy (buf, GAME_STRING (STARBASE_STRING_BASE));
|
||||||
@@ -922,7 +930,8 @@ Restart:
|
|||||||
{
|
{
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
SetFlashRect (NULL_PTR, (FRAME)0);
|
SetFlashRect (NULL_PTR, (FRAME)0);
|
||||||
s.origin.x = s.origin.y = 0;
|
s.origin.x = SUMMARY_X_OFFS;
|
||||||
|
s.origin.y = 0;
|
||||||
s.frame = SetRelFrameIndex (pMS->ModuleFrame, pMS->CurState);
|
s.frame = SetRelFrameIndex (pMS->ModuleFrame, pMS->CurState);
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
||||||
@@ -1045,13 +1054,15 @@ RetrySave:
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetFlashRect (NULL_PTR, (FRAME)0);
|
SetFlashRect (NULL_PTR, (FRAME)0);
|
||||||
s.origin.x = s.origin.y = 0;
|
s.origin.x = SUMMARY_X_OFFS;
|
||||||
|
s.origin.y = 0;
|
||||||
s.frame = SetRelFrameIndex (pMS->ModuleFrame, pMS->CurState);
|
s.frame = SetRelFrameIndex (pMS->ModuleFrame, pMS->CurState);
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
ChangeGameSelection:
|
ChangeGameSelection:
|
||||||
pMS->CurState = NewState;
|
pMS->CurState = NewState;
|
||||||
ShowSummary (&((SUMMARY_DESC *)pMS->CurString)[pMS->CurState]);
|
ShowSummary (&((SUMMARY_DESC *)pMS->CurString)[pMS->CurState]);
|
||||||
s.origin.x = s.origin.y = 0;
|
s.origin.x = SUMMARY_X_OFFS;
|
||||||
|
s.origin.y = 0;
|
||||||
s.frame = SetRelFrameIndex (pMS->ModuleFrame, pMS->CurState + MAX_SAVED_GAMES);
|
s.frame = SetRelFrameIndex (pMS->ModuleFrame, pMS->CurState + MAX_SAVED_GAMES);
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
|
|
||||||
@@ -1078,7 +1089,7 @@ ChangeGameSelection:
|
|||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
}
|
}
|
||||||
|
|
||||||
r.corner.x = 3 + (NewState * 21);
|
r.corner.x = 3 + (NewState * 21) + SUMMARY_X_OFFS;
|
||||||
r.corner.y = 176;
|
r.corner.y = 176;
|
||||||
r.extent.width = 18;
|
r.extent.width = 18;
|
||||||
r.extent.height = 18;
|
r.extent.height = 18;
|
||||||
|
|||||||
Reference in New Issue
Block a user