Cleanup: COLOR arrays do not need to be inited on every func call

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2520 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2006-11-22 18:50:24 +00:00
parent dc63209beb
commit d786877fef
14 changed files with 83 additions and 74 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ static int clock_task_func(void* data)
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
};
DWORD cycle_index, delay_count;
COLOR cycle_tab[] =
static const COLOR cycle_tab[] =
{
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x14, 0x18), 0x5B),
BUILD_COLOR (MAKE_RGB15 (0x06, 0x10, 0x16), 0x5C),
+2 -2
View File
@@ -340,7 +340,7 @@ DrawFadeText (const UNICODE *str1, const UNICODE *str2, BOOLEAN fade_in,
SIZE i;
DWORD TimeIn;
TEXT t1, t2;
COLOR fade_cycle[] =
static const COLOR fade_cycle[] =
{
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x1D),
BUILD_COLOR (MAKE_RGB15 (0x09, 0x09, 0x09), 0x1E),
@@ -437,7 +437,7 @@ UninitEncounter (void)
UNICODE buf[80];
HSTARSHIP hStarShip;
SHIP_FRAGMENTPTR FragPtr;
COLOR fade_ship_cycle[] =
static const COLOR fade_ship_cycle[] =
{
BUILD_COLOR (MAKE_RGB15 (0x07, 0x00, 0x00), 0x2F),
BUILD_COLOR (MAKE_RGB15 (0x0F, 0x00, 0x00), 0x2D),
+1 -1
View File
@@ -630,7 +630,7 @@ DrawCargo (COUNT redraw_state)
{
TEXT t;
UNICODE buf[40];
COLOR cargo_color[] =
static const COLOR cargo_color[] =
{
BUILD_COLOR (MAKE_RGB15 (0x02, 0x0E, 0x13), 0x00),
BUILD_COLOR (MAKE_RGB15 (0x19, 0x00, 0x00), 0x00),
+1 -1
View File
@@ -137,7 +137,7 @@ static BYTE lander_flags;
static COLOR
DamageColorCycle (COLOR c, COUNT i)
{
COLOR damage_tab[DAMAGE_CYCLE + 1] =
static const COLOR damage_tab[DAMAGE_CYCLE + 1] =
{
WHITE_COLOR,
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x00), 0x2A),
+1 -1
View File
@@ -364,7 +364,7 @@ DrawStarMap (COUNT race_update, PRECT pClipRect)
{
COUNT index;
HSTARSHIP hStarShip, hNextShip;
COLOR race_colors[] =
static const COLOR race_colors[] =
{
RACE_COLORS
};
+1 -1
View File
@@ -216,7 +216,7 @@ LoadSolarSys (void)
PPLANET_DESC pCurDesc;
DWORD old_seed;
#define NUM_TEMP_RANGES 5
COLOR temp_color_array[NUM_TEMP_RANGES] =
static const COLOR temp_color_array[NUM_TEMP_RANGES] =
{
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x0E), 0x54),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x06, 0x08), 0x62),
+4 -3
View File
@@ -200,7 +200,7 @@ initialize_megawatt_laser (PELEMENT ShipPtr, HELEMENT LaserArray[])
RECT r;
STARSHIPPTR StarShipPtr;
LASER_BLOCK LaserBlock;
COLOR cycle_array[] =
static const COLOR cycle_array[] =
{
BUILD_COLOR (MAKE_RGB15 (0x17, 0x00, 0x00), 0x2B),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7F),
@@ -348,8 +348,9 @@ chmmr_postprocess (PELEMENT ElementPtr)
DISPLAY_TO_WORLD (8 + 9 + 11 + 14),
DISPLAY_TO_WORLD (8 + 9 + 11 + 14 + 18),
};
COLOR color_tab[] =
{ BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x10), 0x53),
static const COLOR color_tab[] =
{
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x10), 0x53),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x0E), 0x54),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x0C), 0x55),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x09), 0x56),
+5 -3
View File
@@ -307,8 +307,9 @@ orz_intelligence (PELEMENT ShipPtr, PEVALUATE_DESC ObjectsOfConcern, COUNT Conce
void
ion_preprocess (PELEMENT ElementPtr)
{
COLOR color_tab[] =
{ BUILD_COLOR (MAKE_RGB15 (0x1F, 0x00, 0x00), 0x2a),
static const COLOR color_tab[] =
{
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x00, 0x00), 0x2a),
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x00), 0x2b),
BUILD_COLOR (MAKE_RGB15 (0x17, 0x00, 0x00), 0x2c),
BUILD_COLOR (MAKE_RGB15 (0x13, 0x00, 0x00), 0x2d),
@@ -319,7 +320,8 @@ ion_preprocess (PELEMENT ElementPtr)
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0E, 0x00), 0x7c),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0A, 0x00), 0x7d),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x07, 0x00), 0x7e),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7f), };
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7f),
};
#define NUM_TAB_COLORS (sizeof (color_tab) / sizeof (color_tab[0]))
COUNT color_index = 0;
+5 -3
View File
@@ -314,8 +314,9 @@ void
spawn_phoenix_trail (PELEMENT
ElementPtr)
{
COLOR color_tab[] =
{ BUILD_COLOR (MAKE_RGB15 (0x1F, 0x00, 0x00), 0x2a),
static const COLOR color_tab[] =
{
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x00, 0x00), 0x2a),
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x00), 0x2b),
BUILD_COLOR (MAKE_RGB15 (0x17, 0x00, 0x00), 0x2c),
BUILD_COLOR (MAKE_RGB15 (0x13, 0x00, 0x00), 0x2d),
@@ -326,7 +327,8 @@ spawn_phoenix_trail (PELEMENT
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0E, 0x00), 0x7c),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0A, 0x00), 0x7d),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x07, 0x00), 0x7e),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7f), };
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7f),
};
#define NUM_TAB_COLORS (sizeof (color_tab) / sizeof (color_tab[0]))
+1 -1
View File
@@ -328,7 +328,7 @@ spawn_point_defense (PELEMENT ElementPtr)
HELEMENT hObject, hNextObject;
ELEMENTPTR ShipPtr;
COLOR LaserColor;
COLOR ColorRange[] =
static const COLOR ColorRange[] =
{
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7F),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x07, 0x00), 0x7E),
+5 -3
View File
@@ -306,8 +306,9 @@ utwig_preprocess (PELEMENT ElementPtr)
}
else
{
COLOR color_tab[] =
{ BUILD_COLOR (MAKE_RGB15 (0x1F, 0x00, 0x00), 0x2a),
static const COLOR color_tab[] =
{
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x00, 0x00), 0x2a),
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x00), 0x2b),
BUILD_COLOR (MAKE_RGB15 (0x17, 0x00, 0x00), 0x2c),
BUILD_COLOR (MAKE_RGB15 (0x13, 0x00, 0x00), 0x2d),
@@ -318,7 +319,8 @@ utwig_preprocess (PELEMENT ElementPtr)
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0E, 0x00), 0x7c),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0A, 0x00), 0x7d),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x07, 0x00), 0x7e),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7f), };
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7f),
};
#define NUM_TAB_COLORS (sizeof (color_tab) / sizeof (color_tab[0]))
+3 -3
View File
@@ -1108,7 +1108,7 @@ GetCPodCapacity (PPOINT ppt)
GLOBAL_SIS (CrewEnlisted))
{
COUNT pod_remainder, which_row;
COLOR crew_rows[] =
static const COLOR crew_rows[] =
{
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x1E, 0x09), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x1E, 0x00), 0x65),
@@ -1164,7 +1164,7 @@ GetSBayCapacity (PPOINT ppt)
GLOBAL_SIS (TotalElementMass))
{
COUNT bay_remainder, which_row;
COLOR color_bars[] =
static const COLOR color_bars[] =
{
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x1F, 0x1F), 0x0F),
BUILD_COLOR (MAKE_RGB15 (0x1C, 0x1C, 0x1C), 0x11),
@@ -1222,7 +1222,7 @@ GetFTankCapacity (PPOINT ppt)
GLOBAL_SIS (FuelOnBoard))
{
COUNT which_row;
COLOR fuel_colors[] =
static const COLOR fuel_colors[] =
{
BUILD_COLOR (MAKE_RGB15 (0x0F, 0x00, 0x00), 0x2D),
BUILD_COLOR (MAKE_RGB15 (0x13, 0x00, 0x00), 0x2C),
+3 -3
View File
@@ -422,7 +422,7 @@ PostProcessStatus (PELEMENT ShipPtr)
i = (BYTE)(NUM_EXPLOSION_FRAMES * 3 - 1) - ShipPtr->life_span;
if (i <= 4)
{
COLOR flash_tab0[] =
static const COLOR flash_tab0[] =
{
BUILD_COLOR (MAKE_RGB15 (0x0F, 0x00, 0x00), 0x2D),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x19, 0x19), 0x24),
@@ -443,7 +443,7 @@ PostProcessStatus (PELEMENT ShipPtr)
i -= 5;
if (i <= 14)
{
COLOR flash_tab1[] =
static const COLOR flash_tab1[] =
{
BUILD_COLOR (MAKE_RGB15 (0x1E, 0x1F, 0x12), 0x70),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x1F, 0x0A), 0x0E),
@@ -525,7 +525,7 @@ PostProcessStatus (PELEMENT ShipPtr)
c = BLACK_COLOR;
else
{
COLOR flash_tab2[] =
static const COLOR flash_tab2[] =
{
BUILD_COLOR (MAKE_RGB15 (0x17, 0x00, 0x00), 0x2B),
BUILD_COLOR (MAKE_RGB15 (0x0F, 0x00, 0x00), 0x2D),
+6 -4
View File
@@ -569,8 +569,9 @@ spawn_ion_trail (PELEMENT ElementPtr)
}
else
{
COLOR color_tab[] =
{ BUILD_COLOR (MAKE_RGB15 (0x1F, 0x00, 0x00), 0x2a),
static const COLOR color_tab[] =
{
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x00, 0x00), 0x2a),
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x00), 0x2b),
BUILD_COLOR (MAKE_RGB15 (0x17, 0x00, 0x00), 0x2c),
BUILD_COLOR (MAKE_RGB15 (0x13, 0x00, 0x00), 0x2d),
@@ -581,7 +582,8 @@ spawn_ion_trail (PELEMENT ElementPtr)
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0E, 0x00), 0x7c),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0A, 0x00), 0x7d),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x07, 0x00), 0x7e),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7f), };
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7f),
};
#define NUM_TAB_COLORS (sizeof (color_tab) / sizeof (color_tab[0]))
COUNT color_index = 0;
@@ -724,7 +726,7 @@ flee_preprocess (PELEMENT ElementPtr)
{
SIZE dir;
COLOR c;
COLOR color_tab[] =
static const COLOR color_tab[] =
{
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x19, 0x19), 0x24),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x13, 0x13), 0x25),