From: <Mee...@us...> - 2009-11-22 17:58:40
|
Revision: 3342 http://sc2.svn.sourceforge.net/sc2/?rev=3342&view=rev Author: Meep-Eep Date: 2009-11-22 17:58:28 +0000 (Sun, 22 Nov 2009) Log Message: ----------- Give more colors a name, and move them to colors.h Modified Paths: -------------- trunk/sc2/src/uqm/colors.h trunk/sc2/src/uqm/sis.c trunk/sc2/src/uqm/sis.h Modified: trunk/sc2/src/uqm/colors.h =================================================================== --- trunk/sc2/src/uqm/colors.h 2009-11-22 17:47:12 UTC (rev 3341) +++ trunk/sc2/src/uqm/colors.h 2009-11-22 17:58:28 UTC (rev 3342) @@ -156,6 +156,154 @@ 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 === // Background color of the PC-style menus. Modified: trunk/sc2/src/uqm/sis.c =================================================================== --- trunk/sc2/src/uqm/sis.c 2009-11-22 17:47:12 UTC (rev 3341) +++ trunk/sc2/src/uqm/sis.c 2009-11-22 17:58:28 UTC (rev 3342) @@ -51,24 +51,27 @@ OldContext = SetContext (ScreenContext); BatchGraphics (); + + // Left border r.corner.x = SIS_ORG_X - 1; r.corner.y = SIS_ORG_Y - 1; r.extent.width = 1; r.extent.height = SIS_SCREEN_HEIGHT + 2; - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19)); + SetContextForeGroundColor (SIS_LEFT_BORDER_COLOR); DrawFilledRectangle (&r); - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F)); + // Right border + SetContextForeGroundColor (SIS_BOTTOM_RIGHT_BORDER_COLOR); r.corner.x += (SIS_SCREEN_WIDTH + 2) - 1; DrawFilledRectangle (&r); + // Bottom border r.corner.x = SIS_ORG_X - 1; r.corner.y += (SIS_SCREEN_HEIGHT + 2) - 1; r.extent.width = SIS_SCREEN_WIDTH + 2; r.extent.height = 1; DrawFilledRectangle (&r); + UnbatchGraphics (); SetContext (OldContext); @@ -117,6 +120,9 @@ 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 DrawSISTitle (UNICODE *pStr) { @@ -140,12 +146,15 @@ SetContextFont (TinyFont); BatchGraphics (); - SetContextBackGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)); + + // Background color + SetContextBackGroundColor (SIS_TITLE_BACKGROUND_COLOR); ClearDrawable (); - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)); + + // Text color + SetContextForeGroundColor (SIS_TITLE_TEXT_COLOR); font_DrawText (&t); + UnbatchGraphics (); SetContextClipRect (NULL); @@ -158,7 +167,7 @@ { UNICODE buf[100]; - sprintf (buf, "%03u.%01u : %03u.%01u", + snprintf (buf, sizeof buf, "%03u.%01u : %03u.%01u", universe.x / 10, universe.x % 10, universe.y / 10, universe.y % 10); @@ -171,6 +180,7 @@ DrawSISMessageEx (pStr, -1, -1, DSME_NONE); } +// See sis.h for the allowed flags. BOOLEAN DrawSISMessageEx (const UNICODE *pStr, SIZE CurPos, SIZE ExPos, COUNT flags) { @@ -189,8 +199,7 @@ SetContextClipRect (&r); BatchGraphics (); - SetContextBackGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)); + SetContextBackGroundColor (SIS_MESSAGE_BACKGROUND_COLOR); if (pStr == 0) { @@ -222,8 +231,7 @@ } if (!(flags & DSME_MYCOLOR)) - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)); + SetContextForeGroundColor (SIS_MESSAGE_TEXT_COLOR); t.baseline.y = SIS_MESSAGE_HEIGHT - 2; t.pStr = pStr; @@ -296,12 +304,11 @@ cur_r.corner.y = 0; cur_r.extent.height = r.extent.height; - SetContextForeGroundColor (BLACK_COLOR); + SetContextForeGroundColor (SIS_MESSAGE_CURSOR_COLOR); DrawFilledRectangle (&cur_r); } - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)); + SetContextForeGroundColor (SIS_MESSAGE_TEXT_COLOR); if (ExPos >= 0 && ExPos < t.CharCount) { // handle extra characters @@ -309,8 +316,7 @@ font_DrawText (&t); // print extra chars - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x12, 0x00, 0x12), 0x33)); + SetContextForeGroundColor (SIS_MESSAGE_EXTRA_TEXT_COLOR); for (i = ExPos, pchar_deltas = char_deltas; i > 0; --i) t.baseline.x += (SIZE)*pchar_deltas++; t.pStr = skipUTF8Chars (t.pStr, ExPos); @@ -366,8 +372,7 @@ SetContextClipRect (&r); BatchGraphics (); - SetContextBackGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x00, 0x08, 0x00), 0x6E)); + SetContextBackGroundColor (STATUS_MESSAGE_BACKGROUND_COLOR); ClearDrawable (); if (!pStr) @@ -412,8 +417,7 @@ t.CharCount = (COUNT)~0; SetContextFont (TinyFont); - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x00, 0x10, 0x00), 0x6B)); + SetContextForeGroundColor (STATUS_MESSAGE_TEXT_COLOR); font_DrawText (&t); UnbatchGraphics (); @@ -441,8 +445,7 @@ OldContext = SetContext (StatusContext); OldFont = SetContextFont (TinyFont); - OldColor = SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)); + OldColor = SetContextForeGroundColor (CAPTAIN_NAME_BACKGROUND_COLOR); r.corner.x = 2 + 1; r.corner.y = 10; @@ -455,8 +458,7 @@ t.align = ALIGN_CENTER; t.pStr = GLOBAL_SIS (CommanderName); t.CharCount = (COUNT)~0; - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x16, 0x0B, 0x1F), 0x38)); + SetContextForeGroundColor (CAPTAIN_NAME_TEXT_COLOR); font_DrawText (&t); SetContextForeGroundColor (OldColor); @@ -504,7 +506,7 @@ strupr (buf); } OldFontEffect = SetContextFontEffect (NULL); - OldColor = SetContextForeGroundColor (BLACK_COLOR); + OldColor = SetContextForeGroundColor (FLAGSHIP_NAME_BACKGROUND_COLOR); DrawFilledRectangle (&r); t.baseline.x = r.corner.x + (r.extent.width >> 1); @@ -515,8 +517,7 @@ SetContextFontEffect (SetAbsFrameIndex (FontGradFrame, InStatusArea ? 0 : 3)); else - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x14, 0x0A, 0x00), 0x0C)); + SetContextForeGroundColor (THREEDO_FLAGSHIP_NAME_TEXT_COLOR); font_DrawText (&t); @@ -741,6 +742,7 @@ SetContext (OldContext); } +// Draw the storage bays, beneath the picture of the flagship. void DrawStorageBays (BOOLEAN Refresh) { @@ -770,8 +772,7 @@ r.corner.x = (STATUS_WIDTH >> 1) - ((i * (r.extent.width + 1)) >> 1); - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x08)); + SetContextForeGroundColor (STORAGE_BAY_FULL_COLOR); for (j = GLOBAL_SIS (TotalElementMass); j >= STORAGE_BAY_CAPACITY; j -= STORAGE_BAY_CAPACITY) { @@ -791,8 +792,7 @@ if (r.extent.height) { r.corner.y = 123; - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x06, 0x06, 0x06), 0x20)); + SetContextForeGroundColor (STORAGE_BAY_EMPTY_COLOR); DrawFilledRectangle (&r); } r.corner.x += r.extent.width + 1; @@ -801,8 +801,7 @@ } r.extent.height = 4; - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x06, 0x06, 0x06), 0x20)); + SetContextForeGroundColor (STORAGE_BAY_EMPTY_COLOR); while (i--) { DrawFilledRectangle (&r); @@ -854,15 +853,16 @@ font_DrawText (&t); SetContextFontEffect (NULL); + // Background of text "CAPTAIN". r.corner.x = 2 + 1; r.corner.y = 3; r.extent.width = 58; r.extent.height = 7; - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)); + SetContextForeGroundColor (PC_CAPTAIN_STRING_BACKGROUND_COLOR); 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.pStr = GAME_STRING (STATUS_STRING_BASE + 5); // "CAPTAIN" font_DrawText (&t); @@ -1104,19 +1104,7 @@ GLOBAL_SIS (CrewEnlisted)) { COUNT pod_remainder, which_row; - static const COLOR crew_rows[] = - { - 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), - }; + static const COLOR crew_rows[] = PC_CREW_COLOR_TABLE; pod_remainder = GLOBAL_SIS (CrewEnlisted) - capacity; @@ -1127,8 +1115,7 @@ if (optWhichFonts == OPT_PC) SetContextForeGroundColor (crew_rows[which_row]); else - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x05, 0x10, 0x05), 0x65)); + SetContextForeGroundColor (THREEDO_CREW_COLOR); } capacity += CREW_POD_CAPACITY; @@ -1159,19 +1146,7 @@ GLOBAL_SIS (TotalElementMass)) { COUNT bay_remainder, which_row; - static const COLOR color_bars[] = - { - 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), - }; + static const COLOR color_bars[] = STORAGE_BAY_COLOR_TABLE; bay_remainder = GLOBAL_SIS (TotalElementMass) - capacity; which_row = bay_remainder / SBAY_MASS_PER_ROW; @@ -1218,20 +1193,7 @@ GLOBAL_SIS (FuelOnBoard)) { COUNT which_row; - static const COLOR fuel_colors[] = - { - 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), - }; + static const COLOR fuel_colors[] = FUEL_COLOR_TABLE; which_row = (COUNT)( (GLOBAL_SIS (FuelOnBoard) - capacity) @@ -1297,20 +1259,10 @@ static DWORD cycle_index = 0; BOOLEAN OnAutoPilot; - static const COLOR cycle_tab[] = - { - 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])) + static const COLOR cycle_tab[] = AUTOPILOT_COLOR_CYCLE_TABLE; + const size_t cycleCount = sizeof cycle_tab / sizeof cycle_tab[0]; #define BLINK_RATE (ONE_SECOND * 3 / 40) // 9 @ 120 ticks/second - if (Reset) { // Just a reset, not drawing LastPilot = FALSE; @@ -1349,7 +1301,7 @@ SetContext (OldContext); } - cycle_index = (cycle_index + 1) % NUM_CYCLES; + cycle_index = (cycle_index + 1) % cycleCount; NextTime = GetTimeCounter () + BLINK_RATE; } Modified: trunk/sc2/src/uqm/sis.h =================================================================== --- trunk/sc2/src/uqm/sis.h 2009-11-22 17:47:12 UTC (rev 3341) +++ trunk/sc2/src/uqm/sis.h 2009-11-22 17:58:28 UTC (rev 3342) @@ -166,13 +166,21 @@ #define SFR_MENU_ANY ((RECT*)~1L) extern void DrawHyperCoords (POINT puniverse); 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_SETFR (1 << 0) + // Set the flash rectangle to the message area. #define DSME_CLEARFR (1 << 1) + // Disable the flash rectangle. #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) + // 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 DateToString (unsigned char *buf, size_t bufLen, BYTE month_index, BYTE day_index, COUNT year_index); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |