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:
avolkov
2009-06-30 01:11:27 +00:00
parent 8e10817997
commit fb9688751f
10 changed files with 22 additions and 23 deletions
+2
View File
@@ -1,4 +1,6 @@
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
- Allow addons to override any content by placing zips into their
'shadow-content' dir - Alex
+1 -2
View File
@@ -235,8 +235,7 @@ DoPlanetaryAnalysis (SYSTEM_INFO *SysInfoPtr, PLANET_DESC *pPlanetDesc)
{
DWORD old_seed;
/* Earth Starbase */
if (pPlanetDesc->data_index == (BYTE)~0)
if (pPlanetDesc->data_index == HIERARCHY_STARBASE)
return (0);
old_seed = TFB_SeedRandom (pPlanetDesc->rand_seed);
+1 -1
View File
@@ -41,7 +41,7 @@ GenerateChmmr (BYTE control)
COUNT angle;
DWORD rand_val;
pSolarSysState->MoonDesc[0].data_index = (BYTE)~0;
pSolarSysState->MoonDesc[0].data_index = HIERARCHY_STARBASE;
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS;
rand_val = TFB_Random ();
angle = NORMALIZE_ANGLE (LOWORD (rand_val));
+1 -1
View File
@@ -186,7 +186,7 @@ GenerateSamatra (BYTE control)
COUNT angle;
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
+ (2 * MOON_DELTA);
rand_val = TFB_Random ();
+1 -1
View File
@@ -462,7 +462,7 @@ GenerateSOL (BYTE control)
COUNT angle;
/* Starbase: */
pSolarSysState->MoonDesc[0].data_index = (BYTE)~0;
pSolarSysState->MoonDesc[0].data_index = HIERARCHY_STARBASE;
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS;
angle = HALF_CIRCLE + QUADRANT;
pSolarSysState->MoonDesc[0].location.x =
+1 -1
View File
@@ -75,7 +75,7 @@ GenerateSyreen (BYTE control)
GenerateRandomIP (GENERATE_MOONS);
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].location.x =
COSINE (QUADRANT, pSolarSysState->MoonDesc[0].radius);
+7 -1
View File
@@ -180,7 +180,13 @@ enum
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)
-2
View File
@@ -113,8 +113,6 @@ enum
#define MIN_MOON_RADIUS 35
#define MOON_DELTA 20
#define PLANET_SHIELDED (1 << 7)
typedef struct planet_desc
{
DWORD rand_seed;
+2 -4
View File
@@ -152,15 +152,13 @@ GenerateMoons (void)
pMoonDesc->temp_color = pCurDesc->temp_color;
data_index = pMoonDesc->data_index;
if (data_index == (BYTE)~0)
if (data_index == HIERARCHY_STARBASE)
{
/* Starbase */
pMoonDesc->image.frame =
SetAbsFrameIndex (SpaceJunkFrame, 16);
}
else if (data_index == (BYTE)(~0 - 1))
else if (data_index == SA_MATRA)
{
/* Sa-Matra */
pMoonDesc->image.frame =
SetAbsFrameIndex (SpaceJunkFrame, 19);
}
+6 -10
View File
@@ -991,11 +991,11 @@ dumpMoon (FILE *out, const PLANET_DESC *moon)
{
const char *typeStr;
if (moon->data_index == (BYTE) ~0)
if (moon->data_index == HIERARCHY_STARBASE)
{
typeStr = "StarBase";
}
else if (moon->data_index == (BYTE) (~0 - 1))
else if (moon->data_index == SA_MATRA)
{
typeStr = "Sa-Matra";
}
@@ -1014,13 +1014,11 @@ dumpWorld (FILE *out, const PLANET_DESC *world)
{
PLANET_INFO *info;
if (world->data_index == (BYTE) ~0) {
// StarBase
if (world->data_index == HIERARCHY_STARBASE) {
return;
}
if (world->data_index == (BYTE)(~0 - 1)) {
// Sa-Matra
if (world->data_index == SA_MATRA) {
return;
}
@@ -1240,13 +1238,11 @@ tallyMoonCallback (const PLANET_DESC *moon, void *arg)
static void
tallyResourcesWorld (TallyResourcesArg *arg, const PLANET_DESC *world)
{
if (world->data_index == (BYTE) ~0) {
// StarBase
if (world->data_index == HIERARCHY_STARBASE) {
return;
}
if (world->data_index == (BYTE)(~0 - 1)) {
// Sa-Matra
if (world->data_index == SA_MATRA) {
return;
}