mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-07-01 20:37:17 +02:00
Miles: fix voice comm bus regression
Regression was caused in commit 3bb4ee6258
. The new sound engine has breaking changes in its exports. Added shim layer to fix incompatibilities on the export 'MilesSampleSetSourceRaw'.
This commit is contained in:
@ -11,6 +11,8 @@ add_sources( SOURCE_GROUP "Bink"
|
|||||||
add_sources( SOURCE_GROUP "Miles"
|
add_sources( SOURCE_GROUP "Miles"
|
||||||
"miles/miles_impl.cpp"
|
"miles/miles_impl.cpp"
|
||||||
"miles/miles_impl.h"
|
"miles/miles_impl.h"
|
||||||
|
"miles/miles_shim.cpp"
|
||||||
|
"miles/miles_shim.h"
|
||||||
"miles/miles_types.h" # TODO[ AMOS ]: move to public!
|
"miles/miles_types.h" # TODO[ AMOS ]: move to public!
|
||||||
"miles/radshal_wasapi.h"
|
"miles/radshal_wasapi.h"
|
||||||
)
|
)
|
||||||
|
@ -6,6 +6,7 @@ inline void(*v_AIL_LogFunc)(int64_t nLogLevel, const char* pszMessage);
|
|||||||
inline bool(*v_Miles_Initialize)();
|
inline bool(*v_Miles_Initialize)();
|
||||||
inline void(*v_MilesQueueEventRun)(Miles::Queue*, const char*);
|
inline void(*v_MilesQueueEventRun)(Miles::Queue*, const char*);
|
||||||
inline void(*v_MilesBankPatch)(Miles::Bank*, char*, char*);
|
inline void(*v_MilesBankPatch)(Miles::Bank*, char*, char*);
|
||||||
|
inline unsigned int (*v_MilesSampleSetSourceRaw)(__int64 a1, __int64 a2, unsigned int a3, int a4, unsigned __int16 a5, bool a6);
|
||||||
inline void(*v_CSOM_AddEventToQueue)(const char* eventName);
|
inline void(*v_CSOM_AddEventToQueue)(const char* eventName);
|
||||||
|
|
||||||
struct MilesBankList_t
|
struct MilesBankList_t
|
||||||
@ -54,6 +55,7 @@ class MilesCore : public IDetour
|
|||||||
LogFunAdr("Miles_Initialize", v_Miles_Initialize);
|
LogFunAdr("Miles_Initialize", v_Miles_Initialize);
|
||||||
LogFunAdr("MilesQueueEventRun", v_MilesQueueEventRun);
|
LogFunAdr("MilesQueueEventRun", v_MilesQueueEventRun);
|
||||||
LogFunAdr("MilesBankPatch", v_MilesBankPatch);
|
LogFunAdr("MilesBankPatch", v_MilesBankPatch);
|
||||||
|
LogFunAdr("MilesSampleSetSourceRaw", v_MilesSampleSetSourceRaw);
|
||||||
LogFunAdr("CSOM_AddEventToQueue", v_CSOM_AddEventToQueue);
|
LogFunAdr("CSOM_AddEventToQueue", v_CSOM_AddEventToQueue);
|
||||||
LogVarAdr("g_milesGlobals", g_milesGlobals);
|
LogVarAdr("g_milesGlobals", g_milesGlobals);
|
||||||
}
|
}
|
||||||
@ -69,6 +71,7 @@ class MilesCore : public IDetour
|
|||||||
|
|
||||||
g_RadAudioSystemDll.GetExportedSymbol("MilesQueueEventRun").GetPtr(v_MilesQueueEventRun);
|
g_RadAudioSystemDll.GetExportedSymbol("MilesQueueEventRun").GetPtr(v_MilesQueueEventRun);
|
||||||
g_RadAudioSystemDll.GetExportedSymbol("MilesBankPatch").GetPtr(v_MilesBankPatch);
|
g_RadAudioSystemDll.GetExportedSymbol("MilesBankPatch").GetPtr(v_MilesBankPatch);
|
||||||
|
g_RadAudioSystemDll.GetExportedSymbol("MilesSampleSetSourceRaw").GetPtr(v_MilesSampleSetSourceRaw);
|
||||||
}
|
}
|
||||||
virtual void GetVar(void) const { }
|
virtual void GetVar(void) const { }
|
||||||
virtual void GetCon(void) const { }
|
virtual void GetCon(void) const { }
|
||||||
|
27
r5dev/codecs/miles/miles_shim.cpp
Normal file
27
r5dev/codecs/miles/miles_shim.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
//=============================================================================//
|
||||||
|
//
|
||||||
|
// Purpose: Miles Sound System interface shim
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// The engine is compiled with version 10.0.42, this shim layer fixes any
|
||||||
|
// incompatibilities between upgrades. On more recent versions of the Miles
|
||||||
|
// Sound System, some exports have been renamed and/or thoroughly changed.
|
||||||
|
// If we upgrade to these versions, we need to convert this into an actual
|
||||||
|
// DLL shim layer instead of linking it statically with the SDK module.
|
||||||
|
//=============================================================================//
|
||||||
|
#include "miles_impl.h"
|
||||||
|
#include "miles_shim.h"
|
||||||
|
|
||||||
|
unsigned int MilesSampleSetSourceRaw(__int64 a1, __int64 a2, unsigned int a3, int a4, unsigned __int16 a5, bool a6)
|
||||||
|
{
|
||||||
|
// interface fix from 10.0.42 --> 10.0.47. As of version (10.0.43 ?) the
|
||||||
|
// export 'MilesSampleSetSourceRaw' has a newly added bool parameter. The
|
||||||
|
// purpose of this is unknown, but we need to set it to false as they
|
||||||
|
// otherwise would distort the voice comm bus.
|
||||||
|
return v_MilesSampleSetSourceRaw(a1, a2, a3, a4, a5, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MilesShim::Detour(const bool bAttach) const
|
||||||
|
{
|
||||||
|
DetourSetup(&v_MilesSampleSetSourceRaw, &MilesSampleSetSourceRaw, bAttach);
|
||||||
|
}
|
13
r5dev/codecs/miles/miles_shim.h
Normal file
13
r5dev/codecs/miles/miles_shim.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef MILES_SHIM_H
|
||||||
|
#define MILES_SHIM_H
|
||||||
|
|
||||||
|
class MilesShim : public IDetour
|
||||||
|
{
|
||||||
|
virtual void GetAdr(void) const { }
|
||||||
|
virtual void GetFun(void) const { }
|
||||||
|
virtual void GetVar(void) const { }
|
||||||
|
virtual void GetCon(void) const { }
|
||||||
|
virtual void Detour(const bool bAttach) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // MILES_SHIM_H
|
@ -35,6 +35,7 @@
|
|||||||
#ifndef DEDICATED
|
#ifndef DEDICATED
|
||||||
#include "codecs/bink/bink_impl.h"
|
#include "codecs/bink/bink_impl.h"
|
||||||
#include "codecs/miles/miles_impl.h"
|
#include "codecs/miles/miles_impl.h"
|
||||||
|
#include "codecs/miles/miles_shim.h"
|
||||||
#include "codecs/miles/radshal_wasapi.h"
|
#include "codecs/miles/radshal_wasapi.h"
|
||||||
#endif // !DEDICATED
|
#endif // !DEDICATED
|
||||||
#include "vphysics/physics_collide.h"
|
#include "vphysics/physics_collide.h"
|
||||||
@ -525,6 +526,7 @@ void DetourRegister() // Register detour classes to be searched and hooked.
|
|||||||
// Codecs
|
// Codecs
|
||||||
REGISTER(BinkCore); // REGISTER CLIENT ONLY!
|
REGISTER(BinkCore); // REGISTER CLIENT ONLY!
|
||||||
REGISTER(MilesCore); // REGISTER CLIENT ONLY!
|
REGISTER(MilesCore); // REGISTER CLIENT ONLY!
|
||||||
|
REGISTER(MilesShim);
|
||||||
REGISTER(VRadShal);
|
REGISTER(VRadShal);
|
||||||
|
|
||||||
#endif // !DEDICATED
|
#endif // !DEDICATED
|
||||||
|
Reference in New Issue
Block a user