From a59503f881e5275514a6560ac5aa59dab55af621 Mon Sep 17 00:00:00 2001 From: "Azamat H. Hackimov" Date: Mon, 23 Sep 2024 03:16:07 +0300 Subject: [PATCH] Move pserror.h to ddebug module --- 2dlib/CMakeLists.txt | 5 +++-- Descent3/d3music.cpp | 1 + Descent3/lightmap_info.cpp | 7 +++---- Descent3/lightmap_info.h | 3 +-- Descent3/list.cpp | 1 + Descent3/list.h | 3 --- Descent3/object.h | 5 +++-- Descent3/procedurals.h | 4 ++-- Descent3/special_face.cpp | 9 ++++----- Descent3/special_face.h | 4 ++-- Descent3/terrainrender.cpp | 4 ---- Descent3/viseffect_external.h | 3 +-- Descent3/weather.cpp | 5 +---- bitmap/pcx.cpp | 1 - cfile/CMakeLists.txt | 1 + dd_grwin32/CMakeLists.txt | 2 +- ddebug/CMakeLists.txt | 2 ++ {misc => ddebug}/error.cpp | 0 {misc => ddebug}/pserror.h | 0 ddio/CMakeLists.txt | 1 - ddio/lnxforcefeedback.cpp | 1 - grtext/CMakeLists.txt | 5 +++-- linux/CMakeLists.txt | 2 +- linux/lnxdata.cpp | 1 - manage/CMakeLists.txt | 2 +- manage/generic.cpp | 2 -- mem/CMakeLists.txt | 2 +- misc/CMakeLists.txt | 9 ++------- model/CMakeLists.txt | 4 +++- music/CMakeLists.txt | 2 +- music/music.h | 4 ++-- music/omflex.cpp | 7 ++++--- music/streamer.cpp | 1 + networking/CMakeLists.txt | 2 +- networking/networking.cpp | 2 -- physics/CMakeLists.txt | 1 + renderer/CMakeLists.txt | 1 + renderer/HardwareDraw.cpp | 1 + renderer/HardwareInstance.cpp | 4 +++- renderer/HardwareInternal.h | 2 -- renderer/HardwareSetup.cpp | 5 ++--- renderer/HardwareTransforms.cpp | 4 ++-- renderer/dyna_gl.h | 1 - sndlib/CMakeLists.txt | 2 +- sndlib/ddsoundload.cpp | 1 - stream_audio/CMakeLists.txt | 2 +- ui/CMakeLists.txt | 5 +++-- vecmat/CMakeLists.txt | 1 + win32/CMakeLists.txt | 1 - 49 files changed, 62 insertions(+), 76 deletions(-) rename {misc => ddebug}/error.cpp (100%) rename {misc => ddebug}/pserror.h (100%) diff --git a/2dlib/CMakeLists.txt b/2dlib/CMakeLists.txt index 8577875d8..e0bf4d254 100644 --- a/2dlib/CMakeLists.txt +++ b/2dlib/CMakeLists.txt @@ -1,6 +1,7 @@ set(HEADERS gr.h - lib2d.h) + lib2d.h +) set(CPPS font.cpp hardsurf.cpp @@ -15,9 +16,9 @@ set(CPPS add_library(2dlib STATIC ${HEADERS} ${CPPS}) target_link_libraries(2dlib PRIVATE cfile + ddebug logger mem - misc ) target_include_directories(2dlib PUBLIC $ +#include #include "lightmap_info.h" #include "lightmap.h" #include "mono.h" -#include "Ddgr.h" #include "grdefs.h" +#include "pserror.h" #include "renderer.h" -#include -#include #include "mem.h" #include "dedicated_server.h" diff --git a/Descent3/lightmap_info.h b/Descent3/lightmap_info.h index 518502a24..b6b295cbf 100644 --- a/Descent3/lightmap_info.h +++ b/Descent3/lightmap_info.h @@ -39,8 +39,7 @@ #define LIGHTMAP_INFO_H // Lightmap info header -#include "pstypes.h" -#include "pserror.h" +#include #include "vecmat.h" #define BAD_LMI_INDEX 65535 diff --git a/Descent3/list.cpp b/Descent3/list.cpp index a85f3011d..dff97cd25 100644 --- a/Descent3/list.cpp +++ b/Descent3/list.cpp @@ -19,6 +19,7 @@ #include "list.h" #include "log.h" #include "mem.h" +#include "pserror.h" // Allocates space for a new list node, returning the pointer to it listnode *NewListNode(void) { diff --git a/Descent3/list.h b/Descent3/list.h index f76932a8b..57a509bb0 100644 --- a/Descent3/list.h +++ b/Descent3/list.h @@ -19,9 +19,6 @@ #ifndef LIST_H #define LIST_H -#include "pstypes.h" -#include "pserror.h" - struct listnode { void *data; struct listnode *next; diff --git a/Descent3/object.h b/Descent3/object.h index bc52ab937..9c7f27061 100644 --- a/Descent3/object.h +++ b/Descent3/object.h @@ -628,10 +628,11 @@ #ifndef _OBJECT_H #define _OBJECT_H -#include "pstypes.h" -#include "pserror.h" +#include + #include "object_external_struct.h" #include "object_external.h" +#include "pserror.h" /* * CONSTANTS diff --git a/Descent3/procedurals.h b/Descent3/procedurals.h index 62225a3b3..8f7212e88 100644 --- a/Descent3/procedurals.h +++ b/Descent3/procedurals.h @@ -19,8 +19,8 @@ #ifndef PROCEDURALS_H #define PROCEDURALS_H -#include "pstypes.h" -#include "pserror.h" +#include + #include "fix.h" #define MAX_PROC_ELEMENTS 8000 diff --git a/Descent3/special_face.cpp b/Descent3/special_face.cpp index e3117b138..4a966c6f0 100644 --- a/Descent3/special_face.cpp +++ b/Descent3/special_face.cpp @@ -16,13 +16,12 @@ * along with this program. If not, see . */ -#include "pstypes.h" +#include +#include -#include "special_face.h" -#include "mono.h" -#include -#include #include "mem.h" +#include "pserror.h" +#include "special_face.h" int Num_of_special_faces = 0; special_face SpecialFaces[MAX_SPECIAL_FACES]; diff --git a/Descent3/special_face.h b/Descent3/special_face.h index c70f5df9b..a2332ff02 100644 --- a/Descent3/special_face.h +++ b/Descent3/special_face.h @@ -19,8 +19,8 @@ #ifndef SPECIAL_FACE_H #define SPECIAL_FACE_H -#include "pstypes.h" -#include "pserror.h" +#include + #include "vecmat.h" #define BAD_SPECIAL_FACE_INDEX -1 diff --git a/Descent3/terrainrender.cpp b/Descent3/terrainrender.cpp index b37dba3db..0fc2863c9 100644 --- a/Descent3/terrainrender.cpp +++ b/Descent3/terrainrender.cpp @@ -794,16 +794,12 @@ void RenderMine(int viewer_roomnum, int flag_automap, int called_from_terrain, b #include "terrain.h" #include "grdefs.h" #include "3d.h" -#include "pstypes.h" #include "pserror.h" #include "renderer.h" #include "gametexture.h" #include "descent.h" #include "render.h" #include "game.h" -#include "ddio.h" -#include "polymodel.h" -#include "lighting.h" #include "vecmat.h" #include "renderobject.h" #include "findintersection.h" diff --git a/Descent3/viseffect_external.h b/Descent3/viseffect_external.h index 3f8f73288..ea0bc2943 100644 --- a/Descent3/viseffect_external.h +++ b/Descent3/viseffect_external.h @@ -50,8 +50,7 @@ #ifndef __VISEFFECT_EXTERNAL_H_ #define __VISEFFECT_EXTERNAL_H_ -#include "pstypes.h" -#include "pserror.h" +#include #include "vecmat.h" #define MAX_VIS_EFFECTS 5000 diff --git a/Descent3/weather.cpp b/Descent3/weather.cpp index d00bf09ae..29fb42bba 100644 --- a/Descent3/weather.cpp +++ b/Descent3/weather.cpp @@ -17,7 +17,6 @@ */ #include "pserror.h" -#include "pstypes.h" #include "fireball.h" #include "weather.h" #include "viseffect.h" @@ -28,10 +27,8 @@ #include "soundload.h" #include "hlsoundlib.h" #include "sounds.h" - -#include - #include "psrand.h" + weather Weather = {0}; int ThunderA_sound_handle = -1; diff --git a/bitmap/pcx.cpp b/bitmap/pcx.cpp index 5e84e7747..9a365da3a 100644 --- a/bitmap/pcx.cpp +++ b/bitmap/pcx.cpp @@ -61,7 +61,6 @@ #include "grdefs.h" #include "log.h" #include "mem.h" -#include "pserror.h" // load an 8bit pcx image static int bm_pcx_8bit_alloc_file(CFILE *infile); diff --git a/cfile/CMakeLists.txt b/cfile/CMakeLists.txt index 2deebbdcb..8ce507985 100644 --- a/cfile/CMakeLists.txt +++ b/cfile/CMakeLists.txt @@ -10,6 +10,7 @@ set(CPPS add_library(cfile STATIC ${HEADERS} ${CPPS}) target_link_libraries(cfile PRIVATE + ddebug ddio logger mem diff --git a/dd_grwin32/CMakeLists.txt b/dd_grwin32/CMakeLists.txt index 5f5240351..8ee75fb4b 100644 --- a/dd_grwin32/CMakeLists.txt +++ b/dd_grwin32/CMakeLists.txt @@ -11,8 +11,8 @@ set(CPPS add_library(dd_grwin32 STATIC ${HEADERS} ${CPPS}) target_link_libraries(dd_grwin32 PRIVATE 2dlib + ddebug logger - misc ) target_compile_definitions(dd_grwin32 PRIVATE DX_APP) target_link_libraries(dd_grwin32 PRIVATE ${DDRAW_LIBRARY}) diff --git a/ddebug/CMakeLists.txt b/ddebug/CMakeLists.txt index 254d398ed..c4dc53af0 100644 --- a/ddebug/CMakeLists.txt +++ b/ddebug/CMakeLists.txt @@ -2,9 +2,11 @@ set(HEADERS debug.h debugbreak.h mono.h + pserror.h ) set(CPPS debug.cpp + error.cpp $<$: lnxdebug.cpp lnxmono.cpp diff --git a/misc/error.cpp b/ddebug/error.cpp similarity index 100% rename from misc/error.cpp rename to ddebug/error.cpp diff --git a/misc/pserror.h b/ddebug/pserror.h similarity index 100% rename from misc/pserror.h rename to ddebug/pserror.h diff --git a/ddio/CMakeLists.txt b/ddio/CMakeLists.txt index 7c326b508..b2f7d4468 100644 --- a/ddio/CMakeLists.txt +++ b/ddio/CMakeLists.txt @@ -32,7 +32,6 @@ target_link_libraries(ddio PRIVATE ddebug logger mem - misc ) target_include_directories(ddio PUBLIC $ -#include "pstring.h" #include "forcefeedback.h" bool ddForce_found; // a Force Feedback device was found diff --git a/grtext/CMakeLists.txt b/grtext/CMakeLists.txt index c7e35ea49..32982864b 100644 --- a/grtext/CMakeLists.txt +++ b/grtext/CMakeLists.txt @@ -1,6 +1,7 @@ set(HEADERS grtext.h - grtextlib.h) + grtextlib.h +) set(CPPS grfont.cpp grtext.cpp @@ -9,10 +10,10 @@ set(CPPS add_library(grtext STATIC ${HEADERS} ${CPPS}) target_link_libraries(grtext PRIVATE + ddebug ddio logger mem - misc ) target_include_directories(grtext PUBLIC $ ) target_link_libraries(linux PRIVATE + ddebug ddio - misc SDL2::SDL2 ) diff --git a/linux/lnxdata.cpp b/linux/lnxdata.cpp index 24151b0c8..63ca79a0c 100644 --- a/linux/lnxdata.cpp +++ b/linux/lnxdata.cpp @@ -57,7 +57,6 @@ #include "appdatabase.h" #include "linux/lnxdatabase.h" -#include "pserror.h" #include "log.h" #include "pserror.h" #include "registry.h" diff --git a/manage/CMakeLists.txt b/manage/CMakeLists.txt index 262309fac..77cb7e325 100644 --- a/manage/CMakeLists.txt +++ b/manage/CMakeLists.txt @@ -24,10 +24,10 @@ set(CPPS add_library(manage STATIC ${HEADERS} ${CPPS}) target_link_libraries(manage PRIVATE cfile + ddebug ddio logger mem - misc model sndlib stream_audio diff --git a/manage/generic.cpp b/manage/generic.cpp index afed50c54..dd306d88e 100644 --- a/manage/generic.cpp +++ b/manage/generic.cpp @@ -363,8 +363,6 @@ #include "log.h" #include "pserror.h" #include "polymodel.h" -#include "ddio.h" -#include "robotfire.h" #include "weapon.h" #include "sounds.h" #include "mem.h" diff --git a/mem/CMakeLists.txt b/mem/CMakeLists.txt index 7e72ae847..65f710c70 100644 --- a/mem/CMakeLists.txt +++ b/mem/CMakeLists.txt @@ -6,8 +6,8 @@ target_compile_definitions(mem PUBLIC $<$:MEM_USE_RTL> ) target_link_libraries(mem PRIVATE + ddebug logger - misc ) target_include_directories(mem PUBLIC $ + #include "psclass.h" #include "streamaudio.h" diff --git a/music/omflex.cpp b/music/omflex.cpp index 4ce78f66f..9642681d8 100644 --- a/music/omflex.cpp +++ b/music/omflex.cpp @@ -71,14 +71,15 @@ * $NoKeywords: $ */ +#include +#include + #include "log.h" #include "music.h" #include "musiclib.h" #include "inffile.h" #include "mem.h" - -#include -#include +#include "pserror.h" // OMF INF FILE READ #define OMFFILEERR_ADDSECTION INFFILE_CUSTOM // error adding section to list. diff --git a/music/streamer.cpp b/music/streamer.cpp index d694d1633..2cdc3a8f2 100644 --- a/music/streamer.cpp +++ b/music/streamer.cpp @@ -63,6 +63,7 @@ #include "log.h" #include "music.h" #include "streamaudio.h" +#include "pserror.h" oms_stream::oms_stream() {} diff --git a/networking/CMakeLists.txt b/networking/CMakeLists.txt index 0f9d5802c..34b26c08e 100644 --- a/networking/CMakeLists.txt +++ b/networking/CMakeLists.txt @@ -12,10 +12,10 @@ endif() add_library(networking STATIC ${HEADERS} ${CPPS}) target_link_libraries(networking PRIVATE + ddebug ddio logger mem - misc module ${PLATFORM_LIBS} ) diff --git a/networking/networking.cpp b/networking/networking.cpp index c4c41ac56..4cf7fdd09 100644 --- a/networking/networking.cpp +++ b/networking/networking.cpp @@ -323,11 +323,9 @@ typedef int socklen_t; #include "networking.h" #include "ddio.h" #include "mem.h" -#include "module.h" #include "game.h" #include "args.h" #include "byteswap.h" -#include "pstring.h" #ifndef WIN32 bool Use_DirectPlay = false; diff --git a/physics/CMakeLists.txt b/physics/CMakeLists.txt index 729322e87..e0d68c69f 100644 --- a/physics/CMakeLists.txt +++ b/physics/CMakeLists.txt @@ -11,6 +11,7 @@ set(CPPS add_library(physics STATIC ${HEADERS} ${CPPS}) target_link_libraries(physics PRIVATE + ddebug ddio logger mem diff --git a/renderer/CMakeLists.txt b/renderer/CMakeLists.txt index 2d2dc9549..51faa986a 100644 --- a/renderer/CMakeLists.txt +++ b/renderer/CMakeLists.txt @@ -36,6 +36,7 @@ target_link_libraries(renderer PRIVATE glm::glm SDL2::SDL2 bitmap + ddebug ddio logger mem diff --git a/renderer/HardwareDraw.cpp b/renderer/HardwareDraw.cpp index 4daa329d3..71a23f1a6 100644 --- a/renderer/HardwareDraw.cpp +++ b/renderer/HardwareDraw.cpp @@ -18,6 +18,7 @@ #include "3d.h" #include "HardwareInternal.h" +#include "pserror.h" #include "renderer.h" #define round(v) ((int)(((v) + 0.5f))) diff --git a/renderer/HardwareInstance.cpp b/renderer/HardwareInstance.cpp index 487a184f1..c6cb12c48 100644 --- a/renderer/HardwareInstance.cpp +++ b/renderer/HardwareInstance.cpp @@ -16,9 +16,11 @@ * along with this program. If not, see . */ +#include + #include "3d.h" #include "HardwareInternal.h" -#include +#include "pserror.h" struct InstanceContext { matrix m_viewMatrix; // matrix diff --git a/renderer/HardwareInternal.h b/renderer/HardwareInternal.h index 791f48855..78c1ebb07 100644 --- a/renderer/HardwareInternal.h +++ b/renderer/HardwareInternal.h @@ -19,8 +19,6 @@ #ifndef __HARDWARE_INTERNAL_H__ #define __HARDWARE_INTERNAL_H__ -#include "pserror.h" - #define MAX_POINTS_IN_POLY 100 // These structs are for drawing with vertex arrays diff --git a/renderer/HardwareSetup.cpp b/renderer/HardwareSetup.cpp index da1bcf64d..8bee1d512 100644 --- a/renderer/HardwareSetup.cpp +++ b/renderer/HardwareSetup.cpp @@ -16,10 +16,9 @@ * along with this program. If not, see . */ -#include -#include +#include + #include "3d.h" -#include "pserror.h" #include "HardwareInternal.h" #include "renderer.h" diff --git a/renderer/HardwareTransforms.cpp b/renderer/HardwareTransforms.cpp index ed030154b..f013cb561 100644 --- a/renderer/HardwareTransforms.cpp +++ b/renderer/HardwareTransforms.cpp @@ -16,11 +16,11 @@ * along with this program. If not, see . */ +#include + #include "3d.h" -#include "pserror.h" #include "HardwareInternal.h" #include "renderer.h" -#include // Whether or not to use T&L transforms or the pass-thru ones static int sUseTransformPassthru = -1; diff --git a/renderer/dyna_gl.h b/renderer/dyna_gl.h index 8dc74fb9f..3c435f06d 100644 --- a/renderer/dyna_gl.h +++ b/renderer/dyna_gl.h @@ -30,7 +30,6 @@ #include "descent.h" #include "log.h" #include "module.h" -#include "pserror.h" #if defined(WIN32) #define GLFUNCCALL __stdcall diff --git a/sndlib/CMakeLists.txt b/sndlib/CMakeLists.txt index 779a43183..4d79d5e5f 100644 --- a/sndlib/CMakeLists.txt +++ b/sndlib/CMakeLists.txt @@ -20,10 +20,10 @@ set(CPPS add_library(sndlib STATIC ${HEADERS} ${CPPS}) target_link_libraries(sndlib PRIVATE cfile + ddebug ddio logger mem - misc stream_audio physics SDL2::SDL2 diff --git a/sndlib/ddsoundload.cpp b/sndlib/ddsoundload.cpp index 20ab48662..800ae19ba 100644 --- a/sndlib/ddsoundload.cpp +++ b/sndlib/ddsoundload.cpp @@ -92,7 +92,6 @@ #include "ssl_lib.h" #include "cfile.h" #include "mem.h" -#include "pserror.h" #include "byteswap.h" #include "gamesequence.h" #include "log.h" diff --git a/stream_audio/CMakeLists.txt b/stream_audio/CMakeLists.txt index c1793be59..83f8e3837 100644 --- a/stream_audio/CMakeLists.txt +++ b/stream_audio/CMakeLists.txt @@ -7,10 +7,10 @@ set(CPPS add_library(stream_audio STATIC ${HEADERS} ${CPPS}) target_link_libraries(stream_audio PRIVATE + ddebug ddio logger mem - misc sndlib ) target_link_libraries(stream_audio PUBLIC diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index a11de00b5..5dcbbf7ae 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -3,7 +3,8 @@ set(HEADERS ui.h uidraw.h uires.h - uisys.h) + uisys.h +) set(CPPS UIButton.cpp UICombo.cpp @@ -24,11 +25,11 @@ set(CPPS add_library(ui STATIC ${HEADERS} ${CPPS}) target_link_libraries(ui PRIVATE + ddebug ddio grtext logger mem - misc ) target_include_directories(ui PUBLIC $