Isolate module submodule

This commit is contained in:
Azamat H. Hackimov 2024-09-15 23:24:07 +03:00
parent 9ac702dcda
commit 4f4ab3bd20
15 changed files with 35 additions and 20 deletions

View File

@ -112,11 +112,10 @@
#ifndef __OSIRIS_H_ #ifndef __OSIRIS_H_
#define __OSIRIS_H_ #define __OSIRIS_H_
#include "pstypes.h" #include "cfile.h"
#include "module.h"
#include "object_external_struct.h" #include "object_external_struct.h"
#include "osiris_share.h" #include "osiris_share.h"
#include "module.h"
#include "cfile.h"
extern uint32_t Osiris_game_checksum; extern uint32_t Osiris_game_checksum;
extern tOSIRISModuleInit Osiris_module_init; extern tOSIRISModuleInit Osiris_module_init;

View File

@ -55,6 +55,10 @@
#include "dedicated_server.h" #include "dedicated_server.h"
#include "init.h" #include "init.h"
#ifdef WIN32
#include "debug.h"
#endif
std::filesystem::path orig_pwd; std::filesystem::path orig_pwd;
static volatile char already_tried_signal_cleanup = 0; static volatile char already_tried_signal_cleanup = 0;

View File

@ -7,6 +7,7 @@ add_executable(
target_link_libraries( target_link_libraries(
porting-tests porting-tests
module
GTest::gtest_main GTest::gtest_main
) )

View File

@ -44,8 +44,11 @@
#ifndef _OUTRAGE_DIRECTPLAY_HEADER #ifndef _OUTRAGE_DIRECTPLAY_HEADER
#define _OUTRAGE_DIRECTPLAY_HEADER #define _OUTRAGE_DIRECTPLAY_HEADER
#include <cstdint>
#include "dplay.h" #include "dplay.h"
#include "dplobby.h" #include "dplobby.h"
#include "networking.h"
struct modem_list { struct modem_list {
char name[200]; char name[200];
@ -80,7 +83,7 @@ int dp_DirectPlaySend(network_address *who_to, uint8_t *data, int len, bool reli
void dp_DirectPlayDispatch(); void dp_DirectPlayDispatch();
// Initialize stuff // 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 // Shutdown things
void dp_ShutdownDirectPlay(); void dp_ShutdownDirectPlay();

View File

@ -1,8 +1,16 @@
set(HEADERS) set(HEADERS
module.h
)
set(CPPS set(CPPS
module.cpp) module.cpp
)
add_library(module STATIC ${HEADERS} ${CPPS}) add_library(module STATIC ${HEADERS} ${CPPS})
target_link_libraries(module PRIVATE target_link_libraries(module PRIVATE
ddebug ddebug
) )
target_include_directories(module PUBLIC
$<BUILD_INTERFACE:
${PROJECT_SOURCE_DIR}/module
>
)

View File

@ -18,6 +18,7 @@ target_link_libraries(Descent3_Online_TCP_IP PRIVATE
ddio ddio
inetfile inetfile
misc misc
module
ui ui
$<$<PLATFORM_ID:Windows>:ws2_32> $<$<PLATFORM_ID:Windows>:ws2_32>
) )

View File

@ -11,6 +11,7 @@ target_link_libraries(Direct_TCP_IP PRIVATE
ddio ddio
inetfile inetfile
misc misc
module
ui ui
$<$<PLATFORM_ID:Windows>:ws2_32> $<$<PLATFORM_ID:Windows>:ws2_32>
) )

View File

@ -21,6 +21,7 @@ target_link_libraries(Parallax_Online PRIVATE
ddio ddio
inetfile inetfile
misc misc
module
ui ui
$<$<PLATFORM_ID:Windows>:ws2_32> $<$<PLATFORM_ID:Windows>:ws2_32>
) )

View File

@ -30,5 +30,6 @@ add_library(dmfc STATIC ${HEADERS} ${CPPS})
target_link_libraries(dmfc PUBLIC target_link_libraries(dmfc PUBLIC
grtext grtext
misc misc
module
physics physics
) )

View File

@ -15,6 +15,7 @@ target_link_libraries(networking PRIVATE
ddio ddio
mem mem
misc misc
module
${PLATFORM_LIBS} ${PLATFORM_LIBS}
plog::plog plog::plog
) )

View File

@ -290,6 +290,11 @@
#include <process.h> #include <process.h>
#include <wsipx.h> #include <wsipx.h>
#include <ras.h> #include <ras.h>
#include "directplay.h"
#include "dplay.h"
#include "dplobby.h"
typedef int socklen_t; typedef int socklen_t;
#endif #endif
#include <stdlib.h> #include <stdlib.h>
@ -311,36 +316,23 @@ typedef int socklen_t;
#define LPSTR char * #define LPSTR char *
#endif #endif
#ifdef WIN32
#include "dplay.h"
#include "dplobby.h"
#endif
#include "descent.h" #include "descent.h"
#include "appdatabase.h" #include "appdatabase.h"
#include "pstypes.h"
#include "pserror.h" #include "pserror.h"
#include "log.h" #include "log.h"
#include "networking.h" #include "networking.h"
#include "ddio.h" #include "ddio.h"
#include "mem.h" #include "mem.h"
#include "module.h"
#include "game.h" #include "game.h"
#include "args.h" #include "args.h"
#include "byteswap.h" #include "byteswap.h"
#ifdef WIN32
#include "directplay.h"
#endif
#include "pstring.h" #include "pstring.h"
#ifndef WIN32 #ifndef WIN32
bool Use_DirectPlay = false; bool Use_DirectPlay = false;
#endif #endif
#include "module.h" //for some nice defines to use below
#define MAX_CONNECT_TRIES 50 #define MAX_CONNECT_TRIES 50
#define MAX_RECEIVE_BUFSIZE 32768 #define MAX_RECEIVE_BUFSIZE 32768
//(1<<16) // 16 K, eh? //(1<<16) // 16 K, eh?

View File

@ -15,6 +15,7 @@ target_link_libraries(physics PRIVATE
mem mem
misc misc
model model
module
rtperformance rtperformance
sndlib sndlib
plog::plog plog::plog

View File

@ -40,5 +40,6 @@ target_link_libraries(renderer PRIVATE
ddio ddio
mem mem
misc misc
module
rtperformance rtperformance
) )

View File

@ -79,6 +79,7 @@ foreach(SCRIPT ${SCRIPTS})
target_link_libraries(${SCRIPT} target_link_libraries(${SCRIPT}
fix fix
misc misc
module
) )
set_target_properties(${SCRIPT} PROPERTIES PREFIX "") set_target_properties(${SCRIPT} PROPERTIES PREFIX "")
set_target_properties(${SCRIPT} PROPERTIES CXX_VISIBILITY_PRESET "hidden") set_target_properties(${SCRIPT} PROPERTIES CXX_VISIBILITY_PRESET "hidden")