From dff97d82493d39ff24621a661d684e7685e8d52a Mon Sep 17 00:00:00 2001 From: Nomango Date: Mon, 3 Feb 2020 11:11:43 +0800 Subject: [PATCH] [deploy] Remove PathShapeActor --- src/kiwano/2d/ShapeActor.cpp | 49 ----------------- src/kiwano/2d/ShapeActor.h | 53 ------------------- src/kiwano/2d/action/ActionWalk.cpp | 36 ------------- src/kiwano/2d/action/ActionWalk.h | 41 -------------- src/kiwano/macros.h | 6 ++- src/kiwano/math/Matrix.hpp | 6 +-- src/kiwano/platform/win32/StackWalker.cpp | 8 +-- .../render/DirectX/D3D11DeviceResources.cpp | 6 +-- 8 files changed, 15 insertions(+), 190 deletions(-) diff --git a/src/kiwano/2d/ShapeActor.cpp b/src/kiwano/2d/ShapeActor.cpp index ce2b5548..53850bb7 100644 --- a/src/kiwano/2d/ShapeActor.cpp +++ b/src/kiwano/2d/ShapeActor.cpp @@ -219,53 +219,4 @@ void PolygonActor::SetVertices(Vector const& points) } } -//------------------------------------------------------- -// PathShapeActor -//------------------------------------------------------- - -PathShapeActor::PathShapeActor() {} - -PathShapeActor::~PathShapeActor() {} - -void PathShapeActor::BeginPath(Point const& begin_pos) -{ - sink_.BeginPath(begin_pos); -} - -void PathShapeActor::EndPath(bool closed) -{ - sink_.EndPath(closed); - Geometry geo = sink_.GetGeometry(); - - if (geo.IsValid()) - { - SetGeometry(geo); - } -} - -void PathShapeActor::AddLine(Point const& point) -{ - sink_.AddLine(point); -} - -void PathShapeActor::AddLines(Vector const& points) -{ - sink_.AddLines(points); -} - -void PathShapeActor::AddBezier(Point const& point1, Point const& point2, Point const& point3) -{ - sink_.AddBezier(point1, point2, point3); -} - -void PathShapeActor::AddArc(Point const& point, Size const& radius, float rotation, bool clockwise, bool is_small) -{ - sink_.AddArc(point, radius, rotation, clockwise, is_small); -} - -void PathShapeActor::ClearPath() -{ - SetGeometry(Geometry()); -} - } // namespace kiwano diff --git a/src/kiwano/2d/ShapeActor.h b/src/kiwano/2d/ShapeActor.h index be55d7c8..0f21b922 100644 --- a/src/kiwano/2d/ShapeActor.h +++ b/src/kiwano/2d/ShapeActor.h @@ -34,7 +34,6 @@ KGE_DECLARE_SMART_PTR(RoundRectActor); KGE_DECLARE_SMART_PTR(CircleActor); KGE_DECLARE_SMART_PTR(EllipseActor); KGE_DECLARE_SMART_PTR(PolygonActor); -KGE_DECLARE_SMART_PTR(PathShapeActor); /** * \addtogroup Actors @@ -289,58 +288,6 @@ public: void SetVertices(Vector const& points); }; -/// \~chinese -/// @brief 路径图形角色 -class KGE_API PathShapeActor : public ShapeActor -{ -public: - PathShapeActor(); - - virtual ~PathShapeActor(); - - /// \~chinese - /// @brief 开始添加路径 - /// @param begin_pos 起始点 - void BeginPath(Point const& begin_pos = Point()); - - /// \~chinese - /// @brief 结束添加路径 - /// @param closed 路径是否闭合 - void EndPath(bool closed = true); - - /// \~chinese - /// @brief 添加一条线段 - /// @param point 线段端点 - void AddLine(Point const& point); - - /// \~chinese - /// @brief 添加多条线段 - /// @param points 线段端点集合 - void AddLines(Vector const& points); - - /// \~chinese - /// @brief 添加一条三次方贝塞尔曲线 - /// @param point1 贝塞尔曲线的第一个控制点 - /// @param point2 贝塞尔曲线的第二个控制点 - /// @param point3 贝塞尔曲线的终点 - void AddBezier(Point const& point1, Point const& point2, Point const& point3); - - /// \~chinese - /// @brief 添加弧线 - /// @param point 椭圆圆心 - /// @param radius 椭圆半径 - /// @param rotation 椭圆旋转角度 - /// @param clockwise 顺时针 or 逆时针 - /// @param is_small 是否取小于 180° 的弧 - void AddArc(Point const& point, Size const& radius, float rotation, bool clockwise = true, bool is_small = true); - - /// \~chinese - /// @brief 清除路径 - void ClearPath(); - -private: - GeometrySink sink_; -}; /** @} */ diff --git a/src/kiwano/2d/action/ActionWalk.cpp b/src/kiwano/2d/action/ActionWalk.cpp index 0c29953a..1041f376 100644 --- a/src/kiwano/2d/action/ActionWalk.cpp +++ b/src/kiwano/2d/action/ActionWalk.cpp @@ -88,40 +88,4 @@ void ActionWalk::UpdateTween(Actor* target, float percent) } } -void ActionWalk::BeginPath() -{ - sink_.BeginPath(); -} - -void ActionWalk::EndPath(bool closed) -{ - sink_.EndPath(closed); - path_ = sink_.GetGeometry(); -} - -void ActionWalk::AddLine(Point const& point) -{ - sink_.AddLine(point); -} - -void ActionWalk::AddLines(Vector const& points) -{ - sink_.AddLines(points); -} - -void ActionWalk::AddBezier(Point const& point1, Point const& point2, Point const& point3) -{ - sink_.AddBezier(point1, point2, point3); -} - -void ActionWalk::AddArc(Point const& point, Size const& radius, float rotation, bool clockwise, bool is_small) -{ - sink_.AddArc(point, radius, rotation, clockwise, is_small); -} - -void ActionWalk::ClearPath() -{ - path_.Clear(); -} - } // namespace kiwano diff --git a/src/kiwano/2d/action/ActionWalk.h b/src/kiwano/2d/action/ActionWalk.h index fe4ebe46..ddfe18d6 100644 --- a/src/kiwano/2d/action/ActionWalk.h +++ b/src/kiwano/2d/action/ActionWalk.h @@ -65,46 +65,6 @@ public: /// @brief 获取该动画的倒转 ActionPtr Reverse() const override; - /// \~chinese - /// @brief 开始添加路线 - void BeginPath(); - - /// \~chinese - /// @brief 结束路线 - /// @param closed 路线是否闭合 - void EndPath(bool closed = false); - - /// \~chinese - /// @brief 添加一条线段 - /// @param point 线段端点 - void AddLine(Point const& point); - - /// \~chinese - /// @brief 添加多条线段 - /// @param points 端点集合 - void AddLines(Vector const& points); - - /// \~chinese - /// @brief 添加一条三次方贝塞尔曲线 - /// @brief 添加一条三次方贝塞尔曲线 - /// @param point1 贝塞尔曲线的第一个控制点 - /// @param point2 贝塞尔曲线的第二个控制点 - /// @param point3 贝塞尔曲线的终点 - void AddBezier(Point const& point1, Point const& point2, Point const& point3); - - /// \~chinese - /// @brief 添加弧线 - /// @param point 椭圆圆心 - /// @param radius 椭圆半径 - /// @param rotation 椭圆旋转角度 - /// @param clockwise 顺时针 or 逆时针 - /// @param is_small 是否取小于 180° 的弧 - void AddArc(Point const& point, Size const& radius, float rotation, bool clockwise = true, bool is_small = true); - - /// \~chinese - /// @brief 清除路径 - void ClearPath(); - /// \~chinese /// @brief 获取路线 Geometry const& GetPath() const; @@ -125,7 +85,6 @@ private: float length_; Point start_pos_; Geometry path_; - GeometrySink sink_; }; /** @} */ diff --git a/src/kiwano/macros.h b/src/kiwano/macros.h index b7fe3b99..5621a51d 100644 --- a/src/kiwano/macros.h +++ b/src/kiwano/macros.h @@ -100,6 +100,10 @@ #define KGE_DEBUG #endif +#define KGE_SUPPRESS_WARNING_PUSH __pragma(warning(push)) +#define KGE_SUPPRESS_WARNING(CODE) __pragma(warning(disable : CODE)) +#define KGE_SUPPRESS_WARNING_POP __pragma(warning(pop)) + #ifndef KGE_ASSERT #ifdef KGE_DEBUG #define KGE_ASSERT(EXPR) \ @@ -129,7 +133,7 @@ * C++ Standard Library, compiling a debug release (/MTd) and * where the compiler error message refers to _Container_base. */ -#pragma warning(disable : 4251) +KGE_SUPPRESS_WARNING(4251) #endif #define KGE_NOT_USED(VAR) ((void)VAR) diff --git a/src/kiwano/math/Matrix.hpp b/src/kiwano/math/Matrix.hpp index 3a9808e1..9a63d02c 100644 --- a/src/kiwano/math/Matrix.hpp +++ b/src/kiwano/math/Matrix.hpp @@ -85,8 +85,8 @@ struct Matrix3x2T { } -#pragma warning(push) -#pragma warning(disable : 26495) // ignore warning "always initialize member variables" +KGE_SUPPRESS_WARNING_PUSH +KGE_SUPPRESS_WARNING(26495) // ignore warning "always initialize member variables" template Matrix3x2T(_MTy const& other) @@ -95,7 +95,7 @@ struct Matrix3x2T m[i] = other[i]; } -#pragma warning(pop) +KGE_SUPPRESS_WARNING_POP inline value_type operator[](uint32_t index) const { diff --git a/src/kiwano/platform/win32/StackWalker.cpp b/src/kiwano/platform/win32/StackWalker.cpp index eab2b472..c4c1557a 100644 --- a/src/kiwano/platform/win32/StackWalker.cpp +++ b/src/kiwano/platform/win32/StackWalker.cpp @@ -22,10 +22,10 @@ #include #include -#pragma warning(push) -#pragma warning(disable : 4091) -#include -#pragma warning(pop) +KGE_SUPPRESS_WARNING_PUSH +KGE_SUPPRESS_WARNING(4091) +#include // ignored on left of 'type' when no variable is declared +KGE_SUPPRESS_WARNING_POP namespace kiwano { diff --git a/src/kiwano/render/DirectX/D3D11DeviceResources.cpp b/src/kiwano/render/DirectX/D3D11DeviceResources.cpp index 4d5414dc..89a33261 100644 --- a/src/kiwano/render/DirectX/D3D11DeviceResources.cpp +++ b/src/kiwano/render/DirectX/D3D11DeviceResources.cpp @@ -21,10 +21,10 @@ #include #include -#pragma warning(push) -#pragma warning(disable : 4800) +KGE_SUPPRESS_WARNING_PUSH +KGE_SUPPRESS_WARNING(4800) // Implicit conversion from 'type' to bool #include // IsWindows10OrGreater -#pragma warning(pop) +KGE_SUPPRESS_WARNING_POP #pragma comment(lib, "d3d11.lib")