From: divverent Date: Sat, 1 Oct 2011 14:08:36 +0000 (+0000) Subject: CSQC_Event_Sound: pass pitch shift info; actually apply received pitch shift data X-Git-Tag: xonotic-v0.6.0~163^2~169 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c88063697a4bbe0021c5b24938579136ba35e277;p=xonotic%2Fdarkplaces.git CSQC_Event_Sound: pass pitch shift info; actually apply received pitch shift data git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11383 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index 1e81ddef..b4e76e5c 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -195,7 +195,7 @@ 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); +qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos, float speed); /* ================== @@ -289,8 +289,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) ) - S_StartSound (ent, channel, cl.sound_precache[sound_num], pos, volume/255.0f, attenuation); + 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); } /* diff --git a/csprogs.c b/csprogs.c index 69483ae1..51253f3b 100644 --- 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) +qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos, float speed) { qboolean r = false; if(cl.csqc_loaded) @@ -722,7 +722,7 @@ qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float atten PRVM_G_FLOAT(OFS_PARM3) = volume; PRVM_G_FLOAT(OFS_PARM4) = attenuation; VectorCopy(pos, PRVM_G_VECTOR(OFS_PARM5) ); - PRVM_G_FLOAT(OFS_PARM6) = 0; // pitch shift not supported yet + PRVM_G_FLOAT(OFS_PARM6) = speed * 100.0f; PRVM_G_FLOAT(OFS_PARM7) = 0; // flags - none can come in at this point yet PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Event_Sound), "QC function CSQC_Event_Sound is missing"); r = CSQC_RETURNVAL != 0;