From a116c10574e2ed4972b647d28da3e00761c884d3 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 8 Feb 2016 20:38:59 -0600 Subject: [PATCH 1/5] Comment out re2c_test::range reference in re2c::Range --- tools/re2c/src/util/range.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/re2c/src/util/range.h b/tools/re2c/src/util/range.h index 9a9cf03b4..1ea7d9be4 100644 --- a/tools/re2c/src/util/range.h +++ b/tools/re2c/src/util/range.h @@ -55,7 +55,7 @@ private: static void append (Range ** & ptail, uint32_t l, uint32_t u); // test addition and subtraction - template friend Range * re2c_test::range (uint32_t n); + //template friend Range * re2c_test::range (uint32_t n); FORBID_COPY (Range); }; From 4c2bcede6157cf30fd829d5d3a26f7cee9270c8d Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 8 Feb 2016 21:27:02 -0600 Subject: [PATCH 2/5] Update VS2005 projects for re2c and zdoom --- tools/re2c/config.msc.h | 62 +++ tools/re2c/re2c.vcproj | 845 +++++++++++++++++++++++++++++++ tools/re2c/src/conf/msg.cc | 4 + tools/re2c/src/util/c99_stdint.h | 4 + zdoom.vcproj | 8 + 5 files changed, 923 insertions(+) create mode 100644 tools/re2c/config.msc.h create mode 100644 tools/re2c/re2c.vcproj diff --git a/tools/re2c/config.msc.h b/tools/re2c/config.msc.h new file mode 100644 index 000000000..d64e6d9e9 --- /dev/null +++ b/tools/re2c/config.msc.h @@ -0,0 +1,62 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Name of package */ +/* #undef PACKAGE */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "re2c-general@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "re2c" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "re2c 0.16" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "re2c" + +/* Define to the home page for this package. */ +/* #undef PACKAGE_URL */ + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.16" + +/* The size of `0i8', as computed by sizeof. */ +#define SIZEOF_0I8 1 + +/* The size of `0l', as computed by sizeof. */ +#define SIZEOF_0L 4 + +/* The size of `0ll', as computed by sizeof. */ +#define SIZEOF_0LL 8 + +/* The size of `char', as computed by sizeof. */ +#define SIZEOF_CHAR 1 + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `void *', as computed by sizeof. */ +#ifdef _M_X64 +#define SIZEOF_VOID_P 8 +#else +#define SIZEOF_VOID_P 4 +#endif + +/* The size of `__int64', as computed by sizeof. */ +#define SIZEOF___INT64 8 + +/* Version number of package */ +/* #undef VERSION */ diff --git a/tools/re2c/re2c.vcproj b/tools/re2c/re2c.vcproj new file mode 100644 index 000000000..81d8c4941 --- /dev/null +++ b/tools/re2c/re2c.vcproj @@ -0,0 +1,845 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/re2c/src/conf/msg.cc b/tools/re2c/src/conf/msg.cc index ec13c0ac7..87962f0a9 100644 --- a/tools/re2c/src/conf/msg.cc +++ b/tools/re2c/src/conf/msg.cc @@ -2,7 +2,11 @@ #include #include +#if defined(_MSC_VER) && _MSC_VER < 1500 +#include "config.msc.h" +#else #include "config.h" +#endif #include "src/conf/msg.h" namespace re2c { diff --git a/tools/re2c/src/util/c99_stdint.h b/tools/re2c/src/util/c99_stdint.h index ffe2e3ee0..571860431 100644 --- a/tools/re2c/src/util/c99_stdint.h +++ b/tools/re2c/src/util/c99_stdint.h @@ -1,7 +1,11 @@ #ifndef _RE2C_UTIL_C99_STDINT_ #define _RE2C_UTIL_C99_STDINT_ +#if defined(_MSC_VER) && _MSC_VER < 1500 +#include "config.msc.h" +#else #include "config.h" +#endif #if HAVE_STDINT_H # include diff --git a/zdoom.vcproj b/zdoom.vcproj index b16c13fa8..3b98c29b1 100644 --- a/zdoom.vcproj +++ b/zdoom.vcproj @@ -622,6 +622,10 @@ RelativePath=".\src\dthinker.cpp" > + + @@ -1271,6 +1275,10 @@ RelativePath=".\src\dthinker.h" > + + From 8d159b8506d5e0c271c8b9dc45b1b927f646ab23 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 8 Feb 2016 22:11:42 -0600 Subject: [PATCH 3/5] Add OF_StateChanged handling to NoDelay --- src/actor.h | 2 ++ src/g_shared/a_fastprojectile.cpp | 13 ++------- src/p_mobj.cpp | 45 +++++++++++++++++++++++-------- 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/src/actor.h b/src/actor.h index e6ae8d9f8..30e67fa30 100644 --- a/src/actor.h +++ b/src/actor.h @@ -647,6 +647,8 @@ public: // Returns true if this actor is within melee range of its target bool CheckMeleeRange(); + bool CheckNoDelay(); + virtual void BeginPlay(); // Called immediately after the actor is created virtual void PostBeginPlay(); // Called immediately before the actor's first tick virtual void LevelSpawned(); // Called after BeginPlay if this actor was spawned by the world diff --git a/src/g_shared/a_fastprojectile.cpp b/src/g_shared/a_fastprojectile.cpp index da71358f9..4f103be57 100644 --- a/src/g_shared/a_fastprojectile.cpp +++ b/src/g_shared/a_fastprojectile.cpp @@ -138,17 +138,8 @@ void AFastProjectile::Tick () } } } - if ((flags7 & MF7_HANDLENODELAY) && !(flags2 & MF2_DORMANT)) - { - flags7 &= ~MF7_HANDLENODELAY; - if (state->GetNoDelay()) - { - // For immediately spawned objects with the NoDelay flag set for their - // Spawn state, explicitly call the current state's function. - if (state->CallAction(this, this) && (ObjectFlags & OF_EuthanizeMe)) - return; // freed itself - } - } + if (!CheckNoDelay()) + return; // freed itself // Advance the state if (tics != -1) { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index a7573f4dc..eba7f86fd 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3841,17 +3841,8 @@ void AActor::Tick () Destroy(); return; } - if ((flags7 & MF7_HANDLENODELAY) && !(flags2 & MF2_DORMANT)) - { - flags7 &= ~MF7_HANDLENODELAY; - if (state->GetNoDelay()) - { - // For immediately spawned objects with the NoDelay flag set for their - // Spawn state, explicitly call the current state's function. - if (state->CallAction(this, this) && (ObjectFlags & OF_EuthanizeMe)) - return; // freed itself - } - } + if (!CheckNoDelay()) + return; // freed itself // cycle through states, calling action functions at transitions if (tics != -1) { @@ -3892,6 +3883,38 @@ void AActor::Tick () } } +//========================================================================== +// +// AActor :: CheckNoDelay +// +//========================================================================== + +bool AActor::CheckNoDelay() +{ + if ((flags7 & MF7_HANDLENODELAY) && !(flags2 & MF2_DORMANT)) + { + flags7 &= ~MF7_HANDLENODELAY; + if (state->GetNoDelay()) + { + // For immediately spawned objects with the NoDelay flag set for their + // Spawn state, explicitly call the current state's function. + if (state->CallAction(this, this)) + { + if (ObjectFlags & OF_EuthanizeMe) + { + return false; // freed itself + } + if (ObjectFlags & OF_StateChanged) + { + ObjectFlags &= ~OF_StateChanged; + return SetState(state); + } + } + } + } + return true; +} + //========================================================================== // // AActor :: CheckSectorTransition From f0b496205272cde31a9dd406b0b8c3d1df86adc4 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 8 Feb 2016 22:21:42 -0600 Subject: [PATCH 4/5] Fix: CountInv must return a value if the caller's expecting one --- src/thingdef/thingdef_codeptr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e6759e18a..ebc5c0b97 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -238,14 +238,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, CountInv) self = COPY_AAPTR(self, pick_pointer); if (self == NULL || itemtype == NULL) { - ret->SetInt(false); + ret->SetInt(0); } else { AInventory *item = self->FindInventory(itemtype); ret->SetInt(item ? item->Amount : 0); - return 1; } + return 1; } return 0; } From 88f61579846e19a4681cfe0d5f7f3a6b63f86587 Mon Sep 17 00:00:00 2001 From: John Palomo Jr Date: Tue, 9 Feb 2016 02:49:28 -0500 Subject: [PATCH 5/5] Fixed: Player color slider size/position was wrong when using language strings. --- src/menu/playermenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menu/playermenu.cpp b/src/menu/playermenu.cpp index 184b5a465..691986548 100644 --- a/src/menu/playermenu.cpp +++ b/src/menu/playermenu.cpp @@ -484,7 +484,7 @@ void FSliderItem::Drawer(bool selected) screen->DrawText(mFont, selected? OptionSettings.mFontColorSelection : mFontColor, mXpos, mYpos, text, DTA_Clean, true, TAG_DONE); int x = SmallFont->StringWidth ("Green") + 8 + mXpos; - int x2 = SmallFont->StringWidth (mText) + 8 + mXpos; + int x2 = SmallFont->StringWidth (text) + 8 + mXpos; DrawSlider (MAX(x2, x), mYpos); }