Regularized lock and unlock calls on the Graphics and Clock semaphores
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1223 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -65,7 +65,7 @@ int clock_task_func(void* data)
|
|||||||
* can be halted. (e.g. during battle
|
* can be halted. (e.g. during battle
|
||||||
* or communications)
|
* or communications)
|
||||||
*/
|
*/
|
||||||
SetSemaphore (GLOBAL (GameClock).clock_sem);
|
SetSemaphore (GLOBAL (GameClock.clock_sem));
|
||||||
TimeIn = GetTimeCounter ();
|
TimeIn = GetTimeCounter ();
|
||||||
|
|
||||||
if (GLOBAL (GameClock).tick_count <= 0
|
if (GLOBAL (GameClock).tick_count <= 0
|
||||||
@@ -165,7 +165,7 @@ int clock_task_func(void* data)
|
|||||||
LastTime += num_ticks;
|
LastTime += num_ticks;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearSemaphore (GLOBAL (GameClock).clock_sem);
|
ClearSemaphore (GLOBAL (GameClock.clock_sem));
|
||||||
SleepThreadUntil (TimeIn + ONE_SECOND / 120);
|
SleepThreadUntil (TimeIn + ONE_SECOND / 120);
|
||||||
}
|
}
|
||||||
FinishTask (task);
|
FinishTask (task);
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ InitGlobData (void)
|
|||||||
// The clock semaphore was initially initialized as '1'
|
// The clock semaphore was initially initialized as '1'
|
||||||
// but it is always cleared before set, so it toggled between
|
// but it is always cleared before set, so it toggled between
|
||||||
// 2 and 1, which doesn't actually do anything
|
// 2 and 1, which doesn't actually do anything
|
||||||
(GLOBAL (GameClock)).clock_sem = CreateSemaphore(0, "Clock");
|
GLOBAL (GameClock.clock_sem) = CreateSemaphore(0, "Clock");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
@@ -600,7 +600,7 @@ DoOutfit (PMENU_STATE pMS)
|
|||||||
SetTransitionSource (NULL);
|
SetTransitionSource (NULL);
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
DrawSISFrame ();
|
DrawSISFrame ();
|
||||||
SetSemaphore(GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
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));
|
||||||
|
|
||||||
@@ -656,13 +656,13 @@ DoOutfit (PMENU_STATE pMS)
|
|||||||
DrawStamp ((PSTAMP)&s);
|
DrawStamp ((PSTAMP)&s);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearSemaphore(GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
DrawMenuStateStrings (PM_FUEL, pMS->CurState);
|
DrawMenuStateStrings (PM_FUEL, pMS->CurState);
|
||||||
SetSemaphore(GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
DrawFlagshipName (FALSE);
|
DrawFlagshipName (FALSE);
|
||||||
if (optWhichFonts == OPT_PC)
|
if (optWhichFonts == OPT_PC)
|
||||||
DrawFlagshipStats ();
|
DrawFlagshipStats ();
|
||||||
ClearSemaphore(GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
|
|
||||||
{
|
{
|
||||||
RECT r;
|
RECT r;
|
||||||
|
|||||||
@@ -1220,10 +1220,10 @@ DoShipyard (PMENU_STATE pMS)
|
|||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
|
|
||||||
DrawSISFrame ();
|
DrawSISFrame ();
|
||||||
SetSemaphore(GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
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));
|
||||||
ClearSemaphore(GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
DrawBluePrint (pMS);
|
DrawBluePrint (pMS);
|
||||||
pMS->ModuleFrame = s.frame;
|
pMS->ModuleFrame = s.frame;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user