shithub: choc

Download patch

ref: dd39af700d1d726e96b386b07a29e09cb2c9825a
parent: 48b1f583ff25013b862fa9b63e41da2449700c8b
author: Simon Howard <fraggle@gmail.com>
date: Fri Aug 19 17:55:51 EDT 2005

Make sounds louder. Use the correct maximum of 15 when doing sound
calculations.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 53

--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_sound.c 48 2005-08-07 19:21:01Z fraggle $
+// $Id: i_sound.c 53 2005-08-19 21:55:51Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,10 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.10  2005/08/19 21:55:51  fraggle
+// Make sounds louder.  Use the correct maximum of 15 when doing sound
+// calculations.
+//
 // Revision 1.9  2005/08/07 19:21:01  fraggle
 // Cycle round sound channels to stop reuse and conflicts of channel
 // numbers.  Add debug to detect when incorrect sound handles are used.
@@ -59,7 +63,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: i_sound.c 48 2005-08-07 19:21:01Z fraggle $";
+rcsid[] = "$Id: i_sound.c 53 2005-08-19 21:55:51Z fraggle $";
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -141,7 +145,7 @@
         sound_chunks[sound].allocated = 1;
         sound_chunks[sound].abuf = expand_sound_data(data + 8, samplerate, length);
         sound_chunks[sound].alen = (length * 2)  * (22050 / samplerate);
-        sound_chunks[sound].volume = 32;
+        sound_chunks[sound].volume = 64;
     }
 
     return &sound_chunks[sound];
@@ -322,6 +326,7 @@
   int	pitch)
 {
     int tag = handle >> 8;
+    int left, right;
 
     handle &= 0xff;
     
@@ -330,10 +335,11 @@
         fprintf(stderr,
                 "tag is wrong for playing sound: %i, %i\n", tag, handle);
     }
-    
-    Mix_SetPanning(handle, 
-                   ((254 - sep) * vol) / 8, 
-                   ((sep) * vol) / 8);
+
+    left = ((254 - sep) * vol) / 15;
+    right = ((sep) * vol) / 15;
+
+    Mix_SetPanning(handle, left, right);
 }