From 6996d54a23971b5c046870b25219e056d9f487b1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 11 Apr 2020 12:56:55 +0200 Subject: [PATCH] - moved more code to 'common'. This is all low level utilities with no dependencies on game logic. Having this in a separate directory makes sharing with Raze a lot easier. --- src/CMakeLists.txt | 7 +- src/{ => common}/utility/basics.h | 0 src/common/utility/engineerrors.cpp | 115 ++++++++++++++ .../utility/engineerrors.h} | 27 ++-- src/{ => common}/utility/i_module.cpp | 0 src/{ => common}/utility/i_module.h | 0 src/{ => common}/utility/m_alloc.cpp | 0 src/{ => common}/utility/m_alloc.h | 0 src/{ => common}/utility/m_fixed.h | 3 +- src/{ => common}/utility/m_swap.h | 0 src/{ => common}/utility/palentry.h | 0 src/{ => common}/utility/parallel_for.h | 0 src/{ => common}/utility/templates.h | 0 src/{ => common}/utility/tflags.h | 0 src/{ => common}/utility/utf8.cpp | 0 src/{ => common}/utility/utf8.h | 0 src/{ => common}/utility/vectors.h | 2 + src/console/c_cmds.cpp | 2 +- src/console/c_console.cpp | 2 +- src/d_iwad.cpp | 2 +- src/d_main.cpp | 63 +------- src/dobjgc.h | 1 + src/doomtype.h | 8 - src/g_level.cpp | 2 +- src/gamedata/d_dehacked.cpp | 2 +- src/gamedata/fonts/hexfont.cpp | 2 +- src/gamedata/fonts/singlelumpfont.cpp | 2 +- src/gamedata/fonts/singlepicfont.cpp | 2 +- src/gamedata/g_doomedmap.cpp | 2 +- src/gamedata/resourcefiles/ancientzip.h | 2 +- src/gamedata/resourcefiles/file_wad.cpp | 2 +- src/gamedata/statistics.cpp | 2 +- src/gamedata/textures/animations.cpp | 2 +- src/gamedata/textures/formats/fontchars.cpp | 2 +- .../textures/multipatchtexturebuilder.cpp | 2 +- src/i_net.cpp | 2 +- src/maploader/glnodes.cpp | 2 +- src/maploader/maploader.cpp | 2 +- src/maploader/usdf.cpp | 2 +- src/p_setup.cpp | 2 +- src/playsim/fragglescript/t_script.h | 8 +- src/playsim/p_acs.h | 2 +- src/playsim/p_actionfunctions.cpp | 2 +- src/posix/cocoa/i_main.mm | 2 +- src/posix/cocoa/i_system.mm | 6 - src/posix/cocoa/i_video.mm | 2 +- src/posix/cocoa/st_start.mm | 2 +- src/posix/i_steam.cpp | 2 +- src/posix/i_system.h | 2 - src/posix/osx/iwadpicker_cocoa.mm | 2 +- src/posix/sdl/hardware.cpp | 2 +- src/posix/sdl/i_input.cpp | 2 +- src/posix/sdl/i_main.cpp | 4 +- src/posix/sdl/i_system.cpp | 4 - src/posix/sdl/st_start.cpp | 2 +- src/posix/unix/i_specialpaths.cpp | 2 +- src/r_data/r_translate.cpp | 2 +- src/rendering/gl/shaders/gl_shader.cpp | 2 +- src/rendering/gl_load/gl_interface.cpp | 2 +- .../polyrenderer/backend/poly_buffers.cpp | 2 +- .../polyrenderer/backend/poly_framebuffer.cpp | 2 +- src/rendering/swrenderer/line/r_line.cpp | 2 +- .../swrenderer/plane/r_flatplane.cpp | 2 +- src/rendering/swrenderer/r_swscene.cpp | 2 +- .../swrenderer/scene/r_opaque_pass.cpp | 2 +- .../swrenderer/viewport/r_viewport.h | 2 +- src/rendering/vulkan/shaders/vk_shader.cpp | 2 +- src/rendering/vulkan/shaders/vk_shader.h | 2 +- src/rendering/vulkan/system/vk_buffers.cpp | 2 +- src/rendering/vulkan/system/vk_builders.cpp | 2 +- src/rendering/vulkan/system/vk_device.cpp | 2 +- src/rendering/vulkan/system/vk_device.h | 11 +- .../vulkan/system/vk_framebuffer.cpp | 2 +- src/rendering/vulkan/system/vk_objects.h | 2 +- src/scripting/vm/vm.h | 4 +- src/serializer.cpp | 2 +- src/utility/lists.h | 146 ------------------ src/utility/m_bbox.h | 9 ++ src/utility/sc_man.cpp | 2 +- src/win32/base_sysfb.cpp | 2 +- src/win32/gl_sysfb.cpp | 2 +- src/win32/hardware.cpp | 2 +- src/win32/i_input.cpp | 2 +- src/win32/i_main.cpp | 2 +- src/win32/i_system.cpp | 11 +- src/win32/i_system.h | 2 - src/win32/st_start.cpp | 2 +- src/win32/win32basevideo.cpp | 2 +- src/win32/win32glvideo.cpp | 2 +- src/win32/win32polyvideo.cpp | 2 +- 90 files changed, 224 insertions(+), 327 deletions(-) rename src/{ => common}/utility/basics.h (100%) create mode 100644 src/common/utility/engineerrors.cpp rename src/{utility/doomerrors.h => common/utility/engineerrors.h} (84%) rename src/{ => common}/utility/i_module.cpp (100%) rename src/{ => common}/utility/i_module.h (100%) rename src/{ => common}/utility/m_alloc.cpp (100%) rename src/{ => common}/utility/m_alloc.h (100%) rename src/{ => common}/utility/m_fixed.h (98%) rename src/{ => common}/utility/m_swap.h (100%) rename src/{ => common}/utility/palentry.h (100%) rename src/{ => common}/utility/parallel_for.h (100%) rename src/{ => common}/utility/templates.h (100%) rename src/{ => common}/utility/tflags.h (100%) rename src/{ => common}/utility/utf8.cpp (100%) rename src/{ => common}/utility/utf8.h (100%) rename src/{ => common}/utility/vectors.h (99%) delete mode 100644 src/utility/lists.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7be4ba78a..3bc7ff29c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1121,7 +1121,10 @@ set (PCH_SOURCES rendering/swrenderer/textures/warptexture.cpp rendering/swrenderer/textures/swcanvastexture.cpp events.cpp - utility/i_module.cpp + common/utility/engineerrors.cpp + common/utility/i_module.cpp + common/utility/m_alloc.cpp + common/utility/utf8.cpp utility/palette.cpp utility/palettecontainer.cpp utility/files.cpp @@ -1140,13 +1143,11 @@ set (PCH_SOURCES utility/cmdlib.cpp utility/configfile.cpp utility/i_time.cpp - utility/m_alloc.cpp utility/m_argv.cpp utility/m_bbox.cpp utility/name.cpp utility/s_playlist.cpp utility/v_collection.cpp - utility/utf8.cpp utility/zstrformat.cpp common/thirdparty/md5.cpp common/thirdparty/superfasthash.cpp diff --git a/src/utility/basics.h b/src/common/utility/basics.h similarity index 100% rename from src/utility/basics.h rename to src/common/utility/basics.h diff --git a/src/common/utility/engineerrors.cpp b/src/common/utility/engineerrors.cpp new file mode 100644 index 000000000..d15917761 --- /dev/null +++ b/src/common/utility/engineerrors.cpp @@ -0,0 +1,115 @@ +/* +** engineerrors.cpp +** Contains error classes that can be thrown around +** +**--------------------------------------------------------------------------- +** Copyright 1998-2016 Randy Heit +** Copyright 2005-2020 Christoph Oelckers +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1. Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in the +** documentation and/or other materials provided with the distribution. +** 3. The name of the author may not be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**--------------------------------------------------------------------------- +** +*/ + +bool gameisdead; + +#ifdef _WIN32 +#include +#include "zstring.h" +void I_DebugPrint(const char *cp) +{ + if (IsDebuggerPresent()) + { + auto wstr = WideString(cp); + OutputDebugStringW(wstr.c_str()); + } +} +#else +void I_DebugPrint(const char *cp) +{ +} +#endif + +#include "engineerrors.h" +#include "printf.h" + +//========================================================================== +// +// I_Error +// +// Throw an error that will send us to the console if we are far enough +// along in the startup process. +// +//========================================================================== + +void I_Error(const char *error, ...) +{ + va_list argptr; + char errortext[MAX_ERRORTEXT]; + + va_start(argptr, error); + myvsnprintf(errortext, MAX_ERRORTEXT, error, argptr); + va_end(argptr); + I_DebugPrint(errortext); + + throw CRecoverableError(errortext); +} + +//========================================================================== +// +// I_FatalError +// +// Throw an error that will end the game. +// +//========================================================================== +extern FILE *Logfile; + +void I_FatalError(const char *error, ...) +{ + static bool alreadyThrown = false; + gameisdead = true; + + if (!alreadyThrown) // ignore all but the first message -- killough + { + alreadyThrown = true; + char errortext[MAX_ERRORTEXT]; + va_list argptr; + va_start(argptr, error); + myvsnprintf(errortext, MAX_ERRORTEXT, error, argptr); + va_end(argptr); + I_DebugPrint(errortext); + + // Record error to log (if logging) + if (Logfile) + { + fprintf(Logfile, "\n**** DIED WITH FATAL ERROR:\n%s\n", errortext); + fflush(Logfile); + } + + throw CFatalError(errortext); + } + std::terminate(); // recursive I_FatalErrors must immediately terminate. +} + diff --git a/src/utility/doomerrors.h b/src/common/utility/engineerrors.h similarity index 84% rename from src/utility/doomerrors.h rename to src/common/utility/engineerrors.h index fc04ee001..36a755ade 100644 --- a/src/utility/doomerrors.h +++ b/src/common/utility/engineerrors.h @@ -39,18 +39,18 @@ #include #include #include -#include "doomtype.h" +#include "basics.h" #define MAX_ERRORTEXT 1024 -class CDoomError : public std::exception +class CEngineError : public std::exception { public: - CDoomError () + CEngineError () { m_Message[0] = '\0'; } - CDoomError (const char *message) + CEngineError (const char *message) { SetMessage (message); } @@ -83,25 +83,18 @@ protected: }; -class CRecoverableError : public CDoomError +class CRecoverableError : public CEngineError { public: - CRecoverableError() : CDoomError() {} - CRecoverableError(const char *message) : CDoomError(message) {} + CRecoverableError() : CEngineError() {} + CRecoverableError(const char *message) : CEngineError(message) {} }; -class CFatalError : public CDoomError +class CFatalError : public CEngineError { public: - CFatalError() : CDoomError() {} - CFatalError(const char *message) : CDoomError(message) {} -}; - -class CVulkanError : public CDoomError -{ -public: - CVulkanError() : CDoomError() {} - CVulkanError(const char *message) : CDoomError(message) {} + CFatalError() : CEngineError() {} + CFatalError(const char *message) : CEngineError(message) {} }; class CExitEvent : public std::exception diff --git a/src/utility/i_module.cpp b/src/common/utility/i_module.cpp similarity index 100% rename from src/utility/i_module.cpp rename to src/common/utility/i_module.cpp diff --git a/src/utility/i_module.h b/src/common/utility/i_module.h similarity index 100% rename from src/utility/i_module.h rename to src/common/utility/i_module.h diff --git a/src/utility/m_alloc.cpp b/src/common/utility/m_alloc.cpp similarity index 100% rename from src/utility/m_alloc.cpp rename to src/common/utility/m_alloc.cpp diff --git a/src/utility/m_alloc.h b/src/common/utility/m_alloc.h similarity index 100% rename from src/utility/m_alloc.h rename to src/common/utility/m_alloc.h diff --git a/src/utility/m_fixed.h b/src/common/utility/m_fixed.h similarity index 98% rename from src/utility/m_fixed.h rename to src/common/utility/m_fixed.h index 8f1eb72d0..e452242ce 100644 --- a/src/utility/m_fixed.h +++ b/src/common/utility/m_fixed.h @@ -2,7 +2,8 @@ #define __M_FIXED__ #include -#include "doomtype.h" +#include +#include "basics.h" // Modern compilers are smart enough to do these multiplications intelligently. diff --git a/src/utility/m_swap.h b/src/common/utility/m_swap.h similarity index 100% rename from src/utility/m_swap.h rename to src/common/utility/m_swap.h diff --git a/src/utility/palentry.h b/src/common/utility/palentry.h similarity index 100% rename from src/utility/palentry.h rename to src/common/utility/palentry.h diff --git a/src/utility/parallel_for.h b/src/common/utility/parallel_for.h similarity index 100% rename from src/utility/parallel_for.h rename to src/common/utility/parallel_for.h diff --git a/src/utility/templates.h b/src/common/utility/templates.h similarity index 100% rename from src/utility/templates.h rename to src/common/utility/templates.h diff --git a/src/utility/tflags.h b/src/common/utility/tflags.h similarity index 100% rename from src/utility/tflags.h rename to src/common/utility/tflags.h diff --git a/src/utility/utf8.cpp b/src/common/utility/utf8.cpp similarity index 100% rename from src/utility/utf8.cpp rename to src/common/utility/utf8.cpp diff --git a/src/utility/utf8.h b/src/common/utility/utf8.h similarity index 100% rename from src/utility/utf8.h rename to src/common/utility/utf8.h diff --git a/src/utility/vectors.h b/src/common/utility/vectors.h similarity index 99% rename from src/utility/vectors.h rename to src/common/utility/vectors.h index 084e4b530..b56b36e7b 100644 --- a/src/utility/vectors.h +++ b/src/common/utility/vectors.h @@ -314,6 +314,8 @@ struct TVector3 { } + TVector3(std::nullptr_t nul) = delete; + TVector3(const TVector3 &other) = default; TVector3 (const Vector2 &xy, vec_t z) diff --git a/src/console/c_cmds.cpp b/src/console/c_cmds.cpp index 601b50c7d..6cddc9d11 100644 --- a/src/console/c_cmds.cpp +++ b/src/console/c_cmds.cpp @@ -48,7 +48,7 @@ #include "c_dispatch.h" #include "i_system.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "doomstat.h" #include "gstrings.h" #include "s_sound.h" diff --git a/src/console/c_console.cpp b/src/console/c_console.cpp index 38cf1a82a..e31f8cf0e 100644 --- a/src/console/c_console.cpp +++ b/src/console/c_console.cpp @@ -920,7 +920,7 @@ int PrintString (int iprintlevel, const char *outline) return 0; // Don't waste time on calculating this if nothing at all was printed... } -bool gameisdead; +extern bool gameisdead; int VPrintf (int printlevel, const char *format, va_list parms) { diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index bb957b73e..9511b38a1 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -45,7 +45,7 @@ #include "gameconfigfile.h" #include "resourcefiles/resourcefile.h" #include "version.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "v_text.h" CVAR (Bool, queryiwad, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); diff --git a/src/d_main.cpp b/src/d_main.cpp index 49792c7f9..ee8bdf067 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -42,7 +42,7 @@ #include #include -#include "doomerrors.h" +#include "engineerrors.h" #include "i_time.h" #include "d_gui.h" @@ -166,7 +166,6 @@ EXTERN_CVAR (Bool, r_drawplayersprites) EXTERN_CVAR (Bool, show_messages) extern bool setmodeneeded; -extern bool gameisdead; extern bool demorecording; extern bool M_DemoNoPlay; // [RH] if true, then skip any demos in the loop extern bool insave; @@ -2345,64 +2344,6 @@ static void CheckCmdLine() } } -//========================================================================== -// -// I_Error -// -// Throw an error that will send us to the console if we are far enough -// along in the startup process. -// -//========================================================================== - -void I_Error(const char *error, ...) -{ - va_list argptr; - char errortext[MAX_ERRORTEXT]; - - va_start(argptr, error); - myvsnprintf(errortext, MAX_ERRORTEXT, error, argptr); - va_end(argptr); - I_DebugPrint(errortext); - - throw CRecoverableError(errortext); -} - -//========================================================================== -// -// I_FatalError -// -// Throw an error that will end the game. -// -//========================================================================== -extern FILE *Logfile; - -void I_FatalError(const char *error, ...) -{ - static bool alreadyThrown = false; - gameisdead = true; - - if (!alreadyThrown) // ignore all but the first message -- killough - { - alreadyThrown = true; - char errortext[MAX_ERRORTEXT]; - va_list argptr; - va_start(argptr, error); - myvsnprintf(errortext, MAX_ERRORTEXT, error, argptr); - va_end(argptr); - I_DebugPrint(errortext); - - // Record error to log (if logging) - if (Logfile) - { - fprintf(Logfile, "\n**** DIED WITH FATAL ERROR:\n%s\n", errortext); - fflush(Logfile); - } - - throw CFatalError(errortext); - } - std::terminate(); // recursive I_FatalErrors must immediately terminate. -} - static void NewFailure () { I_FatalError ("Failed to allocate memory from system heap"); @@ -2906,6 +2847,8 @@ static int D_DoomMain_Internal (void) while (1); } +void I_ShowFatalError(const char* message); + int D_DoomMain() { int ret = 0; diff --git a/src/dobjgc.h b/src/dobjgc.h index 79316da0d..8b8009eb7 100644 --- a/src/dobjgc.h +++ b/src/dobjgc.h @@ -1,5 +1,6 @@ #pragma once #include +#include "tarray.h" class DObject; class FSerializer; diff --git a/src/doomtype.h b/src/doomtype.h index 538d36b05..1b18244bf 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -58,14 +58,6 @@ typedef TMap FClassMap; extern bool batchrun; // Bounding box coordinate storage. -enum -{ - BOXTOP, - BOXBOTTOM, - BOXLEFT, - BOXRIGHT -}; // bbox coordinates - #include "palentry.h" enum class ETextureType : uint8_t diff --git a/src/g_level.cpp b/src/g_level.cpp index e0ddc56a2..b198826d5 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -40,7 +40,7 @@ #include "s_sound.h" #include "d_event.h" #include "m_random.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "doomstat.h" #include "wi_stuff.h" #include "w_wad.h" diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index b78edbafe..d59d743a7 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -57,7 +57,7 @@ #include "c_dispatch.h" #include "decallib.h" #include "a_sharedglobal.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "p_effect.h" #include "serializer.h" #include "thingdef.h" diff --git a/src/gamedata/fonts/hexfont.cpp b/src/gamedata/fonts/hexfont.cpp index e26f2d7d3..2b04fface 100644 --- a/src/gamedata/fonts/hexfont.cpp +++ b/src/gamedata/fonts/hexfont.cpp @@ -32,7 +32,7 @@ ** */ -#include "doomerrors.h" +#include "engineerrors.h" #include "textures.h" #include "image.h" #include "v_font.h" diff --git a/src/gamedata/fonts/singlelumpfont.cpp b/src/gamedata/fonts/singlelumpfont.cpp index 02e8564b1..ae064f129 100644 --- a/src/gamedata/fonts/singlelumpfont.cpp +++ b/src/gamedata/fonts/singlelumpfont.cpp @@ -33,7 +33,7 @@ ** */ -#include "doomerrors.h" +#include "engineerrors.h" #include "textures.h" #include "image.h" #include "v_font.h" diff --git a/src/gamedata/fonts/singlepicfont.cpp b/src/gamedata/fonts/singlepicfont.cpp index 12daba081..34362b728 100644 --- a/src/gamedata/fonts/singlepicfont.cpp +++ b/src/gamedata/fonts/singlepicfont.cpp @@ -33,7 +33,7 @@ ** */ -#include "doomerrors.h" +#include "engineerrors.h" #include "textures.h" #include "v_font.h" #include "w_wad.h" diff --git a/src/gamedata/g_doomedmap.cpp b/src/gamedata/g_doomedmap.cpp index c1e3abc58..9aadd956d 100644 --- a/src/gamedata/g_doomedmap.cpp +++ b/src/gamedata/g_doomedmap.cpp @@ -38,7 +38,7 @@ #include "p_lnspec.h" #include "c_dispatch.h" #include "v_text.h" -#include "doomerrors.h" +#include "engineerrors.h" const char *SpecialMapthingNames[] = { diff --git a/src/gamedata/resourcefiles/ancientzip.h b/src/gamedata/resourcefiles/ancientzip.h index cffd239ad..3b1497e02 100644 --- a/src/gamedata/resourcefiles/ancientzip.h +++ b/src/gamedata/resourcefiles/ancientzip.h @@ -1,5 +1,5 @@ #include "files.h" -#include "doomerrors.h" +#include "engineerrors.h" class FZipExploder { diff --git a/src/gamedata/resourcefiles/file_wad.cpp b/src/gamedata/resourcefiles/file_wad.cpp index 169cd975d..df60434d0 100644 --- a/src/gamedata/resourcefiles/file_wad.cpp +++ b/src/gamedata/resourcefiles/file_wad.cpp @@ -38,7 +38,7 @@ #include "v_text.h" #include "w_wad.h" #include "gi.h" -#include "doomerrors.h" +#include "engineerrors.h" //========================================================================== // diff --git a/src/gamedata/statistics.cpp b/src/gamedata/statistics.cpp index 7514bae90..b32f107d1 100644 --- a/src/gamedata/statistics.cpp +++ b/src/gamedata/statistics.cpp @@ -45,7 +45,7 @@ #include "d_net.h" #include "g_game.h" #include "m_png.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "w_wad.h" #include "p_local.h" #include "p_setup.h" diff --git a/src/gamedata/textures/animations.cpp b/src/gamedata/textures/animations.cpp index 51ed32782..d975c99ed 100644 --- a/src/gamedata/textures/animations.cpp +++ b/src/gamedata/textures/animations.cpp @@ -34,7 +34,7 @@ #include "doomtype.h" #include "cmdlib.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "r_sky.h" #include "m_random.h" #include "d_player.h" diff --git a/src/gamedata/textures/formats/fontchars.cpp b/src/gamedata/textures/formats/fontchars.cpp index 250e34ac5..41d6e4839 100644 --- a/src/gamedata/textures/formats/fontchars.cpp +++ b/src/gamedata/textures/formats/fontchars.cpp @@ -42,7 +42,7 @@ #include "image.h" #include "imagehelpers.h" #include "fontchars.h" -#include "doomerrors.h" +#include "engineerrors.h" //========================================================================== // diff --git a/src/gamedata/textures/multipatchtexturebuilder.cpp b/src/gamedata/textures/multipatchtexturebuilder.cpp index 1f9ea1db2..e19ccc83f 100644 --- a/src/gamedata/textures/multipatchtexturebuilder.cpp +++ b/src/gamedata/textures/multipatchtexturebuilder.cpp @@ -53,7 +53,7 @@ #include "imagehelpers.h" #include "image.h" #include "formats/multipatchtexture.h" -#include "doomerrors.h" +#include "engineerrors.h" // On the Alpha, accessing the shorts directly if they aren't aligned on a // 4-byte boundary causes unaligned access warnings. Why it does this at diff --git a/src/i_net.cpp b/src/i_net.cpp index d6284abed..f90cae6fc 100644 --- a/src/i_net.cpp +++ b/src/i_net.cpp @@ -61,7 +61,7 @@ #include "d_player.h" #include "st_start.h" #include "m_misc.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "cmdlib.h" #include "i_net.h" diff --git a/src/maploader/glnodes.cpp b/src/maploader/glnodes.cpp index 39a040b62..d72c3f220 100644 --- a/src/maploader/glnodes.cpp +++ b/src/maploader/glnodes.cpp @@ -51,7 +51,7 @@ #include "p_local.h" #include "nodebuild.h" #include "doomstat.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "p_setup.h" #include "version.h" #include "md5.h" diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index cad9d0939..4cfdcaac3 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -68,7 +68,7 @@ #include "v_text.h" #include "p_setup.h" #include "gi.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "types.h" #include "w_wad.h" #include "p_conversation.h" diff --git a/src/maploader/usdf.cpp b/src/maploader/usdf.cpp index 6d398ce33..6acd483fa 100644 --- a/src/maploader/usdf.cpp +++ b/src/maploader/usdf.cpp @@ -36,7 +36,7 @@ #include "p_lnspec.h" #include "p_conversation.h" #include "udmf.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "actor.h" #include "a_pickups.h" #include "w_wad.h" diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 4e7f2da1d..53a2e4bb7 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -44,7 +44,7 @@ #include "p_acs.h" #include "announcer.h" #include "wi_stuff.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "gi.h" #include "p_conversation.h" #include "a_keys.h" diff --git a/src/playsim/fragglescript/t_script.h b/src/playsim/fragglescript/t_script.h index e3d7e9a08..fbe88db9a 100644 --- a/src/playsim/fragglescript/t_script.h +++ b/src/playsim/fragglescript/t_script.h @@ -28,7 +28,7 @@ #include "p_lnspec.h" #include "m_fixed.h" #include "actor.h" -#include "doomerrors.h" +#include "engineerrors.h" #ifdef _MSC_VER // This pragma saves 8kb of wasted code. @@ -38,11 +38,11 @@ class DFraggleThinker; -class CFraggleScriptError : public CDoomError +class CFraggleScriptError : public CEngineError { public: - CFraggleScriptError() : CDoomError() {} - CFraggleScriptError(const char *message) : CDoomError(message) {} + CFraggleScriptError() : CEngineError() {} + CFraggleScriptError(const char *message) : CEngineError(message) {} }; diff --git a/src/playsim/p_acs.h b/src/playsim/p_acs.h index 7c31068a0..c2013a0f1 100644 --- a/src/playsim/p_acs.h +++ b/src/playsim/p_acs.h @@ -37,7 +37,7 @@ #include "doomtype.h" #include "dthinker.h" -#include "doomerrors.h" +#include "engineerrors.h" #define LOCAL_SIZE 20 #define NUM_MAPVARS 128 diff --git a/src/playsim/p_actionfunctions.cpp b/src/playsim/p_actionfunctions.cpp index b8b3ab7da..aba724cd6 100644 --- a/src/playsim/p_actionfunctions.cpp +++ b/src/playsim/p_actionfunctions.cpp @@ -50,7 +50,7 @@ #include "decallib.h" #include "p_local.h" #include "c_console.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "a_sharedglobal.h" #include "v_font.h" #include "doomstat.h" diff --git a/src/posix/cocoa/i_main.mm b/src/posix/cocoa/i_main.mm index c55a82500..5f77b5857 100644 --- a/src/posix/cocoa/i_main.mm +++ b/src/posix/cocoa/i_main.mm @@ -44,7 +44,7 @@ #include "m_argv.h" #include "st_console.h" #include "version.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "s_music.h" diff --git a/src/posix/cocoa/i_system.mm b/src/posix/cocoa/i_system.mm index d27ccd6dd..87ab877f7 100644 --- a/src/posix/cocoa/i_system.mm +++ b/src/posix/cocoa/i_system.mm @@ -66,12 +66,6 @@ void I_SetIWADInfo() } -void I_DebugPrint(const char *cp) -{ - NSLog(@"%s", cp); -} - - void I_PrintStr(const char* const message) { FConsoleWindow::GetInstance().AddText(message); diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 81b14e3cd..e7f7c5fb9 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -53,7 +53,7 @@ #include "st_console.h" #include "v_text.h" #include "version.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "gl/system/gl_framebuffer.h" #include "vulkan/system/vk_framebuffer.h" diff --git a/src/posix/cocoa/st_start.mm b/src/posix/cocoa/st_start.mm index a98ca9873..4e3de2ff1 100644 --- a/src/posix/cocoa/st_start.mm +++ b/src/posix/cocoa/st_start.mm @@ -39,7 +39,7 @@ #include "doomtype.h" #include "st_console.h" #include "st_start.h" -#include "doomerrors.h" +#include "engineerrors.h" FStartupScreen *StartScreen; diff --git a/src/posix/i_steam.cpp b/src/posix/i_steam.cpp index dccadb021..e0baa472f 100644 --- a/src/posix/i_steam.cpp +++ b/src/posix/i_steam.cpp @@ -38,7 +38,7 @@ #include "m_misc.h" #endif // __APPLE__ -#include "doomerrors.h" +#include "engineerrors.h" #include "d_main.h" #include "sc_man.h" #include "cmdlib.h" diff --git a/src/posix/i_system.h b/src/posix/i_system.h index e4c3d68db..8f88212ba 100644 --- a/src/posix/i_system.h +++ b/src/posix/i_system.h @@ -83,8 +83,6 @@ ticcmd_t *I_BaseTiccmd (void); void I_Tactile (int on, int off, int total); -void I_DebugPrint (const char *cp); - // Print a console string void I_PrintStr (const char *str); diff --git a/src/posix/osx/iwadpicker_cocoa.mm b/src/posix/osx/iwadpicker_cocoa.mm index fd9c60014..cb6018e48 100644 --- a/src/posix/osx/iwadpicker_cocoa.mm +++ b/src/posix/osx/iwadpicker_cocoa.mm @@ -40,7 +40,7 @@ #include "m_argv.h" #include "m_misc.h" #include "gameconfigfile.h" -#include "doomerrors.h" +#include "engineerrors.h" #include #include diff --git a/src/posix/sdl/hardware.cpp b/src/posix/sdl/hardware.cpp index 9493b7c48..7b3be1ec2 100644 --- a/src/posix/sdl/hardware.cpp +++ b/src/posix/sdl/hardware.cpp @@ -41,7 +41,7 @@ #include "v_text.h" #include "doomstat.h" #include "m_argv.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "swrenderer/r_swrenderer.h" IVideo *Video; diff --git a/src/posix/sdl/i_input.cpp b/src/posix/sdl/i_input.cpp index 77e6f1860..cf6520e94 100644 --- a/src/posix/sdl/i_input.cpp +++ b/src/posix/sdl/i_input.cpp @@ -47,7 +47,7 @@ #include "g_game.h" #include "g_levellocals.h" #include "utf8.h" -#include "doomerrors.h" +#include "engineerrors.h" static void I_CheckGUICapture (); diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index 9004dc0a3..f244b8b6e 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -41,7 +41,7 @@ #include #include -#include "doomerrors.h" +#include "engineerrors.h" #include "m_argv.h" #include "d_main.h" #include "c_console.h" @@ -53,7 +53,7 @@ #include "r_utility.h" #include "doomstat.h" #include "vm.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "i_system.h" #include "g_game.h" diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index b1f1c261c..14aea823b 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -102,10 +102,6 @@ void CalculateCPUSpeed() { } -void I_DebugPrint(const char *cp) -{ -} - void I_PrintStr(const char *cp) { // Strip out any color escape sequences before writing to debug output diff --git a/src/posix/sdl/st_start.cpp b/src/posix/sdl/st_start.cpp index 7e673d961..59470594e 100644 --- a/src/posix/sdl/st_start.cpp +++ b/src/posix/sdl/st_start.cpp @@ -42,7 +42,7 @@ #include "doomdef.h" #include "i_system.h" #include "c_cvars.h" -#include "doomerrors.h" +#include "engineerrors.h" // MACROS ------------------------------------------------------------------ diff --git a/src/posix/unix/i_specialpaths.cpp b/src/posix/unix/i_specialpaths.cpp index b6cba526a..7effd9128 100644 --- a/src/posix/unix/i_specialpaths.cpp +++ b/src/posix/unix/i_specialpaths.cpp @@ -37,7 +37,7 @@ #include #include "i_system.h" #include "cmdlib.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "version.h" // for GAMENAME diff --git a/src/r_data/r_translate.cpp b/src/r_data/r_translate.cpp index 08a20bde9..cf06d4dc5 100644 --- a/src/r_data/r_translate.cpp +++ b/src/r_data/r_translate.cpp @@ -40,7 +40,7 @@ #include "g_game.h" #include "d_netinf.h" #include "sc_man.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "w_wad.h" #include "serializer.h" #include "d_player.h" diff --git a/src/rendering/gl/shaders/gl_shader.cpp b/src/rendering/gl/shaders/gl_shader.cpp index 939faf557..b58daf6bb 100644 --- a/src/rendering/gl/shaders/gl_shader.cpp +++ b/src/rendering/gl/shaders/gl_shader.cpp @@ -30,7 +30,7 @@ #include "c_cvars.h" #include "v_video.h" #include "w_wad.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "cmdlib.h" #include "md5.h" #include "m_misc.h" diff --git a/src/rendering/gl_load/gl_interface.cpp b/src/rendering/gl_load/gl_interface.cpp index 69c1c258f..1beb8cac9 100644 --- a/src/rendering/gl_load/gl_interface.cpp +++ b/src/rendering/gl_load/gl_interface.cpp @@ -27,7 +27,7 @@ */ #include "gl_load/gl_system.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "tarray.h" #include "doomtype.h" #include "m_argv.h" diff --git a/src/rendering/polyrenderer/backend/poly_buffers.cpp b/src/rendering/polyrenderer/backend/poly_buffers.cpp index fdbac72b8..32be46eff 100644 --- a/src/rendering/polyrenderer/backend/poly_buffers.cpp +++ b/src/rendering/polyrenderer/backend/poly_buffers.cpp @@ -24,7 +24,7 @@ #include "poly_framebuffer.h" #include "poly_renderstate.h" #include "rendering/polyrenderer/drawers/poly_thread.h" -#include "doomerrors.h" +#include "engineerrors.h" PolyBuffer *PolyBuffer::First = nullptr; diff --git a/src/rendering/polyrenderer/backend/poly_framebuffer.cpp b/src/rendering/polyrenderer/backend/poly_framebuffer.cpp index f9e7adb08..d7ceb41ad 100644 --- a/src/rendering/polyrenderer/backend/poly_framebuffer.cpp +++ b/src/rendering/polyrenderer/backend/poly_framebuffer.cpp @@ -51,7 +51,7 @@ #include "poly_buffers.h" #include "poly_renderstate.h" #include "poly_hwtexture.h" -#include "doomerrors.h" +#include "engineerrors.h" void Draw2D(F2DDrawer *drawer, FRenderState &state); void DoWriteSavePic(FileWriter *file, ESSType ssformat, uint8_t *scr, int width, int height, sector_t *viewsector, bool upsidedown); diff --git a/src/rendering/swrenderer/line/r_line.cpp b/src/rendering/swrenderer/line/r_line.cpp index 56557c8eb..40427d3ff 100644 --- a/src/rendering/swrenderer/line/r_line.cpp +++ b/src/rendering/swrenderer/line/r_line.cpp @@ -23,7 +23,7 @@ #include #include #include "templates.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "doomdef.h" #include "doomstat.h" #include "doomdata.h" diff --git a/src/rendering/swrenderer/plane/r_flatplane.cpp b/src/rendering/swrenderer/plane/r_flatplane.cpp index 278fe3e14..f9bad39ba 100644 --- a/src/rendering/swrenderer/plane/r_flatplane.cpp +++ b/src/rendering/swrenderer/plane/r_flatplane.cpp @@ -23,7 +23,7 @@ #include #include #include "templates.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "w_wad.h" #include "doomdef.h" #include "doomstat.h" diff --git a/src/rendering/swrenderer/r_swscene.cpp b/src/rendering/swrenderer/r_swscene.cpp index 1c78c6146..21eec408a 100644 --- a/src/rendering/swrenderer/r_swscene.cpp +++ b/src/rendering/swrenderer/r_swscene.cpp @@ -34,7 +34,7 @@ #include "textures/bitmap.h" #include "swrenderer/scene/r_light.h" #include "image.h" -#include "doomerrors.h" +#include "engineerrors.h" // [RH] Base blending values (for e.g. underwater) int BaseBlendR, BaseBlendG, BaseBlendB; diff --git a/src/rendering/swrenderer/scene/r_opaque_pass.cpp b/src/rendering/swrenderer/scene/r_opaque_pass.cpp index a0ad219f7..ad838d807 100644 --- a/src/rendering/swrenderer/scene/r_opaque_pass.cpp +++ b/src/rendering/swrenderer/scene/r_opaque_pass.cpp @@ -34,7 +34,7 @@ #include "m_bbox.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "p_lnspec.h" #include "p_setup.h" diff --git a/src/rendering/swrenderer/viewport/r_viewport.h b/src/rendering/swrenderer/viewport/r_viewport.h index 3b5c89993..54d3090f6 100644 --- a/src/rendering/swrenderer/viewport/r_viewport.h +++ b/src/rendering/swrenderer/viewport/r_viewport.h @@ -7,7 +7,7 @@ #include "r_defs.h" #include "r_utility.h" #include "actorinlines.h" -#include "utility/matrix.h" +#include "matrix.h" #define MINZ double((2048*4) / double(1 << 20)) diff --git a/src/rendering/vulkan/shaders/vk_shader.cpp b/src/rendering/vulkan/shaders/vk_shader.cpp index 32e13c2df..148556161 100644 --- a/src/rendering/vulkan/shaders/vk_shader.cpp +++ b/src/rendering/vulkan/shaders/vk_shader.cpp @@ -24,7 +24,7 @@ #include "vulkan/system/vk_builders.h" #include "hwrenderer/utility/hw_shaderpatcher.h" #include "w_wad.h" -#include "doomerrors.h" +#include "engineerrors.h" #include VkShaderManager::VkShaderManager(VulkanDevice *device) : device(device) diff --git a/src/rendering/vulkan/shaders/vk_shader.h b/src/rendering/vulkan/shaders/vk_shader.h index c170e5a77..feb897ef0 100644 --- a/src/rendering/vulkan/shaders/vk_shader.h +++ b/src/rendering/vulkan/shaders/vk_shader.h @@ -3,7 +3,7 @@ #include -#include "utility/vectors.h" +#include "vectors.h" #include "matrix.h" #include "name.h" #include "hwrenderer/scene/hw_renderstate.h" diff --git a/src/rendering/vulkan/system/vk_buffers.cpp b/src/rendering/vulkan/system/vk_buffers.cpp index 36c606b5b..715b357ec 100644 --- a/src/rendering/vulkan/system/vk_buffers.cpp +++ b/src/rendering/vulkan/system/vk_buffers.cpp @@ -25,7 +25,7 @@ #include "vk_framebuffer.h" #include "vulkan/renderer/vk_renderstate.h" #include "vulkan/renderer/vk_renderpass.h" -#include "doomerrors.h" +#include "engineerrors.h" VKBuffer *VKBuffer::First = nullptr; diff --git a/src/rendering/vulkan/system/vk_builders.cpp b/src/rendering/vulkan/system/vk_builders.cpp index 08a9f41b6..981aba053 100644 --- a/src/rendering/vulkan/system/vk_builders.cpp +++ b/src/rendering/vulkan/system/vk_builders.cpp @@ -21,7 +21,7 @@ */ #include "vk_builders.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "r_data/renderstyle.h" #include #include diff --git a/src/rendering/vulkan/system/vk_device.cpp b/src/rendering/vulkan/system/vk_device.cpp index f2f018c6f..c3d775b8c 100644 --- a/src/rendering/vulkan/system/vk_device.cpp +++ b/src/rendering/vulkan/system/vk_device.cpp @@ -40,7 +40,7 @@ #include "c_dispatch.h" #include "i_system.h" #include "version.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "gamedata/fonts/v_text.h" bool I_GetVulkanPlatformExtensions(unsigned int *count, const char **names); diff --git a/src/rendering/vulkan/system/vk_device.h b/src/rendering/vulkan/system/vk_device.h index 43185bd50..435ffc187 100644 --- a/src/rendering/vulkan/system/vk_device.h +++ b/src/rendering/vulkan/system/vk_device.h @@ -2,11 +2,12 @@ #include "volk/volk.h" #include "vk_mem_alloc/vk_mem_alloc.h" -#include "utility/doomerrors.h" +#include "engineerrors.h" #include #include #include #include +#include "zstring.h" class VulkanSwapChain; class VulkanSemaphore; @@ -105,6 +106,14 @@ private: FString VkResultToString(VkResult result); +class CVulkanError : public CEngineError +{ +public: + CVulkanError() : CEngineError() {} + CVulkanError(const char* message) : CEngineError(message) {} +}; + + inline void VulkanError(const char *text) { throw CVulkanError(text); diff --git a/src/rendering/vulkan/system/vk_framebuffer.cpp b/src/rendering/vulkan/system/vk_framebuffer.cpp index eb5cf0960..009143c23 100644 --- a/src/rendering/vulkan/system/vk_framebuffer.cpp +++ b/src/rendering/vulkan/system/vk_framebuffer.cpp @@ -58,7 +58,7 @@ #include "vulkan/textures/vk_hwtexture.h" #include "vulkan/system/vk_builders.h" #include "vulkan/system/vk_swapchain.h" -#include "doomerrors.h" +#include "engineerrors.h" void Draw2D(F2DDrawer *drawer, FRenderState &state); void DoWriteSavePic(FileWriter *file, ESSType ssformat, uint8_t *scr, int width, int height, sector_t *viewsector, bool upsidedown); diff --git a/src/rendering/vulkan/system/vk_objects.h b/src/rendering/vulkan/system/vk_objects.h index 4c6a7ace4..dd3204517 100644 --- a/src/rendering/vulkan/system/vk_objects.h +++ b/src/rendering/vulkan/system/vk_objects.h @@ -1,7 +1,7 @@ #pragma once #include "vk_device.h" -#include "doomerrors.h" +#include "engineerrors.h" class VulkanCommandPool; class VulkanDescriptorPool; diff --git a/src/scripting/vm/vm.h b/src/scripting/vm/vm.h index db55dce43..8337bd456 100644 --- a/src/scripting/vm/vm.h +++ b/src/scripting/vm/vm.h @@ -40,7 +40,7 @@ #include "zstring.h" #include "vectors.h" #include "cmdlib.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "memarena.h" #include "scripting/backend/scopebarrier.h" @@ -98,7 +98,7 @@ enum EVMAbortException X_FORMAT_ERROR }; -class CVMAbortException : public CDoomError +class CVMAbortException : public CEngineError { public: static FString stacktrace; diff --git a/src/serializer.cpp b/src/serializer.cpp index ee6571dff..d73403492 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp @@ -55,7 +55,7 @@ #include "a_sharedglobal.h" #include "po_man.h" #include "v_font.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "v_text.h" #include "cmdlib.h" #include "g_levellocals.h" diff --git a/src/utility/lists.h b/src/utility/lists.h deleted file mode 100644 index a244aa22f..000000000 --- a/src/utility/lists.h +++ /dev/null @@ -1,146 +0,0 @@ -/* -** lists.h -** Essentially, Amiga Exec lists and nodes -** -**--------------------------------------------------------------------------- -** Copyright 1998-2006 Randy Heit -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** 3. The name of the author may not be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**--------------------------------------------------------------------------- -** -*/ - -#ifndef __LISTS_H__ -#define __LISTS_H__ - -struct Node -{ - Node *Succ, *Pred; - - void Insert (Node *putAfter) - { - Succ = putAfter->Succ; - Pred = putAfter; - putAfter->Succ = this; - Succ->Pred = this; - } - - void InsertBefore (Node *putBefore) - { - Succ = putBefore; - Pred = putBefore->Pred; - putBefore->Pred = this; - Pred->Succ = this; - } - - void Remove () - { - Pred->Succ = Succ; - Succ->Pred = Pred; - } -}; - -struct List -{ - Node *Head; - const Node *const Tail; - Node *TailPred; - - List () : Head ((Node *)&Tail), Tail (NULL), TailPred ((Node *)&Head) - { - } - - bool IsEmpty () const - { - return TailPred == (Node *)this; - } - - void MakeEmpty () - { - Head = (Node *)&Tail; - TailPred = (Node *)&Head; - } - - void AddHead (Node *node) - { - node->Succ = Head; - node->Pred = (Node *)&Head; - Head->Pred = node; - Head = node; - } - - void AddTail (Node *node) - { - node->Pred = TailPred; - node->Succ = (Node *)&Tail; - TailPred->Succ = node; - TailPred = node; - } - - Node *RemHead () - { - Node *node = Head; - if (node->Succ == NULL) - { - return NULL; - } - Head = node->Succ; - Head->Pred = (Node *)&Head; - return node; - } - - Node *RemHeadQ () // Only use if list is definitely not empty - { - Node *node = Head; - Head = node->Succ; - Head->Pred = (Node *)&Head; - return node; - } - - Node *RemTail () - { - Node *node = TailPred; - if (node->Pred == NULL) - { - return NULL; - } - TailPred = node->Pred; - TailPred->Succ = (Node *)&Tail; - return node; - } - - Node *RemTailQ () // Only use if list is definitely not empty - { - Node *node = TailPred; - TailPred = node->Pred; - TailPred->Succ = (Node *)&Tail; - return node; - } - -private: - List &operator= (const List&) { return *this; } -}; - -#endif //__LISTS_H__ diff --git a/src/utility/m_bbox.h b/src/utility/m_bbox.h index e19f179d7..e529f9b03 100644 --- a/src/utility/m_bbox.h +++ b/src/utility/m_bbox.h @@ -34,6 +34,15 @@ struct line_t; struct node_t; +enum +{ + BOXTOP, + BOXBOTTOM, + BOXLEFT, + BOXRIGHT +}; // bbox coordinates + + class FBoundingBox { public: diff --git a/src/utility/sc_man.cpp b/src/utility/sc_man.cpp index faea890a2..bd9a0d4de 100644 --- a/src/utility/sc_man.cpp +++ b/src/utility/sc_man.cpp @@ -38,7 +38,7 @@ #include #include #include "doomtype.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "sc_man.h" #include "w_wad.h" #include "cmdlib.h" diff --git a/src/win32/base_sysfb.cpp b/src/win32/base_sysfb.cpp index 53384cf2b..c65b0f099 100644 --- a/src/win32/base_sysfb.cpp +++ b/src/win32/base_sysfb.cpp @@ -49,7 +49,7 @@ #include "doomstat.h" #include "v_text.h" #include "m_argv.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "base_sysfb.h" #include "win32basevideo.h" #include "c_dispatch.h" diff --git a/src/win32/gl_sysfb.cpp b/src/win32/gl_sysfb.cpp index c8a6e3ea7..d55723325 100644 --- a/src/win32/gl_sysfb.cpp +++ b/src/win32/gl_sysfb.cpp @@ -49,7 +49,7 @@ #include "doomstat.h" #include "v_text.h" #include "m_argv.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "win32glvideo.h" extern HWND Window; diff --git a/src/win32/hardware.cpp b/src/win32/hardware.cpp index af6ab1188..61c4fa311 100644 --- a/src/win32/hardware.cpp +++ b/src/win32/hardware.cpp @@ -47,7 +47,7 @@ #ifdef HAVE_VULKAN #include "win32vulkanvideo.h" #endif -#include "doomerrors.h" +#include "engineerrors.h" #include "i_system.h" #include "swrenderer/r_swrenderer.h" diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index 61d6c1880..93fd35d73 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -85,7 +85,7 @@ #include "v_text.h" #include "version.h" #include "events.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "i_system.h" #include "g_levellocals.h" diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index 254dc1bc8..9e0e02af1 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -55,7 +55,7 @@ #endif #include "resource.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "hardware.h" #include "m_argv.h" diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 547ae4848..45b3c82f5 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -61,7 +61,7 @@ #include #include "hardware.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "cmdlib.h" #include "version.h" @@ -481,15 +481,6 @@ static void DoPrintStr(const char *cpt, HWND edit, HANDLE StdOut) static TArray bufferedConsoleStuff; -void I_DebugPrint(const char *cp) -{ - if (IsDebuggerPresent()) - { - auto wstr = WideString(cp); - OutputDebugStringW(wstr.c_str()); - } -} - void I_PrintStr(const char *cp) { if (ConWindowHidden) diff --git a/src/win32/i_system.h b/src/win32/i_system.h index 4a28b7f91..0927afc7a 100644 --- a/src/win32/i_system.h +++ b/src/win32/i_system.h @@ -87,8 +87,6 @@ bool I_SetCursor(FTexture *cursor); // Repaint the pre-game console void I_PaintConsole (void); -void I_DebugPrint (const char *cp); - // Print a console string void I_PrintStr (const char *cp); diff --git a/src/win32/st_start.cpp b/src/win32/st_start.cpp index e309c919d..84ab4ca4c 100644 --- a/src/win32/st_start.cpp +++ b/src/win32/st_start.cpp @@ -50,7 +50,7 @@ #include "s_sound.h" #include "m_argv.h" #include "d_main.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "s_music.h" // MACROS ------------------------------------------------------------------ diff --git a/src/win32/win32basevideo.cpp b/src/win32/win32basevideo.cpp index 809571a8f..ed4d382cf 100644 --- a/src/win32/win32basevideo.cpp +++ b/src/win32/win32basevideo.cpp @@ -48,7 +48,7 @@ #include "doomstat.h" #include "v_text.h" #include "m_argv.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "win32basevideo.h" #include "cmdlib.h" diff --git a/src/win32/win32glvideo.cpp b/src/win32/win32glvideo.cpp index e283c700c..d17f6b259 100644 --- a/src/win32/win32glvideo.cpp +++ b/src/win32/win32glvideo.cpp @@ -48,7 +48,7 @@ #include "doomstat.h" #include "v_text.h" #include "m_argv.h" -#include "doomerrors.h" +#include "engineerrors.h" #include "win32glvideo.h" #include "gl/system/gl_framebuffer.h" diff --git a/src/win32/win32polyvideo.cpp b/src/win32/win32polyvideo.cpp index a12ea0517..553c9e513 100644 --- a/src/win32/win32polyvideo.cpp +++ b/src/win32/win32polyvideo.cpp @@ -1,7 +1,7 @@ #include #include "hardware.h" -#include "doomerrors.h" +#include "engineerrors.h" #include EXTERN_CVAR(Bool, vid_vsync)