]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
removed S_StartSound_StartPosition function because it was unnecessary
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 12 Oct 2011 08:18:30 +0000 (08:18 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 12 Oct 2011 08:18:30 +0000 (08:18 +0000)
make sure flags is passed correctly to CL_VM_Event_Sound and
S_StartSound_StartPosition_Flags

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11399 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
clvm_cmds.c
csprogs.c
snd_main.c
snd_null.c
sound.h

index b4e76e5c1e7423ffa69317363a705ef6ac738542..b0554e862eb12cb32c7c3e745d618acfb6f7b0d7 100644 (file)
@@ -194,8 +194,8 @@ static void QW_CL_NextUpload(void);
 void QW_CL_StartUpload(unsigned char *data, int size);
 //static qboolean QW_CL_IsUploading(void);
 static void QW_CL_StopUpload(void);
-void CL_VM_UpdateIntermissionState(int intermission);
-qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos, float speed);
+extern void CL_VM_UpdateIntermissionState(int intermission);
+extern qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos, int flags, float speed);
 
 /*
 ==================
@@ -211,6 +211,7 @@ void CL_ParseStartSoundPacket(int largesoundindex)
        int     field_mask;
        float   attenuation;
        float   speed;
+       int             fflags = CHANNELFLAG_NONE;
 
        if (cls.protocol == PROTOCOL_QUAKEWORLD)
        {
@@ -289,8 +290,8 @@ void CL_ParseStartSoundPacket(int largesoundindex)
        if (ent >= cl.max_entities)
                CL_ExpandEntities(ent);
 
-       if( !CL_VM_Event_Sound(sound_num, volume / 255.0f, channel, attenuation, ent, pos, speed) )
-               S_StartSound_StartPosition_Flags (ent, channel, cl.sound_precache[sound_num], pos, volume/255.0f, attenuation, 0, CHANNELFLAG_NONE, speed);
+       if( !CL_VM_Event_Sound(sound_num, volume / 255.0f, channel, attenuation, ent, pos, fflags, speed) )
+               S_StartSound_StartPosition_Flags (ent, channel, cl.sound_precache[sound_num], pos, volume/255.0f, attenuation, 0, fflags, speed);
 }
 
 /*
index 965b64ebf8eeaf3402ffa4e3ad2d0643c11e85c2..16b37e0322cae274ff43cccc25c3c91bdef75616 100644 (file)
@@ -205,7 +205,7 @@ static void VM_CL_sound (void)
        }
 
        CL_VM_GetEntitySoundOrigin(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), org);
-       S_StartSound_StartPosition_Flags(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, volume, attenuation, 0, CHANNELFLAG_NONE, pitchchange > 0.0f ? pitchchange * 0.01f : 1.0f);
+       S_StartSound_StartPosition_Flags(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, volume, attenuation, 0, flags, pitchchange > 0.0f ? pitchchange * 0.01f : 1.0f);
 }
 
 // #483 void(vector origin, string sample, float volume, float attenuation) pointsound
index 51253f3b59899b1ac1ca5d1c95344f65ee9dd216..1d3065db1b7deca1e56629cd0b9e9d99257eb590 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -706,7 +706,7 @@ void CL_VM_UpdateShowingScoresState (int showingscores)
                CSQC_END
        }
 }
-qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos, float speed)
+qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos, int flags, float speed)
 {
        qboolean r = false;
        if(cl.csqc_loaded)
@@ -723,7 +723,7 @@ qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float atten
                        PRVM_G_FLOAT(OFS_PARM4) = attenuation;
                        VectorCopy(pos, PRVM_G_VECTOR(OFS_PARM5) );
                        PRVM_G_FLOAT(OFS_PARM6) = speed * 100.0f;
-                       PRVM_G_FLOAT(OFS_PARM7) = 0; // flags - none can come in at this point yet
+                       PRVM_G_FLOAT(OFS_PARM7) = flags; // flags
                        PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Event_Sound), "QC function CSQC_Event_Sound is missing");
                        r = CSQC_RETURNVAL != 0;
                }
index 2f7e871af7a4ed32f33b700ab555738bc93081d8..c937615bc05772cb51f70634d125e2314efbed4c 100644 (file)
@@ -1718,14 +1718,9 @@ int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, ve
        return (target_chan - channels);
 }
 
-int S_StartSound_StartPosition (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition)
-{
-       return S_StartSound_StartPosition_Flags(entnum, entchannel, sfx, origin, fvol, attenuation, startposition, CHANNELFLAG_NONE, 1.0f);
-}
-
 int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
 {
-       return S_StartSound_StartPosition(entnum, entchannel, sfx, origin, fvol, attenuation, 0);
+       return S_StartSound_StartPosition_Flags(entnum, entchannel, sfx, origin, fvol, attenuation, 0, CHANNELFLAG_NONE, 1.0f);
 }
 
 void S_StopChannel (unsigned int channel_ind, qboolean lockmutex, qboolean freesfx)
index a30bfd796c4b20458f0260a38fb8d47a3e61dd92..47548e0a807d4a3173d4ca227516f8fc6902607e 100755 (executable)
@@ -69,11 +69,6 @@ int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
        return -1;
 }
 
-int S_StartSound_StartPosition (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition)
-{
-       return -1;
-}
-
 int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition, int flags, float fspeed)
 {
        return -1;
diff --git a/sound.h b/sound.h
index 86839d17aba80a6c93e8a90d5c50043ee56de9a7..cacb23ae5e878818c03319727cbe6995e765cad9 100644 (file)
--- a/sound.h
+++ b/sound.h
@@ -97,7 +97,6 @@ qboolean S_IsSoundPrecached (const sfx_t *sfx);
 
 // S_StartSound returns the channel index, or -1 if an error occurred
 int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
-int S_StartSound_StartPosition (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition);
 int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition, int flags, float fspeed);
 qboolean S_LocalSound (const char *s);