diff --git a/src/actor.h b/src/actor.h index e6ae8d9f84..30e67fa306 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 da71358f98..4f103be57f 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/menu/playermenu.cpp b/src/menu/playermenu.cpp index 184b5a4655..691986548a 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); } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index a7573f4dca..eba7f86fdc 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 diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e6759e18a4..ebc5c0b979 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; } diff --git a/tools/re2c/config.msc.h b/tools/re2c/config.msc.h new file mode 100644 index 0000000000..d64e6d9e9e --- /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 0000000000..81d8c4941f --- /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 ec13c0ac7c..87962f0a9c 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 ffe2e3ee00..5718604316 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/tools/re2c/src/util/range.h b/tools/re2c/src/util/range.h index 9a9cf03b45..1ea7d9be47 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); }; diff --git a/zdoom.vcproj b/zdoom.vcproj index b16c13fa82..3b98c29b1e 100644 --- a/zdoom.vcproj +++ b/zdoom.vcproj @@ -622,6 +622,10 @@ RelativePath=".\src\dthinker.cpp" > + + @@ -1271,6 +1275,10 @@ RelativePath=".\src\dthinker.h" > + +