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

Modified Files:
	data.c local.c map.c mswindow.c newwin.c 
Log Message:
Adds support for paradise wormholes.
Fixes bug with local star draw clearzone.

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- data.c	7 Jun 2007 04:43:38 -0000	1.96
+++ data.c	7 Jun 2007 06:29:05 -0000	1.97
@@ -356,6 +356,9 @@
 W_Icon base_star_bitmap;
 W_Icon star_bitmap[STAR_VIEWS];
 W_Icon star_mbitmap;
+W_Icon base_wormhole_bitmap;
+W_Icon wormhole_bitmap[WORMHOLE_VIEWS];
+W_Icon wormhole_mbitmap;
 W_Icon paradise_ship_bitmaps;
 W_Icon paradise_ships[NUM_PSHIP_TYPES][NUMTEAMS];
 W_Icon paradise_cship_self_bitmaps;

Index: newwin.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- newwin.c	7 Jun 2007 04:43:39 -0000	1.67
+++ newwin.c	7 Jun 2007 06:29:06 -0000	1.68
@@ -504,6 +504,18 @@
         W_StoreBitmap3 ("bitmaps/paradise/starm.bmp", BMP_MSTAR_WIDTH,
                         BMP_MSTAR_HEIGHT, BMP_MSTAR, mapw,
                         LR_DEFAULTCOLOR);
+    base_wormhole_bitmap =
+        W_StoreBitmap3 ("bitmaps/paradise/wormhole.bmp", BMP_WORMHOLE_WIDTH,
+                        BMP_WORMHOLE_HEIGHT * WORMHOLE_VIEWS, BMP_WORMHOLE, w,
+                        LR_DEFAULTCOLOR);
+    for (i = 0; i < WORMHOLE_VIEWS; i++)
+        wormhole_bitmap[i] =
+            W_PointBitmap2 (base_wormhole_bitmap, 0, i, BMP_WORMHOLE_WIDTH, BMP_WORMHOLE_HEIGHT);
+
+    wormhole_mbitmap =
+        W_StoreBitmap3 ("bitmaps/paradise/wormholem.bmp", BMP_MWORMHOLE_WIDTH,
+                        BMP_MWORMHOLE_HEIGHT, BMP_MWORMHOLE, mapw,
+                        LR_DEFAULTCOLOR);
 
     drone_bitmap =
         W_StoreBitmap3 ("bitmaps/paradise/drone.bmp", BMP_DRONE_WIDTH,

Index: mswindow.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- mswindow.c	25 May 2007 03:36:46 -0000	1.85
+++ mswindow.c	7 Jun 2007 06:29:06 -0000	1.86
@@ -595,6 +595,10 @@
     for (i = 0; i < STAR_VIEWS; i++)
         free (star_bitmap[i]);
     free (star_mbitmap);
+    free (base_wormhole_bitmap);
+    for (i = 0; i < WORMHOLE_VIEWS; i++)
+        free (wormhole_bitmap[i]);
+    free (wormhole_mbitmap);
     free (paradise_ship_bitmaps);
     free (paradise_cship_self_bitmaps);
     free (paradise_cship_bitmaps);

Index: map.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- map.c	7 Jun 2007 04:43:39 -0000	1.58
+++ map.c	7 Jun 2007 06:29:06 -0000	1.59
@@ -583,6 +583,11 @@
                              dy - ( BMP_MSTAR_HEIGHT / 2),
                              BMP_MSTAR_WIDTH,
                              BMP_MSTAR_HEIGHT);
+            else if (PL_TYPE(*l) == PLWHOLE)
+                W_ClearArea (mapw, dx - ( BMP_MWORMHOLE_WIDTH / 2),
+                             dy - ( BMP_MWORMHOLE_HEIGHT / 2),
+                             BMP_MWORMHOLE_WIDTH,
+                             BMP_MWORMHOLE_HEIGHT);
             else
             {
 #endif
@@ -649,6 +654,17 @@
                                 star_mbitmap,
                                 planetColor (l),
                                 mapw);
+        else if (PL_TYPE(*l) == PLWHOLE)
+            W_OverlayScaleBitmap (dx - (BMP_MWORMHOLE_WIDTH / 2),
+                                dy - (BMP_MWORMHOLE_HEIGHT / 2),
+                                BMP_MWORMHOLE_WIDTH,
+                                BMP_MWORMHOLE_HEIGHT,
+                                BMP_MWORMHOLE_WIDTH,
+                                BMP_MWORMHOLE_HEIGHT,
+                                0,
+                                wormhole_mbitmap,
+                                planetColor (l),
+                                mapw);
         else
 #endif 
 #ifdef BEEPLITE

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- local.c	25 May 2007 03:36:46 -0000	1.104
+++ local.c	7 Jun 2007 06:29:06 -0000	1.105
@@ -41,6 +41,7 @@
 static int planet_frame = 0;
 #ifdef PARADISE
 static int star_frame = 0;
+static int wormhole_frame = 0;
 #endif
 static int star_updates = 0;
 static int last_speed = 0;
@@ -599,6 +600,25 @@
                                 planetColor (l),
                                 w);
         }
+        else if (PL_TYPE(*l) == PLWHOLE)
+        {
+            int j = wormhole_frame * 10 / server_ups;
+            if ((j >= WORMHOLE_VIEWS - 1) || (j < 0))
+            {
+                j = 0;
+                wormhole_frame = 0;
+            }
+            W_WriteScaleBitmap (dx - (BMP_WORMHOLE_WIDTH / 2) * SCALE / scaleFactor,
+                                dy - (BMP_WORMHOLE_HEIGHT / 2) * SCALE / scaleFactor,
+                                BMP_WORMHOLE_WIDTH * SCALE / scaleFactor,
+                                BMP_WORMHOLE_HEIGHT * SCALE / scaleFactor,
+                                BMP_WORMHOLE_WIDTH,
+                                BMP_WORMHOLE_HEIGHT,
+                                0,
+                                wormhole_bitmap[j],
+                                planetColor (l),
+                                w);
+        }
         else
 #endif    
         if (planetBitmap == 3)
@@ -652,7 +672,11 @@
                          W_White);
         }
 
-        if (showPlanetNames)
+        if (showPlanetNames
+#ifdef PARADISE
+         && (PL_TYPE(*l) != PLWHOLE)
+#endif
+        )
         {
             /* Center name */
             W_MaskText (w, dx - (W_Textwidth * l->pl_namelen / 2),
@@ -710,6 +734,23 @@
             clearzone[3][clearcount] = W_Textheight;
             clearcount++;
         }
+#ifdef PARADISE
+        if (PL_TYPE(*l) == PLSTAR)
+        {
+            clearzone[0][clearcount] = dx - (BMP_STAR_WIDTH / 2) * SCALE / scaleFactor;
+            clearzone[1][clearcount] = dy - (BMP_STAR_HEIGHT / 2) * SCALE / scaleFactor;
+            clearzone[2][clearcount] = BMP_STAR_WIDTH * SCALE / scaleFactor;
+            clearzone[3][clearcount] = BMP_STAR_HEIGHT * SCALE / scaleFactor;
+        }
+        else if (PL_TYPE(*l) == PLWHOLE)
+        {
+            clearzone[0][clearcount] = dx - (BMP_WORMHOLE_WIDTH / 2) * SCALE / scaleFactor;
+            clearzone[1][clearcount] = dy - (BMP_WORMHOLE_HEIGHT / 2) * SCALE / scaleFactor;
+            clearzone[2][clearcount] = BMP_WORMHOLE_WIDTH * SCALE / scaleFactor;
+            clearzone[3][clearcount] = BMP_WORMHOLE_HEIGHT * SCALE / scaleFactor;
+        }
+        else
+#endif
         if (planetBitmap == 3)
         {
             clearzone[0][clearcount] = dx - (5 * BMP_PLANET_WIDTH / 6 * SCALE / scaleFactor) - 1;
@@ -729,6 +770,7 @@
     planet_frame++;
 #ifdef PARADISE
     star_frame++;
+    wormhole_frame++;
 #endif
 }