[chocolate-doom] 36/83: More sensible defaults

Jonathan Dowland jmtd at moszumanska.debian.org
Mon Jan 30 15:06:24 UTC 2017


This is an automated email from the git hooks/post-receive script.

jmtd pushed a commit to annotated tag chocolate-doom-0.0.1
in repository chocolate-doom.

commit d2c5206b1489770c37504426c6d7e9448287479e
Author: Simon Howard <fraggle at gmail.com>
Date:   Fri Aug 5 17:53:07 2005 +0000

    More sensible defaults
    
    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 42
---
 src/i_sound.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/i_sound.c b/src/i_sound.c
index ce13778..263f31d 100644
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_sound.c 39 2005-08-04 21:48:32Z fraggle $
+// $Id: i_sound.c 42 2005-08-05 17:53:07Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.7  2005/08/05 17:53:07  fraggle
+// More sensible defaults
+//
 // Revision 1.6  2005/08/04 21:48:32  fraggle
 // Turn on compiler optimisation and warning options
 // Add SDL_mixer sound code
@@ -48,7 +51,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: i_sound.c 39 2005-08-04 21:48:32Z fraggle $";
+rcsid[] = "$Id: i_sound.c 42 2005-08-05 17:53:07Z fraggle $";
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -78,7 +81,7 @@ static byte *expand_sound_data(byte *data, int samplerate, int length)
 
     if (samplerate == 11025)
     {
-        // need to expand to 2 channels, and expand 8 bit samples to 16 bits
+        // need to expand to 2 channels, and expand 11025->22050
 
         result = Z_Malloc(length * 4, PU_STATIC, NULL);
 
@@ -94,10 +97,9 @@ static byte *expand_sound_data(byte *data, int samplerate, int length)
 
         result = Z_Malloc(length * 2, PU_STATIC, NULL);
 
-        for (i=0; i<length / 2; ++i)
+        for (i=0; i<length; ++i)
         {
-            result[i * 4] = result[i * 4 + 2] = data[i * 2];
-            result[i * 4 + 1] = result[i * 4 + 3] = data[i * 2 + 1];
+            result[i * 2] = result[i * 2 + 1] = data[i];
         }
     }
     else
@@ -128,7 +130,7 @@ static Mix_Chunk *getsfx(int sound)
         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 = 128;
+        sound_chunks[sound].volume = 32;
     }
 
     return &sound_chunks[sound];
@@ -300,6 +302,8 @@ I_InitSound()
     {
         printf("Error initialising SDL_mixer: %s\n", SDL_GetError());
     }
+
+    Mix_AllocateChannels(16);
     
     sound_initialised = 1;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/chocolate-doom.git



More information about the Pkg-games-commits mailing list