Shipyard animations no longer hang the game

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@97 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2002-10-03 07:15:51 +00:00
parent e7224cb3c9
commit 4361372009
+10 -2
View File
@@ -186,6 +186,7 @@ DrawRaceStrings (BYTE NewRaceItem)
#define SHIP_WIN_WIDTH 34
#define SHIP_WIN_HEIGHT (SHIP_WIN_WIDTH + 6)
#define SHIP_WIN_FRAMES ((SHIP_WIN_WIDTH >> 1) + 1)
static void
ShowShipCrew (SHIP_FRAGMENTPTR StarShipPtr, PRECT pRect)
@@ -368,6 +369,7 @@ ShowCombatShip (COUNT which_window, SHIP_FRAGMENTPTR YankedStarShipPtr)
DWORD TimeIn;
RECT r;
CONTEXT OldContext;
int j;
SetSemaphore (GraphicsSem);
OldContext = SetContext (OffScreenContext);
@@ -380,10 +382,13 @@ ShowCombatShip (COUNT which_window, SHIP_FRAGMENTPTR YankedStarShipPtr)
r.extent.height = SHIP_WIN_HEIGHT;
ButtonState = AnyButtonPress (FALSE) ? 1 : 0;
TimeIn = GetTimeCounter ();
do
for (j = 0; (j < SHIP_WIN_FRAMES) && !AllDoorsFinished; j++)
{
ClearSemaphore (GraphicsSem);
SleepThreadUntil (TimeIn + 5);
TimeIn = GetTimeCounter ();
SetSemaphore (GraphicsSem);
BatchGraphics ();
StartFinalPass:
pship_win_info = &ship_win_info[0];
@@ -399,8 +404,11 @@ StartFinalPass:
if (YankedStarShipPtr == 0)
AllDoorsFinished = TRUE;
else
{
pship_win_info->lfdoor_s.origin.x =
pship_win_info->rtdoor_s.origin.x = 0;
AllDoorsFinished = TRUE;
}
goto StartFinalPass;
}
@@ -436,7 +444,7 @@ StartFinalPass:
}
UnbatchGraphics ();
} while (!AllDoorsFinished);
}
SetContextClipRect (NULL_PTR);
SetContext (OldContext);