Bugfix: clean up the queue after done generating defined groups

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2804 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2007-07-11 23:11:32 +00:00
parent 40fc446cd6
commit 40b3a639aa
7 changed files with 23 additions and 11 deletions
+1 -1
View File
@@ -37,8 +37,8 @@ GenerateColony (BYTE control)
{
CloneShipFragment (URQUAN_SHIP,
&GLOBAL (npc_built_ship_q), 0);
GLOBAL (BattleGroupRef) = PutGroupInfo (GROUPS_ADD_NEW, 1);
ReinitQueue (&GLOBAL (npc_built_ship_q));
SET_GAME_STATE_32 (COLONY_GRPOFFS0, GLOBAL (BattleGroupRef));
}
+1
View File
@@ -102,6 +102,7 @@ GenerateMelnorme (BYTE control)
CloneShipFragment (MELNORME_SHIP,
&GLOBAL (npc_built_ship_q), 0);
GLOBAL (BattleGroupRef) = PutGroupInfo (GROUPS_ADD_NEW, 1);
ReinitQueue (&GLOBAL (npc_built_ship_q));
SetMelnormeRef (GLOBAL (BattleGroupRef));
}
GenerateRandomIP (INIT_NPCS);
+2
View File
@@ -66,6 +66,8 @@ BuildUrquanGuard (void)
for (b0 = 1; b0 <= NUM_URQUAN_GUARDS1; ++b0)
PutGroupInfo (GLOBAL (BattleGroupRef), (BYTE)(NUM_URQUAN_GUARDS0 + b0));
ReinitQueue (&GLOBAL (npc_built_ship_q));
GetGroupInfo (GLOBAL (BattleGroupRef), GROUP_INIT_IP);
XFormIPLoc (&pSolarSysState->PlanetDesc[4].image.origin,
+1
View File
@@ -79,6 +79,7 @@ GenerateShofixti (BYTE control)
GLOBAL (BattleGroupRef) = PutGroupInfo (
GLOBAL (BattleGroupRef), 1);
ReinitQueue (&GLOBAL (npc_built_ship_q));
SET_GAME_STATE_32 (SHOFIXTI_GRPOFFS0,
GLOBAL (BattleGroupRef));
}
+1 -1
View File
@@ -415,8 +415,8 @@ GenerateSOL (BYTE control)
{
CloneShipFragment (URQUAN_PROBE_SHIP,
&GLOBAL (npc_built_ship_q), 0);
GLOBAL (BattleGroupRef) = PutGroupInfo (GROUPS_ADD_NEW, 1);
ReinitQueue (&GLOBAL (npc_built_ship_q));
SET_GAME_STATE_32 (URQUAN_PROBE_GRPOFFS0,
GLOBAL (BattleGroupRef));
}
+1 -1
View File
@@ -62,8 +62,8 @@ GenerateScout (BYTE control)
{
CloneShipFragment (ZOQFOTPIK_SHIP,
&GLOBAL (npc_built_ship_q), 0);
GLOBAL (BattleGroupRef) = PutGroupInfo (GROUPS_ADD_NEW, 1);
ReinitQueue (&GLOBAL (npc_built_ship_q));
SET_GAME_STATE_32 (ZOQFOT_GRPOFFS0,
GLOBAL (BattleGroupRef));
}
+16 -8
View File
@@ -892,15 +892,23 @@ lightning_process (ELEMENT *ElementPtr)
else
{
SIZE s;
#define NUM_CYCLES 8
static const COLOR color_tab[] =
{
BUILD_COLOR (MAKE_RGB15 (0x11, 0x11, 0x11), 0x18),
BUILD_COLOR (MAKE_RGB15 (0x13, 0x13, 0x13), 0x17),
BUILD_COLOR (MAKE_RGB15 (0x15, 0x15, 0x15), 0x15),
BUILD_COLOR (MAKE_RGB15 (0x17, 0x17, 0x17), 0x14),
BUILD_COLOR (MAKE_RGB15 (0x19, 0x19, 0x19), 0x13),
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x1B, 0x1B), 0x12),
BUILD_COLOR (MAKE_RGB15 (0x1D, 0x1D, 0x1D), 0x10),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x1F, 0x1F), 0x0f),
};
// XXX: Color cycling is largely unused, because the color
// never actually changes RGB values (see MAKE_RGB15 below).
// This did, however, work in DOS SC2 version (fade effect).
s = 7 - ((SIZE)ElementPtr->cycle - (SIZE)ElementPtr->life_span);
if (s < 0)
s = 0;
// XXX: Was 0x8000 the background flag on 3DO?
SetPrimColor (pPrim, BUILD_COLOR (0x8000 | MAKE_RGB15 (0x1F, 0x1F, 0x1F), s));
s = ElementPtr->life_span;
if (s > NUM_CYCLES - 1)
s = NUM_CYCLES - 1;
SetPrimColor (pPrim, color_tab[s]);
if (ElementPtr->mass_points == LIGHTNING_DISASTER)
{