mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-21 15:32:34 +00:00
core: load exchndl.dll at runtime
This allows the game to run without exchndl.dll present.
This commit is contained in:
parent
4a7463d134
commit
d53efbdace
2 changed files with 16 additions and 15 deletions
|
|
@ -310,15 +310,6 @@ if("${SRB2_CONFIG_HWRENDER}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# TODO: build this with the game
|
|
||||||
if(${CMAKE_SYSTEM} MATCHES Windows AND ${CMAKE_C_COMPILER_ID} MATCHES "GNU" AND ${SRB2_SYSTEM_BITS} EQUAL 32)
|
|
||||||
target_link_libraries(SRB2SDL2 PRIVATE
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/../libs/drmingw/lib/win32/libexchndl.a"
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/../libs/drmingw/lib/win32/libmgwhelp.a"
|
|
||||||
)
|
|
||||||
target_include_directories(SRB2SDL2 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../libs/drmingw/include")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${SRB2_CONFIG_USEASM})
|
if(${SRB2_CONFIG_USEASM})
|
||||||
#SRB2_ASM_FLAGS can be used to pass flags to either nasm or yasm.
|
#SRB2_ASM_FLAGS can be used to pass flags to either nasm or yasm.
|
||||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||||
|
|
@ -401,7 +392,7 @@ target_compile_options(SRB2SDL2 PRIVATE
|
||||||
-Winline
|
-Winline
|
||||||
-Wformat-y2k
|
-Wformat-y2k
|
||||||
-Wformat-security
|
-Wformat-security
|
||||||
|
|
||||||
$<$<VERSION_LESS:$<C_COMPILER_VERSION>,2.9.5>:
|
$<$<VERSION_LESS:$<C_COMPILER_VERSION>,2.9.5>:
|
||||||
-Wno-div-by-zero
|
-Wno-div-by-zero
|
||||||
-Wendif-labels
|
-Wendif-labels
|
||||||
|
|
|
||||||
|
|
@ -71,10 +71,6 @@ char logfilename[1024];
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (_WIN32)
|
|
||||||
#include <exchndl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (_WIN32)
|
#if defined (_WIN32)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "../win32/win_dbg.h"
|
#include "../win32/win_dbg.h"
|
||||||
|
|
@ -202,6 +198,20 @@ static void InitLogging(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void init_exchndl()
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
HMODULE exchndl_module = LoadLibraryA("exchndl.dll");
|
||||||
|
if (exchndl_module != NULL)
|
||||||
|
{
|
||||||
|
using PFN_ExcHndlInit = void(*)(void);
|
||||||
|
PFN_ExcHndlInit pfnExcHndlInit = reinterpret_cast<PFN_ExcHndlInit>(
|
||||||
|
GetProcAddress(exchndl_module, "ExcHndlInit"));
|
||||||
|
if (pfnExcHndlInit != NULL)
|
||||||
|
(pfnExcHndlInit)();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static void
|
static void
|
||||||
|
|
@ -294,7 +304,7 @@ int main(int argc, char **argv)
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ExcHndlInit();
|
init_exchndl();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef __MINGW32__
|
#ifndef __MINGW32__
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue