Remove one more dependance on pSolarSysState->MenuState.Initialized

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3414 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2009-12-10 09:11:44 +00:00
parent 742f64ac4c
commit 70e7ae8204
+12 -23
View File
@@ -202,15 +202,15 @@ DrawOrbitalDisplay (DRAW_ORBITAL_MODE Mode)
void
LoadPlanet (FRAME SurfDefFrame)
{
BOOLEAN WaitMode;
bool WaitMode = !(LastActivity & CHECK_LOAD);
PLANET_DESC *pPlanetDesc;
#ifdef DEBUG
if (disableInteractivity)
return;
#endif
WaitMode = !(LastActivity & CHECK_LOAD) &&
(pSolarSysState->MenuState.Initialized != 3);
assert (pSolarSysState->MenuState.Initialized != 3);
if (WaitMode)
{
@@ -219,25 +219,13 @@ LoadPlanet (FRAME SurfDefFrame)
UnlockMutex (GraphicsLock);
}
// TODO: split off the scan screen redraw code into a separate
// function so that we could lose this hack.
if (!pSolarSysState->TopoFrame)
{
// TopoFrame has not been initialised yet.
// This means the call to LoadPlanet is made from some
// GenerateFunctions.generateOribital() function.
PLANET_DESC *pPlanetDesc;
StopMusic ();
TaskContext = CreateContext ("TaskContext");
StopMusic ();
TaskContext = CreateContext ("TaskContext");
pPlanetDesc = pSolarSysState->pOrbitalDesc;
GeneratePlanetSurface (pPlanetDesc, SurfDefFrame);
SetPlanetMusic (pPlanetDesc->data_index & ~PLANET_SHIELDED);
GeneratePlanetSide ();
}
pPlanetDesc = pSolarSysState->pOrbitalDesc;
GeneratePlanetSurface (pPlanetDesc, SurfDefFrame);
SetPlanetMusic (pPlanetDesc->data_index & ~PLANET_SHIELDED);
GeneratePlanetSide ();
LockMutex (GraphicsLock);
DrawOrbitalDisplay (WaitMode ? DRAW_ORBITAL_UPDATE : DRAW_ORBITAL_FULL);
@@ -249,7 +237,6 @@ LoadPlanet (FRAME SurfDefFrame)
if (WaitMode)
{
assert (pSolarSysState->MenuState.Initialized == 2);
ZoomInPlanetSphere ();
}
@@ -407,7 +394,9 @@ DoPlanetOrbit (MENU_STATE *pMS)
if (!AutoPilotSet)
{ // Redraw the orbital display
LoadPlanet (NULL);
LockMutex (GraphicsLock);
DrawOrbitalDisplay (DRAW_ORBITAL_FULL);
UnlockMutex (GraphicsLock);
break;
}
// Fall through !!!