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

Modified Files:
	dashboard.c dashboard3.c data.c redraw.c sound.c 
Log Message:
Added new sounds for when engine melt, and then for when they are unmelted
Tracked via dashboards - leads to some repetitive code, but it is unavoidable
as engine flag status can be received via multiple packet types, so tracking
it from packet receipt (which is what is done for t-mode start/stop sounds)
is just as complex.

Index: redraw.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/redraw.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- redraw.c	15 Jun 2006 05:09:04 -0000	1.9
+++ redraw.c	15 Mar 2007 01:44:33 -0000	1.10
@@ -181,6 +181,16 @@
     buf[7] = (char) (me->p_flags & PFCLOAK ? 'C' : ' ');
     buf[8] = (char) (me->p_flags & PFWEP ? 'W' : ' ');
     buf[9] = (char) (me->p_flags & PFENG ? 'E' : ' ');
+#ifdef SOUND
+    if (ingame && oldengflag != (me->p_flags & PFENG))
+    {
+        if (me->p_flags & PFENG)
+            Play_Sound(ENGINE_MELT_WAV, SF_INFO);
+        else
+            Play_Sound(ENGINE_OK_WAV, SF_INFO);
+    }
+    oldengflag = (me->p_flags & PFENG);
+#endif
     if (me->p_flags & PFPRESS)
         buf[10] = 'P';
     else if (me->p_flags & PFTRACT)

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- data.c	14 Mar 2007 23:24:08 -0000	1.62
+++ data.c	15 Mar 2007 01:44:33 -0000	1.63
@@ -63,6 +63,7 @@
 int niftyNewMessages = 1;
 unsigned int oldalert = 0;
 unsigned char oldtourn = (unsigned char) 2;  /* placeholder starting status */
+unsigned int oldengflag = 0;
 int alertBorderColor = 0;
 int forceBorder = 0;
 int remap[16] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 };

Index: dashboard.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- dashboard.c	14 Mar 2007 23:24:08 -0000	1.18
+++ dashboard.c	15 Mar 2007 01:44:33 -0000	1.19
@@ -475,6 +475,16 @@
             W_WriteText (tstatw, 2, 3, textColor, "Flags", 5, W_RegularFont);
         W_WriteText (tstatw, 2, 17, textColor, buf, 12, W_RegularFont);
         old_flags = me->p_flags;
+#ifdef SOUND
+        if (ingame && oldengflag != (me->p_flags & PFENG))
+        {
+            if (me->p_flags & PFENG)
+                Play_Sound(ENGINE_MELT_WAV, SF_INFO);
+            else
+                Play_Sound(ENGINE_OK_WAV, SF_INFO);
+        }
+        oldengflag = (me->p_flags & PFENG);
+#endif
     }
     
     if (fr || status->tourn != old_tourn)

Index: dashboard3.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard3.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dashboard3.c	19 May 2006 18:08:07 -0000	1.6
+++ dashboard3.c	15 Mar 2007 01:44:33 -0000	1.7
@@ -328,6 +328,16 @@
 
         old_flags = me->p_flags;
         old_tourn = status->tourn;
+#ifdef SOUND
+        if (ingame && oldengflag != (me->p_flags & PFENG))
+        {
+            if (me->p_flags & PFENG)
+                Play_Sound(ENGINE_MELT_WAV, SF_INFO);
+            else
+                Play_Sound(ENGINE_OK_WAV, SF_INFO);
+        }
+        oldengflag = (me->p_flags & PFENG);
+#endif
     }
 }
 

Index: sound.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- sound.c	1 Mar 2007 18:31:18 -0000	1.34
+++ sound.c	15 Mar 2007 01:44:33 -0000	1.35
@@ -55,6 +55,8 @@
 
   sounds[CLOAKED_WAV] = Mix_LoadWAV(DATAFILE("nt_cloaked.wav"));
   sounds[ENGINE_WAV] = Mix_LoadWAV(DATAFILE("nt_engine.wav"));
+  sounds[ENGINE_MELT_WAV] = Mix_LoadWAV(DATAFILE("nt_enginemelt.wav"));
+  sounds[ENGINE_OK_WAV] = Mix_LoadWAV(DATAFILE("nt_engineok.wav"));
   sounds[ENTER_SHIP_WAV] = Mix_LoadWAV(DATAFILE("nt_enter_ship.wav"));
   sounds[ENTER_WARP_WAV] = Mix_LoadWAV(DATAFILE("nt_enter_warp.wav"));
   sounds[EXIT_WARP_WAV] = Mix_LoadWAV(DATAFILE("nt_exit_warp.wav"));