Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1588/src

Modified Files:
	local.c short.c socket.c 
Log Message:
FPS support for weapon fuses (fixes phaser draw time).
FPS support for jubilee phasers.

Index: short.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- short.c	22 Feb 2007 17:44:34 -0000	1.11
+++ short.c	22 Feb 2007 19:34:44 -0000	1.12
@@ -273,7 +273,7 @@
     thetorp = &torps[((unsigned char) *which * 8)];
     for (shift = 0, i = 0; i < 8; i++, thetorp++, bitset >>= 1)
     {
-        thetorp->t_updateFuse = TORP_UPDATE_FUSE;
+        thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10;
 
         if (bitset & 01)
         {
@@ -998,7 +998,7 @@
     for (shift = 0, i = 0; i < 8;
          thetorp++, *bitset >>= 1, *infobitset >>= 1, i++)
     {
-        thetorp->t_updateFuse = TORP_UPDATE_FUSE;
+        thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10;
 
         if (*bitset & 01)
         {
@@ -2003,7 +2003,7 @@
     phas->ph_y = y;
     phas->ph_target = (short) target;
     phas->ph_fuse = 0;
-    phas->ph_updateFuse = PHASER_UPDATE_FUSE;
+    phas->ph_updateFuse = PHASER_UPDATE_FUSE * fps / 10;
     phas->ph_maxfuse = (players[pnum].p_ship.s_phaserfuse * updatesPerSec) / 10;
 
 #ifdef ROTATERACE

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- local.c	22 Feb 2007 17:59:00 -0000	1.54
+++ local.c	22 Feb 2007 19:34:44 -0000	1.55
@@ -632,6 +632,7 @@
     char idbuf[10];
     int buflen = 1;
     static int ph_col = 0;
+    static int scaled_ph_col = 0;
     const int view = SCALE * WINSIDE / 2 + BMP_SHIELD_WIDTH * SCALE / 2;
     int dx, dy, px, py, wx, wy, tx, ty, lx, ly;
     int new_dx, new_dy;
@@ -1556,7 +1557,7 @@
                     {
                         int col;
 
-                        switch (ph_col)
+                        switch (scaled_ph_col)
                         {
                         case 1:
                         case 2:
@@ -1576,10 +1577,10 @@
                             break;
                         default:
                             col = shipCol[remap[j->p_team]];
-                            ph_col = 0;
                             break;
                         }
                         ph_col += (100/j->p_ship.s_phaserfuse/updatesPerSec);
+                        scaled_ph_col = ph_col * 10 / fps;
                         if (phaserShrinkStyle == 1)
                         {
                             get_shrink_phaser_coords(&new_dx, &new_dy,

Index: socket.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- socket.c	22 Feb 2007 17:44:35 -0000	1.15
+++ socket.c	22 Feb 2007 19:34:44 -0000	1.16
@@ -1098,7 +1098,7 @@
     thetorp->t_x = ntohl (packet->x);
     thetorp->t_y = ntohl (packet->y);
     thetorp->t_dir = packet->dir;
-    thetorp->t_updateFuse = TORP_UPDATE_FUSE;
+    thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10;
 
 
 #ifdef ROTATERACE
@@ -1126,7 +1126,7 @@
 
     weaponUpdate = 1;
     thetorp = &torps[ntohs (packet->tnum)];
-    thetorp->t_updateFuse = TORP_UPDATE_FUSE;
+    thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10;
 
     if (packet->status == TEXPLODE && thetorp->t_status == TFREE)
     {
@@ -1608,7 +1608,7 @@
     phas->ph_y = ntohl (packet->y);
     phas->ph_target = (short) (ntohl (packet->target));
     phas->ph_fuse = 0;          /* NEW */
-    phas->ph_updateFuse = PHASER_UPDATE_FUSE;
+    phas->ph_updateFuse = PHASER_UPDATE_FUSE * fps / 10;
     /* normalized maxfuse */
     phas->ph_maxfuse = (players[packet->pnum].p_ship.s_phaserfuse * updatesPerSec) / 10;
 
@@ -1757,7 +1757,7 @@
 
     weaponUpdate = 1;
     thetorp = &plasmatorps[ntohs (packet->pnum)];
-    thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE;
+    thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * fps / 10;
     if (packet->status == PTEXPLODE && thetorp->pt_status == PTFREE)
     {
         /* FAT: redundant explosion; don't update p_nplasmatorp */
@@ -1800,7 +1800,7 @@
     thetorp = &plasmatorps[ntohs (packet->pnum)];
     thetorp->pt_x = ntohl (packet->x);
     thetorp->pt_y = ntohl (packet->y);
-    thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE;
+    thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * fps / 10;
 
 #ifdef ROTATERACE
     if (rotate)