Merge branch 'dev' of https://github.com/KiwanoEngine/Kiwano into dev
This commit is contained in:
commit
53cb3659c0
|
|
@ -6,8 +6,13 @@ x64/
|
|||
Debug/
|
||||
Release/
|
||||
|
||||
# CMake folders
|
||||
/cmake-build-release/
|
||||
/cmake-build-debug/
|
||||
|
||||
# Application folders
|
||||
.vs
|
||||
.idea
|
||||
|
||||
# vs2010
|
||||
ipch/
|
||||
|
|
@ -27,4 +32,8 @@ packages/
|
|||
# Resources bin
|
||||
*.aps
|
||||
|
||||
docs/
|
||||
# Mac cache files
|
||||
.DS_Store
|
||||
|
||||
# Documents
|
||||
docs/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
project(Kiwano C CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
if (WIN32)
|
||||
message(STATUS "Building on Windows platform.")
|
||||
elseif (APPLE)
|
||||
message(STATUS "Building on MacOS platform.")
|
||||
add_compile_definitions(TARGET_OS_MAC)
|
||||
elseif (UNIX)
|
||||
message(STATUS "Building on UNIX-like OS platform.")
|
||||
endif ()
|
||||
|
||||
include_directories(src/3rd-party)
|
||||
include_directories(src)
|
||||
|
||||
add_subdirectory(src/kiwano)
|
||||
add_subdirectory(src/kiwano-audio)
|
||||
add_subdirectory(src/kiwano-imgui)
|
||||
add_subdirectory(src/kiwano-network)
|
||||
add_subdirectory(src/kiwano-physics)
|
||||
add_subdirectory(src/3rd-party/Box2D)
|
||||
add_subdirectory(src/3rd-party/curl)
|
||||
add_subdirectory(src/3rd-party/nlohmann)
|
||||
add_subdirectory(src/3rd-party/pugixml)
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
include_directories(..)
|
||||
|
||||
set(SOURCE_FILES
|
||||
Collision/Shapes/b2ChainShape.cpp
|
||||
Collision/Shapes/b2ChainShape.h
|
||||
Collision/Shapes/b2CircleShape.cpp
|
||||
Collision/Shapes/b2CircleShape.h
|
||||
Collision/Shapes/b2EdgeShape.cpp
|
||||
Collision/Shapes/b2EdgeShape.h
|
||||
Collision/Shapes/b2PolygonShape.cpp
|
||||
Collision/Shapes/b2PolygonShape.h
|
||||
Collision/Shapes/b2Shape.h
|
||||
Collision/b2BroadPhase.cpp
|
||||
Collision/b2BroadPhase.h
|
||||
Collision/b2CollideCircle.cpp
|
||||
Collision/b2CollideEdge.cpp
|
||||
Collision/b2CollidePolygon.cpp
|
||||
Collision/b2Collision.cpp
|
||||
Collision/b2Collision.h
|
||||
Collision/b2Distance.cpp
|
||||
Collision/b2Distance.h
|
||||
Collision/b2DynamicTree.cpp
|
||||
Collision/b2DynamicTree.h
|
||||
Collision/b2TimeOfImpact.cpp
|
||||
Collision/b2TimeOfImpact.h
|
||||
Common/b2BlockAllocator.cpp
|
||||
Common/b2BlockAllocator.h
|
||||
Common/b2Draw.cpp
|
||||
Common/b2Draw.h
|
||||
Common/b2GrowableStack.h
|
||||
Common/b2Math.cpp
|
||||
Common/b2Math.h
|
||||
Common/b2Settings.cpp
|
||||
Common/b2Settings.h
|
||||
Common/b2StackAllocator.cpp
|
||||
Common/b2StackAllocator.h
|
||||
Common/b2Timer.cpp
|
||||
Common/b2Timer.h
|
||||
Dynamics/Contacts/b2ChainAndCircleContact.cpp
|
||||
Dynamics/Contacts/b2ChainAndCircleContact.h
|
||||
Dynamics/Contacts/b2ChainAndPolygonContact.cpp
|
||||
Dynamics/Contacts/b2ChainAndPolygonContact.h
|
||||
Dynamics/Contacts/b2CircleContact.cpp
|
||||
Dynamics/Contacts/b2CircleContact.h
|
||||
Dynamics/Contacts/b2Contact.cpp
|
||||
Dynamics/Contacts/b2Contact.h
|
||||
Dynamics/Contacts/b2ContactSolver.cpp
|
||||
Dynamics/Contacts/b2ContactSolver.h
|
||||
Dynamics/Contacts/b2EdgeAndCircleContact.cpp
|
||||
Dynamics/Contacts/b2EdgeAndCircleContact.h
|
||||
Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
|
||||
Dynamics/Contacts/b2EdgeAndPolygonContact.h
|
||||
Dynamics/Contacts/b2PolygonAndCircleContact.cpp
|
||||
Dynamics/Contacts/b2PolygonAndCircleContact.h
|
||||
Dynamics/Contacts/b2PolygonContact.cpp
|
||||
Dynamics/Contacts/b2PolygonContact.h
|
||||
Dynamics/Joints/b2DistanceJoint.cpp
|
||||
Dynamics/Joints/b2DistanceJoint.h
|
||||
Dynamics/Joints/b2FrictionJoint.cpp
|
||||
Dynamics/Joints/b2FrictionJoint.h
|
||||
Dynamics/Joints/b2GearJoint.cpp
|
||||
Dynamics/Joints/b2GearJoint.h
|
||||
Dynamics/Joints/b2Joint.cpp
|
||||
Dynamics/Joints/b2Joint.h
|
||||
Dynamics/Joints/b2MotorJoint.cpp
|
||||
Dynamics/Joints/b2MotorJoint.h
|
||||
Dynamics/Joints/b2MouseJoint.cpp
|
||||
Dynamics/Joints/b2MouseJoint.h
|
||||
Dynamics/Joints/b2PrismaticJoint.cpp
|
||||
Dynamics/Joints/b2PrismaticJoint.h
|
||||
Dynamics/Joints/b2PulleyJoint.cpp
|
||||
Dynamics/Joints/b2PulleyJoint.h
|
||||
Dynamics/Joints/b2RevoluteJoint.cpp
|
||||
Dynamics/Joints/b2RevoluteJoint.h
|
||||
Dynamics/Joints/b2RopeJoint.cpp
|
||||
Dynamics/Joints/b2RopeJoint.h
|
||||
Dynamics/Joints/b2WeldJoint.cpp
|
||||
Dynamics/Joints/b2WeldJoint.h
|
||||
Dynamics/Joints/b2WheelJoint.cpp
|
||||
Dynamics/Joints/b2WheelJoint.h
|
||||
Dynamics/b2Body.cpp
|
||||
Dynamics/b2Body.h
|
||||
Dynamics/b2ContactManager.cpp
|
||||
Dynamics/b2ContactManager.h
|
||||
Dynamics/b2Fixture.cpp
|
||||
Dynamics/b2Fixture.h
|
||||
Dynamics/b2Island.cpp
|
||||
Dynamics/b2Island.h
|
||||
Dynamics/b2TimeStep.h
|
||||
Dynamics/b2World.cpp
|
||||
Dynamics/b2World.h
|
||||
Dynamics/b2WorldCallbacks.cpp
|
||||
Dynamics/b2WorldCallbacks.h
|
||||
Rope/b2Rope.cpp
|
||||
Rope/b2Rope.h
|
||||
Box2D.h)
|
||||
|
||||
add_library(libbox2d ${SOURCE_FILES})
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
#define B2_MATH_H
|
||||
|
||||
#include "b2Settings.h"
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
/// This function is used to ensure that a floating point number is not a NaN or infinity.
|
||||
inline bool b2IsValid(float32 x)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
include_directories(..)
|
||||
|
||||
set(SOURCE_FILES
|
||||
curl.h
|
||||
curlbuild.h
|
||||
curlrules.h
|
||||
curlver.h
|
||||
easy.h
|
||||
mprintf.h
|
||||
multi.h
|
||||
stdcheaders.h
|
||||
typecheck-gcc.h)
|
||||
|
||||
add_library(libcurl ${SOURCE_FILES})
|
||||
|
||||
target_link_libraries(libcurl ./libs/libcurl.lib)
|
||||
|
||||
set_target_properties(libcurl PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
include_directories(..)
|
||||
|
||||
set(SOURCE_FILES
|
||||
imconfig.h
|
||||
imgui.cpp
|
||||
imgui.h
|
||||
imgui_demo.cpp
|
||||
imgui_draw.cpp
|
||||
imgui_internal.h
|
||||
imgui_widgets.cpp
|
||||
imstb_rectpack.h
|
||||
imstb_textedit.h
|
||||
imstb_truetype.h)
|
||||
|
||||
add_library(libimgui ${SOURCE_FILES})
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
include_directories(..)
|
||||
|
||||
set(SOURCE_FILES
|
||||
json.hpp)
|
||||
|
||||
add_library(libnlohmann ${SOURCE_FILES})
|
||||
|
||||
set_target_properties(libnlohmann PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
include_directories(..)
|
||||
|
||||
set(SOURCE_FILES
|
||||
pugiconfig.hpp
|
||||
pugixml-impl.hpp
|
||||
pugixml.hpp)
|
||||
|
||||
add_library(libpugixml ${SOURCE_FILES})
|
||||
|
||||
set_target_properties(libpugixml PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
include_directories(..)
|
||||
|
||||
set(SOURCE_FILES
|
||||
AudioModule.cpp
|
||||
AudioModule.h
|
||||
kiwano-audio.h
|
||||
libraries.cpp
|
||||
libraries.h
|
||||
Sound.cpp
|
||||
Sound.h
|
||||
SoundPlayer.cpp
|
||||
SoundPlayer.h
|
||||
Transcoder.cpp
|
||||
Transcoder.h)
|
||||
|
||||
add_library(libkiwanoaudio ${SOURCE_FILES})
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
include_directories(..)
|
||||
|
||||
set(SOURCE_FILES
|
||||
imgui_impl/imgui_impl.h
|
||||
imgui_impl/imgui_impl_dx10.cpp
|
||||
imgui_impl/imgui_impl_dx10.h
|
||||
imgui_impl/imgui_impl_dx11.cpp
|
||||
imgui_impl/imgui_impl_dx11.h
|
||||
ImGuiLayer.cpp
|
||||
ImGuiLayer.h
|
||||
ImGuiModule.cpp
|
||||
ImGuiModule.h
|
||||
kiwano-imgui.h)
|
||||
|
||||
add_library(libkiwanoimgui ${SOURCE_FILES})
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
include_directories(..)
|
||||
|
||||
set(SOURCE_FILES
|
||||
HttpModule.cpp
|
||||
HttpModule.h
|
||||
HttpRequest.cpp
|
||||
HttpRequest.h
|
||||
HttpResponse.hpp
|
||||
kiwano-network.h)
|
||||
|
||||
add_library(libkiwanonetwork ${SOURCE_FILES})
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
include_directories(..)
|
||||
include_directories(../3rd-party)
|
||||
|
||||
set(SOURCE_FILES
|
||||
Contact.cpp
|
||||
Contact.h
|
||||
ContactEdge.cpp
|
||||
ContactEdge.h
|
||||
ContactEvent.cpp
|
||||
ContactEvent.h
|
||||
Fixture.cpp
|
||||
Fixture.h
|
||||
Global.cpp
|
||||
Global.h
|
||||
Joint.cpp
|
||||
Joint.h
|
||||
kiwano-physics.h
|
||||
PhysicBody.cpp
|
||||
PhysicBody.h
|
||||
PhysicWorld.cpp
|
||||
PhysicWorld.h)
|
||||
|
||||
add_library(libkiwanophysics ${SOURCE_FILES})
|
||||
|
||||
target_link_libraries(libkiwanophysics libbox2d)
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,175 @@
|
|||
include_directories(..)
|
||||
|
||||
set(SOURCE_FILES
|
||||
2d/action/Action.cpp
|
||||
2d/action/Action.h
|
||||
2d/action/ActionDelay.cpp
|
||||
2d/action/ActionDelay.h
|
||||
2d/action/ActionGroup.cpp
|
||||
2d/action/ActionGroup.h
|
||||
2d/action/ActionHelper.h
|
||||
2d/action/ActionManager.cpp
|
||||
2d/action/ActionManager.h
|
||||
2d/action/ActionTween.cpp
|
||||
2d/action/ActionTween.h
|
||||
2d/action/ActionWalk.cpp
|
||||
2d/action/ActionWalk.h
|
||||
2d/action/Animation.cpp
|
||||
2d/action/Animation.h
|
||||
2d/Actor.cpp
|
||||
2d/Actor.h
|
||||
2d/Button.cpp
|
||||
2d/Button.h
|
||||
2d/Canvas.cpp
|
||||
2d/Canvas.h
|
||||
2d/Component.cpp
|
||||
2d/Component.h
|
||||
2d/DebugActor.cpp
|
||||
2d/DebugActor.h
|
||||
2d/GifSprite.cpp
|
||||
2d/GifSprite.h
|
||||
2d/LayerActor.cpp
|
||||
2d/LayerActor.h
|
||||
2d/ShapeActor.cpp
|
||||
2d/ShapeActor.h
|
||||
2d/Sprite.cpp
|
||||
2d/Sprite.h
|
||||
2d/Stage.cpp
|
||||
2d/Stage.h
|
||||
2d/TextActor.cpp
|
||||
2d/TextActor.h
|
||||
2d/Transition.cpp
|
||||
2d/Transition.h
|
||||
core/event/Event.cpp
|
||||
core/event/Event.h
|
||||
core/event/EventType.h
|
||||
core/event/KeyEvent.cpp
|
||||
core/event/KeyEvent.h
|
||||
core/event/MouseEvent.cpp
|
||||
core/event/MouseEvent.h
|
||||
core/event/WindowEvent.cpp
|
||||
core/event/WindowEvent.h
|
||||
core/Allocator.cpp
|
||||
core/Allocator.h
|
||||
core/Any.h
|
||||
core/Cloneable.h
|
||||
core/Common.h
|
||||
core/Director.cpp
|
||||
core/Director.h
|
||||
core/EventDispatcher.cpp
|
||||
core/EventDispatcher.h
|
||||
core/EventListener.cpp
|
||||
core/EventListener.h
|
||||
core/Exception.cpp
|
||||
core/Exception.h
|
||||
core/Function.h
|
||||
core/IntrusiveList.h
|
||||
core/Json.h
|
||||
core/Keys.h
|
||||
core/Library.cpp
|
||||
core/Library.h
|
||||
core/Logger.cpp
|
||||
core/Logger.h
|
||||
core/Module.cpp
|
||||
core/Module.h
|
||||
core/ObjectBase.cpp
|
||||
core/ObjectBase.h
|
||||
core/RefCounter.cpp
|
||||
core/RefCounter.h
|
||||
core/Resource.cpp
|
||||
core/Resource.h
|
||||
core/Serializable.h
|
||||
core/Singleton.h
|
||||
core/SmartPtr.hpp
|
||||
core/String.cpp
|
||||
core/String.h
|
||||
core/Time.cpp
|
||||
core/Time.h
|
||||
core/Timer.cpp
|
||||
core/Timer.h
|
||||
core/TimerManager.cpp
|
||||
core/TimerManager.h
|
||||
core/Xml.h
|
||||
math/Constants.h
|
||||
math/EaseFunctions.h
|
||||
math/Math.h
|
||||
math/Matrix.hpp
|
||||
math/Random.h
|
||||
math/Rect.hpp
|
||||
math/Scalar.h
|
||||
math/Transform.hpp
|
||||
math/Vec2.hpp
|
||||
platform/win32/ComPtr.hpp
|
||||
platform/win32/libraries.cpp
|
||||
platform/win32/libraries.h
|
||||
platform/win32/WindowImpl.cpp
|
||||
platform/Application.cpp
|
||||
platform/Application.h
|
||||
platform/FileSystem.cpp
|
||||
platform/FileSystem.h
|
||||
platform/Input.cpp
|
||||
platform/Input.h
|
||||
platform/Runner.cpp
|
||||
platform/Runner.h
|
||||
platform/Window.cpp
|
||||
platform/Window.h
|
||||
render/DirectX/D2DDeviceResources.cpp
|
||||
render/DirectX/D2DDeviceResources.h
|
||||
render/DirectX/D3D10DeviceResources.cpp
|
||||
render/DirectX/D3D10DeviceResources.h
|
||||
render/DirectX/D3D11DeviceResources.cpp
|
||||
render/DirectX/D3D11DeviceResources.h
|
||||
render/DirectX/D3DDeviceResourcesBase.h
|
||||
render/DirectX/FontCollectionLoader.cpp
|
||||
render/DirectX/FontCollectionLoader.h
|
||||
render/DirectX/helper.h
|
||||
render/DirectX/NativePtr.h
|
||||
render/DirectX/RenderContextImpl.cpp
|
||||
render/DirectX/RenderContextImpl.h
|
||||
render/DirectX/RendererImpl.cpp
|
||||
render/DirectX/RendererImpl.h
|
||||
render/DirectX/TextRenderer.cpp
|
||||
render/DirectX/TextRenderer.h
|
||||
render/Brush.cpp
|
||||
render/Brush.h
|
||||
render/Color.cpp
|
||||
render/Color.h
|
||||
render/Font.cpp
|
||||
render/Font.h
|
||||
render/Frame.cpp
|
||||
render/Frame.h
|
||||
render/FrameSequence.cpp
|
||||
render/FrameSequence.h
|
||||
render/GifImage.cpp
|
||||
render/GifImage.h
|
||||
render/Layer.cpp
|
||||
render/Layer.h
|
||||
render/NativeObject.h
|
||||
render/RenderContext.cpp
|
||||
render/RenderContext.h
|
||||
render/Renderer.cpp
|
||||
render/Renderer.h
|
||||
render/Shape.cpp
|
||||
render/Shape.h
|
||||
render/ShapeMaker.cpp
|
||||
render/ShapeMaker.h
|
||||
render/StrokeStyle.cpp
|
||||
render/StrokeStyle.h
|
||||
render/TextLayout.cpp
|
||||
render/TextLayout.h
|
||||
render/TextStyle.hpp
|
||||
render/Texture.cpp
|
||||
render/Texture.h
|
||||
render/TextureCache.cpp
|
||||
render/TextureCache.h
|
||||
utils/LocalStorage.cpp
|
||||
utils/LocalStorage.h
|
||||
utils/ResourceCache.cpp
|
||||
utils/ResourceCache.h
|
||||
utils/UserData.cpp
|
||||
utils/UserData.h
|
||||
config.h
|
||||
kiwano.h
|
||||
macros.h)
|
||||
|
||||
add_library(libkiwano ${SOURCE_FILES})
|
||||
|
|
@ -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