diff --git a/platform/Windows/build.vcxproj b/platform/Windows/build.vcxproj index 103e2171f..710deea8f 100644 --- a/platform/Windows/build.vcxproj +++ b/platform/Windows/build.vcxproj @@ -368,8 +368,6 @@ - - diff --git a/platform/Windows/build.vcxproj.filters b/platform/Windows/build.vcxproj.filters index 83e87c82e..7af5fc202 100644 --- a/platform/Windows/build.vcxproj.filters +++ b/platform/Windows/build.vcxproj.filters @@ -370,12 +370,6 @@ Header Files - - Header Files - - - Header Files - Header Files diff --git a/source/build/include/build.h b/source/build/include/build.h index 4202105ee..c2df10cde 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -285,23 +285,23 @@ static FORCE_INLINE void wall_tracker_hook(uintptr_t address); static FORCE_INLINE void sprite_tracker_hook(uintptr_t address); } -#define TRACKER_NAME_ SectorTracker -#define TRACKER_GLOBAL_HOOK_ sector_tracker_hook +#define TRACKER_NAME__ SectorTracker +#define TRACKER_HOOK_ sector_tracker_hook #include "tracker.hpp" -#undef TRACKER_NAME_ -#undef TRACKER_GLOBAL_HOOK_ +#undef TRACKER_NAME__ +#undef TRACKER_HOOK_ -#define TRACKER_NAME_ WallTracker -#define TRACKER_GLOBAL_HOOK_ wall_tracker_hook +#define TRACKER_NAME__ WallTracker +#define TRACKER_HOOK_ wall_tracker_hook #include "tracker.hpp" -#undef TRACKER_NAME_ -#undef TRACKER_GLOBAL_HOOK_ +#undef TRACKER_NAME__ +#undef TRACKER_HOOK_ -#define TRACKER_NAME_ SpriteTracker -#define TRACKER_GLOBAL_HOOK_ sprite_tracker_hook +#define TRACKER_NAME__ SpriteTracker +#define TRACKER_HOOK_ sprite_tracker_hook #include "tracker.hpp" -#undef TRACKER_NAME_ -#undef TRACKER_GLOBAL_HOOK_ +#undef TRACKER_NAME__ +#undef TRACKER_HOOK_ #define Tracker(Container, Type) Container##Tracker #define TrackerCast(x) x.cast() diff --git a/source/build/include/tracker.hpp b/source/build/include/tracker.hpp index 1b4d4d2a9..5ade506f6 100644 --- a/source/build/include/tracker.hpp +++ b/source/build/include/tracker.hpp @@ -1,109 +1,109 @@ - - -template -class TRACKER_NAME_ +template +class TRACKER_NAME__ { public: - TrackedType TrackedValue; + T value; - inline TrackedType* operator & () + inline T *operator&() { - TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue); - return &this->TrackedValue; + TRACKER_HOOK_((uintptr_t) & this->value); + return &this->value; } - inline TrackedType operator ++ () + inline T operator++() { - TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue); - return ++this->TrackedValue; + TRACKER_HOOK_((uintptr_t) & this->value); + return ++this->value; } - inline TrackedType operator ++ (int) + inline T operator++(int) { - TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue); - return this->TrackedValue++; + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value++; } - inline TrackedType operator -- () + inline T operator--() { - TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue); - return --this->TrackedValue; + TRACKER_HOOK_((uintptr_t) & this->value); + return --this->value; } - inline TrackedType operator -- (int) + inline T operator--(int) { - TRACKER_GLOBAL_HOOK_((uintptr_t)&this->TrackedValue); - return this->TrackedValue--; + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value--; } - template - inline TrackedType operator = (RightHandType); + template inline T operator=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value = (T)operand; + } - template - inline TrackedType operator += (RightHandType); + template inline T operator+=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value += (T)operand; + } - template - inline TrackedType operator -= (RightHandType); + template inline T operator-=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value -= (T)operand; + } - template - inline TrackedType operator *= (RightHandType); + template inline T operator*=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value *= (T)operand; + } - template - inline TrackedType operator /= (RightHandType); + template inline T operator/=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value /= (T)operand; + } - template - inline TrackedType operator |= (RightHandType); + template inline T operator|=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value |= (T)operand; + } - template - inline TrackedType operator &= (RightHandType); + template inline T operator&=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value &= (T)operand; + } - template - inline TrackedType operator ^= (RightHandType); + template inline T operator^=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value ^= (T)operand; + } - template - inline TrackedType operator <<= (RightHandType); + template inline T operator<<=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value <<= (T)operand; + } - template - inline TrackedType operator >>= (RightHandType); + template inline T operator>>=(Tt operand) + { + TRACKER_HOOK_((uintptr_t) & this->value); + return this->value >>= (T)operand; + } - inline operator TrackedType() const; + inline operator T() const { return this->value; } - inline TrackedType cast() const; -}; - -#ifndef tracker_hpp_ -#define tracker_hpp_ - -enum { - TRACKER_NOOP_RIGHTHAND_EQUAL_ = 0, - TRACKER_NOOP_RIGHTHAND_ZERO_, - TRACKER_NOOP_RIGHTHAND_ONE_, - __TRACKER_NEVER, -}; - -#endif - -#include "tracker_operators.hpp" - -template -inline TRACKER_NAME_::operator TrackedType() const -{ - return this->TrackedValue; -} - -template -inline TrackedType TRACKER_NAME_::cast() const -{ - return this->TrackedValue; -} - -template -struct is_signed> -{ - static constexpr bool value = std::is_signed::value; -}; -template -struct is_unsigned> -{ - static constexpr bool value = std::is_unsigned::value; + inline T cast() const { return this->value; } + + struct is_signed + { + static constexpr bool value = std::is_signed::value; + }; + struct is_unsigned + { + static constexpr bool value = std::is_unsigned::value; + }; }; diff --git a/source/build/include/tracker_operator.hpp b/source/build/include/tracker_operator.hpp deleted file mode 100644 index 749f4b8a3..000000000 --- a/source/build/include/tracker_operator.hpp +++ /dev/null @@ -1,25 +0,0 @@ - -template -template -inline TrackedType TRACKER_NAME_::operator TRACKER_OPERATOR_ (RightHandType rightHand) -{ - bool isNoop = false; - - switch (TRACKER_NOOP_) - { - case TRACKER_NOOP_RIGHTHAND_EQUAL_: isNoop = (this->TrackedValue == (TrackedType)rightHand); break; - case TRACKER_NOOP_RIGHTHAND_ZERO_: isNoop = (rightHand == 0); break; - case TRACKER_NOOP_RIGHTHAND_ONE_: isNoop = (rightHand == 1); - fallthrough__; - // case __TRACKER_NEVER: - default: - break; - } - - if (!isNoop) - { - TRACKER_GLOBAL_HOOK_((uintptr_t) & this->TrackedValue); - return this->TrackedValue TRACKER_OPERATOR_ (TrackedType)rightHand; - } - else return this->TrackedValue; -} diff --git a/source/build/include/tracker_operators.hpp b/source/build/include/tracker_operators.hpp deleted file mode 100644 index cca8e4ae5..000000000 --- a/source/build/include/tracker_operators.hpp +++ /dev/null @@ -1,59 +0,0 @@ -#define TRACKER_OPERATOR_ = -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_EQUAL_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_ - -#define TRACKER_OPERATOR_ += -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_ZERO_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_ - -#define TRACKER_OPERATOR_ -= -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_ZERO_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_ - -#define TRACKER_OPERATOR_ *= -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_ONE_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_ - -#define TRACKER_OPERATOR_ /= -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_ONE_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_ - -#define TRACKER_OPERATOR_ |= -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_ZERO_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_ - -#define TRACKER_OPERATOR_ &= -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_EQUAL_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_ - -#define TRACKER_OPERATOR_ ^= -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_ZERO_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_ - -#define TRACKER_OPERATOR_ <<= -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_ZERO_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_ - -#define TRACKER_OPERATOR_ >>= -#define TRACKER_NOOP_ TRACKER_NOOP_RIGHTHAND_ZERO_ -#include "tracker_operator.hpp" -#undef TRACKER_OPERATOR_ -#undef TRACKER_NOOP_