Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3021/src
Modified Files:
data.c defaults.c local.c mswindow.c newwin.c option.c
Log Message:
Addition of color weapons, based on COW/TedTurner, but made better :).
Index: mswindow.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mswindow.c 21 Apr 2006 12:00:07 -0000 1.7
+++ mswindow.c 29 Apr 2006 19:22:38 -0000 1.8
@@ -444,18 +444,39 @@
// Free other bitmaps
free (clockpic);
+ for (j = 0; j < NUM_CTORP_TYPES; j++)
+ {
+ for (i = 0; i < BMP_TORPDET_FRAMES; i++)
+ {
+ free (cloudC[j][i]);
+ free (plcloudC[j][i]);
+ }
+ for (i = 0; i < BMP_TORP_FRAMES; i++)
+ {
+ free (torpC[j][i]);
+ free (mtorpC[j][i]);
+ free (plasmaC[j][i]);
+ free (mplasmaC[j][i]);
+ }
+
+ }
+ free (torp_cloud_bitmaps);
+ free (plasma_cloud_bitmaps);
+ free (mtorp_bitmaps);
+ free (torp_bitmaps);
+ free (mplasma_bitmaps);
+ free (plasma_bitmaps);
+
for (i = 0; i < BMP_TORPDET_FRAMES; i++)
{
free (cloud[i]);
free (plasmacloud[i]);
}
-
-#ifdef COLORIZEWEAPON
free (etorp);
free (mtorp);
free (eplasmatorp);
free (mplasmatorp);
-#endif /* COLORIZEWEAPON */
+
for (i = 0; i < PLANET_VIEWS; i++)
free (bplanets[i]);
@@ -3548,8 +3569,7 @@
HBITMAP temp = 0;
FNHEADER;
- //Allocate memory for the bitmap structure and convert the
- //X11 bitmap into a useful form
+ //Allocate memory for the bitmap structure
if (!(bitmap = (struct Icon *) malloc (sizeof (struct Icon))))
goto memfail;
@@ -3609,8 +3629,7 @@
HBITMAP temp = 0;
FNHEADER;
- //Allocate memory for the bitmap structure and convert the
- //X11 bitmap into a useful form
+ //Allocate memory for the bitmap structure
if (!(bitmap = (struct Icon *) malloc (sizeof (struct Icon))))
goto memfail;
Index: newwin.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- newwin.c 26 Apr 2006 02:04:24 -0000 1.12
+++ newwin.c 29 Apr 2006 19:22:38 -0000 1.13
@@ -419,6 +419,87 @@
}
}
}
+
+/******************************************************************************/
+/*** loadweaponsC() - colorized weapons
+/******************************************************************************/
+void loadweaponsC()
+{
+ int j,k;
+
+ /* Load the four 6x8 weapon bitmaps */
+ torp_bitmaps =
+ W_StoreBitmap3 ("bitmaps/weaplibm/color/torpC.bmp",
+ BMP_CTORP_WIDTH * NUM_CTORP_TYPES,
+ BMP_CTORP_HEIGHT * BMP_TORP_FRAMES, BMP_TORPC, w,
+ LR_DEFAULTCOLOR);
+ mtorp_bitmaps =
+ W_StoreBitmap3 ("bitmaps/weaplibm/color/mtorpC.bmp",
+ BMP_CTORP_WIDTH * NUM_CTORP_TYPES,
+ BMP_CTORP_HEIGHT * BMP_TORP_FRAMES, BMP_MTORPC, w,
+ LR_DEFAULTCOLOR);
+ plasma_bitmaps =
+ W_StoreBitmap3 ("bitmaps/weaplibm/color/plasmaC.bmp",
+ BMP_CPLASMATORP_WIDTH * NUM_CTORP_TYPES,
+ BMP_CPLASMATORP_HEIGHT * BMP_TORP_FRAMES, BMP_PLASMAC, w,
+ LR_DEFAULTCOLOR);
+ mplasma_bitmaps =
+ W_StoreBitmap3 ("bitmaps/weaplibm/color/mplasmaC.bmp",
+ BMP_CPLASMATORP_WIDTH * NUM_CTORP_TYPES,
+ BMP_CPLASMATORP_HEIGHT * BMP_TORP_FRAMES, BMP_MPLASMAC, w,
+ LR_DEFAULTCOLOR);
+
+ /* Make pointers to the four 6x8 weapon bitmaps */
+ for (j = 0; j < NUM_CTORP_TYPES; j++)
+ {
+ for (k = 0; k < BMP_TORP_FRAMES; k++)
+ {
+ torpC[j][k] =
+ W_PointBitmap2 (torp_bitmaps, j, k, BMP_CTORP_WIDTH,
+ BMP_CTORP_HEIGHT);
+
+ mtorpC[j][k] =
+ W_PointBitmap2 (mtorp_bitmaps, j, k, BMP_CTORP_WIDTH,
+ BMP_CTORP_HEIGHT);
+
+ plasmaC[j][k] =
+ W_PointBitmap2 (plasma_bitmaps, j, k, BMP_CPLASMATORP_WIDTH,
+ BMP_CPLASMATORP_HEIGHT);
+
+ mplasmaC[j][k] =
+ W_PointBitmap2 (mplasma_bitmaps, j, k, BMP_CPLASMATORP_WIDTH,
+ BMP_CPLASMATORP_HEIGHT);
+ }
+ }
+
+
+ /* Load the two 6x5 cloud bitmaps */
+ torp_cloud_bitmaps =
+ W_StoreBitmap3 ("bitmaps/weaplibm/color/cloudC.bmp",
+ BMP_CTORPDET_WIDTH * NUM_CTORP_TYPES,
+ BMP_CTORPDET_HEIGHT * BMP_TORPDET_FRAMES, BMP_CLOUDC, w,
+ LR_DEFAULTCOLOR);
+ plasma_cloud_bitmaps =
+ W_StoreBitmap3 ("bitmaps/weaplibm/color/plcloudC.bmp",
+ BMP_CPLASMATORPDET_WIDTH * NUM_CTORP_TYPES,
+ BMP_CPLASMATORPDET_HEIGHT * BMP_TORPDET_FRAMES, BMP_PLCLOUDC, w,
+ LR_DEFAULTCOLOR);
+
+ /* Make pointers to the two 6x5 cloud bitmaps */
+ for (j = 0; j < NUM_CTORP_TYPES; j++)
+ {
+ for (k = 0; k < BMP_TORPDET_FRAMES; k++)
+ {
+ cloudC[j][k] =
+ W_PointBitmap2 (torp_cloud_bitmaps, j, k, BMP_CTORPDET_WIDTH,
+ BMP_CTORPDET_HEIGHT);
+ plcloudC[j][k] =
+ W_PointBitmap2 (plasma_cloud_bitmaps, j, k, BMP_CPLASMATORPDET_WIDTH,
+ BMP_CPLASMATORPDET_HEIGHT);
+ }
+ }
+}
+
/******************************************************************************/
/*** handleMessageWindowKeyDown()
/******************************************************************************/
@@ -813,101 +894,59 @@
}
#endif
-/* Experimental weapons */
-#ifdef COLORIZEWEAPON
-/* Not implemented... have to redo code with StoreBitmap3
- for (i = 0; i < BMP_TORPDET_FRAMES; i++)
- {
- cloud[0][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORPDET_WIDTH, BMP_TORPDET_HEIGHT,
- BMP_FED_TORP_DET + i, w, LR_DEFAULTCOLOR);
- cloud[1][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORPDET_WIDTH, BMP_TORPDET_HEIGHT,
- BMP_ORI_TORP_DET + i, w, LR_DEFAULTCOLOR);
- cloud[2][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORPDET_WIDTH, BMP_TORPDET_HEIGHT,
- BMP_KLI_TORP_DET + i, w, LR_DEFAULTCOLOR);
- cloud[3][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORPDET_WIDTH, BMP_TORPDET_HEIGHT,
- BMP_ROM_TORP_DET + i, w, LR_DEFAULTCOLOR);
- cloud[4][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORPDET_WIDTH, BMP_TORPDET_HEIGHT,
- BMP_IND_TORP_DET + i, w, LR_DEFAULTCOLOR);
- plasmacloud[0][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
- BMP_FED_PLASMA_DET + i, w, LR_DEFAULTCOLOR);
- plasmacloud[1][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
- BMP_ORI_PLASMA_DET + i, w, LR_DEFAULTCOLOR);
- plasmacloud[2][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
- BMP_KLI_PLASMA_DET + i, w, LR_DEFAULTCOLOR);
- plasmacloud[3][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
- BMP_ROM_PLASMA_DET + i, w, LR_DEFAULTCOLOR);
- plasmacloud[4][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
- BMP_IND_PLASMA_DET + i, w, LR_DEFAULTCOLOR);
+ loadweaponsC();
- }
- for (i = 0; i < BMP_TORP_FRAMES; i++)
- {
- torpIcon[0][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORP_WIDTH, BMP_TORP_HEIGHT, BMP_FED_TORP+i, w, LR_DEFAULTCOLOR);
- torpIcon[1][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORP_WIDTH, BMP_TORP_HEIGHT, BMP_ORI_TORP+i, w, LR_DEFAULTCOLOR);
- torpIcon[2][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORP_WIDTH, BMP_TORP_HEIGHT, BMP_KLI_TORP+i, w, LR_DEFAULTCOLOR);
- torpIcon[3][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORP_WIDTH, BMP_TORP_HEIGHT, BMP_ROM_TORP+i, w, LR_DEFAULTCOLOR);
- torpIcon[4][i] = W_StoreBitmap2(hWeapLibrary, BMP_TORP_WIDTH, BMP_TORP_HEIGHT, BMP_IND_TORP+i, w, LR_DEFAULTCOLOR);
- plasmatorpIcon[0][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORP_WIDTH, BMP_PLASMATORP_HEIGHT, BMP_FED_PLASMA+i, w, LR_DEFAULTCOLOR);
- plasmatorpIcon[1][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORP_WIDTH, BMP_PLASMATORP_HEIGHT, BMP_ORI_PLASMA+i, w, LR_DEFAULTCOLOR);
- plasmatorpIcon[2][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORP_WIDTH, BMP_PLASMATORP_HEIGHT, BMP_KLI_PLASMA+i, w, LR_DEFAULTCOLOR);
- plasmatorpIcon[3][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORP_WIDTH, BMP_PLASMATORP_HEIGHT, BMP_ROM_PLASMA+i, w, LR_DEFAULTCOLOR);
- plasmatorpIcon[4][i] = W_StoreBitmap2(hWeapLibrary, BMP_PLASMATORP_WIDTH, BMP_PLASMATORP_HEIGHT, BMP_IND_PLASMA+i, w, LR_DEFAULTCOLOR);
- }
-*/
-#else /* COLORIZEWEAPON */
cloud[0] =
- W_StoreBitmap3 ("bitmaps/weaplibm/cloud1.bmp", BMP_TORPDET_WIDTH,
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/cloud1.bmp", BMP_TORPDET_WIDTH,
BMP_TORPDET_HEIGHT, BMP_CLOUD, w, LR_MONOCHROME);
cloud[1] =
- W_StoreBitmap3 ("bitmaps/weaplibm/cloud2.bmp", BMP_TORPDET_WIDTH,
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/cloud2.bmp", BMP_TORPDET_WIDTH,
BMP_TORPDET_HEIGHT, BMP_CLOUD, w, LR_MONOCHROME);
cloud[2] =
- W_StoreBitmap3 ("bitmaps/weaplibm/cloud3.bmp", BMP_TORPDET_WIDTH,
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/cloud3.bmp", BMP_TORPDET_WIDTH,
BMP_TORPDET_HEIGHT, BMP_CLOUD, w, LR_MONOCHROME);
cloud[3] =
- W_StoreBitmap3 ("bitmaps/weaplibm/cloud4.bmp", BMP_TORPDET_WIDTH,
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/cloud4.bmp", BMP_TORPDET_WIDTH,
BMP_TORPDET_HEIGHT, BMP_CLOUD, w, LR_MONOCHROME);
cloud[4] =
- W_StoreBitmap3 ("bitmaps/weaplibm/cloud5.bmp", BMP_TORPDET_WIDTH,
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/cloud5.bmp", BMP_TORPDET_WIDTH,
BMP_TORPDET_HEIGHT, BMP_CLOUD, w, LR_MONOCHROME);
plasmacloud[0] =
- W_StoreBitmap3 ("bitmaps/weaplibm/plcloud1.bmp",
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/plcloud1.bmp",
BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
BMP_PLCLOUD, w, LR_MONOCHROME);
plasmacloud[1] =
- W_StoreBitmap3 ("bitmaps/weaplibm/plcloud1.bmp",
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/plcloud2.bmp",
BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
BMP_PLCLOUD, w, LR_MONOCHROME);
plasmacloud[2] =
- W_StoreBitmap3 ("bitmaps/weaplibm/plcloud1.bmp",
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/plcloud3.bmp",
BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
BMP_PLCLOUD, w, LR_MONOCHROME);
plasmacloud[3] =
- W_StoreBitmap3 ("bitmaps/weaplibm/plcloud1.bmp",
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/plcloud4.bmp",
BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
BMP_PLCLOUD, w, LR_MONOCHROME);
plasmacloud[4] =
- W_StoreBitmap3 ("bitmaps/weaplibm/plcloud1.bmp",
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/plcloud5.bmp",
BMP_PLASMATORPDET_WIDTH, BMP_PLASMATORPDET_HEIGHT,
BMP_PLCLOUD, w, LR_MONOCHROME);
etorp =
- W_StoreBitmap3 ("bitmaps/weaplibm/etorp.bmp", BMP_TORP_WIDTH,
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/etorp.bmp", BMP_TORP_WIDTH,
BMP_TORP_HEIGHT, BMP_ETORP, w, LR_MONOCHROME);
mtorp =
- W_StoreBitmap3 ("bitmaps/weaplibm/mtorp.bmp", BMP_TORP_WIDTH,
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/mtorp.bmp", BMP_TORP_WIDTH,
BMP_TORP_HEIGHT, BMP_MTORP, w, LR_MONOCHROME);
eplasmatorp =
- W_StoreBitmap3 ("bitmaps/weaplibm/eplasma.bmp", BMP_EPLASMA_WIDTH,
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/eplasma.bmp", BMP_EPLASMA_WIDTH,
BMP_EPLASMA_HEIGHT, BMP_EPLASMA, w, LR_MONOCHROME);
mplasmatorp =
- W_StoreBitmap3 ("bitmaps/weaplibm/mplasma.bmp", BMP_MPLASMA_WIDTH,
+ W_StoreBitmap3 ("bitmaps/weaplibm/mono/mplasma.bmp", BMP_MPLASMA_WIDTH,
BMP_MPLASMA_HEIGHT, BMP_MPLASMA, w, LR_MONOCHROME);
-#endif /* COLORIZEWEAPON */
-
base_planets =
W_StoreBitmap3 (Planlib, BMP_PLANET_WIDTH, BMP_PLANET_HEIGHT * 9,
BMP_PLANET000, w, LR_MONOCHROME);
Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- local.c 27 Apr 2006 21:22:05 -0000 1.14
+++ local.c 29 Apr 2006 19:22:38 -0000 1.15
@@ -1450,6 +1450,7 @@
register int dx, dy;
struct player *j;
int torpCount;
+ int torpTeam;
const int view = SCALE * WINSIDE / 2;
for (t = torps, j = players; j != players + MAXPLAYER; t += MAXTORP, ++j)
@@ -1584,117 +1585,145 @@
}
#endif
-#ifdef COLORIZEWEAPON
- switch (j->p_team)
+ if (colorWeapons)
{
- case FED:
- torpTeam = 0;
- break;
- case ORI:
- torpTeam = 1;
- break;
- case KLI:
- torpTeam = 2;
- break;
- case ROM:
- torpTeam = 3;
- break;
- default:
- torpTeam = 4;
+ if (myPlayer(j))
+ torpTeam = 0;
+ else
+ {
+ switch (j->p_team)
+ {
+ case FED:
+ torpTeam = 1;
+ break;
+ case IND:
+ torpTeam = 2;
+ break;
+ case KLI:
+ torpTeam = 3;
+ break;
+ case ORI:
+ torpTeam = 4;
+ break;
+ case ROM:
+ torpTeam = 5;
+ break;
+ default:
+ torpTeam = 0;
+ }
+ }
+ W_WriteBitmap (dx - (BMP_CTORPDET_WIDTH / 2),
+ dy - (BMP_CTORPDET_HEIGHT / 2),
+ cloudC[torpTeam][k->t_fuse], torpColor (k));
+ clearzone[0][clearcount] = dx - (BMP_CTORPDET_WIDTH / 2);
+ clearzone[1][clearcount] = dy - (BMP_CTORPDET_HEIGHT / 2);
+ clearzone[2][clearcount] = BMP_CTORPDET_WIDTH;
+ clearzone[3][clearcount] = BMP_CTORPDET_HEIGHT;
+ clearcount++;
+ }
+ else
+ {
+ W_WriteBitmap (dx - (BMP_TORPDET_WIDTH / 2),
+ dy - (BMP_TORPDET_HEIGHT / 2),
+ cloud[k->t_fuse], torpColor (k));
+ clearzone[0][clearcount] = dx - (BMP_TORPDET_WIDTH / 2);
+ clearzone[1][clearcount] = dy - (BMP_TORPDET_HEIGHT / 2);
+ clearzone[2][clearcount] = BMP_TORPDET_WIDTH;
+ clearzone[3][clearcount] = BMP_TORPDET_HEIGHT;
+ clearcount++;
}
-
- W_WriteBitmap (dx - (BMP_TORPDET_WIDTH / 2),
- dy - (BMP_TORPDET_HEIGHT / 2),
- cloud[torpTeam][k->t_fuse], torpColor (k));
- /*W_WriteBitmapDB (localSDB, dx - (BMP_TORPDET_WIDTH / 2),
- dy - (BMP_TORPDET_HEIGHT / 2),
- cloud[torpTeam][k->t_fuse], torpColor (k));*/
-#else /* COLORIZEWEAPON */
- W_WriteBitmap (dx - (BMP_TORPDET_WIDTH / 2),
- dy - (BMP_TORPDET_HEIGHT / 2),
- cloud[k->t_fuse], torpColor (k));
- /*W_WriteBitmapDB (localSDB, dx - (BMP_TORPDET_WIDTH / 2),
- dy - (BMP_TORPDET_HEIGHT / 2),
- cloud[k->t_fuse], torpColor (k));*/
- clearzone[0][clearcount] = dx - (BMP_TORPDET_WIDTH / 2);
- clearzone[1][clearcount] = dy - (BMP_TORPDET_HEIGHT / 2);
- clearzone[2][clearcount] = BMP_TORPDET_WIDTH;
- clearzone[3][clearcount] = BMP_TORPDET_HEIGHT;
- clearcount++;
-#endif
- }
- else
-#ifndef COLORIZEWEAPON
- if (j != me && ((k->t_war & me->p_team) ||
- (j->p_team & (me->p_hostile | me->p_swar))))
- {
- /* solid. Looks strange. W_FillArea(w, dx - (etorp_width/2),
- * dy - (etorp_height/2), etorp_width, etorp_height,
- * torpColor(k)); */
-
- /* XFIX */
- W_WriteBitmap (dx - (etorp_width / 2),
- dy - (etorp_height / 2), etorp, torpColor (k));
- /*W_WriteBitmapDB (localSDB, dx - (etorp_width / 2),
- dy - (etorp_height / 2), etorp, torpColor (k));*/
- clearzone[0][clearcount] = dx - (etorp_width / 2);
- clearzone[1][clearcount] = dy - (etorp_height / 2);
- clearzone[2][clearcount] = etorp_width;
- clearzone[3][clearcount] = etorp_height;
- clearcount++;
}
else
{
- W_WriteBitmap (dx - (mtorp_width / 2),
- dy - (mtorp_height / 2), mtorp, torpColor (k));
- /*W_WriteBitmapDB (localSDB, dx - (mtorp_width / 2),
- dy - (mtorp_height / 2), mtorp, torpColor (k));*/
-
- clearzone[0][clearcount] = dx - (mtorp_width / 2);
- clearzone[1][clearcount] = dy - (mtorp_height / 2);
- clearzone[2][clearcount] = mtorp_width;
- clearzone[3][clearcount] = mtorp_height;
- clearcount++;
- }
-#else
-// Experimental weapons SRS 5/17/98
- if ((k->t_fuse++ >= BMP_TORP_FRAMES - 1) || (k->t_fuse < 0))
- k->t_fuse = 0;
- switch (j->p_team)
- {
- case FED:
- torpTeam = 0;
- break;
- case ORI:
- torpTeam = 1;
- break;
- case KLI:
- torpTeam = 2;
- break;
- case ROM:
- torpTeam = 3;
- break;
- default:
- torpTeam = 4;
+ if (colorWeapons)
+ {
+ if ((k->t_fuse++ >= BMP_TORP_FRAMES - 1) || (k->t_fuse < 0))
+ k->t_fuse = 0;
+
+ if (myPlayer(j))
+ torpTeam = 0;
+ else
+ {
+ switch (j->p_team)
+ {
+ case FED:
+ torpTeam = 1;
+ break;
+ case IND:
+ torpTeam = 2;
+ break;
+ case KLI:
+ torpTeam = 3;
+ break;
+ case ORI:
+ torpTeam = 4;
+ break;
+ case ROM:
+ torpTeam = 5;
+ break;
+ default:
+ torpTeam = 0;
+ }
+ }
+
+ if (j != me && ((k->t_war & me->p_team) ||
+ (j->p_team & (me->p_hostile | me->p_swar))))
+ {
+ W_WriteBitmap (dx - (BMP_CTORP_WIDTH / 2),
+ dy - (BMP_CTORP_HEIGHT / 2),
+ torpC[torpTeam][k->t_fuse], torpColor (k));
+ }
+ else
+ {
+ W_WriteBitmap (dx - (BMP_CTORP_WIDTH / 2),
+ dy - (BMP_CTORP_HEIGHT / 2),
+ mtorpC[torpTeam][k->t_fuse], torpColor (k));
+ }
+
+ clearzone[0][clearcount] = dx - (BMP_CTORP_WIDTH / 2);
+ clearzone[1][clearcount] = dy - (BMP_CTORP_HEIGHT / 2);
+ clearzone[2][clearcount] = BMP_CTORP_WIDTH;
+ clearzone[3][clearcount] = BMP_CTORP_HEIGHT;
+ clearcount++;
+ }
+ else
+ {
+ if (j != me && ((k->t_war & me->p_team) ||
+ (j->p_team & (me->p_hostile | me->p_swar))))
+ {
+ /* solid. Looks strange. W_FillArea(w, dx - (etorp_width/2),
+ * dy - (etorp_height/2), etorp_width, etorp_height,
+ * torpColor(k)); */
+
+ /* XFIX */
+ W_WriteBitmap (dx - (etorp_width / 2),
+ dy - (etorp_height / 2), etorp, torpColor (k));
+ /*W_WriteBitmapDB (localSDB, dx - (etorp_width / 2),
+ dy - (etorp_height / 2), etorp, torpColor (k));*/
+ clearzone[0][clearcount] = dx - (etorp_width / 2);
+ clearzone[1][clearcount] = dy - (etorp_height / 2);
+ clearzone[2][clearcount] = etorp_width;
+ clearzone[3][clearcount] = etorp_height;
+ clearcount++;
+ }
+ else
+ {
+ W_WriteBitmap (dx - (mtorp_width / 2),
+ dy - (mtorp_height / 2), mtorp, torpColor (k));
+ /*W_WriteBitmapDB (localSDB, dx - (mtorp_width / 2),
+ dy - (mtorp_height / 2), mtorp, torpColor (k));*/
+
+ clearzone[0][clearcount] = dx - (mtorp_width / 2);
+ clearzone[1][clearcount] = dy - (mtorp_height / 2);
+ clearzone[2][clearcount] = mtorp_width;
+ clearzone[3][clearcount] = mtorp_height;
+ clearcount++;
+ }
+ }
}
-
- W_WriteBitmap (dx - (BMP_TORP_WIDTH / 2),
- dy - (BMP_TORP_HEIGHT / 2),
- torpIcon[torpTeam][k->t_fuse], torpColor (k));
- /*W_WriteBitmapDB (localSDB, dx - (BMP_TORP_WIDTH / 2),
- dy - (BMP_TORP_HEIGHT / 2),
- torpIcon[torpTeam][k->t_fuse], torpColor (k));*/
-
- clearzone[0][clearcount] = dx - (BMP_TORP_WIDTH / 2);
- clearzone[1][clearcount] = dy - (BMP_TORP_HEIGHT / 2);
- clearzone[2][clearcount] = BMP_TORP_WIDTH;
- clearzone[3][clearcount] = BMP_TORP_HEIGHT;
- clearcount++;
}
-#endif
}
}
-}
void
@@ -1703,6 +1732,7 @@
register struct plasmatorp *pt;
register int dx, dy;
const int view = SCALE * WINSIDE / 2;
+ int ptorpTeam;
/* MAXPLASMA is small so work through all the plasmas rather than
look at the number of outstanding plasma torps for each player. */
@@ -1817,125 +1847,142 @@
}
#endif
-#ifdef COLORIZEWEAPON
- switch (players[pt->pt_owner].p_team)
+ if (colorWeapons)
{
- case FED:
- ptorpTeam = 0;
- break;
- case ORI:
- ptorpTeam = 1;
- break;
- case KLI:
- ptorpTeam = 2;
- break;
- case ROM:
- ptorpTeam = 3;
- break;
- default:
- ptorpTeam = 4;
+ if (pt->pt_owner == me->p_no)
+ ptorpTeam = 0;
+ else
+ {
+ switch (players[pt->pt_owner].p_team)
+ {
+ case FED:
+ ptorpTeam = 1;
+ break;
+ case IND:
+ ptorpTeam = 2;
+ break;
+ case KLI:
+ ptorpTeam = 3;
+ break;
+ case ORI:
+ ptorpTeam = 4;
+ break;
+ case ROM:
+ ptorpTeam = 5;
+ break;
+ default:
+ ptorpTeam = 0;
+ }
+ }
+
+ W_WriteBitmap (dx - (BMP_CPLASMATORPDET_WIDTH / 2),
+ dy - (BMP_CPLASMATORPDET_HEIGHT / 2),
+ plcloudC[ptorpTeam][pt->pt_fuse],
+ plasmatorpColor (pt));
+ clearzone[0][clearcount] = dx - (BMP_CPLASMATORPDET_WIDTH / 2);
+ clearzone[1][clearcount] = dy - (BMP_CPLASMATORPDET_HEIGHT / 2);
+ clearzone[2][clearcount] = BMP_CPLASMATORPDET_WIDTH;
+ clearzone[3][clearcount] = BMP_CPLASMATORPDET_HEIGHT;
+ clearcount++;
+ }
+ else
+ {
+ W_WriteBitmap (dx - (BMP_PLASMATORPDET_WIDTH / 2),
+ dy - (BMP_PLASMATORPDET_HEIGHT / 2),
+ plasmacloud[pt->pt_fuse], plasmatorpColor (pt));
+ clearzone[0][clearcount] = dx - (BMP_PLASMATORPDET_WIDTH / 2);
+ clearzone[1][clearcount] = dy - (BMP_PLASMATORPDET_HEIGHT / 2);
+ clearzone[2][clearcount] = BMP_PLASMATORPDET_WIDTH;
+ clearzone[3][clearcount] = BMP_PLASMATORPDET_HEIGHT;
+ clearcount++;
}
-
- W_WriteBitmap (dx - (BMP_PLASMATORPDET_WIDTH / 2),
- dy - (BMP_PLASMATORPDET_HEIGHT / 2),
- plasmacloud[ptorpTeam][pt->pt_fuse],
- plasmatorpColor (pt));
- /*W_WriteBitmapDB (localSDB, dx - (BMP_PLASMATORPDET_WIDTH / 2),
- dy - (BMP_PLASMATORPDET_HEIGHT / 2),
- plasmacloud[ptorpTeam][pt->pt_fuse],
- plasmatorpColor (pt));*/
- clearzone[0][clearcount] = dx - (BMP_PLASMATORPDET_WIDTH / 2);
- clearzone[1][clearcount] = dy - (BMP_PLASMATORPDET_HEIGHT / 2);
- clearzone[2][clearcount] = BMP_PLASMATORPDET_WIDTH;
- clearzone[3][clearcount] = BMP_PLASMATORPDET_HEIGHT;
- clearcount++;
-#else
- W_WriteBitmap (dx - (BMP_PLASMATORPDET_WIDTH / 2),
- dy - (BMP_PLASMATORPDET_HEIGHT / 2),
- plasmacloud[pt->pt_fuse], plasmatorpColor (pt));
- /*W_WriteBitmapDB (localSDB, dx - (BMP_PLASMATORPDET_WIDTH / 2),
- dy - (BMP_PLASMATORPDET_HEIGHT / 2),
- plasmacloud[pt->pt_fuse], plasmatorpColor (pt));*/
- clearzone[0][clearcount] = dx - (BMP_PLASMATORPDET_WIDTH / 2);
- clearzone[1][clearcount] = dy - (BMP_PLASMATORPDET_HEIGHT / 2);
- clearzone[2][clearcount] = BMP_PLASMATORPDET_WIDTH;
- clearzone[3][clearcount] = BMP_PLASMATORPDET_HEIGHT;
- clearcount++;
-#endif /* COLORIZEWEAPON */
- }
-
-#ifndef COLORIZEWEAPON
- /* needmore: if(pt->pt_war & me->p_team) */
- else if (pt->pt_owner != me->p_no && ((pt->pt_war & me->p_team) ||
- (players[pt->pt_owner].
- p_team & (me->p_hostile | me->
- p_swar))))
- {
- W_WriteBitmap (dx - (eplasmatorp_width / 2),
- dy - (eplasmatorp_height / 2),
- eplasmatorp, plasmatorpColor (pt));
- /*W_WriteBitmapDB (localSDB, dx - (eplasmatorp_width / 2),
- dy - (eplasmatorp_height / 2),
- eplasmatorp, plasmatorpColor (pt));*/
- clearzone[0][clearcount] = dx - (eplasmatorp_width / 2);
- clearzone[1][clearcount] = dy - (eplasmatorp_height / 2);
- clearzone[2][clearcount] = eplasmatorp_width;
- clearzone[3][clearcount] = eplasmatorp_height;
- clearcount++;
}
else
{
- W_WriteBitmap (dx - (mplasmatorp_width / 2),
- dy - (mplasmatorp_height / 2),
- mplasmatorp, plasmatorpColor (pt));
- /*W_WriteBitmapDB (localSDB, dx - (mplasmatorp_width / 2),
- dy - (mplasmatorp_height / 2),
- mplasmatorp, plasmatorpColor (pt));*/
- clearzone[0][clearcount] = dx - (mplasmatorp_width / 2);
- clearzone[1][clearcount] = dy - (mplasmatorp_height / 2);
- clearzone[2][clearcount] = mplasmatorp_width;
- clearzone[3][clearcount] = mplasmatorp_height;
- clearcount++;
- }
-#else /*COLORIZEWEAPON */
-
- {
- if ((pt->pt_fuse++ >= BMP_TORP_FRAMES - 1) || (pt->pt_fuse < 0))
- pt->pt_fuse = 0;
- switch (players[pt->pt_owner].p_team)
+ if (colorWeapons)
{
- case FED:
- ptorpTeam = 0;
- break;
- case ORI:
- ptorpTeam = 1;
- break;
- case KLI:
- ptorpTeam = 2;
- break;
- case ROM:
- ptorpTeam = 3;
- break;
- default:
- ptorpTeam = 4;
+ if ((pt->pt_fuse++ >= BMP_TORP_FRAMES - 1) || (pt->pt_fuse < 0))
+ pt->pt_fuse = 0;
+
+ if (pt->pt_owner == me->p_no)
+ ptorpTeam = 0;
+ else
+ {
+ switch (players[pt->pt_owner].p_team)
+ {
+ case FED:
+ ptorpTeam = 1;
+ break;
+ case IND:
+ ptorpTeam = 2;
+ break;
+ case KLI:
+ ptorpTeam = 3;
+ break;
+ case ORI:
+ ptorpTeam = 4;
+ break;
+ case ROM:
+ ptorpTeam = 5;
+ break;
+ default:
+ ptorpTeam = 0;
+ }
+ }
+ if (pt->pt_owner != me->p_no && ((pt->pt_war & me->p_team) ||
+ (players[pt->pt_owner].
+ p_team & (me->p_hostile | me->
+ p_swar))))
+ {
+ W_WriteBitmap (dx - (BMP_CPLASMATORP_WIDTH / 2),
+ dy - (BMP_CPLASMATORP_HEIGHT / 2),
+ plasmaC[ptorpTeam][pt->pt_fuse],
+ plasmatorpColor (pt));
+ }
+ else
+ {
+ W_WriteBitmap (dx - (BMP_CPLASMATORP_WIDTH / 2),
+ dy - (BMP_CPLASMATORP_HEIGHT / 2),
+ mplasmaC[ptorpTeam][pt->pt_fuse],
+ plasmatorpColor (pt));
+ }
+ clearzone[0][clearcount] = dx - (BMP_CPLASMATORP_WIDTH / 2);
+ clearzone[1][clearcount] = dy - (BMP_CPLASMATORP_HEIGHT / 2);
+ clearzone[2][clearcount] = BMP_CPLASMATORP_WIDTH;
+ clearzone[3][clearcount] = BMP_CPLASMATORP_HEIGHT;
+ clearcount++;
+ }
+ else
+ {
+ /* needmore: if(pt->pt_war & me->p_team) */
+ if (pt->pt_owner != me->p_no && ((pt->pt_war & me->p_team) ||
+ (players[pt->pt_owner].
+ p_team & (me->p_hostile | me->
+ p_swar))))
+ {
+ W_WriteBitmap (dx - (eplasmatorp_width / 2),
+ dy - (eplasmatorp_height / 2),
+ eplasmatorp, plasmatorpColor (pt));
+ clearzone[0][clearcount] = dx - (eplasmatorp_width / 2);
+ clearzone[1][clearcount] = dy - (eplasmatorp_height / 2);
+ clearzone[2][clearcount] = eplasmatorp_width;
+ clearzone[3][clearcount] = eplasmatorp_height;
+ clearcount++;
+ }
+ else
+ {
+ W_WriteBitmap (dx - (mplasmatorp_width / 2),
+ dy - (mplasmatorp_height / 2),
+ mplasmatorp, plasmatorpColor (pt));
+
+ clearzone[0][clearcount] = dx - (mplasmatorp_width / 2);
+ clearzone[1][clearcount] = dy - (mplasmatorp_height / 2);
+ clearzone[2][clearcount] = mplasmatorp_width;
+ clearzone[3][clearcount] = mplasmatorp_height;
+ clearcount++;
+ }
}
-
- W_WriteBitmap (dx - (BMP_PLASMATORP_WIDTH / 2),
- dy - (BMP_PLASMATORP_HEIGHT / 2),
- plasmatorpIcon[ptorpTeam][pt->pt_fuse],
- plasmatorpColor (pt));
- /*W_WriteBitmapDB (localSDB, dx - (BMP_PLASMATORP_WIDTH / 2),
- dy - (BMP_PLASMATORP_HEIGHT / 2),
- plasmatorpIcon[ptorpTeam][pt->pt_fuse],
- plasmatorpColor (pt));*/
-
- clearzone[0][clearcount] = dx - (BMP_PLASMATORP_WIDTH / 2);
- clearzone[1][clearcount] = dy - (BMP_PLASMATORP_HEIGHT / 2);
- clearzone[2][clearcount] = BMP_PLASMATORP_WIDTH;
- clearzone[3][clearcount] = BMP_PLASMATORP_HEIGHT;
- clearcount++;
}
-#endif /* COLORIZEWEAPON */
}
}
Index: defaults.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- defaults.c 27 Apr 2006 22:38:42 -0000 1.11
+++ defaults.c 29 Apr 2006 19:22:38 -0000 1.12
@@ -96,6 +96,12 @@
}
},
#endif
+ {"colorWeapons", &colorWeapons, RC_BOOL,
+ {
+ "Use colored bitmaps for torps and plasmas",
+ NULL
+ }
+ },
{"continueTractor", &continueTractor, RC_BOOL,
{
"Show tractor/pressor after lock",
@@ -1454,6 +1460,7 @@
keepPeace = booleanDefault ("keepPeace", keepPeace);
colorClient = intDefault ("colorClient", colorClient);
dynamicBitmaps = booleanDefault ("dynamicBitmaps", dynamicBitmaps);
+ colorWeapons = booleanDefault ("colorWeapons", colorWeapons);
continueTractor = booleanDefault ("continueTractor", continueTractor);
showTractorPressor = booleanDefault ("showTractorPressor", showTractorPressor);
showAllTractorPressor = booleanDefault ("showAllTractorPressor", showAllTractorPressor);
Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- data.c 27 Apr 2006 22:38:42 -0000 1.13
+++ data.c 29 Apr 2006 19:22:38 -0000 1.14
@@ -47,6 +47,7 @@
int colorClient = 1; /* Use new colorized bitmaps SRS 11/12/99 */
int dynamicBitmaps = 1; /* in game switching of ship bitmaps, default to on */
+int colorWeapons = 1; /* Use color bitmaps for torps and plasmas */
int newDashboard = 2; /* use new graphic
* dashboard, 6/2/93 LAB */
int old_db = 0; /* should be same as
@@ -56,7 +57,8 @@
* system support */
int niftyNewMessages = 1;
unsigned int oldalert = 0;
-int remap[16] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 };
+int remap[32] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
+ 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int messpend = 0;
#ifdef XTRA_MESSAGE_UI
int messageHUD = 0; /* Show message being typed on the local display */
@@ -243,17 +245,24 @@
W_Icon expview[BMP_SHIPEXPL_FRAMES];
W_Icon base_sbexpview;
W_Icon sbexpview[BMP_SBEXPL_FRAMES];
-#ifdef COLORIZE
-W_Icon cloud[5][BMP_TORPDET_FRAMES];
-W_Icon plasmacloud[5][BMP_TORPDET_FRAMES];
-W_Icon torpIcon[5][BMP_TORP_FRAMES];
-W_Icon plasmatorpIcon[5][BMP_TORP_FRAMES];
-#else
+
+W_Icon torp_cloud_bitmaps;
+W_Icon cloudC[NUM_CTORP_TYPES][BMP_TORPDET_FRAMES];
+W_Icon plasma_cloud_bitmaps;
+W_Icon plcloudC[NUM_CTORP_TYPES][BMP_TORPDET_FRAMES];
+W_Icon mtorp_bitmaps;
+W_Icon mtorpC[NUM_CTORP_TYPES][BMP_TORP_FRAMES];
+W_Icon torp_bitmaps;
+W_Icon torpC[NUM_CTORP_TYPES][BMP_TORP_FRAMES];
+W_Icon mplasma_bitmaps;
+W_Icon mplasmaC[NUM_CTORP_TYPES][BMP_TORP_FRAMES];
+W_Icon plasma_bitmaps;
+W_Icon plasmaC[NUM_CTORP_TYPES][BMP_TORP_FRAMES];
+
W_Icon cloud[BMP_TORPDET_FRAMES];
W_Icon plasmacloud[BMP_TORPDET_FRAMES];
W_Icon etorp, mtorp;
W_Icon eplasmatorp, mplasmatorp;
-#endif
#ifdef VSHIELD_BITMAPS
W_Icon base_vshield;
Index: option.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- option.c 27 Apr 2006 22:52:12 -0000 1.9
+++ option.c 29 Apr 2006 19:22:38 -0000 1.10
@@ -238,6 +238,7 @@
{0, "Ship Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
{1, "Page %d (click to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
{1, "", &colorClient, 0, 0, 0, bitmaptypemess, &bitmap_range},
+ {1, "use color weapon bitmaps", &colorWeapons, 0, 0, 0, NULL, NULL},
#ifdef VSHIELD_BITMAPS
{1, "vary shields bitmap", &varyShields, 0, 0, 0, NULL, NULL},
#endif