From 7499e1af7f24f773550cb2f4e70d5d53976e2c24 Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Thu, 24 May 2018 00:58:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Exception=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Action/Animate.cpp | 1 + core/Action/JumpBy.cpp | 1 + core/Action/JumpTo.cpp | 1 + core/Action/MoveBy.cpp | 1 + core/Action/MoveTo.cpp | 1 + core/Action/OpacityBy.cpp | 1 + core/Action/OpacityTo.cpp | 1 + core/Action/RotateBy.cpp | 1 + core/Action/RotateTo.cpp | 1 + core/Action/ScaleBy.cpp | 1 + core/Action/ScaleTo.cpp | 1 + core/Base/Game.cpp | 17 +- core/Collider/Collision.cpp | 12 +- core/Common/Scene.cpp | 2 +- core/Custom/Exception.cpp | 37 ++++ core/Manager/ActionManager.cpp | 1 + core/Node/Node.cpp | 12 +- core/e2daction.h | 14 +- core/e2dbase.h | 14 +- core/e2dcollider.h | 8 +- core/e2dcommon.h | 16 +- core/e2dcustom.h | 298 ++++++++++++++------------ core/e2dmanager.h | 14 +- core/e2dnode.h | 8 +- core/e2dtool.h | 12 +- core/e2dtransition.h | 2 +- project/vs2017/Easy2D.vcxproj | 1 + project/vs2017/Easy2D.vcxproj.filters | 3 + 28 files changed, 285 insertions(+), 197 deletions(-) create mode 100644 core/Custom/Exception.cpp diff --git a/core/Action/Animate.cpp b/core/Action/Animate.cpp index 7158815b..00eb8843 100644 --- a/core/Action/Animate.cpp +++ b/core/Action/Animate.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::Animate::Animate() : _frameIndex(0) diff --git a/core/Action/JumpBy.cpp b/core/Action/JumpBy.cpp index f08ded47..7b7102cc 100644 --- a/core/Action/JumpBy.cpp +++ b/core/Action/JumpBy.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::JumpBy::JumpBy(double duration, const Vector & vec, double height, int jumps) : FiniteTimeAction(duration) diff --git a/core/Action/JumpTo.cpp b/core/Action/JumpTo.cpp index 39955320..ea262ada 100644 --- a/core/Action/JumpTo.cpp +++ b/core/Action/JumpTo.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::JumpTo::JumpTo(double duration, const Point & pos, double height, int jumps) : JumpBy(duration, Point(), height, jumps) diff --git a/core/Action/MoveBy.cpp b/core/Action/MoveBy.cpp index 4d214073..4a75063b 100644 --- a/core/Action/MoveBy.cpp +++ b/core/Action/MoveBy.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::MoveBy::MoveBy(double duration, Vector vector) diff --git a/core/Action/MoveTo.cpp b/core/Action/MoveTo.cpp index 5df27af6..308c99c4 100644 --- a/core/Action/MoveTo.cpp +++ b/core/Action/MoveTo.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::MoveTo::MoveTo(double duration, Point pos) : MoveBy(duration, Vector()) diff --git a/core/Action/OpacityBy.cpp b/core/Action/OpacityBy.cpp index 34b746b3..a7acdce9 100644 --- a/core/Action/OpacityBy.cpp +++ b/core/Action/OpacityBy.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::OpacityBy::OpacityBy(double duration, double opacity) diff --git a/core/Action/OpacityTo.cpp b/core/Action/OpacityTo.cpp index 8212c882..ec054f61 100644 --- a/core/Action/OpacityTo.cpp +++ b/core/Action/OpacityTo.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::OpacityTo::OpacityTo(double duration, double opacity) diff --git a/core/Action/RotateBy.cpp b/core/Action/RotateBy.cpp index 3d50571e..aba86b8e 100644 --- a/core/Action/RotateBy.cpp +++ b/core/Action/RotateBy.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::RotateBy::RotateBy(double duration, double rotation) diff --git a/core/Action/RotateTo.cpp b/core/Action/RotateTo.cpp index b72f877e..ee058676 100644 --- a/core/Action/RotateTo.cpp +++ b/core/Action/RotateTo.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::RotateTo::RotateTo(double duration, double rotation) diff --git a/core/Action/ScaleBy.cpp b/core/Action/ScaleBy.cpp index 61a4dbc6..f0ad98dc 100644 --- a/core/Action/ScaleBy.cpp +++ b/core/Action/ScaleBy.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::ScaleBy::ScaleBy(double duration, double scale) diff --git a/core/Action/ScaleTo.cpp b/core/Action/ScaleTo.cpp index 6891815f..c9ac7bb1 100644 --- a/core/Action/ScaleTo.cpp +++ b/core/Action/ScaleTo.cpp @@ -1,4 +1,5 @@ #include "..\e2daction.h" +#include "..\e2dnode.h" e2d::ScaleTo::ScaleTo(double duration, double scale) : ScaleBy(duration, 0, 0) diff --git a/core/Base/Game.cpp b/core/Base/Game.cpp index 0ef0bc7e..07914e0a 100644 --- a/core/Base/Game.cpp +++ b/core/Base/Game.cpp @@ -5,7 +5,7 @@ // 控制游戏终止 -static bool s_bEndGame = false; +static bool s_bEndGame = true; // 控制游戏暂停 static bool s_bPaused = false; // 是否进行过初始化 @@ -127,6 +127,8 @@ int e2d::Game::start(bool autoRelease/* true */) // 初始化计时 Time::__init(); + s_bEndGame = false; + while (!s_bEndGame) { // 处理窗口消息 @@ -154,6 +156,8 @@ int e2d::Game::start(bool autoRelease/* true */) } } + s_bEndGame = true; + if (autoRelease) { Game::destroy(); @@ -178,11 +182,12 @@ void e2d::Game::resume() void e2d::Game::reset() { - // 刷新当前时间 - Time::__reset(); - // 重置动作和定时器 - ActionManager::__resetAll(); - Timer::__resetAll(); + if (s_bInitialized && !s_bEndGame) + { + Time::__reset(); + ActionManager::__resetAll(); + Timer::__resetAll(); + } } bool e2d::Game::isPaused() diff --git a/core/Collider/Collision.cpp b/core/Collider/Collision.cpp index 46179c83..a7f95aa7 100644 --- a/core/Collider/Collision.cpp +++ b/core/Collider/Collision.cpp @@ -4,13 +4,11 @@ typedef std::pair HashPair; -// 监听器容器 -static std::vector s_vListeners; -// 碰撞触发状态 -static bool s_bCollisionEnable = false; -static e2d::Node * s_pActiveNode = nullptr; -static e2d::Node * s_pPassiveNode = nullptr; -static std::set s_sCollisionList; +static std::vector s_vListeners; // 监听器容器 +static bool s_bCollisionEnable = false; // 碰撞触发状态 +static e2d::Node * s_pActiveNode = nullptr; // 主动碰撞体 +static e2d::Node * s_pPassiveNode = nullptr; // 被动碰撞体 +static std::set s_sCollisionList; // 碰撞映射 void e2d::Collision::addName(const String & name1, const String & name2) diff --git a/core/Common/Scene.cpp b/core/Common/Scene.cpp index 62de7caf..02f5d8ac 100644 --- a/core/Common/Scene.cpp +++ b/core/Common/Scene.cpp @@ -15,7 +15,7 @@ e2d::Scene::Scene() } else { - // TODO: 抛出一个异常 + throw Exception(L"场景根节点构造失败!"); } } diff --git a/core/Custom/Exception.cpp b/core/Custom/Exception.cpp new file mode 100644 index 00000000..d3a579de --- /dev/null +++ b/core/Custom/Exception.cpp @@ -0,0 +1,37 @@ +#include "..\e2dcustom.h" + + +e2d::Exception::Exception() + : _message() +{ +} + +e2d::Exception::Exception(String message) + : _message(message) +{ +} + +e2d::Exception::Exception(Exception const& other) + : _message(other._message) +{ +} + +e2d::Exception& e2d::Exception::operator=(Exception const& other) +{ + if (this == &other) + { + return *this; + } + + _message = other._message; + return *this; +} + +e2d::Exception::~Exception() +{ +} + +e2d::String e2d::Exception::msg() const +{ + return _message; +} diff --git a/core/Manager/ActionManager.cpp b/core/Manager/ActionManager.cpp index be9dde77..550c88e6 100644 --- a/core/Manager/ActionManager.cpp +++ b/core/Manager/ActionManager.cpp @@ -1,5 +1,6 @@ #include "..\e2dmanager.h" #include "..\e2daction.h" +#include "..\e2dnode.h" static std::vector s_vActions; static std::vector s_vRunningActions; diff --git a/core/Node/Node.cpp b/core/Node/Node.cpp index 5c501059..a90fab62 100644 --- a/core/Node/Node.cpp +++ b/core/Node/Node.cpp @@ -596,13 +596,17 @@ void e2d::Node::addChild(Node * child, int order /* = 0 */) if (child) { - // TODO: 抛出一个异常 - ASSERT(child->_parent == nullptr, "Node already added. It can't be added again!"); + if (child->_parent != nullptr) + { + throw Exception(L"节点已有父节点, 不能再添加到其他节点!"); + } for (Node * parent = this; parent != nullptr; parent = parent->getParent()) { - // TODO: 抛出一个异常 - ASSERT(child != parent, "A Node cannot be the child of his own children!"); + if (child == parent) + { + throw Exception(L"一个节点不能同时是另一个节点的父节点和子节点!"); + } } _children.push_back(child); diff --git a/core/e2daction.h b/core/e2daction.h index fd1653f5..802ef953 100644 --- a/core/e2daction.h +++ b/core/e2daction.h @@ -1,24 +1,26 @@ #pragma once -#include "e2dnode.h" +#include "e2dcommon.h" +#include "e2dbase.h" namespace e2d { -class ActionManager; +class Node; class Loop; class Sequence; class Spawn; +class ActionManager; // 基础动作 class Action : public Object { - friend ActionManager; - friend Loop; - friend Sequence; - friend Spawn; + friend class ActionManager; + friend class Loop; + friend class Sequence; + friend class Spawn; public: Action(); diff --git a/core/e2dbase.h b/core/e2dbase.h index cd1ea851..ce2bf3c2 100644 --- a/core/e2dbase.h +++ b/core/e2dbase.h @@ -51,7 +51,7 @@ public: // 窗口控制 class Window { - friend Game; + friend class Game; public: // 鼠标指针样式 @@ -147,7 +147,7 @@ private: // 时间控制 class Time { - friend Game; + friend class Game; public: // 获取上一帧与当前帧的时间间隔(秒) @@ -188,7 +188,7 @@ class Listener; // 输入控制 class Input { - friend Game; + friend class Game; public: // 鼠标键值 @@ -375,8 +375,8 @@ private: // 渲染器 class Renderer { - friend Game; - friend Window; + friend class Game; + friend class Window; public: // 获取背景色 @@ -437,8 +437,8 @@ private: // 垃圾回收装置 class GC { - friend Game; - friend Object; + friend class Game; + friend class Object; public: // 创建可自动回收内存的对象 diff --git a/core/e2dcollider.h b/core/e2dcollider.h index 7818e577..bcf45348 100644 --- a/core/e2dcollider.h +++ b/core/e2dcollider.h @@ -13,8 +13,8 @@ class ColliderManager; // 碰撞事件 class Collision { - friend Game; - friend ColliderManager; + friend class Game; + friend class ColliderManager; public: // 添加可互相碰撞物体的名称 @@ -123,8 +123,8 @@ private: class Collider : public Object { - friend ColliderManager; - friend Node; + friend class ColliderManager; + friend class Node; public: // 碰撞体类别 diff --git a/core/e2dcommon.h b/core/e2dcommon.h index 81b67cef..343ea0a0 100644 --- a/core/e2dcommon.h +++ b/core/e2dcommon.h @@ -227,8 +227,8 @@ public: String operator+ (const wchar_t *); // 友元运算符 - friend String operator+ (const char *, const String &); - friend String operator+ (const wchar_t*, const String &); + friend class String operator+ (const char *, const String &); + friend class String operator+ (const wchar_t*, const String &); // 类型转换操作符 operator const wchar_t* () const; @@ -260,11 +260,11 @@ public: // 其他运算符 wchar_t& operator[] (int); - friend std::ostream& operator<< (std::ostream &, const String &); - friend std::wostream& operator<< (std::wostream &, const String &); + friend class std::ostream& operator<< (std::ostream &, const String &); + friend class std::wostream& operator<< (std::wostream &, const String &); - friend std::istream& operator>> (std::istream &, String &); - friend std::wistream& operator>> (std::wistream &, String &); + friend class std::istream& operator>> (std::istream &, String &); + friend class std::wistream& operator>> (std::wistream &, String &); private: std::wstring _str; @@ -571,8 +571,8 @@ class Transition; class Scene : public Object { - friend SceneManager; - friend Transition; + friend class SceneManager; + friend class Transition; public: Scene(); diff --git a/core/e2dcustom.h b/core/e2dcustom.h index a6534ff8..717c6ff2 100644 --- a/core/e2dcustom.h +++ b/core/e2dcustom.h @@ -4,156 +4,182 @@ namespace e2d { - template - inline void SafeRelease(Interface*& p) + + +template +inline void SafeRelease(Interface*& p) +{ + if (p != nullptr) { - if (p != nullptr) - { - p->Release(); - p = nullptr; - } + p->Release(); + p = nullptr; } - - class Music; - - // 音源回调 - class VoiceCallback - : public IXAudio2VoiceCallback - { - public: - VoiceCallback(Music * music); - ~VoiceCallback(); - - void __stdcall OnStreamEnd(); - - void __stdcall OnBufferEnd( - void * pBufferContext - ); - - void __stdcall OnBufferStart( - void * pBufferContext - ); - - void __stdcall OnLoopEnd( - void * pBufferContext - ); - - void __stdcall OnVoiceProcessingPassEnd(); - - void __stdcall OnVoiceProcessingPassStart( - UINT32 SamplesRequired - ); - - void __stdcall OnVoiceError( - void * pBufferContext, - HRESULT Error - ); - - void SetFuncOnStreamEnd( - const Function& func - ); - - void SetFuncOnLoopEnd( - const Function& func - ); - - protected: - Music * _music; - Function _loopEndFunc; - Function _streamEndFunc; - }; +} - // 文字渲染器 - class TextRenderer - : public IDWriteTextRenderer - { - public: - TextRenderer( - ID2D1Factory* pD2DFactory, - ID2D1HwndRenderTarget* pRT, - ID2D1SolidColorBrush* pBrush - ); +class Music; - ~TextRenderer(); +// 音源回调 +class VoiceCallback + : public IXAudio2VoiceCallback +{ +public: + VoiceCallback(Music * music); + ~VoiceCallback(); - STDMETHOD_(void, SetTextStyle)( - CONST D2D1_COLOR_F &fillColor, - BOOL hasOutline, - CONST D2D1_COLOR_F &outlineColor, - FLOAT outlineWidth, - D2D1_LINE_JOIN outlineJoin - ); + void __stdcall OnStreamEnd(); - STDMETHOD(DrawGlyphRun)( - __maybenull void* clientDrawingContext, - FLOAT baselineOriginX, - FLOAT baselineOriginY, - DWRITE_MEASURING_MODE measuringMode, - __in DWRITE_GLYPH_RUN const* glyphRun, - __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription, - IUnknown* clientDrawingEffect - ); + void __stdcall OnBufferEnd( + void * pBufferContext + ); - STDMETHOD(DrawUnderline)( - __maybenull void* clientDrawingContext, - FLOAT baselineOriginX, - FLOAT baselineOriginY, - __in DWRITE_UNDERLINE const* underline, - IUnknown* clientDrawingEffect - ); + void __stdcall OnBufferStart( + void * pBufferContext + ); - STDMETHOD(DrawStrikethrough)( - __maybenull void* clientDrawingContext, - FLOAT baselineOriginX, - FLOAT baselineOriginY, - __in DWRITE_STRIKETHROUGH const* strikethrough, - IUnknown* clientDrawingEffect - ); + void __stdcall OnLoopEnd( + void * pBufferContext + ); - STDMETHOD(DrawInlineObject)( - __maybenull void* clientDrawingContext, - FLOAT originX, - FLOAT originY, - IDWriteInlineObject* inlineObject, - BOOL isSideways, - BOOL isRightToLeft, - IUnknown* clientDrawingEffect - ); + void __stdcall OnVoiceProcessingPassEnd(); - STDMETHOD(IsPixelSnappingDisabled)( - __maybenull void* clientDrawingContext, - __out BOOL* isDisabled - ); + void __stdcall OnVoiceProcessingPassStart( + UINT32 SamplesRequired + ); - STDMETHOD(GetCurrentTransform)( - __maybenull void* clientDrawingContext, - __out DWRITE_MATRIX* transform - ); + void __stdcall OnVoiceError( + void * pBufferContext, + HRESULT Error + ); - STDMETHOD(GetPixelsPerDip)( - __maybenull void* clientDrawingContext, - __out FLOAT* pixelsPerDip - ); + void SetFuncOnStreamEnd( + const Function& func + ); - public: - unsigned long STDMETHODCALLTYPE AddRef(); - unsigned long STDMETHODCALLTYPE Release(); - HRESULT STDMETHODCALLTYPE QueryInterface( - IID const& riid, - void** ppvObject - ); + void SetFuncOnLoopEnd( + const Function& func + ); - private: - unsigned long cRefCount_; - D2D1_COLOR_F sFillColor_; - D2D1_COLOR_F sOutlineColor_; - FLOAT fOutlineWidth; - BOOL bShowOutline_; - D2D1_LINE_JOIN nOutlineJoin_; - ID2D1Factory* pD2DFactory_; - ID2D1HwndRenderTarget* pRT_; - ID2D1SolidColorBrush* pBrush_; - }; +protected: + Music * _music; + Function _loopEndFunc; + Function _streamEndFunc; +}; + + +// 文字渲染器 +class TextRenderer + : public IDWriteTextRenderer +{ +public: + TextRenderer( + ID2D1Factory* pD2DFactory, + ID2D1HwndRenderTarget* pRT, + ID2D1SolidColorBrush* pBrush + ); + + ~TextRenderer(); + + STDMETHOD_(void, SetTextStyle)( + CONST D2D1_COLOR_F &fillColor, + BOOL hasOutline, + CONST D2D1_COLOR_F &outlineColor, + FLOAT outlineWidth, + D2D1_LINE_JOIN outlineJoin + ); + + STDMETHOD(DrawGlyphRun)( + __maybenull void* clientDrawingContext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + DWRITE_MEASURING_MODE measuringMode, + __in DWRITE_GLYPH_RUN const* glyphRun, + __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription, + IUnknown* clientDrawingEffect + ); + + STDMETHOD(DrawUnderline)( + __maybenull void* clientDrawingContext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + __in DWRITE_UNDERLINE const* underline, + IUnknown* clientDrawingEffect + ); + + STDMETHOD(DrawStrikethrough)( + __maybenull void* clientDrawingContext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + __in DWRITE_STRIKETHROUGH const* strikethrough, + IUnknown* clientDrawingEffect + ); + + STDMETHOD(DrawInlineObject)( + __maybenull void* clientDrawingContext, + FLOAT originX, + FLOAT originY, + IDWriteInlineObject* inlineObject, + BOOL isSideways, + BOOL isRightToLeft, + IUnknown* clientDrawingEffect + ); + + STDMETHOD(IsPixelSnappingDisabled)( + __maybenull void* clientDrawingContext, + __out BOOL* isDisabled + ); + + STDMETHOD(GetCurrentTransform)( + __maybenull void* clientDrawingContext, + __out DWRITE_MATRIX* transform + ); + + STDMETHOD(GetPixelsPerDip)( + __maybenull void* clientDrawingContext, + __out FLOAT* pixelsPerDip + ); + +public: + unsigned long STDMETHODCALLTYPE AddRef(); + unsigned long STDMETHODCALLTYPE Release(); + HRESULT STDMETHODCALLTYPE QueryInterface( + IID const& riid, + void** ppvObject + ); + +private: + unsigned long cRefCount_; + D2D1_COLOR_F sFillColor_; + D2D1_COLOR_F sOutlineColor_; + FLOAT fOutlineWidth; + BOOL bShowOutline_; + D2D1_LINE_JOIN nOutlineJoin_; + ID2D1Factory* pD2DFactory_; + ID2D1HwndRenderTarget* pRT_; + ID2D1SolidColorBrush* pBrush_; +}; + + +// 异常 +class Exception +{ +public: + + Exception() throw(); + + explicit Exception(String message) throw(); + + Exception(Exception const& other) throw(); + + virtual ~Exception() throw(); + + Exception& operator=(Exception const& other) throw(); + + // 获取异常信息 + virtual String msg() const; + +private: + String _message; +}; } \ No newline at end of file diff --git a/core/e2dmanager.h b/core/e2dmanager.h index 6fa889e7..bf3e41fa 100644 --- a/core/e2dmanager.h +++ b/core/e2dmanager.h @@ -19,8 +19,8 @@ class Transition; // 场景管理器 class SceneManager { - friend Game; - friend Renderer; + friend class Game; + friend class Renderer; public: // 切换场景 @@ -65,9 +65,9 @@ private: // 动作管理器 class ActionManager { - friend Game; - friend Node; - friend Action; + friend class Game; + friend class Node; + friend class Action; public: // 执行动作 @@ -154,8 +154,8 @@ private: // 碰撞体管理器 class ColliderManager { - friend Node; - friend Collider; + friend class Node; + friend class Collider; private: // 更新碰撞体 diff --git a/core/e2dnode.h b/core/e2dnode.h index 25c166a2..14bf4f65 100644 --- a/core/e2dnode.h +++ b/core/e2dnode.h @@ -13,10 +13,10 @@ class ColliderManager; class Node : public Object { - friend Scene; - friend Collider; - friend Transition; - friend ColliderManager; + friend class Scene; + friend class Collider; + friend class Transition; + friend class ColliderManager; public: // 节点属性 diff --git a/core/e2dtool.h b/core/e2dtool.h index ed5e6560..7965d910 100644 --- a/core/e2dtool.h +++ b/core/e2dtool.h @@ -52,7 +52,7 @@ private: class Music : public Object { - friend Game; + friend class Game; public: Music(); @@ -162,7 +162,7 @@ protected: // 音乐播放器 class Player { - friend Game; + friend class Game; public: // 预加载音乐资源 @@ -258,7 +258,7 @@ private: // 定时器 class Timer { - friend Game; + friend class Game; public: // 启动定时器(每帧执行一次) @@ -324,8 +324,8 @@ class Collision; class Listener : public Object { - friend Input; - friend Collision; + friend class Input; + friend class Collision; public: Listener(); @@ -447,7 +447,7 @@ public: // 路径工具 class Path { - friend Game; + friend class Game; public: // 获取数据的默认保存路径 diff --git a/core/e2dtransition.h b/core/e2dtransition.h index 54f48466..d7af7b9e 100644 --- a/core/e2dtransition.h +++ b/core/e2dtransition.h @@ -12,7 +12,7 @@ class SceneManager; class Transition : public Object { - friend SceneManager; + friend class SceneManager; public: Transition(double duration); diff --git a/project/vs2017/Easy2D.vcxproj b/project/vs2017/Easy2D.vcxproj index d4a49414..d8e346ac 100644 --- a/project/vs2017/Easy2D.vcxproj +++ b/project/vs2017/Easy2D.vcxproj @@ -236,6 +236,7 @@ + diff --git a/project/vs2017/Easy2D.vcxproj.filters b/project/vs2017/Easy2D.vcxproj.filters index 8a9b77fd..738c27b9 100644 --- a/project/vs2017/Easy2D.vcxproj.filters +++ b/project/vs2017/Easy2D.vcxproj.filters @@ -237,6 +237,9 @@ Common + + Custom +