r5sdk/r5dev/codecs/bink/bink_impl.h
Kawe Mazidjatari b76f4aa3bd CModule class improvements
*Use unordered_map to get mpdule sections instead, as this is more performant than comparing strings.
* Removed 'm_SectionName' field from ModuleSections_t, as the unordered map now keeps track of them.
* Removed all extraneous module section copies.
* Renamed 'GetImportedFunction' to 'GetImportedSymbol'.
* Renamed 'GetExportedFunction' to 'GetExportedSymbol'.
*Made a static version of 'GetImportedSymbol' and 'GetExportedSymbol', so it could be used on raw module base addresses.
*Created inlines for getting the DOS and NT headers.
*Improved formatting so the code could be read more easily on a vertical monitor.
2023-06-25 10:29:42 +02:00

37 lines
1.3 KiB
C++

#pragma once
inline CMemory p_BinkOpen;
inline auto v_BinkOpen = p_BinkOpen.RCast<void*(*)(HANDLE hBinkFile, UINT32 nFlags)>();
inline CMemory p_BinkClose;
inline auto v_BinkClose = p_BinkClose.RCast<void(*)(HANDLE hBinkFile)>();
inline CMemory p_BinkGetError;
inline auto v_BinkGetError = p_BinkGetError.RCast<const char*(*)(void)>();
///////////////////////////////////////////////////////////////////////////////
class BinkCore : public IDetour
{
virtual void GetAdr(void) const
{
LogFunAdr("BinkOpen", p_BinkOpen.GetPtr());
LogFunAdr("BinkClose", p_BinkClose.GetPtr());
LogFunAdr("BinkGetError", p_BinkGetError.GetPtr());
}
virtual void GetFun(void) const
{
p_BinkOpen = g_RadVideoToolsDll.GetExportedSymbol("BinkOpen");
v_BinkOpen = p_BinkOpen.RCast<void*(*)(HANDLE, UINT32)>();
p_BinkClose = g_RadVideoToolsDll.GetExportedSymbol("BinkClose");
v_BinkClose = p_BinkClose.RCast<void(*)(HANDLE)>();
p_BinkGetError = g_RadVideoToolsDll.GetExportedSymbol("BinkGetError");
v_BinkGetError = p_BinkGetError.RCast<const char* (*)(void)>();
}
virtual void GetVar(void) const { }
virtual void GetCon(void) const { }
virtual void Attach(void) const;
virtual void Detach(void) const;
};
///////////////////////////////////////////////////////////////////////////////