diff --git a/2dlib/CMakeLists.txt b/2dlib/CMakeLists.txt index 038ebe05c..c37667cef 100644 --- a/2dlib/CMakeLists.txt +++ b/2dlib/CMakeLists.txt @@ -12,4 +12,12 @@ set(CPPS add_library(2dlib STATIC ${HEADERS} ${CPPS}) target_link_libraries(2dlib PRIVATE cfile + bitmap + renderer +) + +target_include_directories(2dlib PUBLIC + $ ) diff --git a/lib/Ddgr.h b/2dlib/ddgr.h similarity index 99% rename from lib/Ddgr.h rename to 2dlib/ddgr.h index 820876769..7bce392ab 100644 --- a/lib/Ddgr.h +++ b/2dlib/ddgr.h @@ -78,8 +78,6 @@ #ifndef _DDGR_H #define _DDGR_H -#include "pstypes.h" -#include "Macros.h" #include "grdefs.h" // ---------------------------------------------------------------------------- diff --git a/lib/gr.h b/2dlib/gr.h similarity index 99% rename from lib/gr.h rename to 2dlib/gr.h index 762e1a57d..105424a50 100644 --- a/lib/gr.h +++ b/2dlib/gr.h @@ -104,7 +104,7 @@ #ifndef _GR_H #define _GR_H -#include "Ddgr.h" +#include "ddgr.h" #include "fix.h" #include "pserror.h" #include "pstypes.h" diff --git a/lib/grdefs.h b/2dlib/grdefs.h similarity index 100% rename from lib/grdefs.h rename to 2dlib/grdefs.h diff --git a/2dlib/lib2d.h b/2dlib/lib2d.h index 9615fb6bb..ce335dcf3 100644 --- a/2dlib/lib2d.h +++ b/2dlib/lib2d.h @@ -24,7 +24,7 @@ #define LIB2D_H #include "gr.h" -#include "renderer.h" +#include "ddgr.h" // structures diff --git a/2dlib/memsurf.cpp b/2dlib/memsurf.cpp index 6d96729a4..6e7a758a5 100644 --- a/2dlib/memsurf.cpp +++ b/2dlib/memsurf.cpp @@ -68,12 +68,13 @@ * $NoKeywords: $ */ -#include "lib2d.h" +#include "gr.h" -#include "bitmap.h" +#include +#include -#include -#include +#include "lib2d.h" +#include "bitmap.h" #include "mem.h" // ---------------------------------------------------------------------------- diff --git a/2dlib/pen.cpp b/2dlib/pen.cpp index df0b61e73..16fcce413 100644 --- a/2dlib/pen.cpp +++ b/2dlib/pen.cpp @@ -93,6 +93,7 @@ #include "lib2d.h" #include "pserror.h" +#include "renderer.h" #define CLIP_LEFT (vp_InitLeft + vp_Left) #define CLIP_TOP (vp_InitTop + vp_Top) diff --git a/AudioEncode/CMakeLists.txt b/AudioEncode/CMakeLists.txt index 8415e67b1..c298991ed 100644 --- a/AudioEncode/CMakeLists.txt +++ b/AudioEncode/CMakeLists.txt @@ -1,6 +1,13 @@ -set(HEADERS) +set(HEADERS + audio_encode.h) set(CPPS - encoder.cpp) + audio_encode.cpp) add_library(AudioEncode STATIC ${HEADERS} ${CPPS}) target_link_libraries(AudioEncode libacm) + +target_include_directories(AudioEncode PUBLIC + $ +) diff --git a/AudioEncode/encoder.cpp b/AudioEncode/audio_encode.cpp similarity index 99% rename from AudioEncode/encoder.cpp rename to AudioEncode/audio_encode.cpp index 8e1fa36cf..dc142f4d8 100644 --- a/AudioEncode/encoder.cpp +++ b/AudioEncode/audio_encode.cpp @@ -22,7 +22,7 @@ #include #include "audio_encode.h" #include "mono.h" -#include "Aencode.h" +#include "aencode.h" int32_t aenc_ReadSamp(void *data) { FILE *f = (FILE *)data; diff --git a/lib/audio_encode.h b/AudioEncode/audio_encode.h similarity index 100% rename from lib/audio_encode.h rename to AudioEncode/audio_encode.h diff --git a/Descent3/AImain.cpp b/Descent3/AImain.cpp index 6f780df99..478e8c4e8 100644 --- a/Descent3/AImain.cpp +++ b/Descent3/AImain.cpp @@ -1534,7 +1534,7 @@ #include "attach.h" #include "demofile.h" #include "matcen.h" -#include "PHYSICS.H" +#include "physics.h" #include "difficulty.h" #include "osiris_dll.h" #include "multi.h" diff --git a/Descent3/CMakeLists.txt b/Descent3/CMakeLists.txt index b2561fce8..b8dbc28f4 100644 --- a/Descent3/CMakeLists.txt +++ b/Descent3/CMakeLists.txt @@ -301,7 +301,8 @@ target_link_libraries(Descent3 fix grtext manage mem misc model module movie stream_audio music networking physics renderer rtperformance sndlib ui unzip vecmat md5 ${PLATFORM_LIBS}) -target_include_directories(Descent3 PRIVATE ${PROJECT_BINARY_DIR}/lib) +target_include_directories(Descent3 PUBLIC . + PRIVATE ${PROJECT_BINARY_DIR}/lib) add_dependencies(Descent3 get_git_hash Direct_TCP_IP_Hog HogFull NetgamesDir) install(TARGETS Descent3 RUNTIME) diff --git a/Descent3/Controls.cpp b/Descent3/Controls.cpp index f2ae05546..5b6a00be2 100644 --- a/Descent3/Controls.cpp +++ b/Descent3/Controls.cpp @@ -406,21 +406,16 @@ #include "controls.h" -#include "object.h" #include "pserror.h" #include "game.h" #include "ddio.h" #include "joystick.h" -#include "descent.h" #include "mono.h" #include "weapon.h" -#include "Controller.h" -#include "Macros.h" #include "gamesequence.h" #include "pilot.h" #include "hud.h" #include "stringtable.h" -#include "TelCom.h" #include "multi.h" #include "args.h" diff --git a/Descent3/CtlCfgElem.cpp b/Descent3/CtlCfgElem.cpp index 1a69f607e..dcb693030 100644 --- a/Descent3/CtlCfgElem.cpp +++ b/Descent3/CtlCfgElem.cpp @@ -125,7 +125,6 @@ #include "localization.h" #include -#include "joystick.h" // all controller binding texts static char Ctltext_KeyBindings[][16] = {"", diff --git a/Descent3/CtlCfgElem.h b/Descent3/CtlCfgElem.h index aa8e30235..2e5f34cff 100644 --- a/Descent3/CtlCfgElem.h +++ b/Descent3/CtlCfgElem.h @@ -78,7 +78,7 @@ #define CTLCFGELEM_H #include "newui.h" -#include "Controller.h" +#include "controller.h" #include "controls.h" #include "stringtable.h" diff --git a/Descent3/Game2DLL.cpp b/Descent3/Game2DLL.cpp index f84a50348..2f999f418 100644 --- a/Descent3/Game2DLL.cpp +++ b/Descent3/Game2DLL.cpp @@ -52,7 +52,7 @@ #include "vclip.h" #include "osiris_dll.h" #include "manage.h" -#include "PHYSICS.H" +#include "physics.h" #include "collide.h" #include "render.h" #include "audiotaunts.h" diff --git a/Descent3/GameLoop.cpp b/Descent3/GameLoop.cpp index cd6676e07..4fc58dc0a 100644 --- a/Descent3/GameLoop.cpp +++ b/Descent3/GameLoop.cpp @@ -833,8 +833,8 @@ #include "SmallViews.h" #include "newui.h" #include "Inventory.h" -#include "PHYSICS.H" -#include "Controller.h" +#include "physics.h" +#include "controller.h" #include "controls.h" #include "gamesequence.h" #include "cockpit.h" @@ -862,7 +862,7 @@ #include "pilot.h" #include "rtperformance.h" #include "demofile.h" -#include "d3music.h" +#include "musicapi.h" // #include "gamespy.h" #include "osiris_dll.h" #include "aiambient.h" diff --git a/Descent3/LoadLevel.cpp b/Descent3/LoadLevel.cpp index 976b86dae..5055e4989 100644 --- a/Descent3/LoadLevel.cpp +++ b/Descent3/LoadLevel.cpp @@ -1287,7 +1287,7 @@ #include "ambient.h" #include "matcen.h" #include "dedicated_server.h" -#include "PHYSICS.H" +#include "physics.h" #include "levelgoal.h" #include "aiambient.h" #include "args.h" diff --git a/Descent3/Mission.cpp b/Descent3/Mission.cpp index 2d23b19f8..586bf94fa 100644 --- a/Descent3/Mission.cpp +++ b/Descent3/Mission.cpp @@ -659,7 +659,7 @@ #include "mem.h" #include "newui.h" #include "stringtable.h" -#include "AppConsole.h" +#include "appconsole.h" #include "pstring.h" #include "dedicated_server.h" #include "osiris_dll.h" diff --git a/Descent3/ObjInit.cpp b/Descent3/ObjInit.cpp index d1612ea31..06e19b4c6 100644 --- a/Descent3/ObjInit.cpp +++ b/Descent3/ObjInit.cpp @@ -602,7 +602,7 @@ #include "player.h" #include "ship.h" #include "pserror.h" -#include "PHYSICS.H" +#include "physics.h" #include "weapon.h" #include "AIMain.h" #include "fireball.h" diff --git a/Descent3/Player.cpp b/Descent3/Player.cpp index ac7b6de3a..171077618 100644 --- a/Descent3/Player.cpp +++ b/Descent3/Player.cpp @@ -1096,7 +1096,7 @@ #include "findintersection.h" #include "hud.h" #include "splinter.h" -#include "PHYSICS.H" +#include "physics.h" #include "viseffect.h" #include "damage.h" #include "multi.h" diff --git a/Descent3/TelCom.cpp b/Descent3/TelCom.cpp index bdbce3de5..6fb953972 100644 --- a/Descent3/TelCom.cpp +++ b/Descent3/TelCom.cpp @@ -521,7 +521,7 @@ #include "textaux.h" #include "psrand.h" #include "controls.h" -#include "d3music.h" +#include "musicapi.h" #define FRAME_RATE 30.0f #define TCPE_TIME 0.5f diff --git a/Descent3/TelComGoals.cpp b/Descent3/TelComGoals.cpp index af0ebc463..2cc0b90ad 100644 --- a/Descent3/TelComGoals.cpp +++ b/Descent3/TelComGoals.cpp @@ -95,14 +95,12 @@ #include "game.h" #include "mem.h" #include "stringtable.h" -#include "gametexture.h" #include "textaux.h" #include "TelComEfxStructs.h" #include "TelComEffects.h" #include "levelgoal.h" #include "textaux.h" #include "Mission.h" -#include "Macros.h" #include "hlsoundlib.h" #include diff --git a/Descent3/config.cpp b/Descent3/config.cpp index a4ca9b4dd..f893076ed 100644 --- a/Descent3/config.cpp +++ b/Descent3/config.cpp @@ -279,43 +279,30 @@ * $NoKeywords: $ */ -#include "ConfigItem.h" -#include "player.h" #include "config.h" -#include "ddio.h" #include "newui.h" #include "3d.h" -#include "polymodel.h" #include "application.h" #include "descent.h" #include "mono.h" -#include "Mission.h" -#include "ddio.h" -#include "gamefont.h" -#include "multi_ui.h" -#include "cinematics.h" #include "hlsoundlib.h" #include "terrain.h" -#include "cfile.h" -#include "mem.h" -#include "lighting.h" -#include "PHYSICS.H" +#include "physics.h" #include "pilot.h" #include "hud.h" -#include "voice.h" #include "bitmap.h" #include "game.h" -#include "render.h" #include "stringtable.h" #include "SmallViews.h" -#include "D3ForceFeedback.h" #include "descent.h" #include "appdatabase.h" #include "hlsoundlib.h" #include "soundload.h" #include "sounds.h" #include "ctlconfig.h" -#include "d3music.h" +#include "musicapi.h" +#include "Macros.h" +#include "forcefeedback.h" #include #include diff --git a/Descent3/config.h b/Descent3/config.h index e0fd088d9..d5698178a 100644 --- a/Descent3/config.h +++ b/Descent3/config.h @@ -117,6 +117,8 @@ #ifndef __CONFIG_H__ #define __CONFIG_H__ +#include + // Main menu configuration functions // ------------------------------------------------------ // ConfigForceFeedback diff --git a/Descent3/controls.h b/Descent3/controls.h index 0d1e2d4b4..9f577868c 100644 --- a/Descent3/controls.h +++ b/Descent3/controls.h @@ -169,7 +169,7 @@ #define CONTROLS_H #include "object.h" -#include "Controller.h" +#include "controller.h" class gameController; class pilot; diff --git a/Descent3/credits.cpp b/Descent3/credits.cpp index 0277dc097..da5534141 100644 --- a/Descent3/credits.cpp +++ b/Descent3/credits.cpp @@ -88,7 +88,7 @@ #include "descent.h" #include "mem.h" #include "3d.h" -#include "d3music.h" +#include "musicapi.h" #include "hlsoundlib.h" #include #include diff --git a/Descent3/ctlconfig.cpp b/Descent3/ctlconfig.cpp index 854c2d05d..4579528ff 100644 --- a/Descent3/ctlconfig.cpp +++ b/Descent3/ctlconfig.cpp @@ -277,20 +277,23 @@ * * $NoKeywords: $ */ + #include "ctlconfig.h" + +#include + #include "CtlCfgElem.h" #include "ctlconfigtxt.h" #include "game.h" #include "weapon.h" #include "pilot.h" -#include "bitmap.h" -#include "multi.h" #include "gameloop.h" #include "gamefont.h" #include "D3ForceFeedback.h" #include "hlsoundlib.h" -#include "ddio.h" -#include +#include "Macros.h" +#include "ddio_common.h" + ////////////////////////////////////////////////////////////////////////////// #define IDV_KCONFIG 10 #define IDV_CCONFIG 11 diff --git a/Descent3/damage.cpp b/Descent3/damage.cpp index 72ff26c8d..6d5347d86 100644 --- a/Descent3/damage.cpp +++ b/Descent3/damage.cpp @@ -577,7 +577,7 @@ #include "attach.h" #include "difficulty.h" #include "demofile.h" -#include "d3music.h" +#include "musicapi.h" #include "osiris_dll.h" #include "D3ForceFeedback.h" #include "multi_server.h" diff --git a/Descent3/dedicated_server.cpp b/Descent3/dedicated_server.cpp index 904888384..7afb17488 100644 --- a/Descent3/dedicated_server.cpp +++ b/Descent3/dedicated_server.cpp @@ -112,24 +112,18 @@ typedef int socklen_t; #endif -#include "pstypes.h" #include "pserror.h" #include "pstring.h" -#include "cfile.h" #include "inffile.h" #include "dedicated_server.h" #include "multi.h" #include "args.h" -#include "AppConsole.h" +#include "appconsole.h" #include "ddio.h" -#include "newui.h" -#include "ui.h" #include "multi_dll_mgr.h" #include "multi_ui.h" #include "Mission.h" #include "multi_server.h" -#include "Macros.h" -#include "game.h" #include "mem.h" #include "stringtable.h" #include "multi_save_settings.h" diff --git a/Descent3/descent.cpp b/Descent3/descent.cpp index 23968a5f0..de4c75cf8 100644 --- a/Descent3/descent.cpp +++ b/Descent3/descent.cpp @@ -395,7 +395,7 @@ #include "Mission.h" #include "ddio.h" #include "controls.h" -#include "Controller.h" +#include "controller.h" #include "gamesequence.h" #include "stringtable.h" #include "dedicated_server.h" diff --git a/Descent3/descent.h b/Descent3/descent.h index 8c233154c..64c1c1d7d 100644 --- a/Descent3/descent.h +++ b/Descent3/descent.h @@ -131,6 +131,10 @@ #include #include "application.h" +#ifdef __LINUX__ +#include "linux_fix.h" +#endif + // The name of this product #ifdef DEMO #define PRODUCT_NAME "Descent 3 Demo" diff --git a/Descent3/fireball.cpp b/Descent3/fireball.cpp index b82aa27a8..115b1da5c 100644 --- a/Descent3/fireball.cpp +++ b/Descent3/fireball.cpp @@ -593,7 +593,7 @@ #include "objinfo.h" #include "gametexture.h" #include "splinter.h" -#include "PHYSICS.H" +#include "physics.h" #include "damage.h" #include "gameevent.h" #include "weapon.h" diff --git a/Descent3/gamecinematics.cpp b/Descent3/gamecinematics.cpp index fd723ba2e..b48e0bb82 100644 --- a/Descent3/gamecinematics.cpp +++ b/Descent3/gamecinematics.cpp @@ -207,7 +207,7 @@ #include "gamefont.h" #include "AIMain.h" #include "controls.h" -#include "d3music.h" +#include "musicapi.h" #include "gamesequence.h" #include "demofile.h" #include "osiris_dll.h" diff --git a/Descent3/gamesave.cpp b/Descent3/gamesave.cpp index 0e308b7d6..35ec9bd28 100644 --- a/Descent3/gamesave.cpp +++ b/Descent3/gamesave.cpp @@ -295,7 +295,7 @@ #include "matcen.h" #include "hud.h" #include "marker.h" -#include "d3music.h" +#include "musicapi.h" #include "weather.h" // function prototypes. diff --git a/Descent3/gamesequence.cpp b/Descent3/gamesequence.cpp index 877bb829b..97908ef59 100644 --- a/Descent3/gamesequence.cpp +++ b/Descent3/gamesequence.cpp @@ -1075,7 +1075,7 @@ #include "lightmap_info.h" #include "lightmap.h" #include "fireball.h" -#include "d3music.h" +#include "musicapi.h" #include "TelComAutoMap.h" #include "aiambient.h" #include "ObjScript.h" diff --git a/Descent3/hud.cpp b/Descent3/hud.cpp index 214d5667e..46674ecc3 100644 --- a/Descent3/hud.cpp +++ b/Descent3/hud.cpp @@ -426,7 +426,7 @@ #include "ship.h" #include "pilot.h" #include "mem.h" -#include "d3music.h" +#include "musicapi.h" #include "demofile.h" #include "stringtable.h" #include "pstring.h" diff --git a/Descent3/hudmessage.cpp b/Descent3/hudmessage.cpp index da3161b1d..23249c7b6 100644 --- a/Descent3/hudmessage.cpp +++ b/Descent3/hudmessage.cpp @@ -339,7 +339,7 @@ #include "game2dll.h" #include "stringtable.h" #include "dedicated_server.h" -#include "AppConsole.h" +#include "appconsole.h" #include "demofile.h" #include "mem.h" #include "textaux.h" diff --git a/Descent3/init.cpp b/Descent3/init.cpp index 0dd013409..00524721f 100644 --- a/Descent3/init.cpp +++ b/Descent3/init.cpp @@ -944,7 +944,7 @@ #include "Mission.h" #include "findintersection.h" #include "appdatabase.h" -#include "AppConsole.h" +#include "appconsole.h" #include "room.h" #include "game.h" #include "render.h" @@ -960,7 +960,7 @@ #include "pilot.h" #include "gameloop.h" #include "trigger.h" -#include "PHYSICS.H" +#include "physics.h" #include "special_face.h" #include "streamaudio.h" #include "voice.h" @@ -977,7 +977,7 @@ #include "SmallViews.h" #include "uisys.h" #include "rtperformance.h" -#include "d3music.h" +#include "musicapi.h" #include "PilotPicsAPI.h" #include "osiris_dll.h" #include "mem.h" @@ -987,6 +987,8 @@ #include "debuggraph.h" #include "vibeinterface.h" +#include "ddvid.h" + // Uncomment this to allow all languages #define ALLOW_ALL_LANG 1 diff --git a/Descent3/intellivibe.cpp b/Descent3/intellivibe.cpp index 1c82acaa6..c128b5fc6 100644 --- a/Descent3/intellivibe.cpp +++ b/Descent3/intellivibe.cpp @@ -58,6 +58,7 @@ void VIBE_DoForce(vector *) {} void VIBE_DoLevelEnd(void) {} #else +#include "winapp.h" #include "intellivibe.h" #include "module.h" #include "mono.h" diff --git a/Descent3/lighting.cpp b/Descent3/lighting.cpp index f99fbe91a..601bbec4b 100644 --- a/Descent3/lighting.cpp +++ b/Descent3/lighting.cpp @@ -24,12 +24,9 @@ * $NoKeywords: $ */ -#include "3d.h" -#include "texture.h" #include "gametexture.h" #include "lighting.h" #include "lightmap.h" -#include "descent.h" #include "game.h" #include "room.h" #include @@ -42,7 +39,6 @@ #include "config.h" #include "dedicated_server.h" #include "objinfo.h" -#include "Macros.h" #include diff --git a/Descent3/lightmap_info.cpp b/Descent3/lightmap_info.cpp index 19d90fec7..405f1b2c0 100644 --- a/Descent3/lightmap_info.cpp +++ b/Descent3/lightmap_info.cpp @@ -22,7 +22,7 @@ #include "lightmap_info.h" #include "lightmap.h" #include "mono.h" -#include "Ddgr.h" +#include "ddgr.h" #include "grdefs.h" #include "renderer.h" #include diff --git a/Descent3/lnxmain.cpp b/Descent3/lnxmain.cpp index ca87022eb..803f43968 100644 --- a/Descent3/lnxmain.cpp +++ b/Descent3/lnxmain.cpp @@ -30,10 +30,10 @@ #include -#include "program.h" +#include "lnxapp.h" +#include "lnxdatabase.h" + #include "descent.h" -#include "application.h" -#include "appdatabase.h" #include "args.h" #include "init.h" @@ -42,6 +42,7 @@ #include "loki_utils.h" #include "log.h" +#include "d3_version.h" extern bool ddio_mouseGrabbed; int no_debug_dialog = 0; diff --git a/Descent3/loadstate.cpp b/Descent3/loadstate.cpp index 9100d47f9..c925a8715 100644 --- a/Descent3/loadstate.cpp +++ b/Descent3/loadstate.cpp @@ -212,7 +212,7 @@ #include "matcen.h" #include "pilot.h" #include "marker.h" -#include "d3music.h" +#include "musicapi.h" #include "weather.h" #include "cockpit.h" #include "hud.h" diff --git a/Descent3/matcen.cpp b/Descent3/matcen.cpp index 85f896f05..35b931564 100644 --- a/Descent3/matcen.cpp +++ b/Descent3/matcen.cpp @@ -165,7 +165,7 @@ #include "viseffect.h" #include "viseffect_external.h" #include "damage.h" -#include "PHYSICS.H" +#include "physics.h" #include "mem.h" #include "ObjScript.h" #ifndef NEWEDITOR diff --git a/Descent3/menu.cpp b/Descent3/menu.cpp index f8db290f9..248f97f39 100644 --- a/Descent3/menu.cpp +++ b/Descent3/menu.cpp @@ -682,7 +682,7 @@ bool Directplay_lobby_launched_game = false; #endif #include "multi_dll_mgr.h" -#include "d3music.h" +#include "musicapi.h" #include "newui_core.h" #define IDV_QUIT 0xff diff --git a/Descent3/mmItem.cpp b/Descent3/mmItem.cpp index e5a692ef6..2512bf40b 100644 --- a/Descent3/mmItem.cpp +++ b/Descent3/mmItem.cpp @@ -116,7 +116,7 @@ #include "cinematics.h" #include "hlsoundlib.h" #include "soundload.h" -#include "d3music.h" +#include "musicapi.h" #include "ddio.h" // #include diff --git a/Descent3/multi.cpp b/Descent3/multi.cpp index 093798836..b5e0bb34a 100644 --- a/Descent3/multi.cpp +++ b/Descent3/multi.cpp @@ -1692,7 +1692,7 @@ #include "doorway.h" #include "object_lighting.h" #include "spew.h" -#include "PHYSICS.H" +#include "physics.h" #include "SmallViews.h" #include "demofile.h" #include "debuggraph.h" diff --git a/Descent3/multi_dll_mgr.h b/Descent3/multi_dll_mgr.h index 25c6eec80..d030b845d 100644 --- a/Descent3/multi_dll_mgr.h +++ b/Descent3/multi_dll_mgr.h @@ -85,6 +85,9 @@ #ifndef _multi_dll_header #define _multi_dll_header +#include "ui.h" +#include "newui.h" + #define MT_EVT_LOGIN 1 #define MT_EVT_FIRST_FRAME 2 #define MT_EVT_FRAME 3 diff --git a/Descent3/multisafe.cpp b/Descent3/multisafe.cpp index 37f924a1a..f335fe9d0 100644 --- a/Descent3/multisafe.cpp +++ b/Descent3/multisafe.cpp @@ -665,7 +665,7 @@ #include "door.h" #include "demofile.h" #include "stringtable.h" -#include "d3music.h" +#include "musicapi.h" #include "multi_world_state.h" #include "osiris_predefs.h" #include "viseffect.h" diff --git a/Descent3/newui_core.cpp b/Descent3/newui_core.cpp index 235f6e752..4fef644fd 100644 --- a/Descent3/newui_core.cpp +++ b/Descent3/newui_core.cpp @@ -197,7 +197,7 @@ #include "stringtable.h" #include "gamefont.h" #include "textaux.h" -#include "d3music.h" +#include "musicapi.h" #include "hlsoundlib.h" #include diff --git a/Descent3/object.cpp b/Descent3/object.cpp index 20f827995..1ee64deae 100644 --- a/Descent3/object.cpp +++ b/Descent3/object.cpp @@ -1144,7 +1144,7 @@ #include "slew.h" #include "game.h" #include "trigger.h" -#include "PHYSICS.H" +#include "physics.h" #include "collide.h" #include "door.h" #include "controls.h" diff --git a/Descent3/osiris_predefs.cpp b/Descent3/osiris_predefs.cpp index fcef38ad9..0779bebc8 100644 --- a/Descent3/osiris_predefs.cpp +++ b/Descent3/osiris_predefs.cpp @@ -451,7 +451,7 @@ #include "matcen.h" #include "findintersection.h" #include "controls.h" -#include "Controller.h" +#include "controller.h" #include "ship.h" #include "Mission.h" #include "osiris_share.h" @@ -460,7 +460,7 @@ #include "polymodel.h" #include "multi.h" #include "viseffect.h" -#include "PHYSICS.H" +#include "physics.h" #include "levelgoal.h" #include "BOA.h" #include "marker.h" diff --git a/Descent3/pilot.h b/Descent3/pilot.h index ba86ac57d..39f14b45b 100644 --- a/Descent3/pilot.h +++ b/Descent3/pilot.h @@ -186,7 +186,7 @@ /* #include "controls.h" -#include "Controller.h" +#include "controller.h" #include "ship.h" #define PILOT_STRING_SIZE 20 diff --git a/Descent3/pilot_class.h b/Descent3/pilot_class.h index 352048c0c..caca48cf7 100644 --- a/Descent3/pilot_class.h +++ b/Descent3/pilot_class.h @@ -89,7 +89,7 @@ #include "pstypes.h" #include "controls.h" -#include "Controller.h" +#include "controller.h" #include "cfile.h" #include "weapon.h" #include "config.h" diff --git a/Descent3/program.cpp b/Descent3/program.cpp index 4292369e5..93cee3205 100644 --- a/Descent3/program.cpp +++ b/Descent3/program.cpp @@ -64,6 +64,11 @@ #include "descent.h" #include "appdatabase.h" +#if defined(WIN32) +#include "windatabase.h" +#elif defined(__LINUX__) +#include "lnxdatabase.h" +#endif program_version Program_version; diff --git a/Descent3/robotfire.cpp b/Descent3/robotfire.cpp index 87b6fa920..6e7328c33 100644 --- a/Descent3/robotfire.cpp +++ b/Descent3/robotfire.cpp @@ -32,7 +32,7 @@ #include "player.h" #include "demofile.h" #include "SmallViews.h" -#include "PHYSICS.H" +#include "physics.h" #include "AIMain.h" #include diff --git a/Descent3/room.h b/Descent3/room.h index 4154c79ef..79fadf45c 100644 --- a/Descent3/room.h +++ b/Descent3/room.h @@ -363,9 +363,9 @@ #ifndef _ROOM_H #define _ROOM_H -#include "pstypes.h" #include "vecmat_external.h" #include "gametexture.h" +#include "bitmap.h" #ifdef NEWEDITOR #include "..\neweditor\ned_GameTexture.h" diff --git a/Descent3/splinter.cpp b/Descent3/splinter.cpp index 2422154b8..647cd9d21 100644 --- a/Descent3/splinter.cpp +++ b/Descent3/splinter.cpp @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#include +#include #include "fireball.h" #include "object.h" @@ -23,13 +25,8 @@ #include "polymodel.h" #include "renderer.h" #include "gametexture.h" - -#include "Macros.h" -#include - #include "psrand.h" -#include // Given an object, renders the representation of this splinter void DrawSplinterObject(object *obj) { diff --git a/Descent3/terrain.cpp b/Descent3/terrain.cpp index 494ac30ca..585e49187 100644 --- a/Descent3/terrain.cpp +++ b/Descent3/terrain.cpp @@ -16,25 +16,21 @@ * along with this program. If not, see . */ +#include + #ifdef NEWEDITOR #include "neweditor\globals.h" -#else -#include #endif #include "vecmat.h" -#include "object.h" #include "mono.h" #include "terrain.h" #include "pserror.h" -#include "texture.h" -#include "bitmap.h" #include "gametexture.h" #include "lighting.h" #include "lightmap.h" #include "weather.h" #include #include "mem.h" -#include "Macros.h" #include "dedicated_server.h" #include "psrand.h" #ifdef EDITOR diff --git a/Descent3/tests/CMakeLists.txt b/Descent3/tests/CMakeLists.txt index 38cf2a563..14e667ece 100644 --- a/Descent3/tests/CMakeLists.txt +++ b/Descent3/tests/CMakeLists.txt @@ -6,6 +6,21 @@ add_executable( target_link_libraries( porting-tests GTest::gtest_main + model + manage + physics + bitmap + module + networking + ddio + 2dlib + $<$: + linux + > + $<$: + win32 + > ) + gtest_discover_tests(porting-tests) diff --git a/Descent3/viseffect.cpp b/Descent3/viseffect.cpp index 3fb40e6d9..2741a350b 100644 --- a/Descent3/viseffect.cpp +++ b/Descent3/viseffect.cpp @@ -448,7 +448,7 @@ #include "object.h" #include #include -#include "PHYSICS.H" +#include "physics.h" #include "weapon.h" #include "lighting.h" #include "dedicated_server.h" diff --git a/Descent3/weapon.cpp b/Descent3/weapon.cpp index cb845942d..d1ab1fda8 100644 --- a/Descent3/weapon.cpp +++ b/Descent3/weapon.cpp @@ -332,15 +332,16 @@ * $NoKeywords: $ */ +#include +#include +#include +#include +#include + #include "weapon.h" -#include "pstypes.h" #include "pserror.h" #include "object.h" #include "3d.h" -#include -#include -#include -#include #include "bitmap.h" #include "vclip.h" #include "game.h" @@ -348,18 +349,14 @@ #include "player.h" #include "hud.h" #include "hlsoundlib.h" -#include "soundload.h" #include "objinfo.h" #include "gametexture.h" #include "ship.h" -#include "gauges.h" #include "sounds.h" #include "stringtable.h" -#include "Macros.h" #include "cfile.h" #include "AIMain.h" -#include // #include "samirlog.h" #define LOGFILE(_s) diff --git a/Descent3/winmain.cpp b/Descent3/winmain.cpp index af2b43982..c6dbbb9a7 100644 --- a/Descent3/winmain.cpp +++ b/Descent3/winmain.cpp @@ -23,8 +23,8 @@ #include "mono.h" #include "descent.h" #include "texture.h" -#include "application.h" -#include "appdatabase.h" +#include "winapp.h" +#include "windatabase.h" #include "pserror.h" #include "args.h" #include "init.h" diff --git a/acmlib/acmlib.cpp b/acmlib/acmlib.cpp index b585a29b7..4a15cb03e 100644 --- a/acmlib/acmlib.cpp +++ b/acmlib/acmlib.cpp @@ -18,7 +18,7 @@ -#include "Adecode.h" +#include "adecode.h" #include "mem.h" #ifdef __cplusplus diff --git a/bitmap/CMakeLists.txt b/bitmap/CMakeLists.txt index c3c592027..614afd18d 100644 --- a/bitmap/CMakeLists.txt +++ b/bitmap/CMakeLists.txt @@ -1,9 +1,14 @@ -set(HEADERS iff.h) +set(HEADERS + bitmap.h + bumpmap.h + iff.h + lightmap.h + NewBitmap.h) + set(CPPS NewBitmap.cpp NewBitmap.h - - bitmain.cpp + bitmap.cpp bumpmap.cpp iff.cpp lightmap.cpp @@ -16,7 +21,10 @@ target_link_libraries(bitmap PRIVATE ddebug ddio stb + renderer + 2dlib ) + target_include_directories(bitmap PUBLIC $ -#include -#include + + +#include +#include +#include +#include + #include "cfile.h" -#include "texture.h" #include "bitmap.h" -#include "pstypes.h" #include "pserror.h" #include "mono.h" #include "iff.h" @@ -311,11 +313,10 @@ #include "lightmap.h" #include "bumpmap.h" #include "mem.h" -#include "psrand.h" -#include "Macros.h" +#include "psrand.h" +#include "grdefs.h" -#include #define BM_FILETYPE_TGA 1 #define BM_FILETYPE_PCX 2 diff --git a/lib/bitmap.h b/bitmap/bitmap.h similarity index 98% rename from lib/bitmap.h rename to bitmap/bitmap.h index 1f5108c4d..a647e351b 100644 --- a/lib/bitmap.h +++ b/bitmap/bitmap.h @@ -19,13 +19,8 @@ #ifndef PSBITMAP_H #define PSBITMAP_H -#include "pstypes.h" #include "cfile.h" -#ifdef __LINUX__ -#include "linux_fix.h" //needed for stricmp's throughout bitmap lib -#endif - #define MAX_BITMAPS 5000 #define NUM_MIP_LEVELS 5 diff --git a/lib/bumpmap.h b/bitmap/bumpmap.h similarity index 98% rename from lib/bumpmap.h rename to bitmap/bumpmap.h index d6f12e918..950081721 100644 --- a/lib/bumpmap.h +++ b/bitmap/bumpmap.h @@ -19,7 +19,7 @@ #ifndef BUMPMAP_H #define BUMPMAP_H -#include "pstypes.h" +#include #define MAX_BUMPMAPS 500 #define BAD_BUMP_INDEX 65535 diff --git a/lib/lightmap.h b/bitmap/lightmap.h similarity index 99% rename from lib/lightmap.h rename to bitmap/lightmap.h index b0bcc1413..af979adb0 100644 --- a/lib/lightmap.h +++ b/bitmap/lightmap.h @@ -19,7 +19,7 @@ #ifndef LIGHTMAP_H #define LIGHTMAP_H -#include "pstypes.h" +#include #define MAX_LIGHTMAPS (65534) #define BAD_LM_INDEX 65535 diff --git a/cfile/CMakeLists.txt b/cfile/CMakeLists.txt index 61959fa30..842f5337e 100644 --- a/cfile/CMakeLists.txt +++ b/cfile/CMakeLists.txt @@ -1,13 +1,21 @@ +set(HEADERS + cfile.h + hogfile.h + inffile.h +) + set(CPPS cfile.cpp hogfile.cpp inffile.cpp ) -add_library(cfile STATIC ${CPPS}) +add_library(cfile STATIC ${HEADERS} ${CPPS}) target_link_libraries(cfile PRIVATE ddio + bitmap ) + target_include_directories(cfile PUBLIC $ #include #include - -#include "pstypes.h" +#include struct library; diff --git a/cfile/inffile.h b/cfile/inffile.h index 22ae31dad..aa45692a5 100644 --- a/cfile/inffile.h +++ b/cfile/inffile.h @@ -23,12 +23,12 @@ #ifndef INFFILE_H #define INFFILE_H -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "pstypes.h" #include "psclass.h" +#include + +#ifdef __LINUX__ +#include "linux_fix.h" +#endif struct CFILE; @@ -71,7 +71,7 @@ class InfFile { struct sym_info // full runtime symbol { - char name[PSPATHNAME_LEN]; + char name[_MAX_PATH]; char *text; }; diff --git a/czip/CMakeLists.txt b/czip/CMakeLists.txt index a107960bb..58ea27b1d 100644 --- a/czip/CMakeLists.txt +++ b/czip/CMakeLists.txt @@ -1,4 +1,4 @@ -set(HEADERS) +set(HEADERS CZip.h) set(CPPS BitIO.cpp CZip.cpp @@ -6,3 +6,9 @@ set(CPPS HuffmanBasic.cpp) add_library(czip STATIC ${HEADERS} ${CPPS}) + +target_include_directories(czip PUBLIC + $ +) diff --git a/czip/CZip.cpp b/czip/CZip.cpp index 9166d74e8..25a04130e 100644 --- a/czip/CZip.cpp +++ b/czip/CZip.cpp @@ -34,12 +34,12 @@ * $NoKeywords: $ */ -#include -#include -#include +#include +#include +#include #include + #include "pserror.h" -#include "Macros.h" #include "CZip.h" CZip::CZip() { diff --git a/lib/CZip.h b/czip/CZip.h similarity index 100% rename from lib/CZip.h rename to czip/CZip.h diff --git a/d3music/CMakeLists.txt b/d3music/CMakeLists.txt index 7e25415d3..a1e15d187 100644 --- a/d3music/CMakeLists.txt +++ b/d3music/CMakeLists.txt @@ -1,8 +1,20 @@ -set(HEADERS) +set(HEADERS + musicapi.h) set(CPPS musicapi.cpp) add_library(d3music STATIC ${HEADERS} ${CPPS}) target_link_libraries(d3music PRIVATE music + stream_audio + libacm + sndlib + manage + bitmap +) + +target_include_directories(d3music PUBLIC + $ ) diff --git a/d3music/musicapi.cpp b/d3music/musicapi.cpp index f5b4fcfab..c135b1214 100644 --- a/d3music/musicapi.cpp +++ b/d3music/musicapi.cpp @@ -16,18 +16,12 @@ * along with this program. If not, see . */ -#include "d3music.h" -#include "music.h" -#include "Macros.h" #include -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif +#include "musicapi.h" +#include "music.h" +#include "mono.h" +#include "pserror.h" // generic constants #define MUSIC_IDLE_TIME 240.0f // how many seconds before background music silences. diff --git a/lib/d3music.h b/d3music/musicapi.h similarity index 100% rename from lib/d3music.h rename to d3music/musicapi.h diff --git a/dd_grwin32/CMakeLists.txt b/dd_grwin32/CMakeLists.txt index 64c350692..6bece4b33 100644 --- a/dd_grwin32/CMakeLists.txt +++ b/dd_grwin32/CMakeLists.txt @@ -9,3 +9,17 @@ set(CPPS ddgrWin32Init.cpp) add_library(dd_grwin32 STATIC ${HEADERS} ${CPPS}) + +target_link_libraries(dd_grwin32 + ddio + 2dlib + $<$: + linux + > + $<$: + win32 + > +) + + +target_include_directories(dd_grwin32 PUBLIC .) diff --git a/dd_grwin32/ddgrWin32DX.cpp b/dd_grwin32/ddgrWin32DX.cpp index 9e4fdb5be..323965d33 100644 --- a/dd_grwin32/ddgrWin32DX.cpp +++ b/dd_grwin32/ddgrWin32DX.cpp @@ -35,7 +35,7 @@ #include "ddgrWin32.h" #include "ddgrWin32DX.h" -#include "Application.h" +#include "winapp.h" #include "mono.h" #include "pserror.h" diff --git a/dd_grwin32/ddgrWin32GDI.cpp b/dd_grwin32/ddgrWin32GDI.cpp index 512f6ab5a..a2aa0969a 100644 --- a/dd_grwin32/ddgrWin32GDI.cpp +++ b/dd_grwin32/ddgrWin32GDI.cpp @@ -75,7 +75,7 @@ #include "ddgrWin32.h" #include "ddgrWin32GDI.h" -#include "Application.h" +#include "winapp.h" #include "mono.h" #include "pserror.h" #include "gr.h" diff --git a/dd_video/CMakeLists.txt b/dd_video/CMakeLists.txt index bea4a244c..bbccc88e3 100644 --- a/dd_video/CMakeLists.txt +++ b/dd_video/CMakeLists.txt @@ -1,3 +1,8 @@ +set(HEADERS + ddvid.h + ddvidlib.h +) + set(CPPS $<$: video_win32.cpp @@ -9,9 +14,20 @@ set(CPPS > ) -add_library(dd_video STATIC ${CPPS}) +add_library(dd_video STATIC ${HEADERS} ${CPPS}) target_link_libraries(dd_video PRIVATE $<$: linux > + $<$: + win32 + > + ddio + 2dlib +) + +target_include_directories(dd_video PUBLIC + $ ) diff --git a/lib/ddvid.h b/dd_video/ddvid.h similarity index 97% rename from lib/ddvid.h rename to dd_video/ddvid.h index f4a986493..4797cde7b 100644 --- a/lib/ddvid.h +++ b/dd_video/ddvid.h @@ -44,8 +44,7 @@ #ifndef DDVID_H #define DDVID_H -#include "pstypes.h" -#include "grdefs.h" +#include "application.h" class oeApplication; diff --git a/dd_video/ddvidlib.h b/dd_video/ddvidlib.h index d7e03ed8f..083d32084 100644 --- a/dd_video/ddvidlib.h +++ b/dd_video/ddvidlib.h @@ -44,11 +44,14 @@ #ifndef DDVIDLIB_H #define DDVIDLIB_H -#include "ddvid.h" +#include +#include #include #include -#include + +#include "ddvid.h" +#include "winapp.h" #define VM_MAX_MODES 96 diff --git a/dd_video/vidWin32FS.cpp b/dd_video/vidWin32FS.cpp index 1407a1b53..8fa28d81a 100644 --- a/dd_video/vidWin32FS.cpp +++ b/dd_video/vidWin32FS.cpp @@ -52,6 +52,7 @@ #include "ddvidlib.h" #include "pserror.h" +#include "grdefs.h" // DirectDraw Display mode enumeration callback HRESULT WINAPI DDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext); diff --git a/dd_video/vidWin32Win.cpp b/dd_video/vidWin32Win.cpp index 522ad9ef8..49dfcbae0 100644 --- a/dd_video/vidWin32Win.cpp +++ b/dd_video/vidWin32Win.cpp @@ -47,7 +47,8 @@ #include "ddvidlib.h" #include "pserror.h" -#include "Application.h" +#include "winapp.h" +#include "grdefs.h" ////////////////////////////////////////////////////////////////////////////// // Variables diff --git a/dd_video/video_lnx.cpp b/dd_video/video_lnx.cpp index 3f568f7b7..b948dcb37 100644 --- a/dd_video/video_lnx.cpp +++ b/dd_video/video_lnx.cpp @@ -26,7 +26,6 @@ #include #include "ddvid.h" -#include "application.h" #include "lnxapp.h" struct tinfo { diff --git a/dd_video/video_win32.cpp b/dd_video/video_win32.cpp index fd0c239b5..c8fdcde1b 100644 --- a/dd_video/video_win32.cpp +++ b/dd_video/video_win32.cpp @@ -50,7 +50,7 @@ #include "ddvidlib.h" #include "pserror.h" -#include "Application.h" +#include "winapp.h" #include diff --git a/ddebug/CMakeLists.txt b/ddebug/CMakeLists.txt index 555e027e2..208ccf23d 100644 --- a/ddebug/CMakeLists.txt +++ b/ddebug/CMakeLists.txt @@ -1,3 +1,8 @@ +set(HEADERS + debug.h + mono.h +) + set(CPPS $<$: lnxdebug.cpp @@ -9,11 +14,15 @@ set(CPPS > ) -add_library(ddebug STATIC ${CPPS}) +add_library(ddebug STATIC ${HEADERS} ${CPPS}) add_dependencies(ddebug get_git_hash) + +target_link_libraries(ddebug PRIVATE + networking +) target_include_directories(ddebug PUBLIC $ PRIVATE ${PROJECT_BINARY_DIR}/lib # For d3_version.h ) diff --git a/ddio/CMakeLists.txt b/ddio/CMakeLists.txt index 629540f48..fb1d680c6 100644 --- a/ddio/CMakeLists.txt +++ b/ddio/CMakeLists.txt @@ -1,17 +1,31 @@ +set(HEADERS + appconsole.h + appdatabase.h + application.h + chrono_timer.h + controller.h + ddio_common.h + ddio.h + ddio_lnx.h + ddio_win.h + forcefeedback.h + joystick.h +) + set(CPPS chrono_timer.cpp ddio.cpp key.cpp $<$: + lnxcdrom.cpp lnxfile.cpp lnxforcefeedback.cpp lnxio.cpp - sdljoy.cpp lnxkey.cpp lnxkey_null.cpp - lnxmouse.cpp - lnxcdrom.cpp lnxkey_sdl.cpp + lnxmouse.cpp + sdljoy.cpp > $<$: winfile.cpp @@ -25,9 +39,16 @@ set(CPPS add_library(ddio STATIC ${CPPS}) target_link_libraries(ddio ddebug + $<$: + linux + > + $<$: + win32 + > ) + target_include_directories(ddio PUBLIC $ ) diff --git a/lib/AppConsole.h b/ddio/appconsole.h similarity index 100% rename from lib/AppConsole.h rename to ddio/appconsole.h diff --git a/lib/appdatabase.h b/ddio/appdatabase.h similarity index 95% rename from lib/appdatabase.h rename to ddio/appdatabase.h index a29e1d0e3..c24d499a1 100644 --- a/lib/appdatabase.h +++ b/ddio/appdatabase.h @@ -51,7 +51,7 @@ #ifndef APPDATABASE #define APPDATABASE -#include "pstypes.h" +#include /* oeAppDatabase to get info about the application from a managed database (or a custom info file) @@ -100,10 +100,4 @@ class oeAppDatabase { Win32 Samir Win32Database.h 06/97 */ -#if defined(WIN32) -#include "win\Win32Database.h" -#elif defined(__LINUX__) -#include "linux/lnxdatabase.h" -#endif - #endif diff --git a/lib/application.h b/ddio/application.h similarity index 96% rename from lib/application.h rename to ddio/application.h index 7dcc45ad1..47bc03d8f 100644 --- a/lib/application.h +++ b/ddio/application.h @@ -66,7 +66,7 @@ */ #ifndef APP_H #define APP_H -#include "pstypes.h" + /* Basic Application data types */ /* Application Object This object entails initialization and cleanup of all operating system @@ -109,9 +109,5 @@ class oeApplication { Add a platform to this list once implemented: Win32 Samir Win32App.h 06/97 */ -#if defined(WIN32) -#include "win\win32app.h" -#elif defined(__LINUX__) -#include "lnxapp.h" -#endif + #endif diff --git a/lib/Controller.h b/ddio/controller.h similarity index 98% rename from lib/Controller.h rename to ddio/controller.h index 29381d85e..f1e37e6c1 100644 --- a/lib/Controller.h +++ b/ddio/controller.h @@ -118,9 +118,6 @@ #include -#include "pstypes.h" -#include "Macros.h" - enum ct_format { ctNoFormat, ctAnalog, // analog information (-1.0 to 1.0) @@ -264,10 +261,4 @@ class gameController { gameController *CreateController(int num_funcs, ct_function *funcs, char *remote_ip); void DestroyController(gameController *ctl); -#if defined(WIN32) -#include "win\WinController.h" -#elif defined(__LINUX__) -#include "lnxcontroller.h" -#endif - #endif diff --git a/ddio/ddio_common.h b/ddio/ddio_common.h index 22af91d48..837d6202e 100644 --- a/ddio/ddio_common.h +++ b/ddio/ddio_common.h @@ -117,8 +117,9 @@ #ifndef DDIO_COMMON_H #define DDIO_COMMON_H +#include + #include "application.h" -#include "pstypes.h" #define DDIO_MOUSE_LITE 2 // some ddio systems support the 'lite' extension of mice. diff --git a/ddio/ddio_lnx.h b/ddio/ddio_lnx.h index 8e96b1d80..888747f42 100644 --- a/ddio/ddio_lnx.h +++ b/ddio/ddio_lnx.h @@ -24,7 +24,7 @@ #ifndef DDIO_LNX_H #define DDIO_LNX_H -#include "application.h" +#include "lnxapp.h" extern oeLnxApplication *Lnx_app_obj; diff --git a/lib/forcefeedback.h b/ddio/forcefeedback.h similarity index 100% rename from lib/forcefeedback.h rename to ddio/forcefeedback.h diff --git a/lib/joystick.h b/ddio/joystick.h similarity index 100% rename from lib/joystick.h rename to ddio/joystick.h diff --git a/ddio/lnxio.cpp b/ddio/lnxio.cpp index 900764853..40cf64807 100644 --- a/ddio/lnxio.cpp +++ b/ddio/lnxio.cpp @@ -62,7 +62,7 @@ #include #endif -#include "application.h" +#include "lnxapp.h" #include "ddio.h" #include "pserror.h" diff --git a/ddio/lnxkey.cpp b/ddio/lnxkey.cpp index c6abbe368..c71fb77d5 100644 --- a/ddio/lnxkey.cpp +++ b/ddio/lnxkey.cpp @@ -49,7 +49,7 @@ // ---------------------------------------------------------------------------- // Keyboard Interface // ---------------------------------------------------------------------------- -#include "application.h" +#include "lnxapp.h" #include "ddio.h" #include "mono.h" diff --git a/ddio/winforcefeedback.cpp b/ddio/winforcefeedback.cpp index 05f80b9fb..e8fcf96c3 100644 --- a/ddio/winforcefeedback.cpp +++ b/ddio/winforcefeedback.cpp @@ -101,7 +101,7 @@ #include "mono.h" #include "ddio.h" #include "ddio_win.h" -#include "Application.h" +#include "winapp.h" #include "forcefeedback.h" #include "mem.h" #include "dinput.h" diff --git a/ddio/winio.cpp b/ddio/winio.cpp index 5edc69f97..3968b61dc 100644 --- a/ddio/winio.cpp +++ b/ddio/winio.cpp @@ -107,12 +107,12 @@ #include #include +#include -#include #include #include "pserror.h" -#include "Application.h" +#include "winapp.h" #include "ddio_win.h" #include "ddio.h" #include "dinput.h" @@ -202,4 +202,4 @@ bool ddio_GetBinaryPath(char *exec_path, size_t len) { } exec_path[len - 1] = '\0'; return true; -} \ No newline at end of file +} diff --git a/ddio/winkey.cpp b/ddio/winkey.cpp index 77ffa3dd9..d87597c8b 100644 --- a/ddio/winkey.cpp +++ b/ddio/winkey.cpp @@ -180,8 +180,7 @@ #include "mono.h" #include "ddio.h" #include "ddio_win.h" -#include "Application.h" -#include "TaskSystem.h" +#include "winapp.h" #include #include diff --git a/ddio/winmouse.cpp b/ddio/winmouse.cpp index eb474fc74..030284410 100644 --- a/ddio/winmouse.cpp +++ b/ddio/winmouse.cpp @@ -20,16 +20,15 @@ // Mouse Interface // ---------------------------------------------------------------------------- -#include -#include +#include +#include #include "pserror.h" #include "mono.h" #include "ddio.h" #include "ddio_win.h" -#include "Application.h" +#include "winapp.h" #include "psclass.h" -#include "Macros.h" struct t_mse_button_info { bool is_down[N_MSEBTNS]; diff --git a/fix/CMakeLists.txt b/fix/CMakeLists.txt index 765148ded..9bb0827d7 100644 --- a/fix/CMakeLists.txt +++ b/fix/CMakeLists.txt @@ -1,10 +1,11 @@ -set(HEADERS) +set(HEADERS + fix.h) set(CPPS fix.cpp) add_library(fix STATIC ${HEADERS} ${CPPS}) target_include_directories(fix PUBLIC $ ) diff --git a/grtext/CMakeLists.txt b/grtext/CMakeLists.txt index 6f55b4e2c..88915de5d 100644 --- a/grtext/CMakeLists.txt +++ b/grtext/CMakeLists.txt @@ -1,4 +1,7 @@ -set(HEADERS grtextlib.h) +set(HEADERS + grtext.h + grtextlib.h) + set(CPPS grfont.cpp grtext.cpp @@ -7,4 +10,14 @@ set(CPPS add_library(grtext STATIC ${HEADERS} ${CPPS}) target_link_libraries(grtext PRIVATE ddio + bitmap + renderer + dd_video + 2dlib +) + +target_include_directories(grtext PUBLIC + $ ) diff --git a/grtext/grfont.cpp b/grtext/grfont.cpp index a4ed9d5c4..bcc975229 100644 --- a/grtext/grfont.cpp +++ b/grtext/grfont.cpp @@ -107,18 +107,20 @@ * $NoKeywords: $ */ +#include +#include +#include +#include + +#include "grtext.h" #include "grtextlib.h" #include "cfile.h" #include "bitmap.h" #include "pserror.h" #include "renderer.h" #include "mem.h" -#include "ddio.h" +#include "ddio_common.h" -#include -#include -#include -#include const int MAX_FONTS = 16, MAX_FONT_BITMAPS = 32; diff --git a/grtext/grtext.cpp b/grtext/grtext.cpp index bcc8de0d4..7e9478506 100644 --- a/grtext/grtext.cpp +++ b/grtext/grtext.cpp @@ -146,18 +146,18 @@ * $NoKeywords: $ */ +#include "grtext.h" + #include #include +#include +#include +#include #include "grtextlib.h" #include "renderer.h" #include "pserror.h" -#include "mem.h" - -#include -#include -#include #define CLIP_LEFT Grtext_left #define CLIP_TOP Grtext_top diff --git a/lib/grtext.h b/grtext/grtext.h similarity index 99% rename from lib/grtext.h rename to grtext/grtext.h index 030300163..f04d9e43c 100644 --- a/lib/grtext.h +++ b/grtext/grtext.h @@ -108,8 +108,7 @@ #ifndef GRTEXT_H #define GRTEXT_H -#include "pstypes.h" -#include "ddvid.h" +#include "grdefs.h" #define GRTEXT_BUFLEN 16384 #define GRTEXT_FORMAT_CHAR 0x2 diff --git a/grtext/grtextlib.h b/grtext/grtextlib.h index c3d3a7c52..387d72e02 100644 --- a/grtext/grtextlib.h +++ b/grtext/grtextlib.h @@ -38,8 +38,7 @@ #ifndef GRTEXTLIB_H #define GRTEXTLIB_H -#include "grtext.h" -#include "pstypes.h" +#include struct tCharBlt { uint16_t ch; diff --git a/legacy/editor/MainFrm.cpp b/legacy/editor/MainFrm.cpp index 89dad323f..3736cce00 100644 --- a/legacy/editor/MainFrm.cpp +++ b/legacy/editor/MainFrm.cpp @@ -806,7 +806,7 @@ // D3 EDITOR HEADERS #include "pserror.h" -#include "Application.h" +#include "application.h" #include "AppDatabase.h" #include "program.h" #include "gr.h" diff --git a/legacy/editor/editor_lighting.cpp b/legacy/editor/editor_lighting.cpp index e7f1c6ce0..c737a5ebf 100644 --- a/legacy/editor/editor_lighting.cpp +++ b/legacy/editor/editor_lighting.cpp @@ -45,7 +45,7 @@ #include "d3edit.h" #include "ddio.h" #include "bsp.h" -#include "Application.h" +#include "application.h" #include "AppDatabase.h" #include "program.h" #include "loadlevel.h" diff --git a/legacy/editor/gameeditor.cpp b/legacy/editor/gameeditor.cpp index 93a4a82b9..960787f55 100644 --- a/legacy/editor/gameeditor.cpp +++ b/legacy/editor/gameeditor.cpp @@ -496,7 +496,7 @@ #include "init.h" #include "game.h" #include "descent.h" -#include "Application.h" +#include "application.h" #include "AppDatabase.h" #include "program.h" #include "ddio.h" @@ -521,7 +521,7 @@ #include "pilot.h" #include "streamaudio.h" #include "D3ForceFeedback.h" -#include "d3music.h" +#include "musicapi.h" #include "osiris_dll.h" #include "d3edit.h" #include "editordoc.h" diff --git a/legacy/musicutils/musicutils.cpp b/legacy/musicutils/musicutils.cpp index 43e8b099e..46ede94eb 100644 --- a/legacy/musicutils/musicutils.cpp +++ b/legacy/musicutils/musicutils.cpp @@ -24,7 +24,7 @@ #include "musicutilsDlg.h" #include "musicplay.h" -#include "Application.h" +#include "application.h" #ifdef _DEBUG #define new DEBUG_NEW diff --git a/legacy/musicutils/musicutilsDlg.cpp b/legacy/musicutils/musicutilsDlg.cpp index 9e7254d79..5d787d7e5 100644 --- a/legacy/musicutils/musicutilsDlg.cpp +++ b/legacy/musicutils/musicutilsDlg.cpp @@ -31,7 +31,7 @@ #include "musicplay.h" #include "pserror.h" -#include "Application.h" +#include "application.h" #include "streamaudio.h" #include "ddio.h" #include "macros.h" diff --git a/legacy/renderer/Direct3D.cpp b/legacy/renderer/Direct3D.cpp index 08b10423d..ea90de752 100644 --- a/legacy/renderer/Direct3D.cpp +++ b/legacy/renderer/Direct3D.cpp @@ -20,7 +20,7 @@ #include "DDAccess.h" // This module has access to machine-dependent variables. #include "pstypes.h" #include "pserror.h" -#include "Application.h" +#include "application.h" #include "renderer.h" #include "3d.h" #include "bitmap.h" diff --git a/lib/psclass.h b/lib/psclass.h index 10aa00732..5eda92935 100644 --- a/lib/psclass.h +++ b/lib/psclass.h @@ -54,6 +54,9 @@ #ifndef PSCLASS_H #define PSCLASS_H +#include +#include + // a universal list node to use with the list type template struct tListNode { T t; diff --git a/libacm/CMakeLists.txt b/libacm/CMakeLists.txt index fbd4e5136..fde189fa6 100644 --- a/libacm/CMakeLists.txt +++ b/libacm/CMakeLists.txt @@ -1,4 +1,7 @@ -set(HEADERS) +set(HEADERS + adecode.h + aencode.h) + set(CPPS aencode.cpp adecode.cpp) @@ -9,3 +12,9 @@ set(LIB_SRC libacm.h) add_library(libacm STATIC ${HEADERS} ${CPPS} ${LIB_SRC}) + +target_include_directories(libacm PUBLIC + $ +) diff --git a/libacm/adecode.cpp b/libacm/adecode.cpp index d8a002404..7978a21f7 100644 --- a/libacm/adecode.cpp +++ b/libacm/adecode.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include "Adecode.h" +#include "adecode.h" #include "libacm.h" diff --git a/lib/Adecode.h b/libacm/adecode.h similarity index 100% rename from lib/Adecode.h rename to libacm/adecode.h diff --git a/libacm/aencode.cpp b/libacm/aencode.cpp index 6c2bcb124..2020197b5 100644 --- a/libacm/aencode.cpp +++ b/libacm/aencode.cpp @@ -21,7 +21,7 @@ #include #include #include -#include "Aencode.h" +#include "aencode.h" typedef uint32_t uint32_t; typedef int32_t int32_t; diff --git a/lib/Aencode.h b/libacm/aencode.h similarity index 98% rename from lib/Aencode.h rename to libacm/aencode.h index 51f965dde..8d14df43c 100644 --- a/lib/Aencode.h +++ b/libacm/aencode.h @@ -21,7 +21,6 @@ #include #include -#include "pstypes.h" typedef int32_t ReadSampleFunction(void *data); diff --git a/libacm/libacm.h b/libacm/libacm.h index 84fa19711..791ee102e 100644 --- a/libacm/libacm.h +++ b/libacm/libacm.h @@ -19,6 +19,8 @@ #ifndef __LIBACM_H #define __LIBACM_H +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/libmve/CMakeLists.txt b/libmve/CMakeLists.txt index 7b92311a4..aeab332e7 100644 --- a/libmve/CMakeLists.txt +++ b/libmve/CMakeLists.txt @@ -18,3 +18,8 @@ endif() add_library(libmve STATIC ${HEADERS} ${CPPS} ${PLATFORM_CPPS}) +target_include_directories(libmve PUBLIC + $ +) diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 73f91b6a1..bccec3a77 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -1,3 +1,10 @@ +set(HEADERS + linux_fix.h + lnxapp.h + lnxcontroller.h + registry.h +) + set(CPPS lnxcon.cpp lnxcon_raw.cpp @@ -8,15 +15,20 @@ set(CPPS registry.cpp ) -add_library(linux STATIC ${CPPS}) +add_library(linux STATIC ${HEADERS} ${CPPS}) target_link_libraries(linux PRIVATE cfile + ddio + networking + renderer + model + manage + 2dlib + bitmap ) target_include_directories(linux PUBLIC $ ) -target_link_libraries(linux PRIVATE - ddio -) + diff --git a/linux/linux_fix.h b/linux/linux_fix.h index cb1f84a2e..48dcaee76 100644 --- a/linux/linux_fix.h +++ b/linux/linux_fix.h @@ -24,6 +24,7 @@ #define LOKI_VERSION "" #define HGLOBAL void * +#define SOCKET int void GlobalFree(void *); void *GlobalAlloc(int flags, int size); diff --git a/linux/lnxapp.cpp b/linux/lnxapp.cpp index 7c3f25eaa..26cd0bad1 100644 --- a/linux/lnxapp.cpp +++ b/linux/lnxapp.cpp @@ -68,15 +68,17 @@ * $NoKeywords: $ */ +#include #include #include #include #include #include -#include "application.h" #include "lnxapp.h" +#include "linux_fix.h" + #ifdef buttons // termios.h defines buttons, but SDL's headers use that symbol. #undef buttons #endif diff --git a/linux/lnxapp.h b/linux/lnxapp.h index 4fe2eb7e5..f942a9b61 100644 --- a/linux/lnxapp.h +++ b/linux/lnxapp.h @@ -19,7 +19,7 @@ #ifndef LNXAPP_H #define LNXAPP_H -#include "linux_fix.h" +#include "application.h" // if no-display/input specifier is given, it will use defaults #define APPFLAG_USESERVICE 0x00000100 // console (run no output/input) diff --git a/linux/lnxcon.cpp b/linux/lnxcon.cpp index f0738f417..dff4093f5 100644 --- a/linux/lnxcon.cpp +++ b/linux/lnxcon.cpp @@ -62,11 +62,8 @@ #include #include -#include "application.h" -#include "AppConsole.h" -#include "TaskSystem.h" -#include "mono.h" -#include "pstring.h" +#include "lnxapp.h" +#include "appconsole.h" #include #include "linux/dyna_curses.h" diff --git a/linux/lnxcon_null.cpp b/linux/lnxcon_null.cpp index fc1e1e75a..e2cd54d47 100644 --- a/linux/lnxcon_null.cpp +++ b/linux/lnxcon_null.cpp @@ -49,9 +49,6 @@ #include #include -#include "application.h" -#include "AppConsole.h" -#include "TaskSystem.h" #include "mono.h" diff --git a/linux/lnxcon_raw.cpp b/linux/lnxcon_raw.cpp index 9b0e30942..e55cddee7 100644 --- a/linux/lnxcon_raw.cpp +++ b/linux/lnxcon_raw.cpp @@ -39,22 +39,19 @@ * $NoKeywords: $ */ +#include + +#include #include #include #include #include #include -#include - -#include "application.h" -#include "AppConsole.h" -#include "TaskSystem.h" -#include "mono.h" -// #include "local_malloc.h" -#include "pstring.h" #include +#include "appconsole.h" + static char *Con_raw_read_buf = NULL; // The next buffer of text from user input static char *Con_raw_inp_buf = NULL, Con_raw_inp_pos = 0; // Currently updating input buffer of text (and it's position) static char Con_raw_last_command[CON_MAX_STRINGLEN]; // The last command entered by the user diff --git a/linux/lnxcontroller.cpp b/linux/lnxcontroller.cpp index 5b49d65db..13a7057c7 100644 --- a/linux/lnxcontroller.cpp +++ b/linux/lnxcontroller.cpp @@ -41,13 +41,15 @@ * $NoKeywords: $ */ +#include "lnxcontroller.h" + #include -#include "Controller.h" + #include "ddio.h" #include "pserror.h" #include "joystick.h" #include "inffile.h" -#include "lnxcontroller.h" +#include "Macros.h" // Sorry! This is needed for the semi-hacky mouselook support #include "descent.h" @@ -409,7 +411,7 @@ ct_config_data lnxgameController::get_controller_value(ct_type type_req) { } for (i = 2; i < m_NumControls; i++) { float pos; - int ctl = CONTROLLER_CTL_INFO(i, -1); + int ctl = CONTROLLER_CTL_INFO(i, 0xFF); if (m_ControlList[i].flags & (CTF_POV << pov_n)) { pos = get_pov_value(i, ctDigital, pov_n, JOYPOV_RIGHT); diff --git a/linux/lnxcontroller.h b/linux/lnxcontroller.h index d5567eb4e..eb47c9d51 100644 --- a/linux/lnxcontroller.h +++ b/linux/lnxcontroller.h @@ -19,7 +19,7 @@ #ifndef __LNXCONTROLLER_H_ #define __LNXCONTROLLER_H_ -#include "Controller.h" +#include "controller.h" #include "joystick.h" #define NULL_LNXCONTROLLER ((int8_t)NULL_CONTROLLER) diff --git a/linux/lnxdata.cpp b/linux/lnxdata.cpp index a87655d46..7d5f4ec6c 100644 --- a/linux/lnxdata.cpp +++ b/linux/lnxdata.cpp @@ -47,8 +47,7 @@ #include #include -#include "appdatabase.h" -#include "linux/lnxdatabase.h" +#include "lnxdatabase.h" #include "pserror.h" #include "mono.h" #include "pserror.h" diff --git a/lib/linux/lnxdatabase.h b/linux/lnxdatabase.h similarity index 98% rename from lib/linux/lnxdatabase.h rename to linux/lnxdatabase.h index 32f839ca2..2b8fe98ab 100644 --- a/lib/linux/lnxdatabase.h +++ b/linux/lnxdatabase.h @@ -28,9 +28,9 @@ #include #include -class CRegistry; +#include "appdatabase.h" -#include "Macros.h" +class CRegistry; /* oeLnxAppDatabase to get info about the application from a managed database (or a custom info file) diff --git a/lib/linux/lnxdraw.h b/linux/lnxdraw.h similarity index 100% rename from lib/linux/lnxdraw.h rename to linux/lnxdraw.h diff --git a/lib/linux/oelnx_os.h b/linux/oelnx_os.h similarity index 100% rename from lib/linux/oelnx_os.h rename to linux/oelnx_os.h diff --git a/linux/registry.cpp b/linux/registry.cpp index 7068abe6d..1aeedcf62 100644 --- a/linux/registry.cpp +++ b/linux/registry.cpp @@ -47,10 +47,11 @@ * $NoKeywords: $ */ -#include -#include -#include -#include +#include +#include +#include +#include + // #include "local_malloc.h" #include "registry.h" #include "mono.h" diff --git a/linux/registry.h b/linux/registry.h index fd4ef9ada..c051be018 100644 --- a/linux/registry.h +++ b/linux/registry.h @@ -49,8 +49,6 @@ #define REGT_STRING 0 #define REGT_DWORD 1 -#include - struct tRecord { char name[MAX_RECORD_NAME]; char type; diff --git a/manage/CMakeLists.txt b/manage/CMakeLists.txt index de9e6866f..ebb4797b7 100644 --- a/manage/CMakeLists.txt +++ b/manage/CMakeLists.txt @@ -2,6 +2,8 @@ set(HEADERS doorpage.h gamefilepage.h genericpage.h + manage_external.h + manage.h megapage.h powerpage.h robotpage.h @@ -9,6 +11,7 @@ set(HEADERS soundpage.h texpage.h weaponpage.h) + set(CPPS doorpage.cpp gamefilepage.cpp @@ -27,4 +30,16 @@ target_link_libraries(manage PRIVATE ddio sndlib stream_audio + 2dlib + model + networking + bitmap + renderer +) + +target_include_directories(manage PUBLIC + $ ) + diff --git a/manage/manage.cpp b/manage/manage.cpp index 25a1d5bad..7c1f513ea 100644 --- a/manage/manage.cpp +++ b/manage/manage.cpp @@ -462,7 +462,7 @@ #include "genericpage.h" #include "mem.h" #include "dedicated_server.h" -#include "AppConsole.h" +#include "appconsole.h" #include "init.h" #include "stringtable.h" #include "args.h" diff --git a/lib/manage.h b/manage/manage.h similarity index 99% rename from lib/manage.h rename to manage/manage.h index dda17a87d..8fa76c7f4 100644 --- a/lib/manage.h +++ b/manage/manage.h @@ -22,7 +22,6 @@ #include #include "cfile.h" -#include "bitmap.h" #include "manage_external.h" #if defined(__LINUX__) @@ -39,7 +38,7 @@ // Tracklocks are for keeping track of what pages the local user is working on or has locked #define PAGELOCK_NAME_LEN 30 -#define TABLE_NAME_LEN PSPATHNAME_LEN +#define TABLE_NAME_LEN _MAX_PATH #define INFO_STRING_LEN 100 #define MAX_PAGELOCKS 1000 #define MAX_TRACKLOCKS 5000 diff --git a/lib/manage_external.h b/manage/manage_external.h similarity index 100% rename from lib/manage_external.h rename to manage/manage_external.h diff --git a/md5/CMakeLists.txt b/md5/CMakeLists.txt index 25ef760aa..eb772dec1 100644 --- a/md5/CMakeLists.txt +++ b/md5/CMakeLists.txt @@ -9,3 +9,11 @@ add_library(md5 STATIC ${HEADERS} ${CPPS} ${PLATFORMCPPS}) if(BUILD_TESTING) add_subdirectory(tests) endif() + +target_include_directories(md5 PUBLIC + $ +) + + diff --git a/mem/CMakeLists.txt b/mem/CMakeLists.txt index c36914040..221d363a4 100644 --- a/mem/CMakeLists.txt +++ b/mem/CMakeLists.txt @@ -3,3 +3,9 @@ set(CPPS mem.cpp) add_library(mem STATIC ${HEADERS} ${CPPS}) + +target_include_directories(mem PUBLIC + $ +) diff --git a/misc/CMakeLists.txt b/misc/CMakeLists.txt index e6e6d9304..be316fb14 100644 --- a/misc/CMakeLists.txt +++ b/misc/CMakeLists.txt @@ -9,7 +9,23 @@ set(CPPS add_library(misc STATIC ${HEADERS} ${CPPS}) -target_link_libraries(misc ddebug) +target_link_libraries(misc PRIVATE + ddebug + ddio + $<$: + linux + > + $<$: + win32 + > +) + +target_include_directories(misc PUBLIC + $ +) + if(BUILD_TESTING) add_subdirectory(tests) diff --git a/model/CMakeLists.txt b/model/CMakeLists.txt index 6496b505d..9d1cbd899 100644 --- a/model/CMakeLists.txt +++ b/model/CMakeLists.txt @@ -1,4 +1,7 @@ -set(HEADERS) +set(HEADERS + polymodel_external.h + polymodel.h) + set(CPPS newstyle.cpp polymodel.cpp) @@ -6,4 +9,16 @@ set(CPPS add_library(model STATIC ${HEADERS} ${CPPS}) target_link_libraries(model PRIVATE ddio + bitmap + renderer + networking + physics + manage + 2dlib +) + +target_include_directories(model PUBLIC + $ ) diff --git a/model/newstyle.cpp b/model/newstyle.cpp index 89eded770..e059aec1e 100644 --- a/model/newstyle.cpp +++ b/model/newstyle.cpp @@ -77,15 +77,18 @@ * */ + +#include +#include + #include "pserror.h" -#include "pstypes.h" +#include "psrand.h" #include "3d.h" #include "vecmat.h" #include "grdefs.h" #include "polymodel.h" #include "gametexture.h" -#include "byteswap.h" #include "renderer.h" #include "lighting.h" #include "game.h" @@ -96,11 +99,6 @@ #include "lighting.h" #include "findintersection.h" -#include -#include - -#include "psrand.h" - static float face_depth[MAX_POLYGON_VECS]; static uint8_t triangulated_faces[MAX_FACES_PER_ROOM]; diff --git a/model/polymodel.cpp b/model/polymodel.cpp index 799eadab1..96f55094a 100644 --- a/model/polymodel.cpp +++ b/model/polymodel.cpp @@ -598,26 +598,23 @@ * $NoKeywords: $ */ +#include +#include +#include + #include "objinfo.h" #include "polymodel.h" #include "pserror.h" #include "3d.h" #include "mono.h" -#include "bitmap.h" #include "renderer.h" #include "manage.h" #include "gametexture.h" -#include "lighting.h" #include "ddio.h" #include "game.h" -#include -#include -#include "robotfire.h" #include "mem.h" #include "gamesequence.h" -#include - int Num_poly_models = 0; poly_model Poly_models[MAX_POLY_MODELS]; diff --git a/lib/polymodel.h b/model/polymodel.h similarity index 99% rename from lib/polymodel.h rename to model/polymodel.h index 0203437cd..104917eba 100644 --- a/lib/polymodel.h +++ b/model/polymodel.h @@ -294,11 +294,7 @@ #ifndef POLYMODEL_H #define POLYMODEL_H -#include "manage.h" -#include "pstypes.h" -#include "vecmat.h" #include "3d.h" -#include "robotfirestruct.h" #include "polymodel_external.h" #include "object_external_struct.h" diff --git a/lib/polymodel_external.h b/model/polymodel_external.h similarity index 99% rename from lib/polymodel_external.h rename to model/polymodel_external.h index 0b8caea91..d66168aef 100644 --- a/lib/polymodel_external.h +++ b/model/polymodel_external.h @@ -56,8 +56,8 @@ #ifndef __POLYMODEL_EXTERNAL_H_ #define __POLYMODEL_EXTERNAL_H_ +#include "robotfirestruct.h" #include "vecmat_external.h" -#include "pstypes.h" #include "grdefs.h" #include "manage_external.h" diff --git a/module/CMakeLists.txt b/module/CMakeLists.txt index a608438a8..95057cc51 100644 --- a/module/CMakeLists.txt +++ b/module/CMakeLists.txt @@ -1,4 +1,5 @@ -set(HEADERS) +set(HEADERS + module.h) set(CPPS module.cpp) @@ -6,3 +7,9 @@ add_library(module STATIC ${HEADERS} ${CPPS}) target_link_libraries(module PRIVATE ddio ) + +target_include_directories(module PUBLIC + $ +) diff --git a/module/module.cpp b/module/module.cpp index 2deb46bdb..3b8f1835e 100644 --- a/module/module.cpp +++ b/module/module.cpp @@ -92,9 +92,12 @@ * $NoKeywords: $ */ #include "module.h" -#include "pstypes.h" + +#include +#include +#include + #include "pserror.h" -#include "ddio.h" #ifdef __LINUX__ #include @@ -102,12 +105,6 @@ static bool mod_FindRealFileNameCaseInsenstive(const char *directory, const char *filename, char *new_filename); #endif -#include "module.h" -#include "pstypes.h" -#include "pserror.h" -#include -#include -#include #if defined(__LINUX__) #include "linux_fix.h" #endif 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/movie/CMakeLists.txt b/movie/CMakeLists.txt index 0fae401c2..78ff0ad1a 100644 --- a/movie/CMakeLists.txt +++ b/movie/CMakeLists.txt @@ -1,9 +1,24 @@ -set(HEADERS) +set(HEADERS + movie.h) set(CPPS - d3movie.cpp) + movie.cpp) add_library(movie STATIC ${HEADERS} ${CPPS}) target_link_libraries(movie PRIVATE ddio libmve + renderer + grtext + bitmap + model + manage + dd_video + 2dlib ) + +target_include_directories(movie PUBLIC + $ +) + diff --git a/movie/d3movie.cpp b/movie/movie.cpp similarity index 99% rename from movie/d3movie.cpp rename to movie/movie.cpp index 2524a9772..fc3c8cf92 100644 --- a/movie/d3movie.cpp +++ b/movie/movie.cpp @@ -32,6 +32,7 @@ #include #include #include "dsound.h" +#include "winapp.h" #endif #include diff --git a/lib/movie.h b/movie/movie.h similarity index 98% rename from lib/movie.h rename to movie/movie.h index 53d666125..7ea79ff9b 100644 --- a/lib/movie.h +++ b/movie/movie.h @@ -19,9 +19,12 @@ #ifndef MOVIE_H__ #define MOVIE_H__ +#include + +#include "application.h" +#include "grdefs.h" #include "renderer.h" -#include #define MVELIB_NOERROR 0 #define MVELIB_FILE_ERROR -1 diff --git a/music/CMakeLists.txt b/music/CMakeLists.txt index 7799f629c..c0ec0dcdf 100644 --- a/music/CMakeLists.txt +++ b/music/CMakeLists.txt @@ -1,4 +1,7 @@ -set(HEADERS) +set(HEADERS + music.h + musiclib.h) + set(CPPS omflex.cpp sequencer.cpp @@ -6,14 +9,18 @@ set(CPPS tracklist.cpp) add_library(music STATIC ${HEADERS} ${CPPS}) -target_link_libraries(music +target_link_libraries(music PRIVATE cfile ddio sndlib stream_audio + libacm + manage + bitmap ) + target_include_directories(music PUBLIC $ ) diff --git a/music/music.h b/music/music.h index cfc30fe0b..3086e92ae 100644 --- a/music/music.h +++ b/music/music.h @@ -99,8 +99,6 @@ #ifndef MUSIC_H #define MUSIC_H -#include "pstypes.h" -#include "pserror.h" #include "psclass.h" #include "streamaudio.h" diff --git a/music/musiclib.h b/music/musiclib.h index 705cf1dc7..9d5018bcc 100644 --- a/music/musiclib.h +++ b/music/musiclib.h @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#ifndef MUSICLIB_H +#define MUSICLIB_H #define OMFCMD_NUM 22 @@ -44,4 +46,6 @@ // undocumented codes. #define OMFCMD_MPLAY 200 // internal code. -#define OMFCMD_ENDIFI 201 // end of ifi conditional. \ No newline at end of file +#define OMFCMD_ENDIFI 201 // end of ifi conditional. + +#endif diff --git a/music/omflex.cpp b/music/omflex.cpp index fe06a18ab..df54223c8 100644 --- a/music/omflex.cpp +++ b/music/omflex.cpp @@ -71,13 +71,16 @@ * $NoKeywords: $ */ +#include +#include + #include "music.h" #include "musiclib.h" #include "inffile.h" #include "mem.h" +#include "mono.h" +#include "pserror.h" -#include -#include // OMF INF FILE READ #define OMFFILEERR_ADDSECTION INFFILE_CUSTOM // error adding section to list. diff --git a/music/sequencer.cpp b/music/sequencer.cpp index 6f27b1526..3ac131a30 100644 --- a/music/sequencer.cpp +++ b/music/sequencer.cpp @@ -144,13 +144,7 @@ #include "music.h" #include "musiclib.h" -#include "ssl_lib.h" -#include "soundload.h" -#include "textaux.h" #include "pserror.h" -#include "ddio.h" -#include "Macros.h" -#include "inffile.h" #include "streamaudio.h" #include "mem.h" #include diff --git a/music/streamer.cpp b/music/streamer.cpp index 43acb96c1..8b9cd1442 100644 --- a/music/streamer.cpp +++ b/music/streamer.cpp @@ -62,6 +62,7 @@ #include "music.h" #include "streamaudio.h" +#include "pserror.h" oms_stream::oms_stream() {} diff --git a/netcon/includes/CFtp.h b/netcon/inetfile/CFtp.h similarity index 97% rename from netcon/includes/CFtp.h rename to netcon/inetfile/CFtp.h index f29d6f9d6..9d95acaf1 100644 --- a/netcon/includes/CFtp.h +++ b/netcon/inetfile/CFtp.h @@ -58,6 +58,11 @@ #define _CFTP_HEADER_ #include +#include + +#ifdef __LINUX__ +#include "linux_fix.h" +#endif #define FTP_STATE_INTERNAL_ERROR 0 #define FTP_STATE_SOCKET_ERROR 1 diff --git a/netcon/inetfile/CMakeLists.txt b/netcon/inetfile/CMakeLists.txt index 2e2edb714..fdd983c13 100644 --- a/netcon/inetfile/CMakeLists.txt +++ b/netcon/inetfile/CMakeLists.txt @@ -1,4 +1,7 @@ -set(HEADERS) +set(HEADERS + CFtp.h + Chttpget.h + inetgetfile.h) set(CPPS CFtp.cpp @@ -6,3 +9,9 @@ set(CPPS inetgetfile.cpp) add_library(inetfile STATIC ${HEADERS} ${CPPS}) + +target_link_libraries(inetfile PRIVATE + networking +) + +target_include_directories(inetfile PUBLIC .) diff --git a/netcon/includes/Chttpget.h b/netcon/inetfile/Chttpget.h similarity index 100% rename from netcon/includes/Chttpget.h rename to netcon/inetfile/Chttpget.h diff --git a/netcon/includes/inetgetfile.h b/netcon/inetfile/inetgetfile.h similarity index 99% rename from netcon/includes/inetgetfile.h rename to netcon/inetfile/inetgetfile.h index b466589fd..6e4a7b59f 100644 --- a/netcon/includes/inetgetfile.h +++ b/netcon/inetfile/inetgetfile.h @@ -97,8 +97,6 @@ #include #include -#include "linux_fix.h" - // Linux includes/defines #if !MACOSX #include diff --git a/netcon/lanclient/CMakeLists.txt b/netcon/lanclient/CMakeLists.txt index ed24ed2a7..83396b932 100644 --- a/netcon/lanclient/CMakeLists.txt +++ b/netcon/lanclient/CMakeLists.txt @@ -1,17 +1,30 @@ +set(HEADERS + lanclient.h + lanstrings.h) set(CPPS lanclient.cpp) -add_library(Direct_TCP_IP MODULE ${CPPS}) +add_library(Direct_TCP_IP MODULE ${HEADERS} ${CPPS}) set_target_properties(Direct_TCP_IP PROPERTIES PREFIX "") set_target_properties(Direct_TCP_IP PROPERTIES CXX_VISIBILITY_PRESET "hidden") set_target_properties(Direct_TCP_IP PROPERTIES OUTPUT_NAME "Direct TCP~IP") target_link_libraries(Direct_TCP_IP PRIVATE ddio inetfile + networking + ui + bitmap + model + module + manage + renderer + 2dlib $<$: ws2_32 > ) +target_include_directories(Direct_TCP_IP PUBLIC .) + add_custom_target(Direct_TCP_IP_Hog COMMAND $ "$/online/Direct TCP~IP.d3c" @@ -23,3 +36,4 @@ add_custom_target(Direct_TCP_IP_Hog COMMENT "Generate 'Direct TCP~IP.d3c'" ) install(FILES "$/online/Direct TCP~IP.d3c" DESTINATION ${CMAKE_INSTALL_DATADIR}/online) + diff --git a/netgames/anarchy/CMakeLists.txt b/netgames/anarchy/CMakeLists.txt index 98a3d04e1..32d492c2e 100644 --- a/netgames/anarchy/CMakeLists.txt +++ b/netgames/anarchy/CMakeLists.txt @@ -8,5 +8,18 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "") set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m") -target_link_libraries(${NETGAME_MODULE} dmfc) +target_link_libraries(${NETGAME_MODULE} + dmfc + grtext + dd_video + 2dlib + module + renderer + physics + model + manage + bitmap + networking + ddio +) install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames) diff --git a/netgames/coop/CMakeLists.txt b/netgames/coop/CMakeLists.txt index 651052fa8..b3d6012cf 100644 --- a/netgames/coop/CMakeLists.txt +++ b/netgames/coop/CMakeLists.txt @@ -8,5 +8,18 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "") set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m") -target_link_libraries(${NETGAME_MODULE} dmfc) +target_link_libraries(${NETGAME_MODULE} + dmfc + grtext + dd_video + 2dlib + module + renderer + physics + model + manage + bitmap + networking + ddio +) install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames) diff --git a/netgames/ctf/CMakeLists.txt b/netgames/ctf/CMakeLists.txt index f3008f2f5..97f3b704c 100644 --- a/netgames/ctf/CMakeLists.txt +++ b/netgames/ctf/CMakeLists.txt @@ -8,5 +8,19 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "") set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m") -target_link_libraries(${NETGAME_MODULE} dmfc) +target_link_libraries(${NETGAME_MODULE} + dmfc + grtext + dd_video + 2dlib + module + renderer + physics + model + manage + bitmap + networking + ddio +) + install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames) diff --git a/netgames/dmfc/CMakeLists.txt b/netgames/dmfc/CMakeLists.txt index 7f75f3724..2d07991c7 100644 --- a/netgames/dmfc/CMakeLists.txt +++ b/netgames/dmfc/CMakeLists.txt @@ -28,3 +28,26 @@ set(CPPS add_definitions(-DOUTRAGE_VERSION -DDMFC_DLL) add_library(dmfc STATIC ${HEADERS} ${CPPS}) + + +target_link_libraries(dmfc PRIVATE + grtext + module + renderer + bitmap + networking + physics + model + manage + ddio + dd_video + 2dlib + $<$: + linux + > + $<$: + win32 + > +) + +target_include_directories(dmfc PUBLIC .) diff --git a/netgames/entropy/CMakeLists.txt b/netgames/entropy/CMakeLists.txt index 77868a27d..c3538c1ac 100644 --- a/netgames/entropy/CMakeLists.txt +++ b/netgames/entropy/CMakeLists.txt @@ -8,5 +8,18 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "") set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m") -target_link_libraries(${NETGAME_MODULE} dmfc) +target_link_libraries(${NETGAME_MODULE} + dmfc + grtext + dd_video + 2dlib + module + renderer + physics + model + manage + bitmap + networking + ddio +) install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames) diff --git a/netgames/hoard/CMakeLists.txt b/netgames/hoard/CMakeLists.txt index 4c8d9d4be..fbf054fbc 100644 --- a/netgames/hoard/CMakeLists.txt +++ b/netgames/hoard/CMakeLists.txt @@ -8,5 +8,18 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "") set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m") -target_link_libraries(${NETGAME_MODULE} dmfc) +target_link_libraries(${NETGAME_MODULE} + dmfc + grtext + dd_video + 2dlib + module + renderer + physics + model + manage + bitmap + networking + ddio +) install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames) diff --git a/netgames/hyperanarchy/CMakeLists.txt b/netgames/hyperanarchy/CMakeLists.txt index c75cfef97..d3cd1f8e9 100644 --- a/netgames/hyperanarchy/CMakeLists.txt +++ b/netgames/hyperanarchy/CMakeLists.txt @@ -8,5 +8,18 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "") set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m") -target_link_libraries(${NETGAME_MODULE} dmfc) +target_link_libraries(${NETGAME_MODULE} + dmfc + grtext + dd_video + 2dlib + module + renderer + physics + model + manage + bitmap + networking + ddio +) install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames) diff --git a/netgames/monsterball/CMakeLists.txt b/netgames/monsterball/CMakeLists.txt index 76392a3d3..56a05a18b 100644 --- a/netgames/monsterball/CMakeLists.txt +++ b/netgames/monsterball/CMakeLists.txt @@ -8,5 +8,18 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "") set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m") -target_link_libraries(${NETGAME_MODULE} dmfc) +target_link_libraries(${NETGAME_MODULE} + dmfc + grtext + dd_video + 2dlib + module + renderer + physics + model + manage + bitmap + networking + ddio +) install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames) diff --git a/netgames/roboanarchy/CMakeLists.txt b/netgames/roboanarchy/CMakeLists.txt index 18268c7e8..4a2a32b83 100644 --- a/netgames/roboanarchy/CMakeLists.txt +++ b/netgames/roboanarchy/CMakeLists.txt @@ -8,5 +8,18 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "") set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m") -target_link_libraries(${NETGAME_MODULE} dmfc) +target_link_libraries(${NETGAME_MODULE} + dmfc + grtext + dd_video + 2dlib + module + renderer + physics + model + manage + bitmap + networking + ddio +) install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames) diff --git a/netgames/tanarchy/CMakeLists.txt b/netgames/tanarchy/CMakeLists.txt index 74c1732de..5c596ee4b 100644 --- a/netgames/tanarchy/CMakeLists.txt +++ b/netgames/tanarchy/CMakeLists.txt @@ -8,5 +8,18 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "") set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m") -target_link_libraries(${NETGAME_MODULE} dmfc) +target_link_libraries(${NETGAME_MODULE} + dmfc + grtext + dd_video + 2dlib + module + renderer + physics + model + manage + bitmap + networking + ddio +) install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames) diff --git a/networking/CMakeLists.txt b/networking/CMakeLists.txt index 509284773..616a85e8b 100644 --- a/networking/CMakeLists.txt +++ b/networking/CMakeLists.txt @@ -1,14 +1,27 @@ -set(HEADERS) +set(HEADERS + networking.h) set(CPPS networking.cpp) -set(PLATFORMCPPS) - if(WIN32) - set(PLATFORMCPPS "directplay.cpp") + set(HEADERS ${HEADERS} directplay.h) + set(CPPS ${CPPS} directplay.cpp) endif() -add_library(networking STATIC ${HEADERS} ${CPPS} ${PLATFORMCPPS}) +add_library(networking STATIC ${HEADERS} ${CPPS}) target_link_libraries(networking PRIVATE ddio + renderer + bitmap + manage + module + ddio + 2dlib + model +) + +target_include_directories(networking PUBLIC + $ ) diff --git a/lib/directplay.h b/networking/directplay.h similarity index 100% rename from lib/directplay.h rename to networking/directplay.h diff --git a/lib/networking.h b/networking/networking.h similarity index 99% rename from lib/networking.h rename to networking/networking.h index 1b33bf1c3..424b317f7 100644 --- a/lib/networking.h +++ b/networking/networking.h @@ -214,7 +214,6 @@ static inline void INADDR_GET_SUN_SUNB(struct in_addr *st, uint8_t *s_b1, uint8_ #include "linux_fix.h" -#define SOCKET int #define BOOL bool #define SOCKADDR_IN sockaddr_in #define SOCKADDR sockaddr diff --git a/physics/CMakeLists.txt b/physics/CMakeLists.txt index 6a6fd011e..8231e543c 100644 --- a/physics/CMakeLists.txt +++ b/physics/CMakeLists.txt @@ -1,7 +1,11 @@ -set(HEADERS) +set(HEADERS + collide.h + findintersection.h + physics.h) + set(CPPS - Collide.cpp - FindIntersection.cpp + collide.cpp + findintersection.cpp newstyle_fi.cpp physics.cpp) @@ -9,4 +13,19 @@ add_library(physics STATIC ${HEADERS} ${CPPS}) target_link_libraries(physics PRIVATE ddio sndlib + rtperformance + module + model + ddio + 2dlib + manage + bitmap + renderer + networking +) + +target_include_directories(physics PUBLIC + $ ) diff --git a/physics/Collide.cpp b/physics/collide.cpp similarity index 99% rename from physics/Collide.cpp rename to physics/collide.cpp index 37651f9c1..99c1cd8b2 100644 --- a/physics/Collide.cpp +++ b/physics/collide.cpp @@ -831,7 +831,7 @@ #include #include "collide.h" -#include "PHYSICS.H" +#include "physics.h" #include "pserror.h" #include "mono.h" #include "object.h" diff --git a/lib/collide.h b/physics/collide.h similarity index 100% rename from lib/collide.h rename to physics/collide.h diff --git a/physics/FindIntersection.cpp b/physics/findintersection.cpp similarity index 99% rename from physics/FindIntersection.cpp rename to physics/findintersection.cpp index c959ffa5e..1f3ce9cc6 100644 --- a/physics/FindIntersection.cpp +++ b/physics/findintersection.cpp @@ -876,7 +876,7 @@ #include "BOA.h" #include "polymodel.h" -#include "PHYSICS.H" +#include "physics.h" #include "player.h" #include "doorway.h" #include "renderer.h" diff --git a/lib/findintersection.h b/physics/findintersection.h similarity index 100% rename from lib/findintersection.h rename to physics/findintersection.h diff --git a/lib/findintersection_external.h b/physics/findintersection_external.h similarity index 100% rename from lib/findintersection_external.h rename to physics/findintersection_external.h diff --git a/physics/physics.cpp b/physics/physics.cpp index 15fb84ee7..380e64201 100644 --- a/physics/physics.cpp +++ b/physics/physics.cpp @@ -22,7 +22,7 @@ #include #include "object.h" -#include "PHYSICS.H" +#include "physics.h" #include "collide.h" #include "findintersection.h" #include "vecmat.h" diff --git a/lib/PHYSICS.H b/physics/physics.h similarity index 100% rename from lib/PHYSICS.H rename to physics/physics.h diff --git a/lib/3d.h b/renderer/3d.h similarity index 100% rename from lib/3d.h rename to renderer/3d.h diff --git a/renderer/CMakeLists.txt b/renderer/CMakeLists.txt index 636a09559..876b26c3d 100644 --- a/renderer/CMakeLists.txt +++ b/renderer/CMakeLists.txt @@ -1,6 +1,9 @@ set(HEADERS dyna_gl.h HardwareInternal.h + rend_d3d.h + renderer.h + rend_opengl.h ) set(CPPS HardwareClipper.cpp @@ -15,6 +18,7 @@ set(CPPS ) if(UNIX) + set(HEADERS ${HEADERS} lnxscreenmode.h) set(CPPS ${CPPS} lnxscreenmode.cpp) endif() @@ -27,4 +31,19 @@ add_library(renderer STATIC ${HEADERS} ${CPPS}) target_link_libraries(renderer PRIVATE bitmap ddio + rtperformance + module + 2dlib + $<$: + linux + > + $<$: + win32 + > +) + +target_include_directories(renderer PUBLIC + $ ) diff --git a/renderer/HardwareOpenGL.cpp b/renderer/HardwareOpenGL.cpp index 633a7e2ad..c4c9e4a84 100644 --- a/renderer/HardwareOpenGL.cpp +++ b/renderer/HardwareOpenGL.cpp @@ -20,7 +20,9 @@ #if defined(WIN32) #include #elif defined(__LINUX__) -#include "lnxscreenmode.h" +#include "lnxapp.h" +#include +#include #else #endif @@ -39,7 +41,7 @@ #include #include #include "HardwareInternal.h" -#include "../Descent3/args.h" +#include "args.h" #include @@ -48,6 +50,7 @@ #if defined(WIN32) #include "win/arb_extensions.h" +#include "winapp.h" #endif #include diff --git a/renderer/dyna_gl.h b/renderer/dyna_gl.h index 429e763ea..ed1699e84 100644 --- a/renderer/dyna_gl.h +++ b/renderer/dyna_gl.h @@ -21,7 +21,8 @@ #if defined(WIN32) #include #else -#include "SDL_opengl.h" +#include +#include #endif #include "module.h" diff --git a/lib/lnxscreenmode.h b/renderer/lnxscreenmode.h similarity index 100% rename from lib/lnxscreenmode.h rename to renderer/lnxscreenmode.h diff --git a/lib/rend_d3d.h b/renderer/rend_d3d.h similarity index 100% rename from lib/rend_d3d.h rename to renderer/rend_d3d.h diff --git a/lib/rend_opengl.h b/renderer/rend_opengl.h similarity index 100% rename from lib/rend_opengl.h rename to renderer/rend_opengl.h diff --git a/lib/renderer.h b/renderer/renderer.h similarity index 100% rename from lib/renderer.h rename to renderer/renderer.h diff --git a/rtperformance/CMakeLists.txt b/rtperformance/CMakeLists.txt index ea06642a0..3f001e278 100644 --- a/rtperformance/CMakeLists.txt +++ b/rtperformance/CMakeLists.txt @@ -1,8 +1,19 @@ -set(HEADERS) +set(HEADERS + rtperformance.h) set(CPPS rtperformance.cpp) add_library(rtperformance STATIC ${HEADERS} ${CPPS}) target_link_libraries(rtperformance PRIVATE ddio + bitmap + manage ) + + +target_include_directories(rtperformance PUBLIC + $ +) + diff --git a/lib/rtperformance.h b/rtperformance/rtperformance.h similarity index 100% rename from lib/rtperformance.h rename to rtperformance/rtperformance.h diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 25229309a..a303ad304 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -70,9 +70,14 @@ set(SCRIPTS foreach(SCRIPT ${SCRIPTS}) add_library(${SCRIPT} MODULE ${CPPS} "${SCRIPT}.cpp") - target_link_libraries(${SCRIPT} fix) + target_link_libraries(${SCRIPT} PRIVATE + fix + module + physics + manage) set_target_properties(${SCRIPT} PROPERTIES PREFIX "") set_target_properties(${SCRIPT} PROPERTIES CXX_VISIBILITY_PRESET "hidden") + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set_target_properties(${SCRIPT} PROPERTIES SUFFIX ".dylib") endif() diff --git a/sndlib/CMakeLists.txt b/sndlib/CMakeLists.txt index b9d8dc441..a0e61070c 100644 --- a/sndlib/CMakeLists.txt +++ b/sndlib/CMakeLists.txt @@ -1,3 +1,23 @@ +set(HEADERS + ddsndgeometry.h + hlsoundlib.h + sndrender.h + soundload.h + ssl_lib.h + $<$: + auddev.h + ds3dlib.h + ds3dlib_internal.h + eax2.h + eax.h + vmanpset.h + > + $<$: + mixer.h + sdlsound.h + > +) + set(CPPS hlsoundlib.cpp sndrender.cpp @@ -17,14 +37,23 @@ set(CPPS > ) -add_library(sndlib STATIC ${CPPS}) +add_library(sndlib STATIC ${HEADERS} ${CPPS}) target_link_libraries(sndlib PRIVATE cfile ddio + networking + bitmap + renderer + manage + model + physics + 2dlib stream_audio + libacm ) + target_include_directories(sndlib PUBLIC $ ) diff --git a/sndlib/ds3dlib.cpp b/sndlib/ds3dlib.cpp index 93e9ee5e4..3ce73fffc 100644 --- a/sndlib/ds3dlib.cpp +++ b/sndlib/ds3dlib.cpp @@ -213,14 +213,14 @@ #include "mono.h" #include "soundload.h" #include "mem.h" -#include "application.h" +#include "winapp.h" #include "auddev.h" #include "Macros.h" #include "ddio.h" // Hacked window handle -- chrishack -static oeWin32Application *SoundApp = NULL; -static void *GameWindowHandle; +static oeApplication* SoundApp = nullptr; +static void* GameWindowHandle = nullptr; #define MIN_SOUND_MIX_VOLUME 0.0 #define MAX_WRITE_AHEAD .04 // Seconds to write ahead of the play position (in seconds) @@ -385,7 +385,7 @@ inline void opti_16s_mix(int16_t *cur_sample_16bit, const int num_write, int &sa *mb = l_sample; mb++; *mb = r_sample; - *mb++; + mb++; } samples_played += (i / 2); } @@ -1395,10 +1395,12 @@ int win_llsSystem::InitSoundLib(char mixer_type, oeApplication *sos, uint8_t Max // reset error system. SetError(SSL_OK); - SoundApp = (oeWin32Application *)sos; + SoundApp = sos; + + if (sos != nullptr) { + oeWin32Application *obj = dynamic_cast(sos); + ASSERT(obj != nullptr); - if (sos) { - oeWin32Application *obj = (oeWin32Application *)sos; // If the the library if already init'ed, then return o.k. if (m_f_sound_lib_init) @@ -1406,7 +1408,7 @@ int win_llsSystem::InitSoundLib(char mixer_type, oeApplication *sos, uint8_t Max GameWindowHandle = (void *)obj->m_hWnd; } else { - ASSERT(GameWindowHandle); + ASSERT(GameWindowHandle != nullptr); } ll_sound_ptr = this; diff --git a/stream_audio/CMakeLists.txt b/stream_audio/CMakeLists.txt index fc5dd3f19..ba1d74c0b 100644 --- a/stream_audio/CMakeLists.txt +++ b/stream_audio/CMakeLists.txt @@ -1,16 +1,20 @@ -set(HEADERS) +set(HEADERS + streamaudio.h) set(CPPS osfarchive.cpp streamaudio.cpp) add_library(stream_audio STATIC ${HEADERS} ${CPPS}) target_link_libraries(stream_audio PRIVATE + sndlib ddio libacm - sndlib + manage + bitmap ) + target_include_directories(stream_audio PUBLIC $ ) diff --git a/stream_audio/streamaudio.cpp b/stream_audio/streamaudio.cpp index 66e7734cf..c48b2f868 100644 --- a/stream_audio/streamaudio.cpp +++ b/stream_audio/streamaudio.cpp @@ -165,13 +165,15 @@ * $NoKeywords: $ */ #include "streamaudio.h" + +#include +#include + #include "pserror.h" -#include "cfile.h" #include "mem.h" #include "Macros.h" #include "ddio.h" -#include -#include + // #include "samirlog.h" #define LOGFILE(_s) // this stream is for everyone (used by the StreamPlay interface) diff --git a/stream_audio/streamaudio.h b/stream_audio/streamaudio.h index 3937613b4..9fc9fe4eb 100644 --- a/stream_audio/streamaudio.h +++ b/stream_audio/streamaudio.h @@ -138,10 +138,9 @@ #ifndef __STREAMAUDIO_H_ #define __STREAMAUDIO_H_ -#include "Adecode.h" +#include "adecode.h" #include "ssl_lib.h" -#include "TaskSystem.h" void *AudioStreamCB(void *user_data, int handle, int *size); int ADecodeFileRead(void *data, void *buf, uint32_t qty); diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index 0350db8c9..a0d93c7f5 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -1,4 +1,10 @@ -set(HEADERS UIlib.h) +set(HEADERS + uidraw.h + ui.h + UIlib.h + uires.h + uisys.h) + set(CPPS UIButton.cpp UICombo.cpp @@ -19,4 +25,11 @@ set(CPPS add_library(ui STATIC ${HEADERS} ${CPPS}) target_link_libraries(ui PRIVATE ddio + bitmap + grtext + renderer + dd_video + 2dlib ) + +target_include_directories(ui PUBLIC .) diff --git a/ui/UIEdit.cpp b/ui/UIEdit.cpp index 910818b38..71030120b 100644 --- a/ui/UIEdit.cpp +++ b/ui/UIEdit.cpp @@ -136,7 +136,8 @@ #include #include -#include "UIlib.h" +#include "ui.h" +#include "ddio_common.h" #include "grtext.h" #include "Macros.h" #include "mem.h" diff --git a/ui/UISystem.cpp b/ui/UISystem.cpp index ae518f96f..cfa6825f7 100644 --- a/ui/UISystem.cpp +++ b/ui/UISystem.cpp @@ -168,10 +168,9 @@ #include "UIlib.h" #include "application.h" #include "bitmap.h" -#include "ddvid.h" #include "renderer.h" -#include "psclass.h" #include "Macros.h" + #define UI_MOUSE_HOTX 2 #define UI_MOUSE_HOTY 2 #define UI_FRAMETIME 0.05 diff --git a/lib/ui.h b/ui/ui.h similarity index 100% rename from lib/ui.h rename to ui/ui.h diff --git a/lib/uidraw.h b/ui/uidraw.h similarity index 100% rename from lib/uidraw.h rename to ui/uidraw.h diff --git a/lib/uires.h b/ui/uires.h similarity index 100% rename from lib/uires.h rename to ui/uires.h diff --git a/lib/uisys.h b/ui/uisys.h similarity index 100% rename from lib/uisys.h rename to ui/uisys.h diff --git a/unzip/CMakeLists.txt b/unzip/CMakeLists.txt index cc071a39e..14fda0cff 100644 --- a/unzip/CMakeLists.txt +++ b/unzip/CMakeLists.txt @@ -1,6 +1,8 @@ -set(HEADERS) +set(HEADERS unzip.h) set(CPPS unzip.cpp) add_library(unzip STATIC ${HEADERS} ${CPPS}) target_link_libraries(unzip ZLIB::ZLIB) + +target_include_directories(unzip PUBLIC .) diff --git a/lib/unzip.h b/unzip/unzip.h similarity index 100% rename from lib/unzip.h rename to unzip/unzip.h diff --git a/vecmat/CMakeLists.txt b/vecmat/CMakeLists.txt index 6a5269ce6..46108aa7f 100644 --- a/vecmat/CMakeLists.txt +++ b/vecmat/CMakeLists.txt @@ -4,3 +4,5 @@ set(CPPS add_library(vecmat STATIC ${HEADERS} ${CPPS}) target_link_libraries(vecmat fix) + +target_include_directories(vecmat PUBLIC .) diff --git a/win32/CMakeLists.txt b/win32/CMakeLists.txt index 359aa6214..ca2d9164b 100644 --- a/win32/CMakeLists.txt +++ b/win32/CMakeLists.txt @@ -1,14 +1,30 @@ +set(HEADERS + winapp.h + windatabase.h + wincontroller.h +) + set(CPPS winapp.cpp wincon.cpp - WinController.cpp + wincontroller.cpp windata.cpp wintask.cpp ) add_library(win32 STATIC ${CPPS}) add_dependencies(win32 get_git_hash) -target_include_directories(win32 PRIVATE ${PROJECT_BINARY_DIR}/lib) + target_link_libraries(win32 PRIVATE ddio + 2dlib + bitmap + manage + model + renderer + networking +) + +target_include_directories(win32 PUBLIC . + PRIVATE ${PROJECT_BINARY_DIR}/lib ) diff --git a/win32/winapp.cpp b/win32/winapp.cpp index a3bda5e9f..53599e557 100644 --- a/win32/winapp.cpp +++ b/win32/winapp.cpp @@ -146,16 +146,19 @@ */ #define OEAPP_INTERNAL_MODULE +#include "winapp.h" -#include "Application.h" -#include "AppConsole.h" -#include "mono.h" -#include "networking.h" +#include +#include +#include #include #include -#include -#include + +#include "appconsole.h" +#include "mono.h" +#include "networking.h" + // taken from winuser.h #ifndef WHEEL_DELTA diff --git a/lib/win/win32app.h b/win32/winapp.h similarity index 99% rename from lib/win/win32app.h rename to win32/winapp.h index 71c189478..be12597cd 100644 --- a/lib/win/win32app.h +++ b/win32/winapp.h @@ -83,6 +83,8 @@ #include #include +#include "application.h" + /* Basic Application Win32 data types, to prevent include of windows.h */ typedef uintptr_t HWnd; typedef uintptr_t HInstance; diff --git a/win32/wincon.cpp b/win32/wincon.cpp index 5ff4f747a..60da0bee0 100644 --- a/win32/wincon.cpp +++ b/win32/wincon.cpp @@ -64,18 +64,17 @@ * $NoKeywords: $ */ +#include "appconsole.h" + +#include #include #include - -#include "Application.h" -#include "AppConsole.h" -#include "TaskSystem.h" +#include #include -#include #include -#include +#include "winapp.h" #define CON_SCROLL_ROWS 25 #define CON_SCROLL_COLS 80 diff --git a/win32/WinController.cpp b/win32/wincontroller.cpp similarity index 99% rename from win32/WinController.cpp rename to win32/wincontroller.cpp index af46ae11c..43830f953 100644 --- a/win32/WinController.cpp +++ b/win32/wincontroller.cpp @@ -309,9 +309,9 @@ * $NoKeywords: $ */ -#include "Controller.h" +#include "wincontroller.h" -#include +#include #include "pserror.h" #include "ddio.h" diff --git a/lib/win/wincontroller.h b/win32/wincontroller.h similarity index 99% rename from lib/win/wincontroller.h rename to win32/wincontroller.h index f74a991a0..9ac3e8c91 100644 --- a/lib/win/wincontroller.h +++ b/win32/wincontroller.h @@ -132,7 +132,7 @@ #ifndef WINCONTROLLER_H #define WINCONTROLLER_H -#include "Controller.h" +#include "controller.h" #include "joystick.h" #define NULL_WINCONTROLLER ((int8_t)NULL_CONTROLLER) diff --git a/win32/windata.cpp b/win32/windata.cpp index 43761e0e3..0c71bdfdb 100644 --- a/win32/windata.cpp +++ b/win32/windata.cpp @@ -68,7 +68,7 @@ * $NoKeywords: $ */ -#include "AppDatabase.h" +#include "windatabase.h" #include #include diff --git a/lib/win/win32database.h b/win32/windatabase.h similarity index 99% rename from lib/win/win32database.h rename to win32/windatabase.h index b77fd7afa..b449bff8b 100644 --- a/lib/win/win32database.h +++ b/win32/windatabase.h @@ -51,6 +51,8 @@ #ifndef WIN32DATABASE #define WIN32DATABASE +#include "appdatabase.h" + /* oeWin32AppDatabase to get info about the application from a managed database (or a custom info file) we get our information from the registry!