From 52c92d448f5df707e386858fafb0f1a3c8239564 Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Sat, 5 May 2007 17:09:58 +0000 Subject: [PATCH] cleanups, comments git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2751 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/build.c | 1 + sc2/src/sc2code/init.c | 5 +++-- sc2/src/sc2code/melee.c | 5 +++++ sc2/src/sc2code/tactrans.c | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sc2/src/sc2code/build.c b/sc2/src/sc2code/build.c index a96138b6b..573c918cb 100644 --- a/sc2/src/sc2code/build.c +++ b/sc2/src/sc2code/build.c @@ -24,6 +24,7 @@ #include "libs/mathlib.h" +// Allocate a new STARSHIP and put it in the queue. HSTARSHIP Build (QUEUE *pQueue, DWORD RaceResIndex, COUNT which_player, BYTE captains_name_index) diff --git a/sc2/src/sc2code/init.c b/sc2/src/sc2code/init.c index 2e95c7dc8..10289b727 100644 --- a/sc2/src/sc2code/init.c +++ b/sc2/src/sc2code/init.c @@ -304,8 +304,9 @@ UninitShips (void) if (LOBYTE (GLOBAL (CurrentActivity)) != IN_ENCOUNTER) { - ReinitQueue (&race_q[0]); - ReinitQueue (&race_q[1]); + // Remove any ships left from the race queue. + for (i = 0; i < NUM_PLAYERS; i++) + ReinitQueue (&race_q[i]); if (LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE) FreeHyperspace (); diff --git a/sc2/src/sc2code/melee.c b/sc2/src/sc2code/melee.c index 97db76792..b14bea7cb 100644 --- a/sc2/src/sc2code/melee.c +++ b/sc2/src/sc2code/melee.c @@ -2062,12 +2062,14 @@ BuildAndDrawShipList (MELEE_STATE *pMS) GetFrameRect (s.frame, &r); t.baseline.x = r.extent.width >> 1; t.baseline.y = r.extent.height - NAME_AREA_HEIGHT + 4; + r.corner.x += 2; r.corner.y += 2; r.extent.width -= (2 * 2) + (ICON_WIDTH + 2) + 1; r.extent.height -= (2 * 2) + NAME_AREA_HEIGHT; SetContextForeGroundColor (PICK_BG_COLOR); DrawFilledRectangle (&r); + r.corner.x += 2; r.extent.width += (ICON_WIDTH + 2) - (2 * 2); r.corner.y += r.extent.height; @@ -2092,6 +2094,8 @@ BuildAndDrawShipList (MELEE_STATE *pMS) SetContextForeGroundColor (PICKSHIP_TEAM_START_VALUE_COLOR); font_DrawText (&t); + assert (CountLinks(&race_q[side]) == 0); + for (index = 0; index < MELEE_FLEET_SIZE; index++) { BYTE StarShip; @@ -2112,6 +2116,7 @@ BuildAndDrawShipList (MELEE_STATE *pMS) hBuiltShip = Build (&race_q[side], StarShipPtr->RaceResIndex, 1 << side, NameCaptain (&race_q[side], StarShipPtr)); + // Draw the icon. row = GetShipRow (index); col = GetShipColumn (index); s.origin.x = 4 + ((ICON_WIDTH + 2) * col); diff --git a/sc2/src/sc2code/tactrans.c b/sc2/src/sc2code/tactrans.c index 1675f95e8..692c48641 100644 --- a/sc2/src/sc2code/tactrans.c +++ b/sc2/src/sc2code/tactrans.c @@ -189,8 +189,10 @@ readyForBattleEnd (COUNT side) #if DEMO_MODE // In Demo mode, the saved journal should be replayed with frame // accuracy. PLRPlaying () isn't consistent enough. + (void) side; return true; #else /* !DEMO_MODE */ + (void) side; return !PLRPlaying ((MUSIC_REF)~0); #endif /* !DEMO_MODE */ #else /* defined (NETPLAY) */