Cleanup: TaskContext removed; the only place using it now has an own context
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3416 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -217,7 +217,6 @@ LoadPlanet (FRAME SurfDefFrame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
StopMusic ();
|
StopMusic ();
|
||||||
TaskContext = CreateContext ("TaskContext");
|
|
||||||
|
|
||||||
pPlanetDesc = pSolarSysState->pOrbitalDesc;
|
pPlanetDesc = pSolarSysState->pOrbitalDesc;
|
||||||
GeneratePlanetSurface (pPlanetDesc, SurfDefFrame);
|
GeneratePlanetSurface (pPlanetDesc, SurfDefFrame);
|
||||||
@@ -300,9 +299,6 @@ FreePlanet (void)
|
|||||||
Orbit->ScratchArray = 0;
|
Orbit->ScratchArray = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyContext (TaskContext);
|
|
||||||
TaskContext = 0;
|
|
||||||
|
|
||||||
DestroyStringTable (ReleaseStringTable (
|
DestroyStringTable (ReleaseStringTable (
|
||||||
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString
|
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -104,10 +104,8 @@ typedef struct
|
|||||||
static void
|
static void
|
||||||
RenderTopography (FRAME DstFrame, BYTE *pTopoData, int w, int h)
|
RenderTopography (FRAME DstFrame, BYTE *pTopoData, int w, int h)
|
||||||
{
|
{
|
||||||
CONTEXT OldContext;
|
|
||||||
FRAME OldFrame;
|
FRAME OldFrame;
|
||||||
|
|
||||||
OldContext = SetContext (TaskContext);
|
|
||||||
OldFrame = SetContextFGFrame (DstFrame);
|
OldFrame = SetContextFGFrame (DstFrame);
|
||||||
|
|
||||||
if (pSolarSysState->XlatRef == 0)
|
if (pSolarSysState->XlatRef == 0)
|
||||||
@@ -205,7 +203,6 @@ RenderTopography (FRAME DstFrame, BYTE *pTopoData, int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetContextFGFrame (OldFrame);
|
SetContextFGFrame (OldFrame);
|
||||||
SetContext (OldContext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@@ -1732,13 +1729,15 @@ GeneratePlanetSurface (PLANET_DESC *pPlanetDesc, FRAME SurfDefFrame)
|
|||||||
COUNT i, y;
|
COUNT i, y;
|
||||||
POINT loc;
|
POINT loc;
|
||||||
CONTEXT OldContext;
|
CONTEXT OldContext;
|
||||||
|
CONTEXT TopoContext;
|
||||||
PLANET_ORBIT *Orbit = &pSolarSysState->Orbit;
|
PLANET_ORBIT *Orbit = &pSolarSysState->Orbit;
|
||||||
BYTE *pScaledTopo = 0;
|
BYTE *pScaledTopo = 0;
|
||||||
BOOLEAN shielded = (pPlanetDesc->data_index & PLANET_SHIELDED) != 0;
|
BOOLEAN shielded = (pPlanetDesc->data_index & PLANET_SHIELDED) != 0;
|
||||||
|
|
||||||
old_seed = TFB_SeedRandom (pPlanetDesc->rand_seed);
|
old_seed = TFB_SeedRandom (pPlanetDesc->rand_seed);
|
||||||
|
|
||||||
OldContext = SetContext (TaskContext);
|
TopoContext = CreateContext ("Plangen.TopoContext");
|
||||||
|
OldContext = SetContext (TopoContext);
|
||||||
planet_orbit_init ();
|
planet_orbit_init ();
|
||||||
|
|
||||||
PlanDataPtr = &PlanData[pPlanetDesc->data_index & ~PLANET_SHIELDED];
|
PlanDataPtr = &PlanData[pPlanetDesc->data_index & ~PLANET_SHIELDED];
|
||||||
@@ -1952,6 +1951,7 @@ GeneratePlanetSurface (PLANET_DESC *pPlanetDesc, FRAME SurfDefFrame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetContext (OldContext);
|
SetContext (OldContext);
|
||||||
|
DestroyContext (TopoContext);
|
||||||
|
|
||||||
TFB_SeedRandom (old_seed);
|
TFB_SeedRandom (old_seed);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ CONTEXT ScreenContext;
|
|||||||
CONTEXT SpaceContext;
|
CONTEXT SpaceContext;
|
||||||
CONTEXT StatusContext;
|
CONTEXT StatusContext;
|
||||||
CONTEXT OffScreenContext;
|
CONTEXT OffScreenContext;
|
||||||
CONTEXT TaskContext;
|
|
||||||
SIZE screen_width, screen_height;
|
SIZE screen_width, screen_height;
|
||||||
FRAME Screen;
|
FRAME Screen;
|
||||||
FONT StarConFont;
|
FONT StarConFont;
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ extern CONTEXT OffScreenContext;
|
|||||||
extern CONTEXT ScreenContext;
|
extern CONTEXT ScreenContext;
|
||||||
extern CONTEXT SpaceContext;
|
extern CONTEXT SpaceContext;
|
||||||
extern CONTEXT StatusContext;
|
extern CONTEXT StatusContext;
|
||||||
extern CONTEXT TaskContext;
|
|
||||||
|
|
||||||
extern SIZE screen_width, screen_height;
|
extern SIZE screen_width, screen_height;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user