DrawSISFrame() does not need to obtain its own GraphicsLock as everyone who calls should have it already; also obtaining GraphicsLock a bit earlier in some cases (more correct)

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1990 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2005-11-12 22:20:12 +00:00
parent 1a4ca6892e
commit 1b7b238be2
8 changed files with 5 additions and 21 deletions
+1 -3
View File
@@ -48,7 +48,6 @@ DrawSISFrame (void)
{ {
RECT r; RECT r;
LockMutex (GraphicsLock);
SetContext (ScreenContext); SetContext (ScreenContext);
BatchGraphics (); BatchGraphics ();
@@ -192,8 +191,7 @@ DrawSISFrame (void)
InitSISContexts (); InitSISContexts ();
ClearSISRect (DRAW_SIS_DISPLAY); ClearSISRect (DRAW_SIS_DISPLAY);
UnbatchGraphics ();
UnlockMutex (GraphicsLock); UnbatchGraphics ();
} }
-4
View File
@@ -2055,9 +2055,7 @@ HailAlien (void)
} }
else /* in starbase */ else /* in starbase */
{ {
UnlockMutex (GraphicsLock);
DrawSISFrame (); DrawSISFrame ();
LockMutex (GraphicsLock);
if (GET_GAME_STATE (STARBASE_AVAILABLE)) if (GET_GAME_STATE (STARBASE_AVAILABLE))
{ {
DrawSISMessage (GAME_STRING (STARBASE_STRING_BASE + 1)); DrawSISMessage (GAME_STRING (STARBASE_STRING_BASE + 1));
@@ -2125,9 +2123,7 @@ InitCommunication (RESOURCE which_comm)
{ {
if (LOBYTE (LastActivity) == 0) if (LOBYTE (LastActivity) == 0)
{ {
UnlockMutex (GraphicsLock);
DrawSISFrame (); DrawSISFrame ();
LockMutex (GraphicsLock);
} }
else else
{ {
-3
View File
@@ -510,10 +510,7 @@ UninitEncounter (void)
VictoryState = 0; VictoryState = 0;
else else
{ {
UnlockMutex (GraphicsLock);
DrawSISFrame (); DrawSISFrame ();
LockMutex (GraphicsLock);
DrawSISMessage (NULL_PTR); DrawSISMessage (NULL_PTR);
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE) if (LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE)
DrawHyperCoords (GLOBAL (ShipStamp.origin)); DrawHyperCoords (GLOBAL (ShipStamp.origin));
-2
View File
@@ -325,9 +325,7 @@ LoadHyperspace (void)
{ {
if (LOBYTE (LastActivity) == 0) if (LOBYTE (LastActivity) == 0)
{ {
UnlockMutex (GraphicsLock);
DrawSISFrame (); DrawSISFrame ();
LockMutex (GraphicsLock);
} }
else else
{ {
+1 -1
View File
@@ -602,10 +602,10 @@ DoOutfit (PMENU_STATE pMS)
s.frame = CaptureDrawable ( s.frame = CaptureDrawable (
LoadGraphic (OUTFIT_PMAP_ANIM)); LoadGraphic (OUTFIT_PMAP_ANIM));
LockMutex (GraphicsLock);
SetTransitionSource (NULL); SetTransitionSource (NULL);
BatchGraphics (); BatchGraphics ();
DrawSISFrame (); DrawSISFrame ();
LockMutex (GraphicsLock);
DrawSISMessage (GAME_STRING (STARBASE_STRING_BASE + 2)); DrawSISMessage (GAME_STRING (STARBASE_STRING_BASE + 2));
DrawSISTitle (GAME_STRING (STARBASE_STRING_BASE)); DrawSISTitle (GAME_STRING (STARBASE_STRING_BASE));
-2
View File
@@ -127,9 +127,7 @@ LoadPlanet (BOOLEAN IsDefined)
{ {
if (LOBYTE (LastActivity) == 0) if (LOBYTE (LastActivity) == 0)
{ {
UnlockMutex (GraphicsLock);
DrawSISFrame (); DrawSISFrame ();
LockMutex (GraphicsLock);
} }
else else
{ {
+2 -4
View File
@@ -1455,6 +1455,8 @@ InitSolarSys (void)
if (pSolarSysState->MenuState.Initialized == 0) if (pSolarSysState->MenuState.Initialized == 0)
{ {
LockMutex (GraphicsLock);
SetTransitionSource (NULL); SetTransitionSource (NULL);
BatchGraphics (); BatchGraphics ();
draw_sys_flags |= UNBATCH_SYS; draw_sys_flags |= UNBATCH_SYS;
@@ -1472,9 +1474,7 @@ InitSolarSys (void)
} }
else else
{ {
LockMutex (GraphicsLock);
ClearSISRect (DRAW_SIS_DISPLAY); ClearSISRect (DRAW_SIS_DISPLAY);
UnlockMutex (GraphicsLock);
LastActivity &= ~CHECK_LOAD; LastActivity &= ~CHECK_LOAD;
} }
@@ -1482,8 +1482,6 @@ InitSolarSys (void)
// Enabled graphics synchronization again, as in 3DO code originally. // Enabled graphics synchronization again, as in 3DO code originally.
// This should fix the 'entering star' lockup/messed graphics problems. // This should fix the 'entering star' lockup/messed graphics problems.
// 2002/11/30 by Mika
LockMutex (GraphicsLock);
DrawSISMessage (NULL_PTR); DrawSISMessage (NULL_PTR);
SetContext (SpaceContext); SetContext (SpaceContext);
SetContextFGFrame (Screen); SetContextFGFrame (Screen);
+1 -2
View File
@@ -1215,11 +1215,10 @@ DoShipyard (PMENU_STATE pMS)
pMS->hMusic = LoadMusicInstance (SHIPYARD_MUSIC); pMS->hMusic = LoadMusicInstance (SHIPYARD_MUSIC);
LockMutex (GraphicsLock);
SetTransitionSource (NULL); SetTransitionSource (NULL);
BatchGraphics (); BatchGraphics ();
DrawSISFrame (); DrawSISFrame ();
LockMutex (GraphicsLock);
DrawSISMessage (GAME_STRING (STARBASE_STRING_BASE + 3)); DrawSISMessage (GAME_STRING (STARBASE_STRING_BASE + 3));
DrawSISTitle (GAME_STRING (STARBASE_STRING_BASE)); DrawSISTitle (GAME_STRING (STARBASE_STRING_BASE));
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);