shithub: choc

Download patch

ref: 80abfe655d55ec658ba581dfbc2ea33290e1ee94
parent: 52efd1028c980b4f8d76b734e955c6fd9524f92b
parent: 06dfd81d3b81142161dc8d1f1f163581ce94e48f
author: Fabian Greffrath <fabian@greffrath.com>
date: Mon Jun 22 15:09:59 EDT 2015

Merge pull request #564 from jmtd/misc-fixups

Misc fixups

--- a/src/doom/s_sound.c
+++ b/src/doom/s_sound.c
@@ -46,7 +46,7 @@
 // Distance tp origin when sounds should be maxed out.
 // This should relate to movement clipping resolution
 // (see BLOCKMAP handling).
-// In the source code release: (160*FRACUNIT).  Changed back to the 
+// In the source code release: (160*FRACUNIT).  Changed back to the
 // Vanilla value of 200 (why was this changed?)
 
 #define S_CLOSE_DIST (200 * FRACUNIT)
@@ -73,7 +73,7 @@
 
     // handle of the sound being played
     int handle;
-    
+
 } channel_t;
 
 // The set of channels available
@@ -85,7 +85,7 @@
 
 int sfxVolume = 8;
 
-// Maximum volume of music. 
+// Maximum volume of music.
 
 int musicVolume = 8;
 
@@ -95,7 +95,7 @@
 
 // Whether songs are mus_paused
 
-static boolean mus_paused;        
+static boolean mus_paused;
 
 // Music currently being played
 
@@ -112,7 +112,7 @@
 //
 
 void S_Init(int sfxVolume, int musicVolume)
-{  
+{
     int i;
 
     I_SetOPLDriverVer(opl_v_new);
@@ -237,10 +237,10 @@
         {
             mnum = spmus[gamemap-1];
         }
-    }        
+    }
 
     S_ChangeMusic(mnum, true);
-}        
+}
 
 void S_StopSound(mobj_t *origin)
 {
@@ -265,7 +265,7 @@
 {
     // channel number to use
     int                cnum;
-    
+
     channel_t*        c;
 
     // Find an open channel
@@ -296,7 +296,7 @@
 
         if (cnum == snd_channels)
         {
-            // FUCK!  No lower priority.  Sorry, Charlie.    
+            // FUCK!  No lower priority.  Sorry, Charlie.
             return -1;
         }
         else
@@ -337,12 +337,12 @@
 
     // From _GG1_ p.428. Appox. eucledian distance fast.
     approx_dist = adx + ady - ((adx < ady ? adx : ady)>>1);
-    
+
     if (gamemap != 8 && approx_dist > S_CLIPPING_DIST)
     {
         return 0;
     }
-    
+
     // angle of source to listener
     angle = R_PointToAngle2(listener->x,
                             listener->y,
@@ -384,9 +384,9 @@
         // distance effect
         *vol = (snd_SfxVolume
                 * ((S_CLIPPING_DIST - approx_dist)>>FRACBITS))
-            / S_ATTENUATOR; 
+            / S_ATTENUATOR;
     }
-    
+
     return (*vol > 0);
 }
 
@@ -438,7 +438,7 @@
 
         if (origin->x == players[consoleplayer].mo->x
          && origin->y == players[consoleplayer].mo->y)
-        {        
+        {
             sep = NORM_SEP;
         }
 
@@ -446,7 +446,7 @@
         {
             return;
         }
-    }        
+    }
     else
     {
         sep = NORM_SEP;
@@ -475,7 +475,7 @@
     }
 
     channels[cnum].handle = I_StartSound(sfx, cnum, volume, sep);
-}        
+}
 
 //
 // Stop and resume music, during game PAUSE.
@@ -549,7 +549,7 @@
                                                   c->origin,
                                                   &volume,
                                                   &sep);
-                    
+
                     if (!audible)
                     {
                         S_StopChannel(cnum);
@@ -576,7 +576,7 @@
     {
         I_Error("Attempt to set music volume at %d",
                 volume);
-    }    
+    }
 
     I_SetMusicVolume(volume);
 }
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -875,7 +875,7 @@
 
     if (!LockSound(sfxinfo))
     {
-	return -1;
+        return -1;
     }
 
     snd = sfxinfo->driver_data;
@@ -882,12 +882,12 @@
 
     // play sound
 
-    Mix_PlayChannelTimed(channel, &snd->chunk, 0, -1);
+    Mix_PlayChannel(channel, &snd->chunk, 0);
 
     channels_playing[channel] = sfxinfo;
 
     // set separation, etc.
- 
+
     I_SDL_UpdateSoundParams(channel, vol, sep);
 
     return channel;
@@ -919,7 +919,7 @@
     return Mix_Playing(handle);
 }
 
-// 
+//
 // Periodically called to update the sound system
 //
 
@@ -935,7 +935,7 @@
         {
             // Sound has finished playing on this channel,
             // but sound data has not been released to cache
-            
+
             ReleaseSoundOnChannel(i);
         }
     }
@@ -942,7 +942,7 @@
 }
 
 static void I_SDL_ShutdownSound(void)
-{    
+{
     if (!sound_initialized)
     {
         return;
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -345,7 +345,7 @@
 {
     if (sound_module != NULL && sound_module->CacheSounds != NULL)
     {
-	sound_module->CacheSounds(sounds, num_sounds);
+        sound_module->CacheSounds(sounds, num_sounds);
     }
 }