minor fixes
This commit is contained in:
parent
646db73f73
commit
b739ef71e2
|
|
@ -18,7 +18,6 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include <kiwano-physics/Global.h>
|
||||
|
||||
namespace kiwano
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@ void Action::UpdateStep(Actor* target, Duration dt)
|
|||
case Status::Started:
|
||||
Update(target, dt);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (status_ == Status::Done)
|
||||
|
|
|
|||
|
|
@ -73,9 +73,9 @@ public:
|
|||
|
||||
/// \~chinese
|
||||
/// @brief »ñÈ¡º¬ÓжÔÏóÀàÐÍ
|
||||
inline const type_info& GetType() const noexcept
|
||||
inline const std::type_info& GetType() const noexcept
|
||||
{
|
||||
const type_info* const info = GetTypeinfo();
|
||||
const std::type_info* const info = GetTypeinfo();
|
||||
if (info)
|
||||
{
|
||||
return *info;
|
||||
|
|
@ -132,7 +132,7 @@ public:
|
|||
{
|
||||
static_assert(!std::is_void<_Ty>::value, "oc::Any cannot contain void");
|
||||
|
||||
const type_info* const info = GetTypeinfo();
|
||||
const std::type_info* const info = GetTypeinfo();
|
||||
if (info && (*info == typeid(std::decay<_Ty>::type)))
|
||||
{
|
||||
if (HasSmallType())
|
||||
|
|
@ -193,12 +193,12 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
const type_info*& GetTypeinfo()
|
||||
const std::type_info*& GetTypeinfo()
|
||||
{
|
||||
return storage_.small_.info_;
|
||||
}
|
||||
|
||||
const type_info* GetTypeinfo() const
|
||||
const std::type_info* GetTypeinfo() const
|
||||
{
|
||||
return storage_.small_.info_;
|
||||
}
|
||||
|
|
@ -430,14 +430,14 @@ private:
|
|||
private:
|
||||
struct SmallStorage
|
||||
{
|
||||
const type_info* info_;
|
||||
const std::type_info* info_;
|
||||
SmallStorageRTTI rtti_;
|
||||
char buffer_[ANY_SMALL_SPACE_SIZE];
|
||||
};
|
||||
|
||||
struct BigStorage
|
||||
{
|
||||
const type_info* info_;
|
||||
const std::type_info* info_;
|
||||
BigStorageRTTI rtti_;
|
||||
void* ptr_;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -75,9 +75,9 @@ public:
|
|||
virtual void Release() = 0;
|
||||
virtual _Ret Invoke(_Args&&... args) const = 0;
|
||||
|
||||
virtual const type_info& TargetType() const noexcept = 0;
|
||||
virtual const std::type_info& TargetType() const noexcept = 0;
|
||||
|
||||
virtual const void* Target(const type_info& type) const noexcept = 0;
|
||||
virtual const void* Target(const std::type_info& type) const noexcept = 0;
|
||||
};
|
||||
|
||||
template <typename _Ret, typename... _Args>
|
||||
|
|
@ -121,12 +121,12 @@ public:
|
|||
return std::invoke(callee_, std::forward<_Args>(args)...);
|
||||
}
|
||||
|
||||
virtual const type_info& TargetType() const noexcept
|
||||
virtual const std::type_info& TargetType() const noexcept
|
||||
{
|
||||
return typeid(_Ty);
|
||||
}
|
||||
|
||||
virtual const void* Target(const type_info& type) const noexcept
|
||||
virtual const void* Target(const std::type_info& type) const noexcept
|
||||
{
|
||||
if (type == this->TargetType())
|
||||
return &callee_;
|
||||
|
|
@ -153,12 +153,12 @@ public:
|
|||
return std::invoke(func_, ptr_, std::forward<_Args>(args)...);
|
||||
}
|
||||
|
||||
virtual const type_info& TargetType() const noexcept
|
||||
virtual const std::type_info& TargetType() const noexcept
|
||||
{
|
||||
return typeid(ProxyMemCallable);
|
||||
}
|
||||
|
||||
virtual const void* Target(const type_info& type) const noexcept
|
||||
virtual const void* Target(const std::type_info& type) const noexcept
|
||||
{
|
||||
if (type == this->TargetType())
|
||||
return this;
|
||||
|
|
@ -193,12 +193,12 @@ public:
|
|||
return std::invoke(func_, ptr_, std::forward<_Args>(args)...);
|
||||
}
|
||||
|
||||
virtual const type_info& TargetType() const noexcept
|
||||
virtual const std::type_info& TargetType() const noexcept
|
||||
{
|
||||
return typeid(ProxyConstMemCallable);
|
||||
}
|
||||
|
||||
virtual const void* Target(const type_info& type) const noexcept
|
||||
virtual const void* Target(const std::type_info& type) const noexcept
|
||||
{
|
||||
if (type == this->TargetType())
|
||||
return this;
|
||||
|
|
@ -321,7 +321,7 @@ public:
|
|||
std::swap(callable_, rhs.callable_);
|
||||
}
|
||||
|
||||
const type_info& target_type() const noexcept
|
||||
const std::type_info& target_type() const noexcept
|
||||
{
|
||||
return callable_->TargetType();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,13 +246,13 @@ public:
|
|||
}
|
||||
|
||||
public:
|
||||
template <typename _PtrTy>
|
||||
template <typename _IterPtrTy>
|
||||
struct Iterator
|
||||
{
|
||||
using iterator_category = std::bidirectional_iterator_tag;
|
||||
using value_type = _PtrTy;
|
||||
using pointer = _PtrTy*;
|
||||
using reference = _PtrTy&;
|
||||
using value_type = _IterPtrTy;
|
||||
using pointer = _IterPtrTy*;
|
||||
using reference = _IterPtrTy&;
|
||||
using difference_type = ptrdiff_t;
|
||||
|
||||
inline Iterator(value_type ptr = nullptr, bool is_end = false)
|
||||
|
|
|
|||
|
|
@ -73,13 +73,13 @@ public:
|
|||
SmartPtr(pointer_type p)
|
||||
: ptr_(p)
|
||||
{
|
||||
typename _ProxyTy::Retain(ptr_);
|
||||
_ProxyTy::Retain(ptr_);
|
||||
}
|
||||
|
||||
SmartPtr(const SmartPtr& other)
|
||||
: ptr_(other.ptr_)
|
||||
{
|
||||
typename _ProxyTy::Retain(ptr_);
|
||||
_ProxyTy::Retain(ptr_);
|
||||
}
|
||||
|
||||
SmartPtr(SmartPtr&& other) noexcept
|
||||
|
|
@ -97,7 +97,7 @@ public:
|
|||
SmartPtr(const SmartPtr<_UTy, _ProxyTy>& other)
|
||||
{
|
||||
ptr_ = const_cast<pointer_type>(dynamic_cast<const_pointer_type>(other.Get()));
|
||||
typename _ProxyTy::Retain(ptr_);
|
||||
_ProxyTy::Retain(ptr_);
|
||||
}
|
||||
|
||||
inline pointer_type Get() noexcept
|
||||
|
|
@ -193,7 +193,7 @@ public:
|
|||
private:
|
||||
void Tidy()
|
||||
{
|
||||
typename _ProxyTy::Release(ptr_);
|
||||
_ProxyTy::Release(ptr_);
|
||||
ptr_ = nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include <kiwano/render/Color.h>
|
||||
#include <kiwano/render/NativeObject.h>
|
||||
#include <kiwano/render/Texture.h>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue