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

Modified Files:
	defaults.c local.c 
Log Message:
Added much needed comments to the confusing cloaking draw logic in local.c
Fixed the phaser sound counter so that it is properly reset even when you are cloaked - other people's phaser sounds were
not being played while you were cloaked, this bug has been around a long time and is in COW as well.
Fixed reversed order of mainresizeable and maintitlebar functions in the defaults list.
Switched around 2 macros in netrekrc to a more logical order.
Updated todo list.

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- local.c	26 Jun 2006 01:21:01 -0000	1.46
+++ local.c	3 Jul 2006 17:03:24 -0000	1.47
@@ -801,6 +801,8 @@
             }
         }
 
+        /* If cloaking cycle is complete, just draw the cloak icon, and skip over
+           the ship drawing code with the goto statement */
         if (j->p_flags & PFCLOAK && (j->p_cloakphase == (CLOAK_PHASES - 1)))
         {
             if (myPlayer (j)
@@ -820,6 +822,8 @@
                 goto shieldlabel;       /* draw the shield even when
                                          * cloaked */
             }
+            /* At this point, it's another player who is fully cloaked - skip
+               the rest of the draw function */
             continue;
         }
         if (j->p_status == PALIVE)
@@ -995,17 +999,20 @@
                                       w);
             }
 
+            /* If the ship is not yet fully cloaked, draw the cloak icon on top
+               of the ship icon */
             if (j->p_cloakphase > 0)
             {
                 W_WriteBitmap (dx - (cloak_width / 2),
                                dy - (cloak_height / 2), cloakicon,
                                playerColor (j), w);
                 if (!myPlayer (j) && !isObsLockPlayer(j))
-                /* if my player, or observing that player, draw the shield */
+                /* If not my player, or not observing that player, we exit the draw
+                   function here */
                     continue;
             }
-
-          shieldlabel:
+            /* This is the goto reentry point for the case when your ship is fully cloaked */
+            shieldlabel:
 
 #ifdef BEEPLITE
 	    if ((useLite && emph_player_seq_n[j->p_no] > 0)
@@ -1217,8 +1224,17 @@
             }
 #endif
 
-            if (j->p_flags & PFCLOAK)   /* when cloaked stop here */
+            /* When cloaked, stop here.  But need to reset the sound_phaser counter
+               to 0, otherwise other people's phaser sounds don't play while you are
+               cloaked.  Not necessary to check against phaser PHFREE status.*/
+            if (j->p_flags & PFCLOAK)
+            {
+#ifdef SOUND
+                if (myPlayer(j) || isObsLockPlayer(j))
+                    sound_phaser = 0;
+#endif
                 continue;
+            }
 
             {
                 int color = playerColor (j);

Index: defaults.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- defaults.c	25 Jun 2006 08:19:40 -0000	1.28
+++ defaults.c	3 Jul 2006 17:03:24 -0000	1.29
@@ -211,15 +211,15 @@
             NULL
         }
     },
-    {"mainTitleBar", &mainTitleBar, RC_BOOL,
+    {"mainResizeable", &mainResizeable, RC_BOOL,
         {
-            "Start main window with title bar on (can be toggled by alt+enter)",
+            "Make main window resizeable",
             NULL
         }
     },
-    {"mainResizeable", &mainResizeable, RC_BOOL,
+    {"mainTitleBar", &mainTitleBar, RC_BOOL,
         {
-            "Make main window resizeable",
+            "Start main window with title bar on (can be toggled by alt+enter)",
             NULL
         }
     },