diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 437a048f5a..d570ffe515 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -8,10 +8,10 @@ #include #include #include +#include #include #include -#include #include @@ -661,7 +661,7 @@ namespace MWBase virtual bool hasCollisionWithDoor(const MWWorld::ConstPtr& door, const osg::Vec3f& position, const osg::Vec3f& destination) const = 0; virtual bool isAreaOccupiedByOtherActor(const osg::Vec3f& position, const float radius, - const Misc::Span& ignore, std::vector* occupyingActors = nullptr) const = 0; + std::span ignore, std::vector* occupyingActors = nullptr) const = 0; virtual void reportStats(unsigned int frameNumber, osg::Stats& stats) const = 0; diff --git a/apps/openmw/mwphysics/physicssystem.cpp b/apps/openmw/mwphysics/physicssystem.cpp index 93dafa3910..2f26a69132 100644 --- a/apps/openmw/mwphysics/physicssystem.cpp +++ b/apps/openmw/mwphysics/physicssystem.cpp @@ -903,7 +903,7 @@ namespace MWPhysics } bool PhysicsSystem::isAreaOccupiedByOtherActor(const osg::Vec3f& position, const float radius, - const Misc::Span& ignore, std::vector* occupyingActors) const + std::span ignore, std::vector* occupyingActors) const { std::vector ignoredObjects; ignoredObjects.reserve(ignore.size()); diff --git a/apps/openmw/mwphysics/physicssystem.hpp b/apps/openmw/mwphysics/physicssystem.hpp index 7843b6a9a3..dde2fc34c7 100644 --- a/apps/openmw/mwphysics/physicssystem.hpp +++ b/apps/openmw/mwphysics/physicssystem.hpp @@ -10,13 +10,13 @@ #include #include #include +#include #include #include #include #include -#include #include #include "../mwworld/ptr.hpp" @@ -280,7 +280,7 @@ namespace MWPhysics } bool isAreaOccupiedByOtherActor(const osg::Vec3f& position, const float radius, - const Misc::Span& ignore, std::vector* occupyingActors) const; + std::span ignore, std::vector* occupyingActors) const; void reportStats(unsigned int frameNumber, osg::Stats& stats) const; void reportCollision(const btVector3& position, const btVector3& normal); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 2228f72847..5864537c4b 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -3979,7 +3979,7 @@ namespace MWWorld } bool World::isAreaOccupiedByOtherActor(const osg::Vec3f& position, const float radius, - const Misc::Span& ignore, std::vector* occupyingActors) const + std::span ignore, std::vector* occupyingActors) const { return mPhysics->isAreaOccupiedByOtherActor(position, radius, ignore, occupyingActors); } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 74e34d5132..db563a7c7b 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -749,7 +749,7 @@ namespace MWWorld bool hasCollisionWithDoor(const MWWorld::ConstPtr& door, const osg::Vec3f& position, const osg::Vec3f& destination) const override; bool isAreaOccupiedByOtherActor(const osg::Vec3f& position, const float radius, - const Misc::Span& ignore, std::vector* occupyingActors) const override; + std::span ignore, std::vector* occupyingActors) const override; void reportStats(unsigned int frameNumber, osg::Stats& stats) const override; diff --git a/components/misc/span.hpp b/components/misc/span.hpp deleted file mode 100644 index 83a424a674..0000000000 --- a/components/misc/span.hpp +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef OPENMW_COMPONENTS_MISC_SPAN_H -#define OPENMW_COMPONENTS_MISC_SPAN_H - -#include - -namespace Misc -{ - template - class Span - { - public: - constexpr Span() = default; - - constexpr Span(T* pointer, std::size_t size) - : mPointer(pointer) - , mSize(size) - {} - - template - constexpr Span(Range& range) - : Span(range.data(), range.size()) - {} - - constexpr T* begin() const { return mPointer; } - - constexpr T* end() const { return mPointer + mSize; } - - constexpr std::size_t size() const { return mSize; } - - private: - T* mPointer = nullptr; - std::size_t mSize = 0; - }; -} - -#endif