mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-09-16 15:02:35 +02:00
Huge engine/host commit.
* Rebuild CModGroupApp::Main, did not include the dedicated routine with the empty class global. * Using a template function now for virtual function calls * Implemented most of the CEngine class and grabbing its global var now. * Using local CEngine now in FrameUpdate * Implemented EngineParms_t fully and grabbing its global var. * Added macro for adding class member variables at offsets. A lot of comments added regarding what needs to be done for this commit. * Check other season compability, wasn't able to do that due to not having access to said binaries at the moment. * Fix sdklauncher to use widestrings to fix the bug with other languages in path
This commit is contained in:
@@ -73,3 +73,17 @@ namespace
|
||||
MODULE g_mRadAudioSystemDll = MODULE("mileswin64.dll");
|
||||
}
|
||||
#endif // !SDKLAUNCHER
|
||||
|
||||
// Since we wanna be able to use it anywhere I thought this might be the best location for it. Since it gets inlined anyway.
|
||||
#define MEMBER_AT_OFFSET(varType, varName, offset) \
|
||||
varType& varName() \
|
||||
{ \
|
||||
static int _##varName = offset; \
|
||||
return *(varType*)((std::uintptr_t)this + _##varName); \
|
||||
}
|
||||
|
||||
template <typename ReturnType, typename ...Args>
|
||||
ReturnType CallVFunc(int index, void* thisPtr, Args... args)
|
||||
{
|
||||
return (*reinterpret_cast<ReturnType(__fastcall***)(void*, Args...)>(thisPtr))[index](thisPtr, args...);
|
||||
}
|
Reference in New Issue
Block a user