mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* All libraries have been isolated from each other, and build into separate artifacts. * Project has been restructured to support isolating libraries. * CCrashHandler now calls a callback on crash (setup from core/dllmain.cpp, this can be setup in any way for any project. This callback is getting called when the apllication crashes. Useful for flushing buffers before closing handles to logging files for example). * Tier0 'CoreMsgV' function now calls a callback sink, which could be set by the user (currently setup to the SDK's internal logger in core/dllmain.cpp). TODO: * Add a batch file to autogenerate all projects. * Add support for dedicated server. * Add support for client dll. Bugs: * Game crashes on the title screen after the UI script compiler has finished (root cause unknown). * Curl error messages are getting logged twice for the dedicated server due to the removal of all "DEDICATED" preprocessor directives to support isolating projects. This has to be fixed properly!
40 lines
1.4 KiB
C++
40 lines
1.4 KiB
C++
//===========================================================================//
|
|
//
|
|
// Purpose: Low-level tier0 interface.
|
|
//
|
|
//===========================================================================//
|
|
#ifndef TIER0_IFACE_H
|
|
#define TIER0_IFACE_H
|
|
|
|
// Module handles; user is responsible for initializing these.
|
|
extern CModule g_GameDll;
|
|
extern CModule g_SDKDll;
|
|
|
|
extern CModule g_RadVideoToolsDll;
|
|
extern CModule g_RadAudioDecoderDll;
|
|
extern CModule g_RadAudioSystemDll;
|
|
|
|
extern string g_LogSessionUUID;
|
|
extern string g_LogSessionDirectory;
|
|
|
|
#define VAR_NAME(varName) #varName
|
|
|
|
#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...);
|
|
}
|
|
|
|
void LogFunAdr(const char* szFun, uintptr_t nAdr); // Logging function addresses.
|
|
void LogVarAdr(const char* szVar, uintptr_t nAdr); // Logging variable addresses.
|
|
void LogConAdr(const char* szCon, uintptr_t nAdr); // Logging constant addresses.
|
|
|
|
#endif // TIER0_IFACE_H
|