diff --git a/Descent3/osiris_dll.h b/Descent3/osiris_dll.h index 50947cc9..a9684b72 100644 --- a/Descent3/osiris_dll.h +++ b/Descent3/osiris_dll.h @@ -112,11 +112,10 @@ #ifndef __OSIRIS_H_ #define __OSIRIS_H_ -#include "pstypes.h" +#include "cfile.h" +#include "module.h" #include "object_external_struct.h" #include "osiris_share.h" -#include "module.h" -#include "cfile.h" extern uint32_t Osiris_game_checksum; extern tOSIRISModuleInit Osiris_module_init; diff --git a/Descent3/sdlmain.cpp b/Descent3/sdlmain.cpp index 00539174..e44a5db5 100644 --- a/Descent3/sdlmain.cpp +++ b/Descent3/sdlmain.cpp @@ -55,6 +55,10 @@ #include "dedicated_server.h" #include "init.h" +#ifdef WIN32 +#include "debug.h" +#endif + std::filesystem::path orig_pwd; static volatile char already_tried_signal_cleanup = 0; diff --git a/Descent3/tests/CMakeLists.txt b/Descent3/tests/CMakeLists.txt index 5e820bdf..20bb30de 100644 --- a/Descent3/tests/CMakeLists.txt +++ b/Descent3/tests/CMakeLists.txt @@ -7,6 +7,7 @@ add_executable( target_link_libraries( porting-tests + module GTest::gtest_main ) diff --git a/lib/directplay.h b/lib/directplay.h index 2f87450b..408ca47c 100644 --- a/lib/directplay.h +++ b/lib/directplay.h @@ -44,8 +44,11 @@ #ifndef _OUTRAGE_DIRECTPLAY_HEADER #define _OUTRAGE_DIRECTPLAY_HEADER +#include + #include "dplay.h" #include "dplobby.h" +#include "networking.h" struct modem_list { char name[200]; @@ -80,7 +83,7 @@ int dp_DirectPlaySend(network_address *who_to, uint8_t *data, int len, bool reli void dp_DirectPlayDispatch(); // Initialize stuff -int dp_InitDirectPlay(char *conn_name, void *parms = NULL, int num_elements = 0); +int dp_InitDirectPlay(char *conn_name, void *parms = nullptr, int num_elements = 0); // Shutdown things void dp_ShutdownDirectPlay(); diff --git a/module/CMakeLists.txt b/module/CMakeLists.txt index 714b4b87..8bc96153 100644 --- a/module/CMakeLists.txt +++ b/module/CMakeLists.txt @@ -1,8 +1,16 @@ -set(HEADERS) +set(HEADERS + module.h +) set(CPPS - module.cpp) + module.cpp +) add_library(module STATIC ${HEADERS} ${CPPS}) target_link_libraries(module PRIVATE ddebug ) +target_include_directories(module PUBLIC + $ +) \ No newline at end of file diff --git a/lib/module.h b/module/module.h similarity index 100% rename from lib/module.h rename to module/module.h diff --git a/netcon/descent3onlineclient/CMakeLists.txt b/netcon/descent3onlineclient/CMakeLists.txt index 3c3ebcc0..2fcdd697 100644 --- a/netcon/descent3onlineclient/CMakeLists.txt +++ b/netcon/descent3onlineclient/CMakeLists.txt @@ -18,6 +18,7 @@ target_link_libraries(Descent3_Online_TCP_IP PRIVATE ddio inetfile misc + module ui $<$:ws2_32> ) diff --git a/netcon/lanclient/CMakeLists.txt b/netcon/lanclient/CMakeLists.txt index deae8140..f6237c66 100644 --- a/netcon/lanclient/CMakeLists.txt +++ b/netcon/lanclient/CMakeLists.txt @@ -11,6 +11,7 @@ target_link_libraries(Direct_TCP_IP PRIVATE ddio inetfile misc + module ui $<$:ws2_32> ) diff --git a/netcon/mtclient/CMakeLists.txt b/netcon/mtclient/CMakeLists.txt index 0bbfb5cd..5a85ad0a 100644 --- a/netcon/mtclient/CMakeLists.txt +++ b/netcon/mtclient/CMakeLists.txt @@ -21,6 +21,7 @@ target_link_libraries(Parallax_Online PRIVATE ddio inetfile misc + module ui $<$:ws2_32> ) diff --git a/netgames/dmfc/CMakeLists.txt b/netgames/dmfc/CMakeLists.txt index 25a6fb41..0d1784c8 100644 --- a/netgames/dmfc/CMakeLists.txt +++ b/netgames/dmfc/CMakeLists.txt @@ -30,5 +30,6 @@ add_library(dmfc STATIC ${HEADERS} ${CPPS}) target_link_libraries(dmfc PUBLIC grtext misc + module physics ) diff --git a/networking/CMakeLists.txt b/networking/CMakeLists.txt index 966f12ea..39b87f45 100644 --- a/networking/CMakeLists.txt +++ b/networking/CMakeLists.txt @@ -15,6 +15,7 @@ target_link_libraries(networking PRIVATE ddio mem misc + module ${PLATFORM_LIBS} plog::plog ) diff --git a/networking/networking.cpp b/networking/networking.cpp index 31807915..b3084eb0 100644 --- a/networking/networking.cpp +++ b/networking/networking.cpp @@ -290,6 +290,11 @@ #include #include #include + +#include "directplay.h" +#include "dplay.h" +#include "dplobby.h" + typedef int socklen_t; #endif #include @@ -311,36 +316,23 @@ typedef int socklen_t; #define LPSTR char * #endif -#ifdef WIN32 -#include "dplay.h" -#include "dplobby.h" -#endif - #include "descent.h" #include "appdatabase.h" - -#include "pstypes.h" #include "pserror.h" #include "log.h" #include "networking.h" #include "ddio.h" #include "mem.h" +#include "module.h" #include "game.h" #include "args.h" #include "byteswap.h" - -#ifdef WIN32 -#include "directplay.h" -#endif - #include "pstring.h" #ifndef WIN32 bool Use_DirectPlay = false; #endif -#include "module.h" //for some nice defines to use below - #define MAX_CONNECT_TRIES 50 #define MAX_RECEIVE_BUFSIZE 32768 //(1<<16) // 16 K, eh? diff --git a/physics/CMakeLists.txt b/physics/CMakeLists.txt index fb452f1e..3a3cc73d 100644 --- a/physics/CMakeLists.txt +++ b/physics/CMakeLists.txt @@ -15,6 +15,7 @@ target_link_libraries(physics PRIVATE mem misc model + module rtperformance sndlib plog::plog diff --git a/renderer/CMakeLists.txt b/renderer/CMakeLists.txt index 00401bf4..da47d419 100644 --- a/renderer/CMakeLists.txt +++ b/renderer/CMakeLists.txt @@ -40,5 +40,6 @@ target_link_libraries(renderer PRIVATE ddio mem misc + module rtperformance ) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 50c259bd..4de4ddfa 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -79,6 +79,7 @@ foreach(SCRIPT ${SCRIPTS}) target_link_libraries(${SCRIPT} fix misc + module ) set_target_properties(${SCRIPT} PROPERTIES PREFIX "") set_target_properties(${SCRIPT} PROPERTIES CXX_VISIBILITY_PRESET "hidden")