diff --git a/Descent3/AIGoal.cpp b/Descent3/AIGoal.cpp index 103525ee..22858d65 100644 --- a/Descent3/AIGoal.cpp +++ b/Descent3/AIGoal.cpp @@ -475,6 +475,7 @@ #include "objinfo.h" #include "AIMain.h" #include "room.h" +#include "pserror.h" #include "psrand.h" #include "BOA.h" #include "findintersection.h" diff --git a/Descent3/ConfigItem.cpp b/Descent3/ConfigItem.cpp index 19fc5c40..cd7a481a 100644 --- a/Descent3/ConfigItem.cpp +++ b/Descent3/ConfigItem.cpp @@ -92,10 +92,10 @@ #include "ConfigItem.h" #include "newui.h" -#include "descent.h" #include "log.h" #include "gamefont.h" #include "mem.h" +#include "pserror.h" #include "stringtable.h" #define UI_CHECKBOX_OFF_CHAR 28 diff --git a/Descent3/CtlCfgElem.cpp b/Descent3/CtlCfgElem.cpp index 1a69f607..3d988572 100644 --- a/Descent3/CtlCfgElem.cpp +++ b/Descent3/CtlCfgElem.cpp @@ -113,18 +113,18 @@ * $NoKeywords: $ */ +#include + #include "CtlCfgElem.h" #include "descent.h" #include "Macros.h" #include "ddio.h" -#include "application.h" #include "renderer.h" #include "stringtable.h" #include "gamefont.h" #include "localization.h" - -#include +#include "pserror.h" #include "joystick.h" // all controller binding texts diff --git a/Descent3/GameLoop.cpp b/Descent3/GameLoop.cpp index c7d57ce1..cb6deb69 100644 --- a/Descent3/GameLoop.cpp +++ b/Descent3/GameLoop.cpp @@ -861,6 +861,7 @@ #include "gamefont.h" #include "renderobject.h" #include "buddymenu.h" +#include "pserror.h" #ifdef EDITOR #include "editor\d3edit.h" diff --git a/Descent3/NewPyroGauges.cpp b/Descent3/NewPyroGauges.cpp index 5a8d4e51..8ddc2cb6 100644 --- a/Descent3/NewPyroGauges.cpp +++ b/Descent3/NewPyroGauges.cpp @@ -61,15 +61,8 @@ */ #include "NewPyroGauges.h" -#include "gauges.h" -#include "gamefont.h" -#include "game.h" -#include "hud.h" -#include "grdefs.h" -#include "bitmap.h" -#include "player.h" -#include "polymodel.h" #include "3d.h" +#include "pserror.h" #include "renderer.h" #include "gametexture.h" diff --git a/Descent3/PilotPicsAPI.cpp b/Descent3/PilotPicsAPI.cpp index 7d8de7cc..cd53c3c3 100644 --- a/Descent3/PilotPicsAPI.cpp +++ b/Descent3/PilotPicsAPI.cpp @@ -63,13 +63,13 @@ #include #include "bitmap.h" -#include "player.h" #include "pilot.h" #include "cfile.h" #include "log.h" #include "ddio.h" #include "manage.h" #include "PilotPicsAPI.h" +#include "pserror.h" #include "mem.h" #define PILOTPIC_DATABASE_HOG "PPics.Hog" diff --git a/Descent3/TelCom.cpp b/Descent3/TelCom.cpp index 554f2f63..3eb970cd 100644 --- a/Descent3/TelCom.cpp +++ b/Descent3/TelCom.cpp @@ -519,6 +519,7 @@ #include "hlsoundlib.h" #include "soundload.h" #include "textaux.h" +#include "pserror.h" #include "psrand.h" #include "controls.h" #include "d3music.h" diff --git a/Descent3/TelComEffects.cpp b/Descent3/TelComEffects.cpp index efccb0a7..4483de2b 100644 --- a/Descent3/TelComEffects.cpp +++ b/Descent3/TelComEffects.cpp @@ -143,6 +143,7 @@ #include "vecmat.h" #include "textaux.h" #include "hlsoundlib.h" +#include "pserror.h" #include "soundload.h" tceffect TCEffects[MAX_TCEFFECTS]; diff --git a/Descent3/TelcomEffectsRender.cpp b/Descent3/TelcomEffectsRender.cpp index 9c2a269a..b11654a6 100644 --- a/Descent3/TelcomEffectsRender.cpp +++ b/Descent3/TelcomEffectsRender.cpp @@ -56,6 +56,7 @@ #include "hlsoundlib.h" #include "log.h" #include "mem.h" +#include "pserror.h" #include "textaux.h" int glitch_dx = 0, glitch_dy = 0; diff --git a/Descent3/WeaponFire.cpp b/Descent3/WeaponFire.cpp index d544d8d5..936867a4 100644 --- a/Descent3/WeaponFire.cpp +++ b/Descent3/WeaponFire.cpp @@ -936,6 +936,7 @@ #include "config.h" #include "ObjScript.h" #include "doorway.h" +#include "pserror.h" #include "psrand.h" #include "BOA.h" diff --git a/Descent3/aiterrain.cpp b/Descent3/aiterrain.cpp index f09870ea..e31ed340 100644 --- a/Descent3/aiterrain.cpp +++ b/Descent3/aiterrain.cpp @@ -48,12 +48,13 @@ * $NoKeywords: $ */ +#include "cstdint" +#include + #include "vecmat.h" #include "terrain.h" -#include "pstypes.h" -#include "findintersection.h" +#include "pserror.h" #include "aiterrain.h" -#include #define AI_MAX_SEGS_CHECKED 200 diff --git a/Descent3/ambient.cpp b/Descent3/ambient.cpp index ade9f295..fe8dbcc0 100644 --- a/Descent3/ambient.cpp +++ b/Descent3/ambient.cpp @@ -82,6 +82,7 @@ #include "room.h" #include "game.h" +#include "pserror.h" #include "psrand.h" #define MAX_AMBIENT_SOUND_PATTERNS 100 diff --git a/Descent3/attach.cpp b/Descent3/attach.cpp index eb7ea8f9..0cc9e6a4 100644 --- a/Descent3/attach.cpp +++ b/Descent3/attach.cpp @@ -24,6 +24,7 @@ #include "demofile.h" #include "polymodel.h" #include "objinfo.h" +#include "pserror.h" /* // Determines the necessary orientation and position of the moving object f_use_uvec = true; diff --git a/Descent3/bnode.cpp b/Descent3/bnode.cpp index f3e577ed..1e9ad7d8 100644 --- a/Descent3/bnode.cpp +++ b/Descent3/bnode.cpp @@ -104,9 +104,9 @@ #include "mem.h" #include "vecmat.h" #include "terrain.h" -#include "room.h" #include "findintersection.h" #include "BOA.h" +#include "pserror.h" #include "psrand.h" bn_list BNode_terrain_list[8]; diff --git a/Descent3/bsp.cpp b/Descent3/bsp.cpp index 86fa9619..8cf81c3a 100644 --- a/Descent3/bsp.cpp +++ b/Descent3/bsp.cpp @@ -52,6 +52,7 @@ #include "mem.h" #include "polymodel.h" #include "object.h" +#include "pserror.h" #include "psrand.h" #define BSP_TREE_VERSION 10003 diff --git a/Descent3/cockpit.cpp b/Descent3/cockpit.cpp index 65c2f416..617e917a 100644 --- a/Descent3/cockpit.cpp +++ b/Descent3/cockpit.cpp @@ -200,6 +200,7 @@ #include "log.h" #include "ship.h" #include "player.h" +#include "pserror.h" #include "room.h" #include "hlsoundlib.h" #include "sounds.h" diff --git a/Descent3/config.cpp b/Descent3/config.cpp index 8d69d709..4a053eec 100644 --- a/Descent3/config.cpp +++ b/Descent3/config.cpp @@ -291,6 +291,7 @@ #include "terrain.h" #include "physics.h" #include "pilot.h" +#include "pserror.h" #include "hud.h" #include "bitmap.h" #include "game.h" diff --git a/Descent3/credits.cpp b/Descent3/credits.cpp index 94a6efe2..584010de 100644 --- a/Descent3/credits.cpp +++ b/Descent3/credits.cpp @@ -92,6 +92,7 @@ #include "mem.h" #include "d3music.h" #include "hlsoundlib.h" +#include "pserror.h" #include "psrand.h" /* diff --git a/Descent3/ctlconfig.cpp b/Descent3/ctlconfig.cpp index 0338d0f6..2fdddfb4 100644 --- a/Descent3/ctlconfig.cpp +++ b/Descent3/ctlconfig.cpp @@ -292,6 +292,7 @@ #include "D3ForceFeedback.h" #include "hlsoundlib.h" #include "ddio.h" +#include "pserror.h" ////////////////////////////////////////////////////////////////////////////// #define IDV_KCONFIG 10 diff --git a/Descent3/damage.cpp b/Descent3/damage.cpp index 76af8c9b..7589de34 100644 --- a/Descent3/damage.cpp +++ b/Descent3/damage.cpp @@ -586,6 +586,7 @@ #include "DeathInfo.h" #include "AIGoal.h" #include "viseffect.h" +#include "pserror.h" #include "psrand.h" diff --git a/Descent3/demofile.cpp b/Descent3/demofile.cpp index 2942c208..2021f110 100644 --- a/Descent3/demofile.cpp +++ b/Descent3/demofile.cpp @@ -294,6 +294,7 @@ #include "osiris_dll.h" #include "args.h" #include "gamecinematics.h" +#include "pserror.h" #include "psrand.h" #include "cockpit.h" // We borrow a lot of code from the savegame system diff --git a/Descent3/game.h b/Descent3/game.h index 3dce2bec..659bed41 100644 --- a/Descent3/game.h +++ b/Descent3/game.h @@ -183,7 +183,6 @@ #ifndef _GAME_H #define _GAME_H -#include "pserror.h" #include "renderer.h" #include "object.h" diff --git a/Descent3/gameevent.cpp b/Descent3/gameevent.cpp index db5c1491..143d9cd6 100644 --- a/Descent3/gameevent.cpp +++ b/Descent3/gameevent.cpp @@ -73,6 +73,7 @@ #include "spew.h" #include "mem.h" #include "player.h" +#include "pserror.h" int Num_events = 0; game_event GameEvent[MAX_EVENTS]; diff --git a/Descent3/gamesave.cpp b/Descent3/gamesave.cpp index 7209d292..4f5c4364 100644 --- a/Descent3/gamesave.cpp +++ b/Descent3/gamesave.cpp @@ -296,6 +296,7 @@ #include "matcen.h" #include "marker.h" #include "d3music.h" +#include "pserror.h" #include "weather.h" // function prototypes. diff --git a/Descent3/gauges.cpp b/Descent3/gauges.cpp index 7abd3229..35f6dc3e 100644 --- a/Descent3/gauges.cpp +++ b/Descent3/gauges.cpp @@ -200,6 +200,7 @@ #include "ship.h" #include "3d.h" #include "weapon.h" +#include "pserror.h" #include "stringtable.h" ////////////////////////////////////////////////////////////////////////////// diff --git a/Descent3/hotspotmap.cpp b/Descent3/hotspotmap.cpp index edb1b408..8f605a40 100644 --- a/Descent3/hotspotmap.cpp +++ b/Descent3/hotspotmap.cpp @@ -110,6 +110,7 @@ #include "mem.h" #include "bitmap.h" #include "manage.h" +#include "pserror.h" static void makecorner(int corner_bmp, int back_bmp, const char *tmap, int l, int t, int r, int b); static int CreateHotSpotMap(const char *map, int width, int height, hotspotmap_t *hsmap); diff --git a/Descent3/hud.cpp b/Descent3/hud.cpp index fc47e9ba..13c78090 100644 --- a/Descent3/hud.cpp +++ b/Descent3/hud.cpp @@ -431,6 +431,7 @@ #include "d3music.h" #include "demofile.h" #include "stringtable.h" +#include "pserror.h" #include "pstring.h" #include "config.h" #include "gamecinematics.h" diff --git a/Descent3/hudmessage.cpp b/Descent3/hudmessage.cpp index fd2648ea..d5f83b6b 100644 --- a/Descent3/hudmessage.cpp +++ b/Descent3/hudmessage.cpp @@ -350,6 +350,7 @@ #include "sounds.h" #include "hlsoundlib.h" #include "args.h" +#include "pserror.h" #define HUD_MESSAGE_NORMAL 0 #define HUD_MESSAGE_BLINKING 1 diff --git a/Descent3/levelgoal.cpp b/Descent3/levelgoal.cpp index 80e6f3f4..4b157b1c 100644 --- a/Descent3/levelgoal.cpp +++ b/Descent3/levelgoal.cpp @@ -175,6 +175,7 @@ #include "osiris_share.h" #include "multisafe.h" #include "multi_world_state.h" +#include "pserror.h" #define GOAL_MESSAGE_TIME 10.0 #define GOAL_MESSAGE_COLOR GR_RGB(0, 242, 148) diff --git a/Descent3/lighting.cpp b/Descent3/lighting.cpp index 1fb9614d..1a128b77 100644 --- a/Descent3/lighting.cpp +++ b/Descent3/lighting.cpp @@ -43,6 +43,7 @@ #include "config.h" #include "dedicated_server.h" #include "objinfo.h" +#include "pserror.h" #define NUM_DYNAMIC_CLASSES 7 #define MAX_DYNAMIC_FACES 2000 diff --git a/Descent3/loadstate.cpp b/Descent3/loadstate.cpp index 5fe61a39..c64e4014 100644 --- a/Descent3/loadstate.cpp +++ b/Descent3/loadstate.cpp @@ -217,6 +217,7 @@ #include "weather.h" #include "cockpit.h" #include "hud.h" +#include "pserror.h" extern void PageInAllData(); diff --git a/Descent3/localization.cpp b/Descent3/localization.cpp index 1e89a2b5..1ef04654 100644 --- a/Descent3/localization.cpp +++ b/Descent3/localization.cpp @@ -96,6 +96,7 @@ #include "localization.h" #include "log.h" #include "mem.h" +#include "pserror.h" struct tLangTag { const char *tag; diff --git a/Descent3/marker.cpp b/Descent3/marker.cpp index 40fac4aa..0d7294a6 100644 --- a/Descent3/marker.cpp +++ b/Descent3/marker.cpp @@ -23,6 +23,7 @@ #include "player.h" #include "multi.h" #include "game.h" +#include "pserror.h" #ifdef _DEBUG #include "AIMain.h" #endif diff --git a/Descent3/matcen.cpp b/Descent3/matcen.cpp index b6742f21..24b6ae78 100644 --- a/Descent3/matcen.cpp +++ b/Descent3/matcen.cpp @@ -175,6 +175,7 @@ #include "ObjScript.h" #include "psrand.h" #include "demofile.h" +#include "pserror.h" // Beginning of the real file #define LEVEL_DATA_MATCEN_VERSION 1 diff --git a/Descent3/mission_download.cpp b/Descent3/mission_download.cpp index 5df68603..3b529393 100644 --- a/Descent3/mission_download.cpp +++ b/Descent3/mission_download.cpp @@ -135,6 +135,7 @@ #include "grtext.h" #include "Mission.h" #include "mission_download.h" +#include "pserror.h" #include "renderer.h" #include "unzip.h" diff --git a/Descent3/mmItem.cpp b/Descent3/mmItem.cpp index e5a692ef..2abb3655 100644 --- a/Descent3/mmItem.cpp +++ b/Descent3/mmItem.cpp @@ -109,6 +109,8 @@ * */ +#include + #include "mmItem.h" #include "game.h" #include "program.h" @@ -117,12 +119,9 @@ #include "hlsoundlib.h" #include "soundload.h" #include "d3music.h" - #include "ddio.h" -// #include #include "mem.h" - -#include +#include "pserror.h" // externed from newui.cpp extern int UI_frame_result; diff --git a/Descent3/multi_client.cpp b/Descent3/multi_client.cpp index 98f25387..37771bde 100644 --- a/Descent3/multi_client.cpp +++ b/Descent3/multi_client.cpp @@ -142,6 +142,7 @@ #include "player.h" #include "ddio.h" #include "pilot.h" +#include "pserror.h" #include "Mission.h" #include "stringtable.h" #include "ship.h" diff --git a/Descent3/multi_connect.cpp b/Descent3/multi_connect.cpp index a7af5b5a..388a3ac5 100644 --- a/Descent3/multi_connect.cpp +++ b/Descent3/multi_connect.cpp @@ -263,6 +263,7 @@ #include "Mission.h" #include "stringtable.h" #include "pilot.h" +#include "pserror.h" #include "ship.h" #include "args.h" #include "ui.h" diff --git a/Descent3/multi_server.cpp b/Descent3/multi_server.cpp index ed5ae8b2..ddbabf15 100644 --- a/Descent3/multi_server.cpp +++ b/Descent3/multi_server.cpp @@ -639,6 +639,7 @@ #include "LoadLevel.h" #include "Mission.h" #include "game2dll.h" +#include "pserror.h" #include "stringtable.h" // #define USE_DIRECTPLAY diff --git a/Descent3/multi_ui.cpp b/Descent3/multi_ui.cpp index facde1fb..cda686d6 100644 --- a/Descent3/multi_ui.cpp +++ b/Descent3/multi_ui.cpp @@ -331,6 +331,7 @@ #include "manage.h" #include "menu.h" #include "pilot.h" +#include "pserror.h" #include "ddio.h" #include "objinfo.h" #include "ship.h" diff --git a/Descent3/multisafe.cpp b/Descent3/multisafe.cpp index 5df2ca62..4f3a9e5e 100644 --- a/Descent3/multisafe.cpp +++ b/Descent3/multisafe.cpp @@ -657,6 +657,7 @@ #include "sounds.h" #include "ship.h" #include "player.h" +#include "pserror.h" #include "object_lighting.h" #include "soundload.h" #include "streamaudio.h" diff --git a/Descent3/newui.cpp b/Descent3/newui.cpp index 1edf1e19..d5c3a150 100644 --- a/Descent3/newui.cpp +++ b/Descent3/newui.cpp @@ -304,7 +304,6 @@ #include "log.h" #include "newui.h" #include "game.h" -#include "descent.h" #include "renderer.h" #include "3d.h" #include "gamefont.h" @@ -314,6 +313,7 @@ #include "newui_core.h" #include "hlsoundlib.h" #include "dedicated_server.h" +#include "pserror.h" #define MSGBOX_HEIGHT msgbox.H() #define BTN_WIDTH 96 diff --git a/Descent3/newui_filedlg.cpp b/Descent3/newui_filedlg.cpp index 0c831afa..15409fe6 100644 --- a/Descent3/newui_filedlg.cpp +++ b/Descent3/newui_filedlg.cpp @@ -109,6 +109,7 @@ #include "game.h" #include "log.h" #include "newui.h" +#include "pserror.h" #include "pstring.h" #include "renderer.h" #include "stringtable.h" diff --git a/Descent3/object.cpp b/Descent3/object.cpp index 74846ed7..8701fd2a 100644 --- a/Descent3/object.cpp +++ b/Descent3/object.cpp @@ -3327,6 +3327,24 @@ bool ObjGetAnimUpdate(uint16_t objnum, custom_anim *multi_anim_info) { return false; } +void SetObjectDeadFlag(object *obj, bool tell_clients_to_remove, bool play_sound_on_clients) { + int objnum = OBJNUM(obj); + ASSERT(objnum != -1); + ASSERT(objnum != 0); + ASSERT(obj->type != OBJ_NONE); + ASSERT(obj != Player_object); + + obj->flags |= OF_DEAD; + + if (tell_clients_to_remove) { + if (play_sound_on_clients) { + obj->flags |= OF_SEND_MULTI_REMOVE_ON_DEATHWS; + } else { + obj->flags |= OF_SEND_MULTI_REMOVE_ON_DEATH; + } + } +} + void SetObjectControlType(object *obj, int control_type) { ASSERT(obj); ASSERT(OBJNUM(obj) >= 0 && OBJNUM(obj) < MAX_OBJECTS); diff --git a/Descent3/object.h b/Descent3/object.h index 9c7f2706..eac08df1 100644 --- a/Descent3/object.h +++ b/Descent3/object.h @@ -632,7 +632,6 @@ #include "object_external_struct.h" #include "object_external.h" -#include "pserror.h" /* * CONSTANTS @@ -706,24 +705,7 @@ extern int16_t BigObjectList[MAX_BIG_OBJECTS]; // DAJ_MR utb int */ // Set the dead flag for an object -static inline void SetObjectDeadFlag(object *obj, bool tell_clients_to_remove = false, bool play_sound_on_clients = false); -static inline void SetObjectDeadFlag(object *obj, bool tell_clients_to_remove, bool play_sound_on_clients) { - int objnum = OBJNUM(obj); - ASSERT(objnum != -1); - ASSERT(objnum != 0); - ASSERT(obj->type != OBJ_NONE); - ASSERT(obj != Player_object); - - obj->flags |= OF_DEAD; - - if (tell_clients_to_remove) { - if (play_sound_on_clients) { - obj->flags |= OF_SEND_MULTI_REMOVE_ON_DEATHWS; - } else { - obj->flags |= OF_SEND_MULTI_REMOVE_ON_DEATH; - } - } -} +void SetObjectDeadFlag(object *obj, bool tell_clients_to_remove = false, bool play_sound_on_clients = false); void SetObjectControlType(object *obj, int control_type); diff --git a/Descent3/object_lighting.cpp b/Descent3/object_lighting.cpp index 5b2caec7..ada517e1 100644 --- a/Descent3/object_lighting.cpp +++ b/Descent3/object_lighting.cpp @@ -108,6 +108,7 @@ #include "hlsoundlib.h" #include "soundload.h" #include "hud.h" +#include "pserror.h" #include "stringtable.h" // How far the headlight casts light diff --git a/Descent3/pilot.cpp b/Descent3/pilot.cpp index 53d732f0..d94e94ca 100644 --- a/Descent3/pilot.cpp +++ b/Descent3/pilot.cpp @@ -597,6 +597,7 @@ #include "newui.h" #include "pilot.h" #include "polymodel.h" +#include "pserror.h" #include "pstring.h" #include "renderer.h" #include "render.h" diff --git a/Descent3/postrender.cpp b/Descent3/postrender.cpp index 96fafc8d..28454783 100644 --- a/Descent3/postrender.cpp +++ b/Descent3/postrender.cpp @@ -76,13 +76,13 @@ #include "..\neweditor\globals.h" #endif -#include #include "object.h" #include "viseffect.h" #include "render.h" #include "renderobject.h" #include "room.h" #include "postrender.h" +#include "pserror.h" #include "config.h" #include "terrain.h" #include "renderer.h" diff --git a/Descent3/render.cpp b/Descent3/render.cpp index 43071b6e..005abd6b 100644 --- a/Descent3/render.cpp +++ b/Descent3/render.cpp @@ -29,6 +29,7 @@ * $NoKeywords: $ */ +#include #include #include @@ -58,6 +59,7 @@ #include "TelComAutoMap.h" #include "postrender.h" #include "mem.h" +#include "pserror.h" #include "psrand.h" #include "player.h" #include "args.h" @@ -65,8 +67,6 @@ #include "editor\d3edit.h" #endif -#include - // #define KATMAI // Katmai enhanced rotate only in a release build, because not diff --git a/Descent3/renderobject.cpp b/Descent3/renderobject.cpp index abf52abc..08294309 100644 --- a/Descent3/renderobject.cpp +++ b/Descent3/renderobject.cpp @@ -608,6 +608,7 @@ #include "game2dll.h" #include "marker.h" #include "ship.h" +#include "pserror.h" #include "psrand.h" #ifdef EDITOR diff --git a/Descent3/robotfire.cpp b/Descent3/robotfire.cpp index f42101aa..03e1139c 100644 --- a/Descent3/robotfire.cpp +++ b/Descent3/robotfire.cpp @@ -36,6 +36,7 @@ #include "SmallViews.h" #include "physics.h" #include "AIMain.h" +#include "pserror.h" #include "psrand.h" // Fires a multiplayer and AI on/off weapon diff --git a/Descent3/room.cpp b/Descent3/room.cpp index 2c34864b..b7b0fd63 100644 --- a/Descent3/room.cpp +++ b/Descent3/room.cpp @@ -416,6 +416,7 @@ #include "multi_world_state.h" #include "damage_external.h" #include "descent.h" +#include "pserror.h" #ifdef EDITOR #include "editor\editor_lighting.h" #endif diff --git a/Descent3/screens.cpp b/Descent3/screens.cpp index 5e67b479..978bfd5c 100644 --- a/Descent3/screens.cpp +++ b/Descent3/screens.cpp @@ -203,6 +203,7 @@ #include "log.h" #include "sounds.h" #include "pilot.h" +#include "pserror.h" #include "joystick.h" #define LVLRES_FADEIN_TIME 0.50f diff --git a/Descent3/splinter.cpp b/Descent3/splinter.cpp index 1e72d3a7..b5029a2f 100644 --- a/Descent3/splinter.cpp +++ b/Descent3/splinter.cpp @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#include #include "fireball.h" #include "object.h" @@ -23,13 +24,9 @@ #include "polymodel.h" #include "renderer.h" #include "gametexture.h" - -#include "Macros.h" -#include - +#include "pserror.h" #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 67772c84..d982bc4b 100644 --- a/Descent3/terrain.cpp +++ b/Descent3/terrain.cpp @@ -108,6 +108,17 @@ int Terrain_checksum = -1; uint8_t Terrain_occlusion_map[256][32]; int Terrain_occlusion_checksum = -2; +#ifndef RELEASE +int TERRAIN_REGION(int x) { + ASSERT(x != -1 && "invalid/unset room number (-1)!"); + // Note: due to the 0x7FFFFFFF mask, terrSegIdx will be >= 0 + int terrSegIdx = 0x7FFFFFFF & x; + // catch other invalid cell/segment numbers than -1 as well + ASSERT((terrSegIdx < TERRAIN_WIDTH * TERRAIN_DEPTH) && "invalid cellnum!"); + return (Terrain_seg[terrSegIdx].flags & TFM_REGION_MASK) >> 5; +} +#endif + // returns the index of the highest float int GetHighestDelta(float *deltas, int count) { int high_index = -999; diff --git a/Descent3/terrain.h b/Descent3/terrain.h index 10a0b17f..e5b89fb7 100644 --- a/Descent3/terrain.h +++ b/Descent3/terrain.h @@ -214,14 +214,7 @@ extern int16_t Terrain_seg_render_objs[]; #ifdef RELEASE #define TERRAIN_REGION(x) ((Terrain_seg[0x7FFFFFFF & x].flags & TFM_REGION_MASK) >> 5) #else // debug(-ish) builds - check if x is valid -static inline int TERRAIN_REGION(int x) { - ASSERT(x != -1 && "invalid/unset room number (-1)!"); - // Note: due to the 0x7FFFFFFF mask, terrSegIdx will be >= 0 - int terrSegIdx = 0x7FFFFFFF & x; - // catch other invalid cell/segment numbers than -1 as well - ASSERT((terrSegIdx < TERRAIN_WIDTH * TERRAIN_DEPTH) && "invalid cellnum!"); - return (Terrain_seg[terrSegIdx].flags & TFM_REGION_MASK) >> 5; -} +int TERRAIN_REGION(int x); #endif extern terrain_sky Terrain_sky; diff --git a/Descent3/viseffect.cpp b/Descent3/viseffect.cpp index f3dddfcf..6152f97c 100644 --- a/Descent3/viseffect.cpp +++ b/Descent3/viseffect.cpp @@ -454,6 +454,7 @@ #include "physics.h" #include "player.h" #include "polymodel.h" +#include "pserror.h" #include "psrand.h" #include "room.h" #include "terrain.h" diff --git a/ddebug/CMakeLists.txt b/ddebug/CMakeLists.txt index c4dc53af..2ebe1779 100644 --- a/ddebug/CMakeLists.txt +++ b/ddebug/CMakeLists.txt @@ -26,9 +26,10 @@ target_include_directories(ddebug PUBLIC PRIVATE ${PROJECT_BINARY_DIR}/lib # For d3_version.h ) target_link_libraries(ddebug PRIVATE - logger $<$: mem misc > + PUBLIC + logger ) diff --git a/netgames/includes/DMFC.h b/netgames/includes/DMFC.h index dab75704..0d3256d5 100644 --- a/netgames/includes/DMFC.h +++ b/netgames/includes/DMFC.h @@ -400,22 +400,26 @@ #endif // OS check #else // Release build + #ifdef DEBUG_BREAK #undef DEBUG_BREAK -#define DEBUG_BREAK() #endif +#define DEBUG_BREAK() + #define DLLASSERT(x) #define DLLmprintf(...) + #ifdef Int3 #undef Int3 -#define Int3() #endif #define Int3() + #ifdef ASSERT #undef ASSERT +#endif #define ASSERT(x) -#endif -#endif + +#endif // #ifndef RELEASE #ifdef mprintf // undefine mprintf and redirect it to use DLLmprintf #undef mprintf diff --git a/networking/networking.cpp b/networking/networking.cpp index 4cf7fdd0..5c7af2f2 100644 --- a/networking/networking.cpp +++ b/networking/networking.cpp @@ -294,6 +294,7 @@ #include "directplay.h" #include "dplay.h" #include "dplobby.h" +#include "module.h" typedef int socklen_t; #endif diff --git a/physics/physics.cpp b/physics/physics.cpp index 54a17e70..31badcd1 100644 --- a/physics/physics.cpp +++ b/physics/physics.cpp @@ -33,6 +33,7 @@ #include "physics.h" #include "player.h" #include "polymodel.h" +#include "pserror.h" #include "terrain.h" #include "vecmat.h" #include "viseffect.h" diff --git a/sndlib/sndrender.cpp b/sndlib/sndrender.cpp index 63e067fb..aa651c74 100644 --- a/sndlib/sndrender.cpp +++ b/sndlib/sndrender.cpp @@ -59,7 +59,7 @@ #include "application.h" #include "soundload.h" #include "gametexture.h" - +#include "pserror.h" static llsGeometry *Geometry = NULL; static int16_t Sound_room_list[SOUND_RENDER_ROOM_LIMIT + 1]; diff --git a/ui/UIButton.cpp b/ui/UIButton.cpp index 1c0dffe9..81c9d2a0 100644 --- a/ui/UIButton.cpp +++ b/ui/UIButton.cpp @@ -123,7 +123,9 @@ #include +#include "pserror.h" #include "UIlib.h" +#include "ui.h" #if defined(POSIX) int UIButton::m_ButtonFont; @@ -161,6 +163,11 @@ void UIButton::Create(UIWindow *parent, int id, UIItem *item, int x, int y, int UIGadget::Create(parent, id, x, y, w, h, flags); } +UIItem *UIButton::GetStateItem(int state) { + ASSERT(state < UI_BTS_NUM); + return m_Items[state]; +}; + // sets the background bitmap for a specified button state void UIButton::SetStateItem(int state, UIItem *item) { ASSERT(state < UI_BTS_NUM); @@ -172,6 +179,11 @@ void UIButton::SetStateItem(int state, UIItem *item) { m_Items[state] = item->CopyUIItem(); } +int UIButton::GetColor(int state) const { + ASSERT(state < UI_BTS_NUM); + return m_Colors[state]; +}; + // sets the background color for a specified button state void UIButton::SetColor(int state, ddgr_color col) { ASSERT(state < UI_BTS_NUM); diff --git a/ui/UIConsole.cpp b/ui/UIConsole.cpp index 764cc548..b3d4eb34 100644 --- a/ui/UIConsole.cpp +++ b/ui/UIConsole.cpp @@ -60,6 +60,7 @@ #include "UIlib.h" #include "grtext.h" #include "mem.h" +#include "pserror.h" #include "textaux.h" #define CONSOLE_LINE_FILLER 128 diff --git a/ui/UIEdit.cpp b/ui/UIEdit.cpp index 54f5b5b9..e0d91e7e 100644 --- a/ui/UIEdit.cpp +++ b/ui/UIEdit.cpp @@ -141,7 +141,7 @@ #include "log.h" #include "Macros.h" #include "mem.h" - +#include "pserror.h" static UIEdit *UI_current_editbox = NULL; diff --git a/ui/UIGadget.cpp b/ui/UIGadget.cpp index 4e58aa1d..2e8d42af 100644 --- a/ui/UIGadget.cpp +++ b/ui/UIGadget.cpp @@ -121,6 +121,7 @@ #include "UIlib.h" #include "Macros.h" +#include "pserror.h" int UIGadget::m_LastKey = 0; int UIGadget::m_LastKeyCount = 0; diff --git a/ui/UIGroup.cpp b/ui/UIGroup.cpp index a0ff17dd..ae4d6357 100644 --- a/ui/UIGroup.cpp +++ b/ui/UIGroup.cpp @@ -49,6 +49,7 @@ #include "UIlib.h" #include "mem.h" +#include "pserror.h" // ---------------------------------------------------------------------------- // UIGroup diff --git a/ui/UIHotspot.cpp b/ui/UIHotspot.cpp index a761ad55..453335f8 100644 --- a/ui/UIHotspot.cpp +++ b/ui/UIHotspot.cpp @@ -78,6 +78,7 @@ */ #include "UIlib.h" +#include "pserror.h" // ---------------------------------------------------------------------------- // UIHotspot diff --git a/ui/UIListBox.cpp b/ui/UIListBox.cpp index 2a100e8e..4da92787 100644 --- a/ui/UIListBox.cpp +++ b/ui/UIListBox.cpp @@ -162,6 +162,7 @@ #include "UIlib.h" #include "log.h" +#include "pserror.h" #define SCROLL_BUTTON_GAP 4 diff --git a/ui/UIObject.cpp b/ui/UIObject.cpp index ea9b4ad7..7111e2ff 100644 --- a/ui/UIObject.cpp +++ b/ui/UIObject.cpp @@ -40,6 +40,7 @@ #include "UIlib.h" #include "log.h" +#include "pserror.h" UIObject::UIObject() { m_X = m_Y = 0; diff --git a/ui/UISlider.cpp b/ui/UISlider.cpp index fb2e021c..5a0f6ca5 100644 --- a/ui/UISlider.cpp +++ b/ui/UISlider.cpp @@ -62,6 +62,7 @@ */ #include "UIlib.h" +#include "pserror.h" // Construction and destruction diff --git a/ui/UISystem.cpp b/ui/UISystem.cpp index 7a122b95..6fe0b005 100644 --- a/ui/UISystem.cpp +++ b/ui/UISystem.cpp @@ -170,6 +170,7 @@ #include "application.h" #include "bitmap.h" #include "log.h" +#include "pserror.h" #include "renderer.h" #include "Macros.h" diff --git a/ui/UIWindow.cpp b/ui/UIWindow.cpp index 4fafe432..f67611ae 100644 --- a/ui/UIWindow.cpp +++ b/ui/UIWindow.cpp @@ -152,6 +152,7 @@ #include "UIlib.h" #include "Macros.h" #include "log.h" +#include "pserror.h" // the window font for all windows int UIWindow::m_WindowFont = 0; diff --git a/ui/ui.h b/ui/ui.h index ffab4600..a6d89170 100644 --- a/ui/ui.h +++ b/ui/ui.h @@ -270,7 +270,6 @@ #include #include "grdefs.h" -#include "pserror.h" #include "uires.h" // Class identification @@ -554,15 +553,9 @@ private: protected: int m_State; // state of button - UIItem *GetStateItem(int state) { - ASSERT(state < UI_BTS_NUM); - return m_Items[state]; - }; + UIItem *GetStateItem(int state); - int GetColor(int state) const { - ASSERT(state < UI_BTS_NUM); - return m_Colors[state]; - }; + int GetColor(int state) const; public: static void SetDefaultFont(int font) { // sets the button font diff --git a/vecmat/vector.cpp b/vecmat/vector.cpp index 09164f10..6ae13b24 100644 --- a/vecmat/vector.cpp +++ b/vecmat/vector.cpp @@ -146,9 +146,8 @@ * $NoKeywords: $ */ -#include -#include -#include +#include +#include #include "vecmat.h" #include "mono.h" @@ -160,7 +159,7 @@ const matrix Identity_matrix = IDENTITY_MATRIX; void vm_AverageVector(vector *a, int num) { // Averages a vector. ie divides each component of vector a by num - assert(num != 0); + ASSERT(num != 0); a->x = a->x / (float)num; a->y = a->y / (float)num; a->z = a->z / (float)num; @@ -254,7 +253,7 @@ void vm_DivVector(vector *dest, vector *src, float n) { // Divides a vector into n portions // Dest can equal src - assert(n != 0); + ASSERT(n != 0); dest->x = src->x / n; dest->y = src->y / n; dest->z = src->z / n; @@ -325,7 +324,7 @@ void vm_TransposeMatrix(matrix *m) { void vm_MatrixMulVector(vector *result, vector *v, matrix *m) { // Rotates a vector thru a matrix - assert(result != v); + ASSERT(result != v); result->x = *v * m->rvec; result->y = *v * m->uvec; @@ -334,7 +333,7 @@ void vm_MatrixMulVector(vector *result, vector *v, matrix *m) { // Multiply a vector times the transpose of a matrix void vm_VectorMulTMatrix(vector *result, vector *v, matrix *m) { - assert(result != v); + ASSERT(result != v); result->x = vm_Dot3Vector(m->rvec.x, m->uvec.x, m->fvec.x, v); result->y = vm_Dot3Vector(m->rvec.y, m->uvec.y, m->fvec.y, v); @@ -344,7 +343,7 @@ void vm_VectorMulTMatrix(vector *result, vector *v, matrix *m) { void vm_MatrixMul(matrix *dest, matrix *src0, matrix *src1) { // For multiplying two 3x3 matrices together - assert((dest != src0) && (dest != src1)); + ASSERT((dest != src0) && (dest != src1)); dest->rvec.x = vm_Dot3Vector(src0->rvec.x, src0->uvec.x, src0->fvec.x, &src1->rvec); dest->uvec.x = vm_Dot3Vector(src0->rvec.x, src0->uvec.x, src0->fvec.x, &src1->uvec); @@ -363,7 +362,7 @@ void vm_MatrixMul(matrix *dest, matrix *src0, matrix *src1) { void vm_MatrixMulTMatrix(matrix *dest, matrix *src0, matrix *src1) { // For multiplying two 3x3 matrices together - assert((dest != src0) && (dest != src1)); + ASSERT((dest != src0) && (dest != src1)); dest->rvec.x = src0->rvec.x * src1->rvec.x + src0->uvec.x * src1->uvec.x + src0->fvec.x * src1->fvec.x; dest->uvec.x = src0->rvec.x * src1->rvec.y + src0->uvec.x * src1->uvec.y + src0->fvec.x * src1->fvec.y;