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 void
LoadPlanet (FRAME SurfDefFrame) LoadPlanet (FRAME SurfDefFrame)
{ {
BOOLEAN WaitMode; bool WaitMode = !(LastActivity & CHECK_LOAD);
PLANET_DESC *pPlanetDesc;
#ifdef DEBUG #ifdef DEBUG
if (disableInteractivity) if (disableInteractivity)
return; return;
#endif #endif
WaitMode = !(LastActivity & CHECK_LOAD) && assert (pSolarSysState->MenuState.Initialized != 3);
(pSolarSysState->MenuState.Initialized != 3);
if (WaitMode) if (WaitMode)
{ {
@@ -219,25 +219,13 @@ LoadPlanet (FRAME SurfDefFrame)
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
// TODO: split off the scan screen redraw code into a separate StopMusic ();
// function so that we could lose this hack. TaskContext = CreateContext ("TaskContext");
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 (); pPlanetDesc = pSolarSysState->pOrbitalDesc;
GeneratePlanetSurface (pPlanetDesc, SurfDefFrame);
TaskContext = CreateContext ("TaskContext"); SetPlanetMusic (pPlanetDesc->data_index & ~PLANET_SHIELDED);
GeneratePlanetSide ();
pPlanetDesc = pSolarSysState->pOrbitalDesc;
GeneratePlanetSurface (pPlanetDesc, SurfDefFrame);
SetPlanetMusic (pPlanetDesc->data_index & ~PLANET_SHIELDED);
GeneratePlanetSide ();
}
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
DrawOrbitalDisplay (WaitMode ? DRAW_ORBITAL_UPDATE : DRAW_ORBITAL_FULL); DrawOrbitalDisplay (WaitMode ? DRAW_ORBITAL_UPDATE : DRAW_ORBITAL_FULL);
@@ -249,7 +237,6 @@ LoadPlanet (FRAME SurfDefFrame)
if (WaitMode) if (WaitMode)
{ {
assert (pSolarSysState->MenuState.Initialized == 2); assert (pSolarSysState->MenuState.Initialized == 2);
ZoomInPlanetSphere (); ZoomInPlanetSphere ();
} }
@@ -407,7 +394,9 @@ DoPlanetOrbit (MENU_STATE *pMS)
if (!AutoPilotSet) if (!AutoPilotSet)
{ // Redraw the orbital display { // Redraw the orbital display
LoadPlanet (NULL); LockMutex (GraphicsLock);
DrawOrbitalDisplay (DRAW_ORBITAL_FULL);
UnlockMutex (GraphicsLock);
break; break;
} }
// Fall through !!! // Fall through !!!