Remove the last dependencies on pSolarSysState->MenuState.Initialized; replaced with SOLARSYS_STATE.InOrbit
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3418 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -92,10 +92,8 @@ GenerateChmmr_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
{
|
{
|
||||||
if (GET_GAME_STATE (CHMMR_UNLEASHED))
|
if (GET_GAME_STATE (CHMMR_UNLEASHED))
|
||||||
{
|
{
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
InitCommunication (CHMMR_CONVERSATION);
|
InitCommunication (CHMMR_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (GET_GAME_STATE (CHMMR_BOMB_STATE) == 2)
|
if (GET_GAME_STATE (CHMMR_BOMB_STATE) == 2)
|
||||||
{
|
{
|
||||||
@@ -115,11 +113,9 @@ GenerateChmmr_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (ILWRATH_SHIP,
|
CloneShipFragment (ILWRATH_SHIP,
|
||||||
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
InitCommunication (ILWRATH_CONVERSATION);
|
InitCommunication (ILWRATH_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -93,11 +93,9 @@ GenerateDruuge_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (DRUUGE_SHIP,
|
CloneShipFragment (DRUUGE_SHIP,
|
||||||
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
InitCommunication (DRUUGE_CONVERSATION);
|
InitCommunication (DRUUGE_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
{
|
{
|
||||||
GLOBAL (CurrentActivity) &= ~START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) &= ~START_INTERPLANETARY;
|
||||||
|
|||||||
@@ -83,11 +83,9 @@ GenerateIlwrath_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (ILWRATH_SHIP,
|
CloneShipFragment (ILWRATH_SHIP,
|
||||||
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
InitCommunication (ILWRATH_CONVERSATION);
|
InitCommunication (ILWRATH_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ GenerateMycon_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
&GLOBAL (npc_built_ship_q), 0);
|
&GLOBAL (npc_built_ship_q), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
if (CurStarDescPtr->Index == MYCON_DEFINED)
|
if (CurStarDescPtr->Index == MYCON_DEFINED)
|
||||||
{
|
{
|
||||||
@@ -117,7 +116,6 @@ GenerateMycon_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
||||||
}
|
}
|
||||||
InitCommunication (MYCON_CONVERSATION);
|
InitCommunication (MYCON_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -108,10 +108,8 @@ GenerateOrz_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
}
|
}
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
||||||
}
|
}
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
InitCommunication (ORZ_CONVERSATION);
|
InitCommunication (ORZ_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ GenerateTalkingPet_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world
|
|||||||
|
|
||||||
if (ActivateStarShip (UMGAH_SHIP, SPHERE_TRACKING))
|
if (ActivateStarShip (UMGAH_SHIP, SPHERE_TRACKING))
|
||||||
{
|
{
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
if (!GET_GAME_STATE (UMGAH_ZOMBIE_BLOBBIES))
|
if (!GET_GAME_STATE (UMGAH_ZOMBIE_BLOBBIES))
|
||||||
@@ -106,7 +105,6 @@ GenerateTalkingPet_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world
|
|||||||
}
|
}
|
||||||
InitCommunication (TALKING_PET_CONVERSATION);
|
InitCommunication (TALKING_PET_CONVERSATION);
|
||||||
}
|
}
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
|
|||||||
@@ -84,11 +84,9 @@ GeneratePkunk_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (PKUNK_SHIP,
|
CloneShipFragment (PKUNK_SHIP,
|
||||||
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
InitCommunication (PKUNK_CONVERSATION);
|
InitCommunication (PKUNK_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -188,7 +188,6 @@ GenerateSaMatra_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
SET_GAME_STATE (URQUAN_PROTECTING_SAMATRA, 1);
|
SET_GAME_STATE (URQUAN_PROTECTING_SAMATRA, 1);
|
||||||
@@ -219,7 +218,6 @@ GenerateSaMatra_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
InitCommunication (YEHAT_REBEL_CONVERSATION);
|
InitCommunication (YEHAT_REBEL_CONVERSATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,9 +57,7 @@ GenerateSlylandro_generateOrbital (SOLARSYS_STATE *solarSys,
|
|||||||
{
|
{
|
||||||
if (matchWorld (solarSys, world, 3, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 3, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
InitCommunication (SLYLANDRO_HOME_CONVERSATION);
|
InitCommunication (SLYLANDRO_HOME_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,11 +123,9 @@ GenerateSpathi_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (SPATHI_SHIP, &GLOBAL (npc_built_ship_q),
|
CloneShipFragment (SPATHI_SHIP, &GLOBAL (npc_built_ship_q),
|
||||||
INFINITE_FLEET);
|
INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
InitCommunication (SPATHI_CONVERSATION);
|
InitCommunication (SPATHI_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -84,11 +84,9 @@ GenerateSupox_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (SUPOX_SHIP, &GLOBAL (npc_built_ship_q),
|
CloneShipFragment (SUPOX_SHIP, &GLOBAL (npc_built_ship_q),
|
||||||
INFINITE_FLEET);
|
INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
InitCommunication (SUPOX_CONVERSATION);
|
InitCommunication (SUPOX_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -88,9 +88,7 @@ GenerateSyreen_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
if (matchWorld (solarSys, world, 0, 0))
|
if (matchWorld (solarSys, world, 0, 0))
|
||||||
{
|
{
|
||||||
/* Starbase */
|
/* Starbase */
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
InitCommunication (SYREEN_CONVERSATION);
|
InitCommunication (SYREEN_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ GenerateThraddash_generateOrbital (SOLARSYS_STATE *solarSys,
|
|||||||
CloneShipFragment (THRADDASH_SHIP, &GLOBAL (npc_built_ship_q),
|
CloneShipFragment (THRADDASH_SHIP, &GLOBAL (npc_built_ship_q),
|
||||||
INFINITE_FLEET);
|
INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
if (CurStarDescPtr->Index == THRADD_DEFINED)
|
if (CurStarDescPtr->Index == THRADD_DEFINED)
|
||||||
{
|
{
|
||||||
@@ -113,7 +112,6 @@ GenerateThraddash_generateOrbital (SOLARSYS_STATE *solarSys,
|
|||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
||||||
}
|
}
|
||||||
InitCommunication (THRADD_CONVERSATION);
|
InitCommunication (THRADD_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ GenerateUtwig_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (UTWIG_SHIP,
|
CloneShipFragment (UTWIG_SHIP,
|
||||||
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
if (CurStarDescPtr->Index == UTWIG_DEFINED)
|
if (CurStarDescPtr->Index == UTWIG_DEFINED)
|
||||||
{
|
{
|
||||||
@@ -123,7 +122,6 @@ GenerateUtwig_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
||||||
}
|
}
|
||||||
InitCommunication (UTWIG_CONVERSATION);
|
InitCommunication (UTWIG_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
{
|
{
|
||||||
@@ -149,11 +147,9 @@ GenerateUtwig_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (DRUUGE_SHIP,
|
CloneShipFragment (DRUUGE_SHIP,
|
||||||
&GLOBAL (npc_built_ship_q), 0);
|
&GLOBAL (npc_built_ship_q), 0);
|
||||||
}
|
}
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
||||||
InitCommunication (DRUUGE_CONVERSATION);
|
InitCommunication (DRUUGE_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -135,10 +135,8 @@ GenerateVux_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
InitCommunication (VUX_CONVERSATION);
|
InitCommunication (VUX_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -82,11 +82,9 @@ GenerateYehat_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (YEHAT_SHIP, &GLOBAL (npc_built_ship_q),
|
CloneShipFragment (YEHAT_SHIP, &GLOBAL (npc_built_ship_q),
|
||||||
INFINITE_FLEET);
|
INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
InitCommunication (YEHAT_CONVERSATION);
|
InitCommunication (YEHAT_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -93,11 +93,9 @@ GenerateZoqFotPik_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (BLACK_URQUAN_SHIP,
|
CloneShipFragment (BLACK_URQUAN_SHIP,
|
||||||
&GLOBAL (npc_built_ship_q), 0);
|
&GLOBAL (npc_built_ship_q), 0);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
InitCommunication (BLACKURQ_CONVERSATION);
|
InitCommunication (BLACKURQ_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
|
||||||
return true;
|
return true;
|
||||||
@@ -114,11 +112,9 @@ GenerateZoqFotPik_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
CloneShipFragment (ZOQFOTPIK_SHIP, &GLOBAL (npc_built_ship_q),
|
CloneShipFragment (ZOQFOTPIK_SHIP, &GLOBAL (npc_built_ship_q),
|
||||||
INFINITE_FLEET);
|
INFINITE_FLEET);
|
||||||
|
|
||||||
solarSys->MenuState.Initialized += 2;
|
|
||||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||||
InitCommunication (ZOQFOTPIK_CONVERSATION);
|
InitCommunication (ZOQFOTPIK_CONVERSATION);
|
||||||
solarSys->MenuState.Initialized -= 2;
|
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ LoadPlanet (FRAME SurfDefFrame)
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
assert (pSolarSysState->MenuState.Initialized != 3);
|
assert (pSolarSysState->InOrbit && !pSolarSysState->TopoFrame);
|
||||||
|
|
||||||
if (WaitMode)
|
if (WaitMode)
|
||||||
{
|
{
|
||||||
@@ -228,7 +228,6 @@ LoadPlanet (FRAME SurfDefFrame)
|
|||||||
|
|
||||||
if (WaitMode)
|
if (WaitMode)
|
||||||
{
|
{
|
||||||
assert (pSolarSysState->MenuState.Initialized == 2);
|
|
||||||
ZoomInPlanetSphere ();
|
ZoomInPlanetSphere ();
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
DrawOrbitalDisplay (DRAW_ORBITAL_UPDATE);
|
DrawOrbitalDisplay (DRAW_ORBITAL_UPDATE);
|
||||||
@@ -240,9 +239,6 @@ LoadPlanet (FRAME SurfDefFrame)
|
|||||||
DrawOrbitalDisplay (DRAW_ORBITAL_FULL);
|
DrawOrbitalDisplay (DRAW_ORBITAL_FULL);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: Mark as in-orbit. This should go away eventually
|
|
||||||
pSolarSysState->MenuState.Initialized = 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -228,6 +228,9 @@ struct solarsys_state
|
|||||||
Color Tint_rgb;
|
Color Tint_rgb;
|
||||||
FRAME TopoFrame;
|
FRAME TopoFrame;
|
||||||
PLANET_ORBIT Orbit;
|
PLANET_ORBIT Orbit;
|
||||||
|
BOOLEAN InOrbit;
|
||||||
|
// Set to TRUE when player hits a world in an inner system
|
||||||
|
// Homeworld encounters count as 'in orbit'
|
||||||
};
|
};
|
||||||
|
|
||||||
extern SOLARSYS_STATE *pSolarSysState;
|
extern SOLARSYS_STATE *pSolarSysState;
|
||||||
|
|||||||
@@ -186,11 +186,7 @@ playerInSolarSystem (void)
|
|||||||
bool
|
bool
|
||||||
playerInPlanetOrbit (void)
|
playerInPlanetOrbit (void)
|
||||||
{
|
{
|
||||||
assert (!pSolarSysState || pSolarSysState->MenuState.Initialized < 4);
|
return playerInSolarSystem () && pSolarSysState->InOrbit;
|
||||||
|
|
||||||
return playerInSolarSystem () &&
|
|
||||||
pSolarSysState->MenuState.Initialized == 3;
|
|
||||||
// XXX: This test will change eventually
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -348,11 +344,12 @@ seedRandomForSolarSys (void)
|
|||||||
CurStarDescPtr->star_pt.y));
|
CurStarDescPtr->star_pt.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOLEAN
|
// Returns an orbital PLANET_DESC when player is in orbit
|
||||||
|
static PLANET_DESC *
|
||||||
LoadSolarSys (void)
|
LoadSolarSys (void)
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
BOOLEAN orbital = FALSE;
|
PLANET_DESC *orbital = NULL;
|
||||||
PLANET_DESC *pCurDesc;
|
PLANET_DESC *pCurDesc;
|
||||||
DWORD old_seed;
|
DWORD old_seed;
|
||||||
#define NUM_TEMP_RANGES 5
|
#define NUM_TEMP_RANGES 5
|
||||||
@@ -433,18 +430,16 @@ LoadSolarSys (void)
|
|||||||
|
|
||||||
if (GLOBAL (in_orbit))
|
if (GLOBAL (in_orbit))
|
||||||
{ // Only when loading a game into orbital
|
{ // Only when loading a game into orbital
|
||||||
orbital = TRUE;
|
|
||||||
i = GLOBAL (in_orbit) - 1;
|
i = GLOBAL (in_orbit) - 1;
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{ // Orbiting the planet itself
|
{ // Orbiting the planet itself
|
||||||
pSolarSysState->pOrbitalDesc =
|
orbital = pSolarSysState->pBaseDesc->pPrevDesc;
|
||||||
pSolarSysState->pBaseDesc->pPrevDesc;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Orbiting a moon
|
{ // Orbiting a moon
|
||||||
// -1 because planet itself is 1, and moons have to be 1-based
|
// -1 because planet itself is 1, and moons have to be 1-based
|
||||||
i -= 1;
|
i -= 1;
|
||||||
pSolarSysState->pOrbitalDesc = &pSolarSysState->MoonDesc[i];
|
orbital = &pSolarSysState->MoonDesc[i];
|
||||||
}
|
}
|
||||||
GLOBAL (ip_location) = pSolarSysState->SunDesc[0].location;
|
GLOBAL (ip_location) = pSolarSysState->SunDesc[0].location;
|
||||||
GLOBAL (in_orbit) = 0;
|
GLOBAL (in_orbit) = 0;
|
||||||
@@ -465,6 +460,25 @@ LoadSolarSys (void)
|
|||||||
return orbital;
|
return orbital;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
saveNonOrbitalLocation (void)
|
||||||
|
{
|
||||||
|
// XXX: Solar system reentry test depends on ShipFacing != 0
|
||||||
|
GLOBAL (ShipFacing) = GetFrameIndex (GLOBAL (ShipStamp.frame)) + 1;
|
||||||
|
GLOBAL (in_orbit) = 0;
|
||||||
|
if (!playerInInnerSystem ())
|
||||||
|
{
|
||||||
|
GLOBAL (ip_planet) = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// ip_planet is 1-based because code tests for ip_planet!=0
|
||||||
|
GLOBAL (ip_planet) = 1 + planetIndex (pSolarSysState,
|
||||||
|
pSolarSysState->pOrbitalDesc);
|
||||||
|
GLOBAL (ip_location) = pSolarSysState->SunDesc[0].location;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
FreeSolarSys (void)
|
FreeSolarSys (void)
|
||||||
{
|
{
|
||||||
@@ -479,7 +493,7 @@ FreeSolarSys (void)
|
|||||||
pSolarSysState->MenuState.flash_task = 0;
|
pSolarSysState->MenuState.flash_task = 0;
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
SaveSolarSysLocation ();
|
saveNonOrbitalLocation ();
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyDrawable (ReleaseDrawable (SolarSysFrame));
|
DestroyDrawable (ReleaseDrawable (SolarSysFrame));
|
||||||
@@ -932,10 +946,7 @@ enterOrbital (PLANET_DESC *planet)
|
|||||||
{
|
{
|
||||||
ZeroVelocityComponents (&GLOBAL (velocity));
|
ZeroVelocityComponents (&GLOBAL (velocity));
|
||||||
pSolarSysState->pOrbitalDesc = planet;
|
pSolarSysState->pOrbitalDesc = planet;
|
||||||
|
pSolarSysState->InOrbit = TRUE;
|
||||||
// XXX: This is nasty: signal enter orbital
|
|
||||||
assert (pSolarSysState->MenuState.Initialized == 1);
|
|
||||||
pSolarSysState->MenuState.Initialized = 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
@@ -1286,7 +1297,8 @@ EnterPlanetOrbit (void)
|
|||||||
CHECK_ABORT | CHECK_LOAD))
|
CHECK_ABORT | CHECK_LOAD))
|
||||||
&& GLOBAL_SIS (CrewEnlisted) != (COUNT)~0)
|
&& GLOBAL_SIS (CrewEnlisted) != (COUNT)~0)
|
||||||
{ // Reload the system and return to the inner view
|
{ // Reload the system and return to the inner view
|
||||||
LoadSolarSys ();
|
PLANET_DESC *orbital = LoadSolarSys ();
|
||||||
|
assert (!orbital);
|
||||||
CheckZoomLevel ();
|
CheckZoomLevel ();
|
||||||
ValidateOrbits ();
|
ValidateOrbits ();
|
||||||
ValidateInnerOrbits ();
|
ValidateInnerOrbits ();
|
||||||
@@ -1304,7 +1316,7 @@ InitSolarSys (void)
|
|||||||
{
|
{
|
||||||
BOOLEAN InnerSystem;
|
BOOLEAN InnerSystem;
|
||||||
BOOLEAN Reentry;
|
BOOLEAN Reentry;
|
||||||
BOOLEAN orbital;
|
PLANET_DESC *orbital;
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|
||||||
@@ -1359,8 +1371,7 @@ InitSolarSys (void)
|
|||||||
|
|
||||||
if (orbital)
|
if (orbital)
|
||||||
{
|
{
|
||||||
// XXX: signal enter orbital
|
enterOrbital (orbital);
|
||||||
pSolarSysState->MenuState.Initialized = 2;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Draw the borders, the system (inner or outer) and fade/transition
|
{ // Draw the borders, the system (inner or outer) and fade/transition
|
||||||
@@ -1374,7 +1385,6 @@ InitSolarSys (void)
|
|||||||
DrawSISMessage (NULL);
|
DrawSISMessage (NULL);
|
||||||
|
|
||||||
ResetSolarSys ();
|
ResetSolarSys ();
|
||||||
pSolarSysState->MenuState.Initialized = 1;
|
|
||||||
|
|
||||||
if (LastActivity == (CHECK_LOAD | CHECK_RESTART))
|
if (LastActivity == (CHECK_LOAD | CHECK_RESTART))
|
||||||
{ // Starting a new game, NOT from load!
|
{ // Starting a new game, NOT from load!
|
||||||
@@ -1737,6 +1747,7 @@ ExploreSolarSys (void)
|
|||||||
SolarSysState.genFuncs = getGenerateFunctions (CurStarDescPtr->Index);
|
SolarSysState.genFuncs = getGenerateFunctions (CurStarDescPtr->Index);
|
||||||
|
|
||||||
InitSolarSys ();
|
InitSolarSys ();
|
||||||
|
SolarSysState.MenuState.Initialized = TRUE;
|
||||||
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
DoInput (&SolarSysState.MenuState, FALSE);
|
DoInput (&SolarSysState.MenuState, FALSE);
|
||||||
UninitSolarSys ();
|
UninitSolarSys ();
|
||||||
@@ -1746,7 +1757,7 @@ ExploreSolarSys (void)
|
|||||||
UNICODE *
|
UNICODE *
|
||||||
GetNamedPlanetaryBody (void)
|
GetNamedPlanetaryBody (void)
|
||||||
{
|
{
|
||||||
if (!CurStarDescPtr || !playerInInnerSystem ())
|
if (!CurStarDescPtr || !playerInSolarSystem () || !playerInInnerSystem ())
|
||||||
return NULL; // Not inside an inner system, so no name
|
return NULL; // Not inside an inner system, so no name
|
||||||
|
|
||||||
assert (pSolarSysState->pOrbitalDesc != NULL);
|
assert (pSolarSysState->pOrbitalDesc != NULL);
|
||||||
@@ -1837,7 +1848,7 @@ GetPlanetOrMoonName (UNICODE *buf, COUNT bufsize)
|
|||||||
// Either not named or we already have a name
|
// Either not named or we already have a name
|
||||||
utf8StringCopy (buf, bufsize, GLOBAL_SIS (PlanetName));
|
utf8StringCopy (buf, bufsize, GLOBAL_SIS (PlanetName));
|
||||||
|
|
||||||
if (!playerInInnerSystem () ||
|
if (!playerInSolarSystem () || !playerInInnerSystem () ||
|
||||||
worldIsPlanet (pSolarSysState, pSolarSysState->pOrbitalDesc))
|
worldIsPlanet (pSolarSysState, pSolarSysState->pOrbitalDesc))
|
||||||
{ // Outer or inner system or orbiting a planet
|
{ // Outer or inner system or orbiting a planet
|
||||||
return;
|
return;
|
||||||
@@ -1861,25 +1872,12 @@ SaveSolarSysLocation (void)
|
|||||||
assert (playerInSolarSystem ());
|
assert (playerInSolarSystem ());
|
||||||
|
|
||||||
// This is a two-stage saving procedure
|
// This is a two-stage saving procedure
|
||||||
// Stage 1: called when saving from inner/outer view, and when
|
// Stage 1: called when saving from inner/outer view
|
||||||
// entering orbital
|
|
||||||
// Stage 2: called when saving from orbital
|
// Stage 2: called when saving from orbital
|
||||||
|
|
||||||
if (!playerInPlanetOrbit ())
|
if (!playerInPlanetOrbit ())
|
||||||
{
|
{
|
||||||
// XXX: Solar system reentry test depends on ShipFacing != 0
|
saveNonOrbitalLocation ();
|
||||||
GLOBAL (ShipFacing) = GetFrameIndex (GLOBAL (ShipStamp.frame)) + 1;
|
|
||||||
GLOBAL (in_orbit) = 0;
|
|
||||||
if (!playerInInnerSystem ())
|
|
||||||
{
|
|
||||||
GLOBAL (ip_planet) = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GLOBAL (ip_planet) = 1 + planetIndex (pSolarSysState,
|
|
||||||
pSolarSysState->pOrbitalDesc);
|
|
||||||
GLOBAL (ip_location) = pSolarSysState->SunDesc[0].location;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // In orbit around a planet.
|
{ // In orbit around a planet.
|
||||||
@@ -1895,6 +1893,7 @@ SaveSolarSysLocation (void)
|
|||||||
// GLOBAL (ip_planet) is already set
|
// GLOBAL (ip_planet) is already set
|
||||||
assert (GLOBAL (ip_planet) != 0);
|
assert (GLOBAL (ip_planet) != 0);
|
||||||
|
|
||||||
|
// has to be at least 1 because code tests for in_orbit!=0
|
||||||
moon = 1; /* the planet itself */
|
moon = 1; /* the planet itself */
|
||||||
if (worldIsMoon (pSolarSysState, pSolarSysState->pOrbitalDesc))
|
if (worldIsMoon (pSolarSysState, pSolarSysState->pOrbitalDesc))
|
||||||
{
|
{
|
||||||
@@ -2013,18 +2012,13 @@ DoIpFlight (MENU_STATE *pMS)
|
|||||||
static TimeCount NextTime;
|
static TimeCount NextTime;
|
||||||
BOOLEAN cancel = PulsedInputState.menu[KEY_MENU_CANCEL];
|
BOOLEAN cancel = PulsedInputState.menu[KEY_MENU_CANCEL];
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
(void) pMS; // suppress unused warning
|
||||||
{
|
|
||||||
// XXX: This should be unreachable now
|
if (pSolarSysState->InOrbit)
|
||||||
// XXX: pMS refers to pSolarSysState->MenuState
|
|
||||||
pMS->Initialized = 1;
|
|
||||||
}
|
|
||||||
else if (pMS->Initialized == 2)
|
|
||||||
{ // CheckShipLocation() or InitSolarSys() sent us to orbital
|
{ // CheckShipLocation() or InitSolarSys() sent us to orbital
|
||||||
EnterPlanetOrbit ();
|
EnterPlanetOrbit ();
|
||||||
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
// XXX: pMS refers to pSolarSysState->MenuState
|
pSolarSysState->InOrbit = FALSE;
|
||||||
pMS->Initialized = 1;
|
|
||||||
}
|
}
|
||||||
else if (cancel || LastActivity == CHECK_LOAD)
|
else if (cancel || LastActivity == CHECK_LOAD)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user