diff --git a/sc2/src/uqm/planets/planets.c b/sc2/src/uqm/planets/planets.c index 83984755f..53ac8a373 100644 --- a/sc2/src/uqm/planets/planets.c +++ b/sc2/src/uqm/planets/planets.c @@ -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 !!!