Give more colors a name, and move them to colors.h

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3342 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2009-11-22 17:58:28 +00:00
parent c99241ca22
commit a44f12cfe7
3 changed files with 204 additions and 96 deletions
+148
View File
@@ -156,6 +156,154 @@
BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F) BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F)
// === SIS ===
// Left border of the "SIS" view (the part in which your ship flies).
#define SIS_LEFT_BORDER_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19)
// Right and bottom border of the "SIS" view.
#define SIS_BOTTOM_RIGHT_BORDER_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F)
// Text color of the string "CAPTAIN", when using PC fonts.
#define PC_CAPTAIN_STRING_TEXT_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x02, 0x04, 0x1E), 0x38)
// Background color of the string "CAPTAIN", when using PC fonts.
#define PC_CAPTAIN_STRING_BACKGROUND_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)
// Text color of the captain's name.
#define CAPTAIN_NAME_TEXT_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x16, 0x0B, 0x1F), 0x38)
// Background color of the captain's name.
#define CAPTAIN_NAME_BACKGROUND_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)
// Text color of the flagship's name, when using 3DO fonts.
#define THREEDO_FLAGSHIP_NAME_TEXT_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x14, 0x0A, 0x00), 0x0C)
// Background color of the flagship's name.
#define FLAGSHIP_NAME_BACKGROUND_COLOR \
BLACK_COLOR
// Text color for the message area (at the top of the screen, on the left
// hand side, containing the name of the solar system.
#define SIS_MESSAGE_TEXT_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)
// Color of autocompleted text after the current cursor position,
// when editing in the title area.
#define SIS_MESSAGE_EXTRA_TEXT_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x12, 0x00, 0x12), 0x33)
// Background color for the message area.
#define SIS_MESSAGE_BACKGROUND_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)
// Cursor color when editing in the message area.
#define SIS_MESSAGE_CURSOR_COLOR \
BLACK_COLOR
// Text color of the title (at the top of the screen, on the right
// hand side, containing the coordinates in HyperSpace, or the planet name
// in IP.
#define SIS_TITLE_TEXT_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)
// Background color of the title.
#define SIS_TITLE_BACKGROUND_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)
// Text color of the status message, below the flagship overview, containing
// the date, RU, etc.
#define STATUS_MESSAGE_TEXT_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x10, 0x00), 0x6B)
// Background color of the status message.
#define STATUS_MESSAGE_BACKGROUND_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x08, 0x00), 0x6E)
// Pulsating color of the string "AUTO-PILOT"
#define AUTOPILOT_COLOR_CYCLE_TABLE \
{ \
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x14, 0x18), 0x5B), \
BUILD_COLOR (MAKE_RGB15 (0x06, 0x10, 0x16), 0x5C), \
BUILD_COLOR (MAKE_RGB15 (0x03, 0x0E, 0x14), 0x5D), \
BUILD_COLOR (MAKE_RGB15 (0x02, 0x0C, 0x11), 0x5E), \
BUILD_COLOR (MAKE_RGB15 (0x01, 0x0B, 0x0F), 0x5F), \
BUILD_COLOR (MAKE_RGB15 (0x01, 0x09, 0x0D), 0x60), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x07, 0x0B), 0x61), \
}
// Colors for the fuel in the fuel tanks as they are filled up,
// when viewed from the shipyard.
#define FUEL_COLOR_TABLE \
{ \
BUILD_COLOR (MAKE_RGB15 (0x0F, 0x00, 0x00), 0x2D), \
BUILD_COLOR (MAKE_RGB15 (0x13, 0x00, 0x00), 0x2C), \
BUILD_COLOR (MAKE_RGB15 (0x17, 0x00, 0x00), 0x2B), \
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x00), 0x2A), \
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7F), \
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x07, 0x00), 0x7E), \
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0A, 0x00), 0x7D), \
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0E, 0x00), 0x7C), \
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x11, 0x00), 0x7B), \
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x15, 0x00), 0x7A), \
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x18, 0x00), 0x79), \
}
// Colors for the crew in the crew pods as they are filled up,
// when viewed from the shipyard, when using PC fonts.
#define PC_CREW_COLOR_TABLE \
{ \
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x1E, 0x09), 0x65), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x1E, 0x00), 0x65), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x1B, 0x00), 0x65), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x18, 0x00), 0x65), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x15, 0x00), 0x65), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x12, 0x00), 0x65), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x10, 0x00), 0x65), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x0D, 0x00), 0x65), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x0A, 0x00), 0x65), \
BUILD_COLOR (MAKE_RGB15 (0x00, 0x07, 0x00), 0x65), \
}
// Colors for the crew in the crew pods as they are filled up,
// when viewed from the shipyard, when using 3DO fonts.
#define THREEDO_CREW_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x05, 0x10, 0x05), 0x65)
// Colors for the minerals in the storage bays as they are filled up,
// when viewed from the shipyard.
#define STORAGE_BAY_COLOR_TABLE \
{ \
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x1F, 0x1F), 0x0F), \
BUILD_COLOR (MAKE_RGB15 (0x1C, 0x1C, 0x1C), 0x11), \
BUILD_COLOR (MAKE_RGB15 (0x18, 0x18, 0x18), 0x13), \
BUILD_COLOR (MAKE_RGB15 (0x15, 0x15, 0x15), 0x15), \
BUILD_COLOR (MAKE_RGB15 (0x12, 0x12, 0x12), 0x17), \
BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19), \
BUILD_COLOR (MAKE_RGB15 (0x0D, 0x0D, 0x0D), 0x1B), \
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x1D), \
BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F), \
BUILD_COLOR (MAKE_RGB15 (0x05, 0x05, 0x05), 0x21), \
}
// Color of the storage bay indicator, as shown beneath the flagship,
// for the parts which are full.
#define STORAGE_BAY_FULL_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x08)
// Color of the storage bay indicator, as shown beneath the flagship,
// for the parts which are empty.
#define STORAGE_BAY_EMPTY_COLOR \
BUILD_COLOR (MAKE_RGB15 (0x06, 0x06, 0x06), 0x20)
// === PC Menus === // === PC Menus ===
// Background color of the PC-style menus. // Background color of the PC-style menus.
+46 -94
View File
@@ -51,24 +51,27 @@ RepairSISBorder (void)
OldContext = SetContext (ScreenContext); OldContext = SetContext (ScreenContext);
BatchGraphics (); BatchGraphics ();
// Left border
r.corner.x = SIS_ORG_X - 1; r.corner.x = SIS_ORG_X - 1;
r.corner.y = SIS_ORG_Y - 1; r.corner.y = SIS_ORG_Y - 1;
r.extent.width = 1; r.extent.width = 1;
r.extent.height = SIS_SCREEN_HEIGHT + 2; r.extent.height = SIS_SCREEN_HEIGHT + 2;
SetContextForeGroundColor ( SetContextForeGroundColor (SIS_LEFT_BORDER_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19));
DrawFilledRectangle (&r); DrawFilledRectangle (&r);
SetContextForeGroundColor ( // Right border
BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F)); SetContextForeGroundColor (SIS_BOTTOM_RIGHT_BORDER_COLOR);
r.corner.x += (SIS_SCREEN_WIDTH + 2) - 1; r.corner.x += (SIS_SCREEN_WIDTH + 2) - 1;
DrawFilledRectangle (&r); DrawFilledRectangle (&r);
// Bottom border
r.corner.x = SIS_ORG_X - 1; r.corner.x = SIS_ORG_X - 1;
r.corner.y += (SIS_SCREEN_HEIGHT + 2) - 1; r.corner.y += (SIS_SCREEN_HEIGHT + 2) - 1;
r.extent.width = SIS_SCREEN_WIDTH + 2; r.extent.width = SIS_SCREEN_WIDTH + 2;
r.extent.height = 1; r.extent.height = 1;
DrawFilledRectangle (&r); DrawFilledRectangle (&r);
UnbatchGraphics (); UnbatchGraphics ();
SetContext (OldContext); SetContext (OldContext);
@@ -117,6 +120,9 @@ ClearSISRect (BYTE ClearFlags)
SetContext (OldContext); SetContext (OldContext);
} }
// Draw the SIS title. This is the field at the top of the screen, on the
// right hand side, containing the coordinates in HyperSpace, or the planet
// name in IP.
void void
DrawSISTitle (UNICODE *pStr) DrawSISTitle (UNICODE *pStr)
{ {
@@ -140,12 +146,15 @@ DrawSISTitle (UNICODE *pStr)
SetContextFont (TinyFont); SetContextFont (TinyFont);
BatchGraphics (); BatchGraphics ();
SetContextBackGroundColor (
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)); // Background color
SetContextBackGroundColor (SIS_TITLE_BACKGROUND_COLOR);
ClearDrawable (); ClearDrawable ();
SetContextForeGroundColor (
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)); // Text color
SetContextForeGroundColor (SIS_TITLE_TEXT_COLOR);
font_DrawText (&t); font_DrawText (&t);
UnbatchGraphics (); UnbatchGraphics ();
SetContextClipRect (NULL); SetContextClipRect (NULL);
@@ -158,7 +167,7 @@ DrawHyperCoords (POINT universe)
{ {
UNICODE buf[100]; UNICODE buf[100];
sprintf (buf, "%03u.%01u : %03u.%01u", snprintf (buf, sizeof buf, "%03u.%01u : %03u.%01u",
universe.x / 10, universe.x % 10, universe.x / 10, universe.x % 10,
universe.y / 10, universe.y % 10); universe.y / 10, universe.y % 10);
@@ -171,6 +180,7 @@ DrawSISMessage (const UNICODE *pStr)
DrawSISMessageEx (pStr, -1, -1, DSME_NONE); DrawSISMessageEx (pStr, -1, -1, DSME_NONE);
} }
// See sis.h for the allowed flags.
BOOLEAN BOOLEAN
DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos, SIZE ExPos, COUNT flags) DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos, SIZE ExPos, COUNT flags)
{ {
@@ -189,8 +199,7 @@ DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos, SIZE ExPos, COUNT flags)
SetContextClipRect (&r); SetContextClipRect (&r);
BatchGraphics (); BatchGraphics ();
SetContextBackGroundColor ( SetContextBackGroundColor (SIS_MESSAGE_BACKGROUND_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01));
if (pStr == 0) if (pStr == 0)
{ {
@@ -222,8 +231,7 @@ DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos, SIZE ExPos, COUNT flags)
} }
if (!(flags & DSME_MYCOLOR)) if (!(flags & DSME_MYCOLOR))
SetContextForeGroundColor ( SetContextForeGroundColor (SIS_MESSAGE_TEXT_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33));
t.baseline.y = SIS_MESSAGE_HEIGHT - 2; t.baseline.y = SIS_MESSAGE_HEIGHT - 2;
t.pStr = pStr; t.pStr = pStr;
@@ -296,12 +304,11 @@ DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos, SIZE ExPos, COUNT flags)
cur_r.corner.y = 0; cur_r.corner.y = 0;
cur_r.extent.height = r.extent.height; cur_r.extent.height = r.extent.height;
SetContextForeGroundColor (BLACK_COLOR); SetContextForeGroundColor (SIS_MESSAGE_CURSOR_COLOR);
DrawFilledRectangle (&cur_r); DrawFilledRectangle (&cur_r);
} }
SetContextForeGroundColor ( SetContextForeGroundColor (SIS_MESSAGE_TEXT_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33));
if (ExPos >= 0 && ExPos < t.CharCount) if (ExPos >= 0 && ExPos < t.CharCount)
{ // handle extra characters { // handle extra characters
@@ -309,8 +316,7 @@ DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos, SIZE ExPos, COUNT flags)
font_DrawText (&t); font_DrawText (&t);
// print extra chars // print extra chars
SetContextForeGroundColor ( SetContextForeGroundColor (SIS_MESSAGE_EXTRA_TEXT_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x12, 0x00, 0x12), 0x33));
for (i = ExPos, pchar_deltas = char_deltas; i > 0; --i) for (i = ExPos, pchar_deltas = char_deltas; i > 0; --i)
t.baseline.x += (SIZE)*pchar_deltas++; t.baseline.x += (SIZE)*pchar_deltas++;
t.pStr = skipUTF8Chars (t.pStr, ExPos); t.pStr = skipUTF8Chars (t.pStr, ExPos);
@@ -366,8 +372,7 @@ DrawStatusMessage (const UNICODE *pStr)
SetContextClipRect (&r); SetContextClipRect (&r);
BatchGraphics (); BatchGraphics ();
SetContextBackGroundColor ( SetContextBackGroundColor (STATUS_MESSAGE_BACKGROUND_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x00, 0x08, 0x00), 0x6E));
ClearDrawable (); ClearDrawable ();
if (!pStr) if (!pStr)
@@ -412,8 +417,7 @@ DrawStatusMessage (const UNICODE *pStr)
t.CharCount = (COUNT)~0; t.CharCount = (COUNT)~0;
SetContextFont (TinyFont); SetContextFont (TinyFont);
SetContextForeGroundColor ( SetContextForeGroundColor (STATUS_MESSAGE_TEXT_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x00, 0x10, 0x00), 0x6B));
font_DrawText (&t); font_DrawText (&t);
UnbatchGraphics (); UnbatchGraphics ();
@@ -441,8 +445,7 @@ DrawCaptainsName (void)
OldContext = SetContext (StatusContext); OldContext = SetContext (StatusContext);
OldFont = SetContextFont (TinyFont); OldFont = SetContextFont (TinyFont);
OldColor = SetContextForeGroundColor ( OldColor = SetContextForeGroundColor (CAPTAIN_NAME_BACKGROUND_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01));
r.corner.x = 2 + 1; r.corner.x = 2 + 1;
r.corner.y = 10; r.corner.y = 10;
@@ -455,8 +458,7 @@ DrawCaptainsName (void)
t.align = ALIGN_CENTER; t.align = ALIGN_CENTER;
t.pStr = GLOBAL_SIS (CommanderName); t.pStr = GLOBAL_SIS (CommanderName);
t.CharCount = (COUNT)~0; t.CharCount = (COUNT)~0;
SetContextForeGroundColor ( SetContextForeGroundColor (CAPTAIN_NAME_TEXT_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x16, 0x0B, 0x1F), 0x38));
font_DrawText (&t); font_DrawText (&t);
SetContextForeGroundColor (OldColor); SetContextForeGroundColor (OldColor);
@@ -504,7 +506,7 @@ DrawFlagshipName (BOOLEAN InStatusArea)
strupr (buf); strupr (buf);
} }
OldFontEffect = SetContextFontEffect (NULL); OldFontEffect = SetContextFontEffect (NULL);
OldColor = SetContextForeGroundColor (BLACK_COLOR); OldColor = SetContextForeGroundColor (FLAGSHIP_NAME_BACKGROUND_COLOR);
DrawFilledRectangle (&r); DrawFilledRectangle (&r);
t.baseline.x = r.corner.x + (r.extent.width >> 1); t.baseline.x = r.corner.x + (r.extent.width >> 1);
@@ -515,8 +517,7 @@ DrawFlagshipName (BOOLEAN InStatusArea)
SetContextFontEffect (SetAbsFrameIndex (FontGradFrame, SetContextFontEffect (SetAbsFrameIndex (FontGradFrame,
InStatusArea ? 0 : 3)); InStatusArea ? 0 : 3));
else else
SetContextForeGroundColor ( SetContextForeGroundColor (THREEDO_FLAGSHIP_NAME_TEXT_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x14, 0x0A, 0x00), 0x0C));
font_DrawText (&t); font_DrawText (&t);
@@ -741,6 +742,7 @@ DrawLanders (void)
SetContext (OldContext); SetContext (OldContext);
} }
// Draw the storage bays, beneath the picture of the flagship.
void void
DrawStorageBays (BOOLEAN Refresh) DrawStorageBays (BOOLEAN Refresh)
{ {
@@ -770,8 +772,7 @@ DrawStorageBays (BOOLEAN Refresh)
r.corner.x = (STATUS_WIDTH >> 1) r.corner.x = (STATUS_WIDTH >> 1)
- ((i * (r.extent.width + 1)) >> 1); - ((i * (r.extent.width + 1)) >> 1);
SetContextForeGroundColor ( SetContextForeGroundColor (STORAGE_BAY_FULL_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x08));
for (j = GLOBAL_SIS (TotalElementMass); for (j = GLOBAL_SIS (TotalElementMass);
j >= STORAGE_BAY_CAPACITY; j -= STORAGE_BAY_CAPACITY) j >= STORAGE_BAY_CAPACITY; j -= STORAGE_BAY_CAPACITY)
{ {
@@ -791,8 +792,7 @@ DrawStorageBays (BOOLEAN Refresh)
if (r.extent.height) if (r.extent.height)
{ {
r.corner.y = 123; r.corner.y = 123;
SetContextForeGroundColor ( SetContextForeGroundColor (STORAGE_BAY_EMPTY_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x06, 0x06, 0x06), 0x20));
DrawFilledRectangle (&r); DrawFilledRectangle (&r);
} }
r.corner.x += r.extent.width + 1; r.corner.x += r.extent.width + 1;
@@ -801,8 +801,7 @@ DrawStorageBays (BOOLEAN Refresh)
} }
r.extent.height = 4; r.extent.height = 4;
SetContextForeGroundColor ( SetContextForeGroundColor (STORAGE_BAY_EMPTY_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x06, 0x06, 0x06), 0x20));
while (i--) while (i--)
{ {
DrawFilledRectangle (&r); DrawFilledRectangle (&r);
@@ -854,15 +853,16 @@ DrawPC_SIS (void)
font_DrawText (&t); font_DrawText (&t);
SetContextFontEffect (NULL); SetContextFontEffect (NULL);
// Background of text "CAPTAIN".
r.corner.x = 2 + 1; r.corner.x = 2 + 1;
r.corner.y = 3; r.corner.y = 3;
r.extent.width = 58; r.extent.width = 58;
r.extent.height = 7; r.extent.height = 7;
SetContextForeGroundColor ( SetContextForeGroundColor (PC_CAPTAIN_STRING_BACKGROUND_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01));
DrawFilledRectangle (&r); DrawFilledRectangle (&r);
SetContextForeGroundColor (
BUILD_COLOR (MAKE_RGB15 (0x02, 0x04, 0x1E), 0x38)); // Text "CAPTAIN".
SetContextForeGroundColor (PC_CAPTAIN_STRING_TEXT_COLOR);
t.baseline.y = r.corner.y + 6; t.baseline.y = r.corner.y + 6;
t.pStr = GAME_STRING (STATUS_STRING_BASE + 5); // "CAPTAIN" t.pStr = GAME_STRING (STATUS_STRING_BASE + 5); // "CAPTAIN"
font_DrawText (&t); font_DrawText (&t);
@@ -1104,19 +1104,7 @@ GetCPodCapacity (POINT *ppt)
GLOBAL_SIS (CrewEnlisted)) GLOBAL_SIS (CrewEnlisted))
{ {
COUNT pod_remainder, which_row; COUNT pod_remainder, which_row;
static const COLOR crew_rows[] = static const COLOR crew_rows[] = PC_CREW_COLOR_TABLE;
{
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x1E, 0x09), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x1E, 0x00), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x1B, 0x00), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x18, 0x00), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x15, 0x00), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x12, 0x00), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x10, 0x00), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x0D, 0x00), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x0A, 0x00), 0x65),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x07, 0x00), 0x65),
};
pod_remainder = GLOBAL_SIS (CrewEnlisted) - capacity; pod_remainder = GLOBAL_SIS (CrewEnlisted) - capacity;
@@ -1127,8 +1115,7 @@ GetCPodCapacity (POINT *ppt)
if (optWhichFonts == OPT_PC) if (optWhichFonts == OPT_PC)
SetContextForeGroundColor (crew_rows[which_row]); SetContextForeGroundColor (crew_rows[which_row]);
else else
SetContextForeGroundColor ( SetContextForeGroundColor (THREEDO_CREW_COLOR);
BUILD_COLOR (MAKE_RGB15 (0x05, 0x10, 0x05), 0x65));
} }
capacity += CREW_POD_CAPACITY; capacity += CREW_POD_CAPACITY;
@@ -1159,19 +1146,7 @@ GetSBayCapacity (POINT *ppt)
GLOBAL_SIS (TotalElementMass)) GLOBAL_SIS (TotalElementMass))
{ {
COUNT bay_remainder, which_row; COUNT bay_remainder, which_row;
static const COLOR color_bars[] = static const COLOR color_bars[] = STORAGE_BAY_COLOR_TABLE;
{
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x1F, 0x1F), 0x0F),
BUILD_COLOR (MAKE_RGB15 (0x1C, 0x1C, 0x1C), 0x11),
BUILD_COLOR (MAKE_RGB15 (0x18, 0x18, 0x18), 0x13),
BUILD_COLOR (MAKE_RGB15 (0x15, 0x15, 0x15), 0x15),
BUILD_COLOR (MAKE_RGB15 (0x12, 0x12, 0x12), 0x17),
BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19),
BUILD_COLOR (MAKE_RGB15 (0x0D, 0x0D, 0x0D), 0x1B),
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x1D),
BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F),
BUILD_COLOR (MAKE_RGB15 (0x05, 0x05, 0x05), 0x21),
};
bay_remainder = GLOBAL_SIS (TotalElementMass) - capacity; bay_remainder = GLOBAL_SIS (TotalElementMass) - capacity;
which_row = bay_remainder / SBAY_MASS_PER_ROW; which_row = bay_remainder / SBAY_MASS_PER_ROW;
@@ -1218,20 +1193,7 @@ GetFTankCapacity (POINT *ppt)
GLOBAL_SIS (FuelOnBoard)) GLOBAL_SIS (FuelOnBoard))
{ {
COUNT which_row; COUNT which_row;
static const COLOR fuel_colors[] = static const COLOR fuel_colors[] = FUEL_COLOR_TABLE;
{
BUILD_COLOR (MAKE_RGB15 (0x0F, 0x00, 0x00), 0x2D),
BUILD_COLOR (MAKE_RGB15 (0x13, 0x00, 0x00), 0x2C),
BUILD_COLOR (MAKE_RGB15 (0x17, 0x00, 0x00), 0x2B),
BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x00), 0x2A),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x03, 0x00), 0x7F),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x07, 0x00), 0x7E),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0A, 0x00), 0x7D),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x0E, 0x00), 0x7C),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x11, 0x00), 0x7B),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x15, 0x00), 0x7A),
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x18, 0x00), 0x79),
};
which_row = (COUNT)( which_row = (COUNT)(
(GLOBAL_SIS (FuelOnBoard) - capacity) (GLOBAL_SIS (FuelOnBoard) - capacity)
@@ -1297,20 +1259,10 @@ DrawAutoPilotMessage (BOOLEAN Reset)
static DWORD cycle_index = 0; static DWORD cycle_index = 0;
BOOLEAN OnAutoPilot; BOOLEAN OnAutoPilot;
static const COLOR cycle_tab[] = static const COLOR cycle_tab[] = AUTOPILOT_COLOR_CYCLE_TABLE;
{ const size_t cycleCount = sizeof cycle_tab / sizeof cycle_tab[0];
BUILD_COLOR (MAKE_RGB15 (0x0A, 0x14, 0x18), 0x5B),
BUILD_COLOR (MAKE_RGB15 (0x06, 0x10, 0x16), 0x5C),
BUILD_COLOR (MAKE_RGB15 (0x03, 0x0E, 0x14), 0x5D),
BUILD_COLOR (MAKE_RGB15 (0x02, 0x0C, 0x11), 0x5E),
BUILD_COLOR (MAKE_RGB15 (0x01, 0x0B, 0x0F), 0x5F),
BUILD_COLOR (MAKE_RGB15 (0x01, 0x09, 0x0D), 0x60),
BUILD_COLOR (MAKE_RGB15 (0x00, 0x07, 0x0B), 0x61),
};
#define NUM_CYCLES (sizeof (cycle_tab) / sizeof (cycle_tab[0]))
#define BLINK_RATE (ONE_SECOND * 3 / 40) // 9 @ 120 ticks/second #define BLINK_RATE (ONE_SECOND * 3 / 40) // 9 @ 120 ticks/second
if (Reset) if (Reset)
{ // Just a reset, not drawing { // Just a reset, not drawing
LastPilot = FALSE; LastPilot = FALSE;
@@ -1349,7 +1301,7 @@ DrawAutoPilotMessage (BOOLEAN Reset)
SetContext (OldContext); SetContext (OldContext);
} }
cycle_index = (cycle_index + 1) % NUM_CYCLES; cycle_index = (cycle_index + 1) % cycleCount;
NextTime = GetTimeCounter () + BLINK_RATE; NextTime = GetTimeCounter () + BLINK_RATE;
} }
+10 -2
View File
@@ -166,13 +166,21 @@ extern void SetFlashRect (RECT *pRect);
#define SFR_MENU_ANY ((RECT*)~1L) #define SFR_MENU_ANY ((RECT*)~1L)
extern void DrawHyperCoords (POINT puniverse); extern void DrawHyperCoords (POINT puniverse);
extern void DrawSISTitle (UNICODE *pStr); extern void DrawSISTitle (UNICODE *pStr);
extern BOOLEAN DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos,
SIZE ExPos, COUNT flags); // Flags for DrawSISMessageEx (may be OR'ed):
#define DSME_NONE 0 #define DSME_NONE 0
#define DSME_SETFR (1 << 0) #define DSME_SETFR (1 << 0)
// Set the flash rectangle to the message area.
#define DSME_CLEARFR (1 << 1) #define DSME_CLEARFR (1 << 1)
// Disable the flash rectangle.
#define DSME_BLOCKCUR (1 << 2) #define DSME_BLOCKCUR (1 << 2)
// Use a block cursor instead of an insertion point cursor,
// when editing in the message field.
#define DSME_MYCOLOR (1 << 3) #define DSME_MYCOLOR (1 << 3)
// Use the current foreground color, instead of the default.
extern BOOLEAN DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos,
SIZE ExPos, COUNT flags);
extern void DrawSISMessage (const UNICODE *pStr); extern void DrawSISMessage (const UNICODE *pStr);
extern void DateToString (unsigned char *buf, size_t bufLen, extern void DateToString (unsigned char *buf, size_t bufLen,
BYTE month_index, BYTE day_index, COUNT year_index); BYTE month_index, BYTE day_index, COUNT year_index);