Einen üblen Soundcrash entfernt

This commit is contained in:
Yamagi Burmeister 2009-03-10 20:29:15 +00:00
parent 674b138af9
commit 327c0352d2
3 changed files with 12 additions and 1 deletions

View File

@ -116,6 +116,7 @@ S_Init
void S_Init (void) void S_Init (void)
{ {
cvar_t *cv; cvar_t *cv;
s_pendingplays.next = NULL;
Com_Printf("\n------- sound initialization -------\n"); Com_Printf("\n------- sound initialization -------\n");
@ -716,6 +717,12 @@ void S_StartSound(vec3_t origin, int entnum, int entchannel, sfx_t *sfx, float f
else else
ps->begin = (int)(start + timeofs * dma.speed); ps->begin = (int)(start + timeofs * dma.speed);
if(s_pendingplays.next == NULL)
{
s_pendingplays = *ps;
return;
}
// sort into the pending sound list // sort into the pending sound list
for (sort = s_pendingplays.next ; for (sort = s_pendingplays.next ;
sort != &s_pendingplays && sort->begin < ps->begin ; sort != &s_pendingplays && sort->begin < ps->begin ;

View File

@ -199,6 +199,10 @@ void S_PaintChannels(int endtime)
while (1) while (1)
{ {
ps = s_pendingplays.next; ps = s_pendingplays.next;
if (ps == NULL)
break;
if (ps == &s_pendingplays) if (ps == &s_pendingplays)
break; // no more pending sounds break; // no more pending sounds
if (ps->begin <= paintedtime) if (ps->begin <= paintedtime)

View File

@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../game/quake2/q_shared.h" #include "../game/quake2/q_shared.h"
#define VERSION 1.02 #define VERSION 1.03
#define BASEDIRNAME "baseq2" #define BASEDIRNAME "baseq2"
#if defined __linux__ #if defined __linux__