From e02367dd097fe5631a637627e4382014db73fbea Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Fri, 23 Nov 2018 12:06:44 +0100 Subject: [PATCH 1/4] - use std::runtime_error instead as the constructor on std::exception is a MSVC extension --- src/doomerrors.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doomerrors.h b/src/doomerrors.h index a7ec02654..3d780466b 100644 --- a/src/doomerrors.h +++ b/src/doomerrors.h @@ -80,10 +80,10 @@ protected: char m_Message[MAX_ERRORTEXT]; }; -class CNoRunExit : public std::exception +class CNoRunExit : public std::runtime_error { public: - CNoRunExit() : std::exception("NoRunExit") + CNoRunExit() : std::runtime_error("NoRunExit") { } }; From ac62088690562b6115725c1086498149e718dc89 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Fri, 23 Nov 2018 12:09:36 +0100 Subject: [PATCH 2/4] - fix wrong attribute count passed to SetFormat - fix missing include statement --- src/doomerrors.h | 1 + src/hwrenderer/models/hw_models.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doomerrors.h b/src/doomerrors.h index 3d780466b..831db4a91 100644 --- a/src/doomerrors.h +++ b/src/doomerrors.h @@ -38,6 +38,7 @@ #include #include #include +#include #define MAX_ERRORTEXT 1024 diff --git a/src/hwrenderer/models/hw_models.cpp b/src/hwrenderer/models/hw_models.cpp index d4241c026..95ee84411 100644 --- a/src/hwrenderer/models/hw_models.cpp +++ b/src/hwrenderer/models/hw_models.cpp @@ -147,7 +147,7 @@ FModelVertexBuffer::FModelVertexBuffer(bool needindex, bool singleframe) { 1, VATTR_VERTEX2, VFmt_Float3, (int)myoffsetof(FModelVertex, x) }, { 1, VATTR_NORMAL2, VFmt_Packed_A2R10G10B10, (int)myoffsetof(FModelVertex, packedNormal) } }; - mVertexBuffer->SetFormat(2, 4, sizeof(FModelVertex), format); + mVertexBuffer->SetFormat(2, 5, sizeof(FModelVertex), format); } //=========================================================================== From dc6ba6bd529fc12a28803f6e98db20236a86ca75 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 23 Nov 2018 15:03:37 +0200 Subject: [PATCH 3/4] - fixed compilation of POSIX targets src/doomerrors.h:74:14: error: exception specification of overriding function is more lax than base version src/posix/sdl/i_main.cpp:272:28: error: 'class std::exception' has no member named 'GetMessage' --- src/doomerrors.h | 2 +- src/posix/sdl/i_main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doomerrors.h b/src/doomerrors.h index 831db4a91..52bc3c12b 100644 --- a/src/doomerrors.h +++ b/src/doomerrors.h @@ -71,7 +71,7 @@ public: else return NULL; } - char const *what() const override + char const *what() const noexcept override { return m_Message; } diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index 8e7230777..0c2389294 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -265,11 +265,11 @@ int main (int argc, char **argv) fprintf (stderr, "%s\n", error.what ()); #ifdef __APPLE__ - Mac_I_FatalError(error.GetMessage()); + Mac_I_FatalError(error.what()); #endif // __APPLE__ #ifdef __linux__ - Linux_I_FatalError(error.GetMessage()); + Linux_I_FatalError(error.what()); #endif // __linux__ exit (-1); From ee91cf77e4db25e97638eaaab527ded39d9083ab Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Fri, 23 Nov 2018 20:50:56 +0100 Subject: [PATCH 4/4] expose defaultbloodcolor to ZScript. --- src/gi.cpp | 2 +- wadsrc/static/zscript/base.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gi.cpp b/src/gi.cpp index 87c8b68cf..4edb2420f 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -61,7 +61,7 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_single) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_coop) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_dm) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mSliderColor) - +DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, defaultbloodcolor) const char *GameNames[17] = { diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 2576ea9b2..411746035 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -366,6 +366,7 @@ struct GameInfoStruct native native double gibfactor; native bool intermissioncounter; native Name mSliderColor; + native Color defaultbloodcolor; } class Object native