Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs16:/tmp/cvs-serv22272/src Modified Files: colors.c defaults.c dmessage.c local.c map.c mswindow.c Log Message: Yanked RACE_COLOR define, this is standard now. Moved color defines to a common area (defs.h). Added new color to colortable for God messages (default is white). Added all color settings to netrekrc, and added them to the in game save function. The settings in netrekrc are to the "bright" color settings, as players seem to prefer these. Bug fix with phaser misses (check to make sure x,y less than GWIDTH) Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- mswindow.c 11 Apr 2007 08:03:08 -0000 1.67 +++ mswindow.c 11 Apr 2007 23:06:34 -0000 1.68 @@ -41,35 +41,6 @@ #include "resource.h" #include "math.h" -#undef WHITE -#undef BLACK -#undef RED -#undef GREEN -#undef YELLOW -#undef CYAN - -#define WHITE 0 -#define BLACK 1 -#define RED 2 -#define GREEN 3 -#define YELLOW 4 -#define CYAN 5 -#define GREY 6 - -#ifdef RACE_COLORS -#define C_ROM 7 -#define C_KLI 8 -#define C_FED 9 -#define C_ORI 10 -#define C_IND 11 -#endif - -#ifdef RACE_COLORS -#define COLORS 12 -#else -#define COLORS 7 -#endif - #define RaceDefaultOffset (C_ROM - RED) @@ -211,10 +182,8 @@ W_Font W_HighlightFont, W_UnderlineFont; W_Color W_White = WHITE, W_Black = BLACK, W_Red = RED, W_Green = GREEN; W_Color W_Yellow = YELLOW, W_Cyan = CYAN, W_Grey = GREY; -#ifdef RACE_COLORS -W_Color W_Ind = C_IND, W_Fed = C_FED, W_Rom = C_ROM, W_Kli = C_KLI, W_Ori = +W_Color W_God = C_GOD, W_Ind = C_IND, W_Fed = C_FED, W_Rom = C_ROM, W_Kli = C_KLI, W_Ori = C_ORI; -#endif int W_Textwidth = 6, W_Textheight = 10; int forceMono = 0; @@ -260,7 +229,9 @@ , //Cyan { RGB (0xa0, 0xa0, 0xa0), 0, 0, 0} //Light grey -#ifdef RACE_COLORS + , + { + RGB (0xff, 0xff, 0xff), 0, 0, 0} //God , { RGB (0xff, 0x5f, 0x5f), 0, 0, 0} @@ -276,7 +247,6 @@ , //Ori { RGB (0xa0, 0xa0, 0xa0), 0, 0, 0} //Ind -#endif } , @@ -304,7 +274,9 @@ , //Cyan { RGB (0xa0, 0xa0, 0xa0), 0, 0, 0} //Light grey -#ifdef RACE_COLORS + , + { + RGB (0xff, 0xff, 0xff), 0, 0, 0} //God , { RGB (0xff, 0x00, 0x00), 0, 0, 0} @@ -320,7 +292,6 @@ , //Ori { RGB (0xa0, 0xa0, 0xa0), 0, 0, 0} //Ind -#endif }; char *colornames[COLORS] = { @@ -330,15 +301,13 @@ {"green"}, {"yellow"}, {"cyan"}, - {"light grey"} -#ifdef RACE_COLORS - , + {"light grey"}, + {"God"}, {"Rom"}, {"Kli"}, {"Fed"}, {"Ori"}, {"Ind"} -#endif }; HPALETTE NetrekPalette = 0; @@ -968,13 +937,11 @@ char buf[30]; sprintf (buf, "color.%s", colornames[i]); //Check netrekrc file def = stringDefault (buf); -#ifdef RACE_COLORS - if (!def && i >= COLORS - RaceDefaultOffset) // For race colors we use default color + if (!def && i >= COLORS - RaceDefaultOffset) // For race colors we use default color { // color for that race if not set, i.e. sprintf (buf, "color.%s", colornames[i - RaceDefaultOffset]); def = stringDefault (buf); // if "color.rom" is not set, "color.red" } -#endif if (def) if (def[0] == '#') //Explicit RGB color { Index: dmessage.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dmessage.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- dmessage.c 28 Feb 2007 12:21:50 -0000 1.8 +++ dmessage.c 11 Apr 2007 23:06:33 -0000 1.9 @@ -142,7 +142,7 @@ if (from == 255) { /* From God */ - color = textColor; + color = W_God; } else { Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- local.c 11 Apr 2007 08:03:08 -0000 1.94 +++ local.c 11 Apr 2007 23:06:34 -0000 1.95 @@ -1588,7 +1588,7 @@ /* Here I will have to compute end coordinate */ /* Server will sometimes send us this information though, so check if we have it first */ - if (php->ph_x > 0 && php->ph_y > 0) + if (php->ph_x > 0 && php->ph_y > 0 && php->ph_x < GWIDTH && php->ph_y < GWIDTH) { tx = (php->ph_x - me->p_x) / scaleFactor + TWINSIDE / 2; ty = (php->ph_y - me->p_y) / scaleFactor + TWINSIDE / 2; Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- defaults.c 10 Apr 2007 00:44:03 -0000 1.75 +++ defaults.c 11 Apr 2007 23:06:33 -0000 1.76 @@ -3308,6 +3308,24 @@ #endif if (saveBig) + fputs ("# Color settings\n", fp); + + for (j = 0; j < COLORS; j++) + { + sprintf (str1, "color.%s", colornames[j]); + adefault = stringDefault (str1); + if (adefault) + { + sprintf(str, "%s: %s\n", str1, adefault); + fputs (str, fp); + } + } + fputs ("\n", fp); + + if (saveBig) + fputs ("\n", fp); + + if (saveBig) { fputs ("# Esoteric features such as individual ship rcfiles/keymaps\n", fp); fputs ("# /ckeymaps/buttonmaps (i.e. keymap-ca: <keymap>) and observer\n", fp); Index: colors.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/colors.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- colors.c 21 Jan 2003 21:28:39 -0000 1.1.1.1 +++ colors.c 11 Apr 2007 23:06:33 -0000 1.2 @@ -19,19 +19,11 @@ foreColor = W_White; textColor = W_White; -#ifdef RACE_COLORS shipCol[0] = W_Ind; shipCol[1] = W_Fed; shipCol[2] = W_Rom; shipCol[3] = W_Kli; shipCol[4] = W_Ori; -#else - shipCol[0] = W_Grey; - shipCol[1] = W_Yellow; - shipCol[2] = W_Red; - shipCol[3] = W_Green; - shipCol[4] = W_Cyan; -#endif warningColor = W_Red; unColor = W_Grey; Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- map.c 11 Apr 2007 01:10:05 -0000 1.49 +++ map.c 11 Apr 2007 23:06:34 -0000 1.50 @@ -1208,7 +1208,7 @@ /* Here I will have to compute end coordinate */ /* Server will sometimes send us this information though, so check if we have it first */ - if (ph->ph_x > 0 && ph->ph_y > 0) + if (ph->ph_x > 0 && ph->ph_y > 0 && ph->ph_x < GWIDTH && ph->ph_y < GWIDTH) { tx = ph->ph_x * GWINSIDE / GWIDTH; ty = ph->ph_y * GWINSIDE / GWIDTH;