Change hardcoded Starbase and Sa-Matra values to pretty enum values; bug #1047; from Nic
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3160 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
Changes towards version 0.7:
|
Changes towards version 0.7:
|
||||||
|
- Change hardcoded Starbase and Sa-Matra values to pretty enum values
|
||||||
|
(bug #1047), from Nic
|
||||||
- Load override.cfg from user's dir to add or override menu controls - Alex
|
- Load override.cfg from user's dir to add or override menu controls - Alex
|
||||||
- Allow addons to override any content by placing zips into their
|
- Allow addons to override any content by placing zips into their
|
||||||
'shadow-content' dir - Alex
|
'shadow-content' dir - Alex
|
||||||
|
|||||||
@@ -235,8 +235,7 @@ DoPlanetaryAnalysis (SYSTEM_INFO *SysInfoPtr, PLANET_DESC *pPlanetDesc)
|
|||||||
{
|
{
|
||||||
DWORD old_seed;
|
DWORD old_seed;
|
||||||
|
|
||||||
/* Earth Starbase */
|
if (pPlanetDesc->data_index == HIERARCHY_STARBASE)
|
||||||
if (pPlanetDesc->data_index == (BYTE)~0)
|
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
old_seed = TFB_SeedRandom (pPlanetDesc->rand_seed);
|
old_seed = TFB_SeedRandom (pPlanetDesc->rand_seed);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ GenerateChmmr (BYTE control)
|
|||||||
COUNT angle;
|
COUNT angle;
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
|
|
||||||
pSolarSysState->MoonDesc[0].data_index = (BYTE)~0;
|
pSolarSysState->MoonDesc[0].data_index = HIERARCHY_STARBASE;
|
||||||
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS;
|
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS;
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
angle = NORMALIZE_ANGLE (LOWORD (rand_val));
|
angle = NORMALIZE_ANGLE (LOWORD (rand_val));
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ GenerateSamatra (BYTE control)
|
|||||||
COUNT angle;
|
COUNT angle;
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
|
|
||||||
pSolarSysState->MoonDesc[0].data_index = (BYTE)(~0 - 1);
|
pSolarSysState->MoonDesc[0].data_index = SA_MATRA;
|
||||||
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS
|
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS
|
||||||
+ (2 * MOON_DELTA);
|
+ (2 * MOON_DELTA);
|
||||||
rand_val = TFB_Random ();
|
rand_val = TFB_Random ();
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ GenerateSOL (BYTE control)
|
|||||||
COUNT angle;
|
COUNT angle;
|
||||||
|
|
||||||
/* Starbase: */
|
/* Starbase: */
|
||||||
pSolarSysState->MoonDesc[0].data_index = (BYTE)~0;
|
pSolarSysState->MoonDesc[0].data_index = HIERARCHY_STARBASE;
|
||||||
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS;
|
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS;
|
||||||
angle = HALF_CIRCLE + QUADRANT;
|
angle = HALF_CIRCLE + QUADRANT;
|
||||||
pSolarSysState->MoonDesc[0].location.x =
|
pSolarSysState->MoonDesc[0].location.x =
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ GenerateSyreen (BYTE control)
|
|||||||
GenerateRandomIP (GENERATE_MOONS);
|
GenerateRandomIP (GENERATE_MOONS);
|
||||||
if (pSolarSysState->pBaseDesc == &pSolarSysState->PlanetDesc[0])
|
if (pSolarSysState->pBaseDesc == &pSolarSysState->PlanetDesc[0])
|
||||||
{
|
{
|
||||||
pSolarSysState->MoonDesc[0].data_index = (BYTE)~0;
|
pSolarSysState->MoonDesc[0].data_index = HIERARCHY_STARBASE;
|
||||||
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS;
|
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS;
|
||||||
pSolarSysState->MoonDesc[0].location.x =
|
pSolarSysState->MoonDesc[0].location.x =
|
||||||
COSINE (QUADRANT, pSolarSysState->MoonDesc[0].radius);
|
COSINE (QUADRANT, pSolarSysState->MoonDesc[0].radius);
|
||||||
|
|||||||
@@ -180,7 +180,13 @@ enum
|
|||||||
YEL_GAS_GIANT,
|
YEL_GAS_GIANT,
|
||||||
LAST_GAS_GIANT = YEL_GAS_GIANT,
|
LAST_GAS_GIANT = YEL_GAS_GIANT,
|
||||||
|
|
||||||
NUMBER_OF_PLANET_TYPES
|
NUMBER_OF_PLANET_TYPES,
|
||||||
|
|
||||||
|
WORLD_TYPE_SPECIAL = 0x80,
|
||||||
|
PLANET_SHIELDED = WORLD_TYPE_SPECIAL,
|
||||||
|
|
||||||
|
HIERARCHY_STARBASE = 127 | WORLD_TYPE_SPECIAL,
|
||||||
|
SA_MATRA = 126 | WORLD_TYPE_SPECIAL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUMBER_OF_SMALL_ROCKY_WORLDS (LAST_SMALL_ROCKY_WORLD - FIRST_SMALL_ROCKY_WORLD + 1)
|
#define NUMBER_OF_SMALL_ROCKY_WORLDS (LAST_SMALL_ROCKY_WORLD - FIRST_SMALL_ROCKY_WORLD + 1)
|
||||||
|
|||||||
@@ -113,8 +113,6 @@ enum
|
|||||||
#define MIN_MOON_RADIUS 35
|
#define MIN_MOON_RADIUS 35
|
||||||
#define MOON_DELTA 20
|
#define MOON_DELTA 20
|
||||||
|
|
||||||
#define PLANET_SHIELDED (1 << 7)
|
|
||||||
|
|
||||||
typedef struct planet_desc
|
typedef struct planet_desc
|
||||||
{
|
{
|
||||||
DWORD rand_seed;
|
DWORD rand_seed;
|
||||||
|
|||||||
@@ -152,15 +152,13 @@ GenerateMoons (void)
|
|||||||
pMoonDesc->temp_color = pCurDesc->temp_color;
|
pMoonDesc->temp_color = pCurDesc->temp_color;
|
||||||
|
|
||||||
data_index = pMoonDesc->data_index;
|
data_index = pMoonDesc->data_index;
|
||||||
if (data_index == (BYTE)~0)
|
if (data_index == HIERARCHY_STARBASE)
|
||||||
{
|
{
|
||||||
/* Starbase */
|
|
||||||
pMoonDesc->image.frame =
|
pMoonDesc->image.frame =
|
||||||
SetAbsFrameIndex (SpaceJunkFrame, 16);
|
SetAbsFrameIndex (SpaceJunkFrame, 16);
|
||||||
}
|
}
|
||||||
else if (data_index == (BYTE)(~0 - 1))
|
else if (data_index == SA_MATRA)
|
||||||
{
|
{
|
||||||
/* Sa-Matra */
|
|
||||||
pMoonDesc->image.frame =
|
pMoonDesc->image.frame =
|
||||||
SetAbsFrameIndex (SpaceJunkFrame, 19);
|
SetAbsFrameIndex (SpaceJunkFrame, 19);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -991,11 +991,11 @@ dumpMoon (FILE *out, const PLANET_DESC *moon)
|
|||||||
{
|
{
|
||||||
const char *typeStr;
|
const char *typeStr;
|
||||||
|
|
||||||
if (moon->data_index == (BYTE) ~0)
|
if (moon->data_index == HIERARCHY_STARBASE)
|
||||||
{
|
{
|
||||||
typeStr = "StarBase";
|
typeStr = "StarBase";
|
||||||
}
|
}
|
||||||
else if (moon->data_index == (BYTE) (~0 - 1))
|
else if (moon->data_index == SA_MATRA)
|
||||||
{
|
{
|
||||||
typeStr = "Sa-Matra";
|
typeStr = "Sa-Matra";
|
||||||
}
|
}
|
||||||
@@ -1014,13 +1014,11 @@ dumpWorld (FILE *out, const PLANET_DESC *world)
|
|||||||
{
|
{
|
||||||
PLANET_INFO *info;
|
PLANET_INFO *info;
|
||||||
|
|
||||||
if (world->data_index == (BYTE) ~0) {
|
if (world->data_index == HIERARCHY_STARBASE) {
|
||||||
// StarBase
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world->data_index == (BYTE)(~0 - 1)) {
|
if (world->data_index == SA_MATRA) {
|
||||||
// Sa-Matra
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1240,13 +1238,11 @@ tallyMoonCallback (const PLANET_DESC *moon, void *arg)
|
|||||||
static void
|
static void
|
||||||
tallyResourcesWorld (TallyResourcesArg *arg, const PLANET_DESC *world)
|
tallyResourcesWorld (TallyResourcesArg *arg, const PLANET_DESC *world)
|
||||||
{
|
{
|
||||||
if (world->data_index == (BYTE) ~0) {
|
if (world->data_index == HIERARCHY_STARBASE) {
|
||||||
// StarBase
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world->data_index == (BYTE)(~0 - 1)) {
|
if (world->data_index == SA_MATRA) {
|
||||||
// Sa-Matra
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user