Updated Core and SDK Tools for ep2v EmitSound sdk change.
Updated Core and SDK Tools for ep2v EmitSound sdk change.
1.1 --- a/core/MenuStyle_Base.cpp Wed Jun 27 22:18:38 2012 -0400
1.2 +++ b/core/MenuStyle_Base.cpp Wed Jun 27 22:42:23 2012 -0400
1.3 @@ -337,6 +337,9 @@
1.4 #endif
1.5 0,
1.6 PITCH_NORM,
1.7 +#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
1.8 + 0,
1.9 +#endif
1.10 &pos);
1.11 }
1.12 }
2.1 --- a/extensions/sdktools/vnatives.cpp Wed Jun 27 22:18:38 2012 -0400
2.2 +++ b/extensions/sdktools/vnatives.cpp Wed Jun 27 22:42:23 2012 -0400
2.3 @@ -528,7 +528,9 @@
2.4 CellRecipientFilter rf;
2.5 rf.SetToReliable(true);
2.6 rf.Initialize(player_list, total_players);
2.7 -#if SOURCE_ENGINE < SE_PORTAL2
2.8 +#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
2.9 + engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, 0, &pos);
2.10 +#elif SOURCE_ENGINE < SE_PORTAL2
2.11 engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, &pos);
2.12 #else
2.13 engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, -1, sound_name, VOL_NORM, ATTN_NORM, 0, 0, PITCH_NORM, &pos);
3.1 --- a/extensions/sdktools/vsound.cpp Wed Jun 27 22:18:38 2012 -0400
3.2 +++ b/extensions/sdktools/vsound.cpp Wed Jun 27 22:42:23 2012 -0400
3.3 @@ -36,6 +36,9 @@
3.4 #if SOURCE_ENGINE >= SE_PORTAL2
3.5 SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 0, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
3.6 SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 1, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
3.7 +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
3.8 +SH_DECL_HOOK15_void(IEngineSound, EmitSound, SH_NOATTRIB, 0, IRecipientFilter &, int, int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
3.9 +SH_DECL_HOOK15_void(IEngineSound, EmitSound, SH_NOATTRIB, 1, IRecipientFilter &, int, int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
3.10 #else
3.11 SH_DECL_HOOK14_void(IEngineSound, EmitSound, SH_NOATTRIB, 0, IRecipientFilter &, int, int, const char *, float, float, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
3.12 SH_DECL_HOOK14_void(IEngineSound, EmitSound, SH_NOATTRIB, 1, IRecipientFilter &, int, int, const char *, float, soundlevel_t, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
3.13 @@ -262,6 +265,11 @@
3.14 float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin,
3.15 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
3.16 float soundtime, int speakerentity)
3.17 +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
3.18 +void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample,
3.19 + float flVolume, soundlevel_t iSoundlevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin,
3.20 + const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
3.21 + float soundtime, int speakerentity)
3.22 #else
3.23 void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample,
3.24 float flVolume, soundlevel_t iSoundlevel, int iFlags, int iPitch, const Vector *pOrigin,
3.25 @@ -318,6 +326,14 @@
3.26 (crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, iSoundlevel, nSeed, iFlags, iPitch, pOrigin,
3.27 pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
3.28 );
3.29 +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
3.30 + RETURN_META_NEWPARAMS(
3.31 + MRES_IGNORED,
3.32 + static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float, soundlevel_t,
3.33 + int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>(&IEngineSound::EmitSound),
3.34 + (crf, iEntIndex, iChannel, buffer, flVolume, iSoundlevel, iFlags, iPitch, iSpecialDSP, pOrigin,
3.35 + pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
3.36 + );
3.37 #else
3.38 RETURN_META_NEWPARAMS(
3.39 MRES_IGNORED,
3.40 @@ -341,6 +357,11 @@
3.41 float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const Vector *pOrigin,
3.42 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
3.43 float soundtime, int speakerentity)
3.44 +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
3.45 +void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample,
3.46 + float flVolume, float flAttenuation, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin,
3.47 + const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
3.48 + float soundtime, int speakerentity)
3.49 #else
3.50 void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample,
3.51 float flVolume, float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin,
3.52 @@ -398,6 +419,14 @@
3.53 (crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, SNDLVL_TO_ATTN(static_cast<soundlevel_t>(sndlevel)),
3.54 nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
3.55 );
3.56 +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
3.57 +RETURN_META_NEWPARAMS(
3.58 + MRES_IGNORED,
3.59 + static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char *, float, float,
3.60 + int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>(&IEngineSound::EmitSound),
3.61 + (crf, iEntIndex, iChannel, buffer, flVolume, SNDLVL_TO_ATTN(static_cast<soundlevel_t>(sndlevel)),
3.62 + iFlags, iPitch, iSpecialDSP, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
3.63 + );
3.64 #else
3.65 RETURN_META_NEWPARAMS(
3.66 MRES_IGNORED,
3.67 @@ -654,6 +683,47 @@
3.68 soundtime,
3.69 speakerentity);
3.70 }
3.71 +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
3.72 + if (g_InSoundHook)
3.73 + {
3.74 + SH_CALL(enginesoundPatch,
3.75 + static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float,
3.76 + soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>
3.77 + (&IEngineSound::EmitSound))
3.78 + (crf,
3.79 + player[0],
3.80 + channel,
3.81 + sample,
3.82 + vol,
3.83 + (soundlevel_t)level,
3.84 + flags,
3.85 + pitch,
3.86 + 0,
3.87 + pOrigin,
3.88 + pDir,
3.89 + pOrigVec,
3.90 + updatePos,
3.91 + soundtime,
3.92 + speakerentity);
3.93 + }
3.94 + else
3.95 + {
3.96 + engsound->EmitSound(crf,
3.97 + player[0],
3.98 + channel,
3.99 + sample,
3.100 + vol,
3.101 + (soundlevel_t)level,
3.102 + flags,
3.103 + pitch,
3.104 + 0,
3.105 + pOrigin,
3.106 + pDir,
3.107 + pOrigVec,
3.108 + updatePos,
3.109 + soundtime,
3.110 + speakerentity);
3.111 + }
3.112 #else
3.113 if (g_InSoundHook)
3.114 {
3.115 @@ -741,6 +811,47 @@
3.116 soundtime,
3.117 speakerentity);
3.118 }
3.119 +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
3.120 + if (g_InSoundHook)
3.121 + {
3.122 + SH_CALL(enginesoundPatch,
3.123 + static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float,
3.124 + soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>
3.125 + (&IEngineSound::EmitSound))
3.126 + (crf,
3.127 + entity,
3.128 + channel,
3.129 + sample,
3.130 + vol,
3.131 + (soundlevel_t)level,
3.132 + flags,
3.133 + pitch,
3.134 + 0,
3.135 + pOrigin,
3.136 + pDir,
3.137 + pOrigVec,
3.138 + updatePos,
3.139 + soundtime,
3.140 + speakerentity);
3.141 + }
3.142 + else
3.143 + {
3.144 + engsound->EmitSound(crf,
3.145 + entity,
3.146 + channel,
3.147 + sample,
3.148 + vol,
3.149 + (soundlevel_t)level,
3.150 + flags,
3.151 + pitch,
3.152 + 0,
3.153 + pOrigin,
3.154 + pDir,
3.155 + pOrigVec,
3.156 + updatePos,
3.157 + soundtime,
3.158 + speakerentity);
3.159 + }
3.160 #else
3.161 if (g_InSoundHook)
3.162 {
4.1 --- a/extensions/sdktools/vsound.h Wed Jun 27 22:18:38 2012 -0400
4.2 +++ b/extensions/sdktools/vsound.h Wed Jun 27 22:42:23 2012 -0400
4.3 @@ -63,6 +63,17 @@
4.4 #else
4.5 void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol,
4.6 soundlevel_t soundlevel, int fFlags, int pitch, float delay);
4.7 +#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
4.8 +
4.9 + void OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume,
4.10 + soundlevel_t iSoundlevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin,
4.11 + const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
4.12 + float soundtime, int speakerentity);
4.13 + void OnEmitSound2(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume,
4.14 + float flAttenuation, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin,
4.15 + const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
4.16 + float soundtime, int speakerentity);
4.17 +#else
4.18 void OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume,
4.19 soundlevel_t iSoundlevel, int iFlags, int iPitch, const Vector *pOrigin,
4.20 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
4.21 @@ -71,7 +82,8 @@
4.22 float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin,
4.23 const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
4.24 float soundtime, int speakerentity);
4.25 -#endif
4.26 +#endif // SOURCE_ENGINE == SE_ORANGEBOXVALVE
4.27 +#endif // SOURCE_ENGINE >= SE_PORTAL2
4.28 private:
4.29 size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter);
4.30 void _IncRefCounter(int type);