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:
IcePixelx
2022-01-23 18:26:48 +01:00
parent a1f96797c0
commit f43c5da8ae
21 changed files with 380 additions and 93 deletions

View File

@@ -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...);
}