diff --git a/.gitignore b/.gitignore
index c0da8165..86bb91a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,8 @@ Easy2D/Win32/
Easy2D/x64/
/Win32/
/x64/
+Debug/
+Release/
backup/
*.lnk
.vs
\ No newline at end of file
diff --git a/Demo/Demo.vcxproj b/Demo/Demo.vcxproj
new file mode 100644
index 00000000..98bd4630
--- /dev/null
+++ b/Demo/Demo.vcxproj
@@ -0,0 +1,156 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 15.0
+ {9D85A92F-BCCE-4EF0-BAD3-601C0086661C}
+ Win32Proj
+ Demo
+ 10.0.15063.0
+
+
+
+ Application
+ true
+ v141
+ Unicode
+
+
+ Application
+ false
+ v141
+ true
+ Unicode
+
+
+ Application
+ true
+ v141
+ Unicode
+
+
+ Application
+ false
+ v141
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ $(MSBuildProjectDirectory)\..\Win32;$(LibraryPath)
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+
+
+
+ Level3
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ true
+
+
+
+
+
+
+ Level3
+ Disabled
+ _DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ true
+
+
+
+
+
+
+ Level3
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ true
+ true
+ true
+
+
+
+
+
+
+ Level3
+ MaxSpeed
+ true
+ true
+ NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ true
+ true
+ true
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Demo/Demo.vcxproj.filters b/Demo/Demo.vcxproj.filters
new file mode 100644
index 00000000..203a71c4
--- /dev/null
+++ b/Demo/Demo.vcxproj.filters
@@ -0,0 +1,22 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;hm;inl;inc;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ 源文件
+
+
+
\ No newline at end of file
diff --git a/Demo/main.cpp b/Demo/main.cpp
new file mode 100644
index 00000000..22db1191
--- /dev/null
+++ b/Demo/main.cpp
@@ -0,0 +1,24 @@
+#include "..\Easy2D\easy2d.h"
+#pragma comment(lib, "d2d1.lib")
+
+
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
+{
+ EApp app;
+
+ if (app.init(L"Easy2D Demo", 640, 480))
+ {
+ auto scene = new EScene();
+
+ auto node = new ENode();
+ node->setPos(50, 80);
+ node->setSize(30, 180);
+ scene->add(node);
+
+ app.enterScene(scene);
+
+ app.run();
+ }
+
+ return 0;
+}
diff --git a/Easy2D.sln b/Easy2D.sln
index 6b3b67bc..2c6780c3 100644
--- a/Easy2D.sln
+++ b/Easy2D.sln
@@ -1,38 +1,38 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26730.12
+VisualStudioVersion = 15.0.26730.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Easy2D", "Easy2D\Easy2D.vcxproj", "{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo", "Demo\Demo.vcxproj", "{9D85A92F-BCCE-4EF0-BAD3-601C0086661C}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
- DebugW|x64 = DebugW|x64
- DebugW|x86 = DebugW|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
- ReleaseW|x64 = ReleaseW|x64
- ReleaseW|x86 = ReleaseW|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Debug|x64.ActiveCfg = Debug|x64
{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Debug|x64.Build.0 = Debug|x64
+ {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Debug|x64.Deploy.0 = Debug|x64
{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Debug|x86.ActiveCfg = Debug|Win32
{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Debug|x86.Build.0 = Debug|Win32
- {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.DebugW|x64.ActiveCfg = DebugW|x64
- {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.DebugW|x64.Build.0 = DebugW|x64
- {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.DebugW|x86.ActiveCfg = DebugW|Win32
- {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.DebugW|x86.Build.0 = DebugW|Win32
+ {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Debug|x86.Deploy.0 = Debug|Win32
{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Release|x64.ActiveCfg = Release|x64
{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Release|x64.Build.0 = Release|x64
{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Release|x86.ActiveCfg = Release|Win32
{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.Release|x86.Build.0 = Release|Win32
- {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.ReleaseW|x64.ActiveCfg = ReleaseW|x64
- {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.ReleaseW|x64.Build.0 = ReleaseW|x64
- {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.ReleaseW|x86.ActiveCfg = ReleaseW|Win32
- {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}.ReleaseW|x86.Build.0 = ReleaseW|Win32
+ {9D85A92F-BCCE-4EF0-BAD3-601C0086661C}.Debug|x64.ActiveCfg = Debug|x64
+ {9D85A92F-BCCE-4EF0-BAD3-601C0086661C}.Debug|x64.Build.0 = Debug|x64
+ {9D85A92F-BCCE-4EF0-BAD3-601C0086661C}.Debug|x86.ActiveCfg = Debug|Win32
+ {9D85A92F-BCCE-4EF0-BAD3-601C0086661C}.Debug|x86.Build.0 = Debug|Win32
+ {9D85A92F-BCCE-4EF0-BAD3-601C0086661C}.Release|x64.ActiveCfg = Release|x64
+ {9D85A92F-BCCE-4EF0-BAD3-601C0086661C}.Release|x64.Build.0 = Release|x64
+ {9D85A92F-BCCE-4EF0-BAD3-601C0086661C}.Release|x86.ActiveCfg = Release|Win32
+ {9D85A92F-BCCE-4EF0-BAD3-601C0086661C}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Easy2D/Action/Action.cpp b/Easy2D/Action/Action.cpp
deleted file mode 100644
index 1d99e527..00000000
--- a/Easy2D/Action/Action.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-#include "..\easy2d.h"
-#include
-
-Action::Action() :
- m_bRunning(true),
- m_bWaiting(false),
- m_bEnding(false),
- m_bInit(false),
- m_pTargetSprite(nullptr),
- m_pParentScene(nullptr)
-{
- // Ĭ϶ 15ms һ
- setInterval(15);
-}
-
-Action::~Action()
-{
-}
-
-bool Action::isRunning()
-{
- return m_bRunning && !m_bWaiting;
-}
-
-bool Action::isEnding()
-{
- return m_bEnding;
-}
-
-void Action::start()
-{
- m_bRunning = true;
-}
-
-void Action::resume()
-{
- m_bRunning = true;
-}
-
-void Action::pause()
-{
- m_bRunning = false;
-}
-
-void Action::stop()
-{
- m_bEnding = true;
-}
-void Action::wait()
-{
- m_bWaiting = true;
-}
-
-void Action::notify()
-{
- m_bWaiting = false;
-}
-
-void Action::setInterval(LONGLONG milliSeconds)
-{
- // öʱ
- m_nAnimationInterval = milliSeconds;
-}
-
-Action * Action::reverse() const
-{
- assert(0);
- return nullptr;
-}
-
-Sprite * Action::getTarget()
-{
- return m_pTargetSprite;
-}
-
-void Action::_init()
-{
- m_bInit = true;
-}
-
-void Action::_reset()
-{
- m_bInit = false;
- m_bEnding = false;
-}
diff --git a/Easy2D/Action/ActionCallback.cpp b/Easy2D/Action/ActionCallback.cpp
deleted file mode 100644
index c1cf46e1..00000000
--- a/Easy2D/Action/ActionCallback.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "..\easy2d.h"
-
-ActionCallback::ActionCallback(const std::function& callback) :
- m_Callback(callback)
-{
-}
-
-ActionCallback::~ActionCallback()
-{
-}
-
-ActionCallback * ActionCallback::copy() const
-{
- return new ActionCallback(m_Callback);
-}
-
-void ActionCallback::_init()
-{
- Action::_init();
-}
-
-void ActionCallback::_exec(std::chrono::steady_clock::time_point nNow)
-{
- m_Callback();
- this->stop();
-}
-
-void ActionCallback::_reset()
-{
- Action::_reset();
-}
diff --git a/Easy2D/Action/ActionDelay.cpp b/Easy2D/Action/ActionDelay.cpp
deleted file mode 100644
index 4e5c8b6a..00000000
--- a/Easy2D/Action/ActionDelay.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "..\easy2d.h"
-#include "..\Win\winbase.h"
-
-ActionDelay::ActionDelay(float duration)
-{
- setInterval(LONGLONG(duration * 1000));
-}
-
-ActionDelay::~ActionDelay()
-{
-}
-
-ActionDelay * ActionDelay::copy() const
-{
- return new ActionDelay(m_nAnimationInterval / 1000.0f);
-}
-
-void ActionDelay::_init()
-{
- Action::_init();
- // ¼ǰʱ
- m_nLast = steady_clock::now();
-}
-
-void ActionDelay::_exec(steady_clock::time_point nNow)
-{
- // жʱǷ㹻
- if (duration_cast(nNow - m_nLast).count() > m_nAnimationInterval)
- {
- this->stop();
- }
-}
-
-void ActionDelay::_reset()
-{
- Action::_reset();
- // ¼ǰʱ
- m_nLast = steady_clock::now();
-}
diff --git a/Easy2D/Action/ActionFrames.cpp b/Easy2D/Action/ActionFrames.cpp
deleted file mode 100644
index 582bf48b..00000000
--- a/Easy2D/Action/ActionFrames.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-#include "..\easy2d.h"
-#include "..\Win\winbase.h"
-
-ActionFrames::ActionFrames() :
- m_nFrameIndex(0)
-{
- // ֡Ĭ .5s ˢһ
- setInterval(500);
-}
-
-ActionFrames::ActionFrames(LONGLONG frameDelay) :
- m_nFrameIndex(0)
-{
- setInterval(frameDelay);
-}
-
-ActionFrames::~ActionFrames()
-{
- for (auto frame : m_vFrames)
- {
- frame->autoRelease();
- frame->release();
- }
-}
-
-void ActionFrames::_init()
-{
- Action::_init();
- // ¼ǰʱ
- m_nLast = steady_clock::now();
-}
-
-void ActionFrames::_exec(steady_clock::time_point nNow)
-{
- // жʱǷ㹻
- while (duration_cast(nNow - m_nLast).count() > m_nAnimationInterval)
- {
- // ¼¼ʱ
- m_nLast += milliseconds(m_nAnimationInterval);
- m_pTargetSprite->setImage(m_vFrames[m_nFrameIndex]);
- m_nFrameIndex++;
- // ж϶Ƿ
- if (m_nFrameIndex == m_vFrames.size())
- {
- this->stop();
- break;
- }
- }
-}
-
-void ActionFrames::_reset()
-{
- Action::_reset();
- m_nFrameIndex = 0;
- // ¼ǰʱ
- m_nLast = steady_clock::now();
-}
-
-void ActionFrames::addFrame(Image * frame)
-{
- if (frame)
- {
- m_vFrames.push_back(frame);
- frame->retain();
- }
-}
-
-ActionFrames * ActionFrames::copy() const
-{
- auto a = new ActionFrames(this->m_nAnimationInterval);
- for (auto f : m_vFrames)
- {
- a->addFrame(f);
- }
- return a;
-}
-
-ActionFrames * ActionFrames::reverse() const
-{
- auto a = this->copy();
- a->m_vFrames.reserve(m_vFrames.size());
- return a;
-}
diff --git a/Easy2D/Action/ActionMoveBy.cpp b/Easy2D/Action/ActionMoveBy.cpp
deleted file mode 100644
index ebc83a66..00000000
--- a/Easy2D/Action/ActionMoveBy.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "..\easy2d.h"
-#include "..\Win\winbase.h"
-
-ActionMoveBy::ActionMoveBy(float duration, CVector vec) :
- Animation(duration)
-{
- m_MoveVector = vec;
-}
-
-ActionMoveBy::~ActionMoveBy()
-{
-}
-
-void ActionMoveBy::_init()
-{
- Animation::_init();
- m_BeginPos = m_pTargetSprite->getPos();
-}
-
-void ActionMoveBy::_exec(steady_clock::time_point nNow)
-{
- while (Animation::_isDelayEnough(nNow))
- {
- // ƶλ
- float scale = float(m_nDuration) / m_nTotalDuration;
- // ƶ Sprite
- m_pTargetSprite->setPos(int(m_BeginPos.x + m_MoveVector.x * scale),
- int(m_BeginPos.y + m_MoveVector.y * scale));
- // ж϶Ƿ
- if (_isEnd())
- {
- this->stop();
- break;
- }
- }
-}
-
-void ActionMoveBy::_reset()
-{
- Animation::_reset();
-}
-
-ActionMoveBy * ActionMoveBy::copy() const
-{
- return new ActionMoveBy(m_nAnimationInterval / 1000.0f, m_MoveVector);
-}
-
-ActionMoveBy * ActionMoveBy::reverse() const
-{
- return new ActionMoveBy(m_nTotalDuration / 1000.0f, CVector(-m_MoveVector.x, -m_MoveVector.y));
-}
\ No newline at end of file
diff --git a/Easy2D/Action/ActionMoveTo.cpp b/Easy2D/Action/ActionMoveTo.cpp
deleted file mode 100644
index c4249317..00000000
--- a/Easy2D/Action/ActionMoveTo.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "..\easy2d.h"
-
-ActionMoveTo::ActionMoveTo(float duration, CPoint pos) :
- ActionMoveBy(duration, CVector())
-{
- m_EndPos = pos;
-}
-
-ActionMoveTo::~ActionMoveTo()
-{
-}
-
-ActionMoveTo * ActionMoveTo::copy() const
-{
- return new ActionMoveTo(m_nAnimationInterval / 1000.0f, m_EndPos);
-}
-
-void ActionMoveTo::_init()
-{
- ActionMoveBy::_init();
- m_MoveVector = m_EndPos - m_BeginPos;
-}
-
-void ActionMoveTo::_reset()
-{
- ActionMoveBy::_reset();
-}
diff --git a/Easy2D/Action/ActionNeverStop.cpp b/Easy2D/Action/ActionNeverStop.cpp
deleted file mode 100644
index ac11b65c..00000000
--- a/Easy2D/Action/ActionNeverStop.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "..\easy2d.h"
-
-ActionNeverStop::ActionNeverStop(Action * action) :
- m_Action(action)
-{
- m_Action->retain();
-}
-
-ActionNeverStop::~ActionNeverStop()
-{
- SafeRelease(m_Action);
-}
-
-ActionNeverStop * ActionNeverStop::copy() const
-{
- return new ActionNeverStop(m_Action->copy());
-}
-
-void ActionNeverStop::_init()
-{
- Action::_init();
- m_Action->m_pTargetSprite = m_pTargetSprite;
- m_Action->_init();
-}
-
-void ActionNeverStop::_exec(std::chrono::steady_clock::time_point nNow)
-{
- m_Action->_exec(nNow);
-
- if (m_Action->isEnding())
- {
- m_Action->_reset();
- }
-}
-
-void ActionNeverStop::_reset()
-{
- Action::_reset();
-}
diff --git a/Easy2D/Action/ActionOpacityBy.cpp b/Easy2D/Action/ActionOpacityBy.cpp
deleted file mode 100644
index 2d9ea7c0..00000000
--- a/Easy2D/Action/ActionOpacityBy.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "..\easy2d.h"
-#include "..\Win\winbase.h"
-
-ActionOpacityBy::ActionOpacityBy(float duration, float opacity) :
- Animation(duration)
-{
- m_nVariation = opacity;
-}
-
-ActionOpacityBy::~ActionOpacityBy()
-{
-}
-
-void ActionOpacityBy::_init()
-{
- Animation::_init();
- m_nBeginVal = m_pTargetSprite->getOpacity();
-}
-
-void ActionOpacityBy::_exec(steady_clock::time_point nNow)
-{
- while (Animation::_isDelayEnough(nNow))
- {
- // ƶλ
- float scale = float(m_nDuration) / m_nTotalDuration;
- // ƶ Sprite
- m_pTargetSprite->setOpacity(m_nBeginVal + m_nVariation * scale);
- // ж϶Ƿ
- if (_isEnd())
- {
- this->stop();
- break;
- }
- }
-}
-
-void ActionOpacityBy::_reset()
-{
- Animation::_reset();
-}
-
-ActionOpacityBy * ActionOpacityBy::copy() const
-{
- return new ActionOpacityBy(m_nAnimationInterval / 1000.0f, m_nVariation);
-}
-
-ActionOpacityBy * ActionOpacityBy::reverse() const
-{
- return new ActionOpacityBy(m_nTotalDuration / 1000.0f, -m_nVariation);
-}
\ No newline at end of file
diff --git a/Easy2D/Action/ActionOpacityTo.cpp b/Easy2D/Action/ActionOpacityTo.cpp
deleted file mode 100644
index 5bd7c001..00000000
--- a/Easy2D/Action/ActionOpacityTo.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "..\easy2d.h"
-
-ActionOpacityTo::ActionOpacityTo(float duration, float opacity) :
- ActionOpacityBy(duration, 0)
-{
- m_nEndVal = opacity;
-}
-
-ActionOpacityTo::~ActionOpacityTo()
-{
-}
-
-ActionOpacityTo * ActionOpacityTo::copy() const
-{
- return new ActionOpacityTo(m_nAnimationInterval / 1000.0f, m_nEndVal);
-}
-
-void ActionOpacityTo::_init()
-{
- ActionOpacityBy::_init();
- m_nVariation = m_nEndVal - m_nBeginVal;
-}
-
-void ActionOpacityTo::_reset()
-{
- ActionOpacityBy::_reset();
-}
diff --git a/Easy2D/Action/ActionScaleBy.cpp b/Easy2D/Action/ActionScaleBy.cpp
deleted file mode 100644
index b86f0f5c..00000000
--- a/Easy2D/Action/ActionScaleBy.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "..\easy2d.h"
-#include "..\Win\winbase.h"
-
-ActionScaleBy::ActionScaleBy(float duration, float scaleX, float scaleY) :
- Animation(duration)
-{
- m_nVariationX = scaleX;
- m_nVariationY = scaleY;
-}
-
-ActionScaleBy::~ActionScaleBy()
-{
-}
-
-void ActionScaleBy::_init()
-{
- Animation::_init();
- m_nBeginScaleX = m_pTargetSprite->getScaleX();
- m_nBeginScaleY = m_pTargetSprite->getScaleY();
-}
-
-void ActionScaleBy::_exec(steady_clock::time_point nNow)
-{
- while (Animation::_isDelayEnough(nNow))
- {
- // ƶλ
- float scale = float(m_nDuration) / m_nTotalDuration;
- // ƶ Sprite
- m_pTargetSprite->setScale(m_nBeginScaleX + m_nVariationX * scale, m_nBeginScaleX + m_nVariationX * scale);
- // ж϶Ƿ
- if (_isEnd())
- {
- this->stop();
- break;
- }
- }
-}
-
-void ActionScaleBy::_reset()
-{
- Animation::_reset();
-}
-
-ActionScaleBy * ActionScaleBy::copy() const
-{
- return new ActionScaleBy(m_nAnimationInterval / 1000.0f, m_nVariationX, m_nVariationY);
-}
-
-ActionScaleBy * ActionScaleBy::reverse() const
-{
- return new ActionScaleBy(m_nTotalDuration / 1000.0f, -m_nVariationX, -m_nVariationY);
-}
\ No newline at end of file
diff --git a/Easy2D/Action/ActionScaleTo.cpp b/Easy2D/Action/ActionScaleTo.cpp
deleted file mode 100644
index 76b8fdcc..00000000
--- a/Easy2D/Action/ActionScaleTo.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "..\easy2d.h"
-
-ActionScaleTo::ActionScaleTo(float duration, float scaleX, float scaleY) :
- ActionScaleBy(duration, 0, 0)
-{
- m_nEndScaleX = scaleX;
- m_nEndScaleY = scaleY;
-}
-
-ActionScaleTo::~ActionScaleTo()
-{
-}
-
-ActionScaleTo * ActionScaleTo::copy() const
-{
- return new ActionScaleTo(m_nAnimationInterval / 1000.0f, m_nEndScaleX, m_nEndScaleY);
-}
-
-void ActionScaleTo::_init()
-{
- ActionScaleBy::_init();
- m_nVariationX = m_nEndScaleX - m_nBeginScaleX;
- m_nVariationY = m_nEndScaleY - m_nBeginScaleY;
-}
-
-void ActionScaleTo::_reset()
-{
- ActionScaleBy::_reset();
-}
diff --git a/Easy2D/Action/ActionSequence.cpp b/Easy2D/Action/ActionSequence.cpp
deleted file mode 100644
index 911dfde9..00000000
--- a/Easy2D/Action/ActionSequence.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-#include "..\easy2d.h"
-#include
-
-ActionSequence::ActionSequence() :
- m_nActionIndex(0)
-{
-}
-
-ActionSequence::ActionSequence(int number, Action * action1, ...) :
- m_nActionIndex(0)
-{
- va_list params;
- va_start(params, number);
-
- while (number > 0)
- {
- this->addAction(va_arg(params, Action*));
- number--;
- }
-
- va_end(params);
-}
-
-ActionSequence::~ActionSequence()
-{
- for (auto action : m_vActions)
- {
- SafeRelease(action);
- }
-}
-
-void ActionSequence::_init()
-{
- Action::_init();
- // жĿ
- for (auto action : m_vActions)
- {
- action->m_pTargetSprite = m_pTargetSprite;
- }
- // ʼһ
- m_vActions[0]->_init();
-}
-
-void ActionSequence::_exec(std::chrono::steady_clock::time_point nNow)
-{
- m_vActions[m_nActionIndex]->_exec(nNow);
-
- if (m_vActions[m_nActionIndex]->isEnding())
- {
- m_nActionIndex++;
- if (m_nActionIndex == m_vActions.size())
- {
- this->stop();
- }
- else
- {
- m_vActions[m_nActionIndex]->_init();
- }
- }
-}
-
-void ActionSequence::_reset()
-{
- Action::_reset();
- for (auto action : m_vActions)
- {
- action->_reset();
- }
- m_nActionIndex = 0;
-}
-
-void ActionSequence::addAction(Action * action)
-{
- m_vActions.push_back(action);
- action->retain();
-}
-
-ActionSequence * ActionSequence::copy() const
-{
- auto a = new ActionSequence();
- for (auto action : m_vActions)
- {
- a->addAction(action->copy());
- }
- return a;
-}
-
-ActionSequence * ActionSequence::reverse(bool actionReverse) const
-{
- auto a = new ActionSequence();
- for (auto action : a->m_vActions)
- {
- if (actionReverse)
- {
- a->addAction(action->reverse());
- }
- else
- {
- a->addAction(action->copy());
- }
- }
- // ˳
- a->m_vActions.reserve(m_vActions.size());
- return a;
-}
\ No newline at end of file
diff --git a/Easy2D/Action/ActionTwo.cpp b/Easy2D/Action/ActionTwo.cpp
deleted file mode 100644
index 669ebcd4..00000000
--- a/Easy2D/Action/ActionTwo.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "..\easy2d.h"
-
-ActionTwo::ActionTwo(Action * actionFirst, Action * actionSecond) :
- m_FirstAction(actionFirst),
- m_SecondAction(actionSecond)
-{
- m_FirstAction->retain();
- m_SecondAction->retain();
-}
-
-ActionTwo::~ActionTwo()
-{
- SafeRelease(m_FirstAction);
- SafeRelease(m_SecondAction);
-}
-
-ActionTwo * ActionTwo::copy() const
-{
- return new ActionTwo(m_FirstAction->copy(), m_SecondAction->copy());
-}
-
-ActionTwo * ActionTwo::reverse(bool actionReverse) const
-{
- if (actionReverse)
- {
- return new ActionTwo(m_SecondAction->reverse(), m_FirstAction->reverse());
- }
- else
- {
- return new ActionTwo(m_SecondAction->copy(), m_FirstAction->copy());
- }
-}
-
-void ActionTwo::_init()
-{
- Action::_init();
- m_FirstAction->m_pTargetSprite = m_pTargetSprite;
- m_SecondAction->m_pTargetSprite = m_pTargetSprite;
-
- m_FirstAction->_init();
-}
-
-void ActionTwo::_exec(std::chrono::steady_clock::time_point nNow)
-{
- if (!m_FirstAction->isEnding())
- {
- m_FirstAction->_exec(nNow);
- if (m_FirstAction->isEnding())
- {
- // true ʾһѾ
- m_SecondAction->_init();
- }
- }
- else if (!m_SecondAction->isEnding())
- {
- m_SecondAction->_exec(nNow);
- }
- else
- {
- this->stop();
- }
-}
-
-void ActionTwo::_reset()
-{
- Action::_reset();
-
- m_FirstAction->_reset();
- m_SecondAction->_reset();
-}
diff --git a/Easy2D/Action/Animation.cpp b/Easy2D/Action/Animation.cpp
deleted file mode 100644
index 0ad44d20..00000000
--- a/Easy2D/Action/Animation.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "..\easy2d.h"
-#include "..\Win\winbase.h"
-
-Animation::Animation(float duration)
-{
- m_nDuration = 0;
- m_nTotalDuration = UINT(duration * 1000);
-}
-
-Animation::~Animation()
-{
-}
-
-bool Animation::_isEnd() const
-{
- return m_nDuration >= m_nTotalDuration;
-}
-
-void Animation::_init()
-{
- Action::_init();
- // ¼ǰʱ
- m_nLast = steady_clock::now();
-}
-
-bool Animation::_isDelayEnough(steady_clock::time_point nNow)
-{
- // жʱǷ㹻
- if (duration_cast(nNow - m_nLast).count() > m_nAnimationInterval)
- {
- // ¼¼ʱ
- m_nLast += milliseconds(m_nAnimationInterval);
- m_nDuration += m_nAnimationInterval;
- return true;
- }
- return false;
-}
-
-void Animation::_reset()
-{
- Action::_reset();
- m_nDuration = 0;
- // ¼ǰʱ
- m_nLast = steady_clock::now();
-}
diff --git a/Easy2D/Base/EApp.cpp b/Easy2D/Base/EApp.cpp
index b19cb5e7..622ae220 100644
--- a/Easy2D/Base/EApp.cpp
+++ b/Easy2D/Base/EApp.cpp
@@ -1,5 +1,6 @@
#include "..\ebase.h"
#include "..\Win\winbase.h"
+#include "..\etools.h"
#include
#include
#include
@@ -18,7 +19,7 @@ std::stack s_SceneStack;
e2d::EApp::EApp()
: m_bRunning(false)
- , m_ClearColor(EColor::White)
+ , m_ClearColor(EColor::Black)
, m_bSaveScene(true)
, m_pCurrentScene(nullptr)
, m_pNextScene(nullptr)
@@ -46,72 +47,74 @@ bool e2d::EApp::init(e2d::EString title, e2d::ESize size, bool bShowConsole /* =
bool e2d::EApp::init(e2d::EString title, UINT32 width, UINT32 height, bool bShowConsole /* = false */)
{
- m_sTitle = title;
-
HRESULT hr;
hr = CoInitialize(NULL);
if (SUCCEEDED(hr))
{
- // رտ̨.
- if (bShowConsole)
+ // رտ̨
+ if (!bShowConsole)
{
- HWND hwnd = FindWindow(L"ConsoleWindowClass", NULL);
+ HWND consoleHWnd = FindWindow(L"ConsoleWindowClass", NULL);
- if (hwnd)
+ if (consoleHWnd)
{
- ShowWindow(hwnd, SW_HIDE);
+ ShowWindow(consoleHWnd, SW_HIDE);
}
}
+
+ // ʼ device-indpendent Դ
+ // Direct2D factory.
+ hr = _createDeviceIndependentResources();
}
if (SUCCEEDED(hr))
{
- // ʼ device-indpendent Դ
- // Direct2D factory.
- hr = _createDeviceIndependentResources();
+ // עᴰ
+ WNDCLASSEX wcex = { sizeof(WNDCLASSEX) };
+ wcex.style = CS_HREDRAW | CS_VREDRAW;
+ wcex.lpfnWndProc = EApp::WndProc;
+ wcex.cbClsExtra = 0;
+ wcex.cbWndExtra = sizeof(LONG_PTR);
+ wcex.hInstance = HINST_THISCOMPONENT;
+ wcex.hbrBackground = NULL;
+ wcex.lpszMenuName = NULL;
+ wcex.hCursor = LoadCursor(NULL, IDI_APPLICATION);
+ wcex.lpszClassName = L"E2DApp";
- if (SUCCEEDED(hr))
+ RegisterClassEx(&wcex);
+
+
+ // Because the CreateWindow function takes its size in pixels,
+ // obtain the system DPI and use it to scale the window size.
+ FLOAT dpiX, dpiY;
+
+ // The factory returns the current system DPI. This is also the value it will use
+ // to create its own windows.
+ GetFactory()->GetDesktopDpi(&dpiX, &dpiY);
+
+ m_sTitle = title;
+
+ // Create the window.
+ GetHWnd() = CreateWindow(
+ L"E2DApp",
+ m_sTitle.c_str(),
+ WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ static_cast(ceil(width * dpiX / 96.f)),
+ static_cast(ceil(height * dpiY / 96.f)),
+ NULL,
+ NULL,
+ HINST_THISCOMPONENT,
+ this
+ );
+
+ hr = GetHWnd() ? S_OK : E_FAIL;
+ if (FAILED(hr))
{
- // עᴰ
- WNDCLASSEX wcex = { sizeof(WNDCLASSEX) };
- wcex.style = CS_HREDRAW | CS_VREDRAW;
- wcex.lpfnWndProc = EApp::WndProc;
- wcex.cbClsExtra = 0;
- wcex.cbWndExtra = sizeof(LONG_PTR);
- wcex.hInstance = HINST_THISCOMPONENT;
- wcex.hbrBackground = NULL;
- wcex.lpszMenuName = NULL;
- wcex.hCursor = LoadCursor(NULL, IDI_APPLICATION);
- wcex.lpszClassName = L"E2DApp";
-
- RegisterClassEx(&wcex);
-
-
- // Because the CreateWindow function takes its size in pixels,
- // obtain the system DPI and use it to scale the window size.
- FLOAT dpiX, dpiY;
-
- // The factory returns the current system DPI. This is also the value it will use
- // to create its own windows.
- GetFactory()->GetDesktopDpi(&dpiX, &dpiY);
-
-
- // Create the window.
- GetHWnd() = CreateWindow(
- L"E2DApp",
- m_sTitle.c_str(),
- WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT,
- CW_USEDEFAULT,
- static_cast(ceil(width * dpiX / 96.f)),
- static_cast(ceil(height * dpiY / 96.f)),
- NULL,
- NULL,
- HINST_THISCOMPONENT,
- this
- );
- hr = GetHWnd() ? S_OK : E_FAIL;
+ UnregisterClass(L"E2DApp", HINST_THISCOMPONENT);
+ MessageBox(nullptr, L"Create Window Failed!", L"Error", MB_OK);
}
}
@@ -126,6 +129,9 @@ bool e2d::EApp::init(e2d::EString title, UINT32 width, UINT32 height, bool bShow
// Ϸ
void e2d::EApp::run()
{
+ ASSERT(m_pNextScene != nullptr);
+ // һ
+ _enterNextScene();
// ʾ
ShowWindow(GetHWnd(), SW_SHOWNORMAL);
UpdateWindow(GetHWnd());
@@ -181,7 +187,7 @@ void e2d::EApp::_mainLoop()
{
// ¼ǰʱ
nLast = nNow;
- //
+ // ִϷ
_onControl();
// ˢϷ
_onRender();
@@ -213,7 +219,7 @@ void e2d::EApp::_onControl()
//KeyMsg::__exec(); // ̰
//Timer::__exec(); // ʱִг
//ActionManager::__exec(); // ִг
- //EObjectManager::__flush(); // ˢڴ
+ EObjectManager::__flush(); // ˢڴ
}
// This method discards device-specific
@@ -233,7 +239,7 @@ bool e2d::EApp::_onRender()
GetRenderTarget()->Clear(D2D1::ColorF(m_ClearColor));
- m_pCurrentScene->_onDraw(); // Ƶǰ
+ m_pCurrentScene->_onRender(); // Ƶǰ
hr = GetRenderTarget()->EndDraw();
}
@@ -474,7 +480,7 @@ HRESULT e2d::EApp::_createDeviceIndependentResources()
if (FAILED(hr))
{
- MessageBox(nullptr, L"Create Device Independent Resources Fail!", L"Error", MB_OK);
+ MessageBox(nullptr, L"Create Device Independent Resources Failed!", L"Error", MB_OK);
}
return hr;
@@ -506,6 +512,11 @@ HRESULT e2d::EApp::_createDeviceResources()
);
}
+ if (FAILED(hr))
+ {
+ MessageBox(nullptr, L"Create Device Resources Failed!", L"Error", MB_OK);
+ }
+
return hr;
}
@@ -537,10 +548,10 @@ LRESULT e2d::EApp::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
if (message == WM_CREATE)
{
LPCREATESTRUCT pcs = (LPCREATESTRUCT)lParam;
- EApp *pEApp = (EApp *)pcs->lpCreateParams;
+ e2d::EApp *pEApp = (e2d::EApp *)pcs->lpCreateParams;
::SetWindowLongPtrW(
- GetHWnd(),
+ hWnd,
GWLP_USERDATA,
PtrToUlong(pEApp)
);
@@ -549,9 +560,9 @@ LRESULT e2d::EApp::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
}
else
{
- EApp *pEApp = reinterpret_cast(static_cast(
+ e2d::EApp *pEApp = reinterpret_cast(static_cast(
::GetWindowLongPtrW(
- GetHWnd(),
+ hWnd,
GWLP_USERDATA
)));
@@ -572,6 +583,23 @@ LRESULT e2d::EApp::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
} while (msg.wParam != WA_ACTIVE);
}
}*/
+ case WM_LBUTTONUP:
+ case WM_LBUTTONDOWN:
+ case WM_LBUTTONDBLCLK:
+ case WM_MBUTTONUP:
+ case WM_MBUTTONDOWN:
+ case WM_MBUTTONDBLCLK:
+ case WM_RBUTTONUP:
+ case WM_RBUTTONDOWN:
+ case WM_RBUTTONDBLCLK:
+ case WM_MOUSEMOVE:
+ case WM_MOUSEWHEEL:
+ {
+ EMsgManager::setMouseMsg(message);
+ }
+ result = 0;
+ break;
+
case WM_SIZE:
{
UINT width = LOWORD(lParam);
@@ -584,7 +612,7 @@ LRESULT e2d::EApp::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
case WM_DISPLAYCHANGE:
{
- InvalidateRect(GetHWnd(), NULL, FALSE);
+ InvalidateRect(hWnd, NULL, FALSE);
}
result = 0;
wasHandled = true;
@@ -593,7 +621,7 @@ LRESULT e2d::EApp::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
case WM_PAINT:
{
pEApp->_onRender();
- ValidateRect(GetHWnd(), NULL);
+ ValidateRect(hWnd, NULL);
}
result = 0;
wasHandled = true;
@@ -611,7 +639,7 @@ LRESULT e2d::EApp::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
if (!wasHandled)
{
- result = DefWindowProc(GetHWnd(), message, wParam, lParam);
+ result = DefWindowProc(hWnd, message, wParam, lParam);
}
}
diff --git a/Easy2D/Base/EScene.cpp b/Easy2D/Base/EScene.cpp
index a33dc05d..2de8ed04 100644
--- a/Easy2D/Base/EScene.cpp
+++ b/Easy2D/Base/EScene.cpp
@@ -25,12 +25,12 @@ void e2d::EScene::_exec()
}
}
-void e2d::EScene::_onDraw()
+void e2d::EScene::_onRender()
{
// нڵ
for (auto child : m_vChildren)
{
- child->_onDraw();
+ child->_onRender();
}
}
@@ -46,7 +46,7 @@ void e2d::EScene::onExit()
{
}
-void e2d::EScene::add(ENode * child, int zOrder)
+void e2d::EScene::add(ENode * child, int zOrder /* = 0 */)
{
// ӵĽڵǿ
ASSERT(child != nullptr);
@@ -80,7 +80,7 @@ void e2d::EScene::add(ENode * child, int zOrder)
}
}
-bool e2d::EScene::del(ENode * child)
+bool e2d::EScene::del(ENode * child, bool autoRelease /* = true */)
{
if (child == nullptr) return false;
@@ -91,6 +91,7 @@ bool e2d::EScene::del(ENode * child)
// ҵͬڵ
if (*iter == child)
{
+ if (autoRelease) (*iter)->autoRelease();
// üһ
(*iter)->release();
// ȥýڵ
diff --git a/Easy2D/Easy2D.vcxproj b/Easy2D/Easy2D.vcxproj
index 4315f90b..410a9fdb 100644
--- a/Easy2D/Easy2D.vcxproj
+++ b/Easy2D/Easy2D.vcxproj
@@ -1,34 +1,18 @@
-
- DebugW
- Win32
-
-
- DebugW
- x64
-
Debug
Win32
-
- ReleaseW
- Win32
-
-
- ReleaseW
- x64
-
-
- Release
- Win32
-
Debug
x64
+
+ Release
+ Win32
+
Release
x64
@@ -43,25 +27,12 @@
- StaticLibrary
- true
- v141
- MultiByte
-
-
StaticLibrary
true
v141
Unicode
- StaticLibrary
- false
- v141
- false
- MultiByte
-
-
StaticLibrary
false
v141
@@ -69,25 +40,12 @@
Unicode
- StaticLibrary
- true
- v141
- MultiByte
-
-
StaticLibrary
true
v141
Unicode
- StaticLibrary
- false
- v141
- false
- MultiByte
-
-
StaticLibrary
false
v141
@@ -99,74 +57,38 @@
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
- true
- Easy2Dd
- $(SolutionDir)$(Platform)\
- $(Platform)\$(Configuration)\
-
-
true
Easy2Ddw
$(SolutionDir)$(Platform)\
$(Platform)\$(Configuration)\
- true
- Easy2Dd
- $(SolutionDir)$(Platform)\
- $(Platform)\$(Configuration)\
-
-
true
Easy2Ddw
$(SolutionDir)$(Platform)\
$(Platform)\$(Configuration)\
- false
- Easy2D
- $(SolutionDir)$(Platform)\
- $(Platform)\$(Configuration)\
-
-
false
Easy2Dw
$(SolutionDir)$(Platform)\
$(Platform)\$(Configuration)\
- false
- Easy2D
- $(SolutionDir)$(Platform)\
- $(Platform)\$(Configuration)\
-
-
false
Easy2Dw
$(SolutionDir)$(Platform)\
@@ -179,31 +101,7 @@
Disabled
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
- None
- false
-
-
- Console
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- NotUsing
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- None
+ EditAndContinue
false
@@ -223,27 +121,6 @@
-
- NotUsing
- Level3
- Disabled
- _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- None
- false
-
-
- Console
- true
-
-
-
-
-
-
-
-
-
NotUsing
Level3
@@ -265,30 +142,6 @@
-
- NotUsing
- Level3
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- None
-
-
- Console
- true
- true
- true
-
-
-
-
-
-
-
-
-
NotUsing
Level3
@@ -315,30 +168,6 @@
-
- NotUsing
- Level3
- MaxSpeed
- true
- true
- NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- None
-
-
- Console
- true
- true
- true
-
-
-
-
-
-
-
-
-
NotUsing
Level3
@@ -367,6 +196,8 @@
+
+
diff --git a/Easy2D/Easy2D.vcxproj.filters b/Easy2D/Easy2D.vcxproj.filters
index a6bbd9f1..cdc50456 100644
--- a/Easy2D/Easy2D.vcxproj.filters
+++ b/Easy2D/Easy2D.vcxproj.filters
@@ -1,72 +1,57 @@
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hh;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
- {261633d3-3814-40c7-bd6d-201ede6c6ade}
-
-
+
{2f0f3d30-bfc2-4aea-a170-258bbaacaa79}
-
+
+ {42d46a92-c043-4667-8c20-358319e5c313}
+
+
{51864c81-02ee-4043-bf09-9ce3cbe5b6da}
-
- {42d46a92-c043-4667-8c20-358319e5c313}
+
+ {261633d3-3814-40c7-bd6d-201ede6c6ade}
+
+
+ {bdc55351-669e-4ee5-ba0b-ee0e4b628fea}
- 源文件\Win
+ Win
- 源文件\Base
+ Base
- 源文件\Base
+ Base
- 源文件\Node
+ Node
- 源文件\Tool
+ Tool
- 源文件\Base
+ Base
+
+
+ Tool
+
+
+ Tool\Listener
-
- 头文件
-
-
- 头文件
-
-
- 头文件
-
- 源文件\Win
-
-
- 头文件
-
-
- 头文件
-
-
- 头文件
+ Win
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Easy2D/EasyX/easyx.h b/Easy2D/EasyX/easyx.h
deleted file mode 100644
index d5a35fac..00000000
--- a/Easy2D/EasyX/easyx.h
+++ /dev/null
@@ -1,321 +0,0 @@
-/******************************************************
- * EasyX Library for C++ (Ver:20170827(beta))
- * http://www.easyx.cn
- *
- * EasyX.h
- * VC ʵּĻͼ
- ******************************************************/
-
-#pragma once
-
-#ifndef WINVER
-#define WINVER 0x0400 // Specifies that the minimum required platform is Windows 95 and Windows NT 4.0.
-#endif
-
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0500 // Specifies that the minimum required platform is Windows 2000.
-#endif
-
-#ifndef _WIN32_WINDOWS
-#define _WIN32_WINDOWS 0x0410 // Specifies that the minimum required platform is Windows 98.
-#endif
-
-
-#ifndef __cplusplus
-#error EasyX is only for C++
-#endif
-
-
-#include
-#include
-
-// ͼڳʼ
-#define SHOWCONSOLE 1 // ͼδʱ̨ʾ
-#define NOCLOSE 2 // ûйرչ
-#define NOMINIMIZE 4 // ûС
-
-// ɫ
-#define BLACK 0
-#define BLUE 0xAA0000
-#define GREEN 0x00AA00
-#define CYAN 0xAAAA00
-#define RED 0x0000AA
-#define MAGENTA 0xAA00AA
-#define BROWN 0x0055AA
-#define LIGHTGRAY 0xAAAAAA
-#define DARKGRAY 0x555555
-#define LIGHTBLUE 0xFF5555
-#define LIGHTGREEN 0x55FF55
-#define LIGHTCYAN 0xFFFF55
-#define LIGHTRED 0x5555FF
-#define LIGHTMAGENTA 0xFF55FF
-#define YELLOW 0x55FFFF
-#define WHITE 0xFFFFFF
-
-// ɫת
-#define BGR(color) ( (((color) & 0xFF) << 16) | ((color) & 0xFF00FF00) | (((color) & 0xFF0000) >> 16) )
-
-
-class IMAGE;
-
-// ߵʽ
-class LINESTYLE
-{
-public:
- LINESTYLE();
- LINESTYLE(const LINESTYLE &style);
- LINESTYLE& operator = (const LINESTYLE &style); // ֵغ
- virtual ~LINESTYLE();
-
- DWORD style;
- DWORD thickness;
- DWORD *puserstyle;
- DWORD userstylecount;
-};
-
-class FILLSTYLE
-{
-public:
- FILLSTYLE();
- FILLSTYLE(const FILLSTYLE &style);
- FILLSTYLE& operator = (const FILLSTYLE &style); // ֵغ
- virtual ~FILLSTYLE();
-
- int style; // ʽ
- long hatch; // ͼʽ
- IMAGE* ppattern; // ͼ
-};
-
-// ͼ
-class IMAGE
-{
-public:
- int getwidth() const; // ȡĿ
- int getheight() const; // ȡĸ߶
-
-private:
- int width, height; // Ŀ
- HBITMAP m_hBmp;
- HDC m_hMemDC;
- int m_MemCurX; // ǰX
- int m_MemCurY; // ǰY
- float m_data[6];
- COLORREF m_LineColor; // ǰɫ
- COLORREF m_FillColor; // ǰɫ
- COLORREF m_TextColor; // ǰɫ
- COLORREF m_BkColor; // ǰɫ
- DWORD* m_pBuffer; // ͼڴ
-
- LINESTYLE m_LineStyle; // ʽ
- FILLSTYLE m_FillStyle; // ʽ
-
- virtual void SetDefault(); // ΪĬ״̬
-
-public:
- IMAGE(int _width = 0, int _height = 0); // ͼ
- IMAGE(const IMAGE &img); // 캯
- IMAGE& operator = (const IMAGE &img); // ֵغ
- virtual ~IMAGE();
- virtual void Resize(int _width, int _height); // ߴ
-};
-
-
-
-// ͼģʽغ
-
-HWND initgraph(int width, int height, int flag = NULL); // ʼͼλ
-void closegraph(); // رͼλ
-
-// ͼ
-
-void cleardevice(); //
-void setcliprgn(HRGN hrgn); // õǰͼ豸IJü
-void clearcliprgn(); // üĻ
-
-void getlinestyle(LINESTYLE* pstyle); // ȡǰʽ
-void setlinestyle(const LINESTYLE* pstyle); // õǰʽ
-void setlinestyle(int style, int thickness = 1, const DWORD *puserstyle = NULL, DWORD userstylecount = 0); // õǰʽ
-void getfillstyle(FILLSTYLE* pstyle); // ȡǰʽ
-void setfillstyle(const FILLSTYLE* pstyle); // õǰʽ
-void setfillstyle(int style, long hatch = NULL, IMAGE* ppattern = NULL); // õǰʽ
-void setfillstyle(BYTE* ppattern8x8); // õǰʽ
-
-void setorigin(int x, int y); // ԭ
-void getaspectratio(float *pxasp, float *pyasp); // ȡǰ
-void setaspectratio(float xasp, float yasp); // õǰ
-
-int getrop2(); // ȡǰĶԪդģʽ
-void setrop2(int mode); // ǰĶԪդģʽ
-int getpolyfillmode(); // ȡģʽ
-void setpolyfillmode(int mode); // öģʽ
-
-void graphdefaults(); // лͼΪĬֵ
-
-COLORREF getlinecolor(); // ȡǰɫ
-void setlinecolor(COLORREF color); // õǰɫ
-COLORREF gettextcolor(); // ȡǰɫ
-void settextcolor(COLORREF color); // õǰɫ
-COLORREF getfillcolor(); // ȡǰɫ
-void setfillcolor(COLORREF color); // õǰɫ
-COLORREF getbkcolor(); // ȡǰͼɫ
-void setbkcolor(COLORREF color); // õǰͼɫ
-int getbkmode(); // ȡģʽ
-void setbkmode(int mode); // ñģʽ
-
-// ɫģת
-COLORREF RGBtoGRAY(COLORREF rgb);
-void RGBtoHSL(COLORREF rgb, float *H, float *S, float *L);
-void RGBtoHSV(COLORREF rgb, float *H, float *S, float *V);
-COLORREF HSLtoRGB(float H, float S, float L);
-COLORREF HSVtoRGB(float H, float S, float V);
-
-
-// ͼ
-
-COLORREF getpixel(int x, int y); // ȡɫ
-void putpixel(int x, int y, COLORREF color); //
-
-void moveto(int x, int y); // ƶǰ()
-void moverel(int dx, int dy); // ƶǰ()
-
-void line(int x1, int y1, int x2, int y2); //
-void linerel(int dx, int dy); // ()
-void lineto(int x, int y); // ()
-
-void rectangle (int left, int top, int right, int bottom); //
-void fillrectangle (int left, int top, int right, int bottom); // (б߿)
-void solidrectangle(int left, int top, int right, int bottom); // (ޱ߿)
-void clearrectangle(int left, int top, int right, int bottom); // վ
-
-void circle (int x, int y, int radius); // Բ
-void fillcircle (int x, int y, int radius); // Բ(б߿)
-void solidcircle(int x, int y, int radius); // Բ(ޱ߿)
-void clearcircle(int x, int y, int radius); // Բ
-
-void ellipse (int left, int top, int right, int bottom); // Բ
-void fillellipse (int left, int top, int right, int bottom); // Բ(б߿)
-void solidellipse(int left, int top, int right, int bottom); // Բ(ޱ߿)
-void clearellipse(int left, int top, int right, int bottom); // Բ
-
-void roundrect (int left, int top, int right, int bottom, int ellipsewidth, int ellipseheight); // ԲǾ
-void fillroundrect (int left, int top, int right, int bottom, int ellipsewidth, int ellipseheight); // ԲǾ(б߿)
-void solidroundrect(int left, int top, int right, int bottom, int ellipsewidth, int ellipseheight); // ԲǾ(ޱ߿)
-void clearroundrect(int left, int top, int right, int bottom, int ellipsewidth, int ellipseheight); // ԲǾ
-
-void arc (int left, int top, int right, int bottom, double stangle, double endangle); // Բ(ʼǶȺֹǶΪ)
-void pie (int left, int top, int right, int bottom, double stangle, double endangle); // Բ(ʼǶȺֹǶΪ)
-void fillpie (int left, int top, int right, int bottom, double stangle, double endangle); // Բ(б߿)
-void solidpie(int left, int top, int right, int bottom, double stangle, double endangle); // Բ(ޱ߿)
-void clearpie(int left, int top, int right, int bottom, double stangle, double endangle); // Բ
-
-void polyline (const POINT *points, int num); //
-void polygon (const POINT *points, int num); //
-void fillpolygon (const POINT *points, int num); // Ķ(б߿)
-void solidpolygon(const POINT *points, int num); // Ķ(ޱ߿)
-void clearpolygon(const POINT *points, int num); // ն
-
-void floodfill(int x, int y, int border); //
-
-
-
-// غ
-
-void outtext(LPCTSTR str); // ڵǰλַ
-void outtext(TCHAR c); // ڵǰλַ
-void outtextxy(int x, int y, LPCTSTR str); // ָλַ
-void outtextxy(int x, int y, TCHAR c); // ָλַ
-int textwidth(LPCTSTR str); // ȡַռõؿ
-int textwidth(TCHAR c); // ȡַռõؿ
-int textheight(LPCTSTR str); // ȡַռõظ
-int textheight(TCHAR c); // ȡַռõظ
-int drawtext(LPCTSTR str, RECT* pRect, UINT uFormat); // ָָʽַ
-int drawtext(TCHAR c, RECT* pRect, UINT uFormat); // ָָʽַ
-
-// õǰʽ()
-// nHeight: ַƽ߶ȣ
-// nWidth: ַƽ(0 ʾӦ)
-// lpszFace: ƣ
-// nEscapement: ַдǶ(λ 0.1 )
-// nOrientation: ÿַдǶ(λ 0.1 )
-// nWeight: ַıʻϸ(0 ʾĬϴϸ)
-// bItalic: Ƿб壻
-// bUnderline: Ƿ»ߣ
-// bStrikeOut: Ƿɾߣ
-// fbCharSet: ַָ
-// fbOutPrecision: ֵָȣ
-// fbClipPrecision: ֵָļȣ
-// fbQuality: ֵָ
-// fbPitchAndFamily: ָԳ淽ʽϵС
-void settextstyle(int nHeight, int nWidth, LPCTSTR lpszFace);
-void settextstyle(int nHeight, int nWidth, LPCTSTR lpszFace, int nEscapement, int nOrientation, int nWeight, bool bItalic, bool bUnderline, bool bStrikeOut);
-void settextstyle(int nHeight, int nWidth, LPCTSTR lpszFace, int nEscapement, int nOrientation, int nWeight, bool bItalic, bool bUnderline, bool bStrikeOut, BYTE fbCharSet, BYTE fbOutPrecision, BYTE fbClipPrecision, BYTE fbQuality, BYTE fbPitchAndFamily);
-void settextstyle(const LOGFONT *font); // õǰʽ
-void gettextstyle(LOGFONT *font); // ȡǰʽ
-
-
-
-// ͼ
-void loadimage(IMAGE *pDstImg, LPCTSTR pImgFile, int nWidth = 0, int nHeight = 0, bool bResize = false); // ͼƬļȡͼ(bmp/jpg/gif/emf/wmf)
-void loadimage(IMAGE *pDstImg, LPCTSTR pResType, LPCTSTR pResName, int nWidth = 0, int nHeight = 0, bool bResize = false); // Դļȡͼ(bmp/jpg/gif/emf/wmf)
-void saveimage(LPCTSTR pImgFile, IMAGE* pImg = NULL); // ͼ
-void getimage(IMAGE *pDstImg, int srcX, int srcY, int srcWidth, int srcHeight); // ӵǰͼ豸ȡͼ
-void putimage(int dstX, int dstY, const IMAGE *pSrcImg, DWORD dwRop = SRCCOPY); // ͼĻ
-void putimage(int dstX, int dstY, int dstWidth, int dstHeight, const IMAGE *pSrcImg, int srcX, int srcY, DWORD dwRop = SRCCOPY); // ͼĻ(ָ)
-void rotateimage(IMAGE *dstimg, IMAGE *srcimg, double radian, COLORREF bkcolor = BLACK, bool autosize = false, bool highquality = true);// תͼ
-void Resize(IMAGE* pImg, int width, int height); // ͼ豸ĴС
-DWORD* GetImageBuffer(IMAGE* pImg = NULL); // ȡͼ豸Դָ
-IMAGE* GetWorkingImage(); // ȡǰͼ豸
-void SetWorkingImage(IMAGE* pImg = NULL); // õǰͼ豸
-HDC GetImageHDC(IMAGE* pImg = NULL); // ȡͼ豸(HDC)
-
-
-//
-
-int getwidth(); // ȡͼ
-int getheight(); // ȡͼ߶
-int getx(); // ȡǰ x
-int gety(); // ȡǰ y
-
-void BeginBatchDraw(); // ʼ
-void FlushBatchDraw(); // ִδɵĻ
-void FlushBatchDraw(int left, int top, int right, int bottom); // ִָδɵĻ
-void EndBatchDraw(); // ƣִδɵĻ
-void EndBatchDraw(int left, int top, int right, int bottom); // ƣִָδɵĻ
-
-HWND GetHWnd(); // ȡͼھ(HWND)
-TCHAR* GetEasyXVer(); // ȡ EasyX ǰ汾
-
-// ȡû
-bool InputBox(LPTSTR pString, int nMaxCount, LPCTSTR pPrompt = NULL, LPCTSTR pTitle = NULL, LPCTSTR pDefault = NULL, int width = 0, int height = 0, bool bOnlyOK = true);
-
-
-
-// Ϣ
-// ֧Ϣ
-// WM_MOUSEMOVE ƶ
-// WM_MOUSEWHEEL ֲ
-// WM_LBUTTONDOWN
-// WM_LBUTTONUP
-// WM_LBUTTONDBLCLK ˫
-// WM_MBUTTONDOWN м
-// WM_MBUTTONUP м
-// WM_MBUTTONDBLCLK м˫
-// WM_RBUTTONDOWN Ҽ
-// WM_RBUTTONUP Ҽ
-// WM_RBUTTONDBLCLK Ҽ˫
-struct MOUSEMSG
-{
- UINT uMsg; // ǰϢ
- bool mkCtrl; // Ctrl Ƿ
- bool mkShift; // Shift Ƿ
- bool mkLButton; // Ƿ
- bool mkMButton; // мǷ
- bool mkRButton; // ҼǷ
- short x; // ǰ x
- short y; // ǰ y
- short wheel; // ֵֹ (120 ı)
-};
-
-bool MouseHit(); // ǷϢ
-MOUSEMSG GetMouseMsg(); // ȡһϢûУ͵ȴ
-void FlushMouseMsgBuffer(); // Ϣ
diff --git a/Easy2D/EasyX/x64/EasyXa.lib b/Easy2D/EasyX/x64/EasyXa.lib
deleted file mode 100644
index d1c996b2..00000000
Binary files a/Easy2D/EasyX/x64/EasyXa.lib and /dev/null differ
diff --git a/Easy2D/EasyX/x64/EasyXw.lib b/Easy2D/EasyX/x64/EasyXw.lib
deleted file mode 100644
index f47b4075..00000000
Binary files a/Easy2D/EasyX/x64/EasyXw.lib and /dev/null differ
diff --git a/Easy2D/EasyX/x86/EasyXa.lib b/Easy2D/EasyX/x86/EasyXa.lib
deleted file mode 100644
index db14e5bf..00000000
Binary files a/Easy2D/EasyX/x86/EasyXa.lib and /dev/null differ
diff --git a/Easy2D/EasyX/x86/EasyXw.lib b/Easy2D/EasyX/x86/EasyXw.lib
deleted file mode 100644
index c2f75141..00000000
Binary files a/Easy2D/EasyX/x86/EasyXw.lib and /dev/null differ
diff --git a/Easy2D/Msg/KeyMsg.cpp b/Easy2D/Msg/KeyMsg.cpp
deleted file mode 100644
index b3a76b14..00000000
--- a/Easy2D/Msg/KeyMsg.cpp
+++ /dev/null
@@ -1,314 +0,0 @@
-#include "..\easy2d.h"
-#include "..\EasyX\easyx.h"
-#include
-
-// ص
-static std::vector s_vListeners;
-
-// ֵĶ
-const VK_KEY KeyMsg::A = 'A';
-const VK_KEY KeyMsg::B = 'B';
-const VK_KEY KeyMsg::C = 'C';
-const VK_KEY KeyMsg::D = 'D';
-const VK_KEY KeyMsg::E = 'E';
-const VK_KEY KeyMsg::F = 'F';
-const VK_KEY KeyMsg::G = 'G';
-const VK_KEY KeyMsg::H = 'H';
-const VK_KEY KeyMsg::I = 'I';
-const VK_KEY KeyMsg::J = 'J';
-const VK_KEY KeyMsg::K = 'K';
-const VK_KEY KeyMsg::L = 'L';
-const VK_KEY KeyMsg::M = 'M';
-const VK_KEY KeyMsg::N = 'N';
-const VK_KEY KeyMsg::O = 'O';
-const VK_KEY KeyMsg::P = 'P';
-const VK_KEY KeyMsg::Q = 'Q';
-const VK_KEY KeyMsg::R = 'R';
-const VK_KEY KeyMsg::S = 'S';
-const VK_KEY KeyMsg::T = 'T';
-const VK_KEY KeyMsg::U = 'U';
-const VK_KEY KeyMsg::V = 'V';
-const VK_KEY KeyMsg::W = 'W';
-const VK_KEY KeyMsg::X = 'X';
-const VK_KEY KeyMsg::Y = 'Y';
-const VK_KEY KeyMsg::Z = 'Z';
-const VK_KEY KeyMsg::NUM_0 = '0';
-const VK_KEY KeyMsg::NUM_1 = '1';
-const VK_KEY KeyMsg::NUM_2 = '2';
-const VK_KEY KeyMsg::NUM_3 = '3';
-const VK_KEY KeyMsg::NUM_4 = '4';
-const VK_KEY KeyMsg::NUM_5 = '5';
-const VK_KEY KeyMsg::NUM_6 = '6';
-const VK_KEY KeyMsg::NUM_7 = '7';
-const VK_KEY KeyMsg::NUM_8 = '8';
-const VK_KEY KeyMsg::NUM_9 = '9';
-const VK_KEY KeyMsg::NUMPAD_0 = VK_NUMPAD0;
-const VK_KEY KeyMsg::NUMPAD_1 = VK_NUMPAD1;
-const VK_KEY KeyMsg::NUMPAD_2 = VK_NUMPAD2;
-const VK_KEY KeyMsg::NUMPAD_3 = VK_NUMPAD3;
-const VK_KEY KeyMsg::NUMPAD_4 = VK_NUMPAD4;
-const VK_KEY KeyMsg::NUMPAD_5 = VK_NUMPAD5;
-const VK_KEY KeyMsg::NUMPAD_6 = VK_NUMPAD6;
-const VK_KEY KeyMsg::NUMPAD_7 = VK_NUMPAD7;
-const VK_KEY KeyMsg::NUMPAD_8 = VK_NUMPAD8;
-const VK_KEY KeyMsg::NUMPAD_9 = VK_NUMPAD9;
-const VK_KEY KeyMsg::Enter = VK_RETURN;
-const VK_KEY KeyMsg::Space = VK_SPACE;
-const VK_KEY KeyMsg::Ctrl = VK_CONTROL;
-const VK_KEY KeyMsg::LCtrl = VK_LCONTROL;
-const VK_KEY KeyMsg::RCtrl = VK_RCONTROL;
-const VK_KEY KeyMsg::Shift = VK_SHIFT;
-const VK_KEY KeyMsg::LShift = VK_LSHIFT;
-const VK_KEY KeyMsg::RShift = VK_RSHIFT;
-const VK_KEY KeyMsg::Up = VK_UP;
-const VK_KEY KeyMsg::Down = VK_DOWN;
-const VK_KEY KeyMsg::Left = VK_LEFT;
-const VK_KEY KeyMsg::Right = VK_RIGHT;
-const VK_KEY KeyMsg::Esc = VK_ESCAPE;
-const VK_KEY KeyMsg::F1 = VK_F1;
-const VK_KEY KeyMsg::F2 = VK_F2;
-const VK_KEY KeyMsg::F3 = VK_F3;
-const VK_KEY KeyMsg::F4 = VK_F4;
-const VK_KEY KeyMsg::F5 = VK_F5;
-const VK_KEY KeyMsg::F6 = VK_F6;
-const VK_KEY KeyMsg::F7 = VK_F7;
-const VK_KEY KeyMsg::F8 = VK_F8;
-const VK_KEY KeyMsg::F9 = VK_F9;
-const VK_KEY KeyMsg::F10 = VK_F10;
-const VK_KEY KeyMsg::F11 = VK_F11;
-const VK_KEY KeyMsg::F12 = VK_F12;
-
-static VK_KEY convert(int ascii);
-
-KeyMsg::KeyMsg(TString name, const KEY_CALLBACK & callback) :
- m_sName(name),
- m_callback(callback),
- m_pParentScene(nullptr),
- m_bRunning(true),
- m_bWaiting(false)
-{
-}
-
-KeyMsg::~KeyMsg()
-{
-}
-
-void KeyMsg::onKbHit(VK_KEY key)
-{
- m_callback(key);
-}
-
-void KeyMsg::start()
-{
- m_bRunning = true;
-}
-
-void KeyMsg::stop()
-{
- m_bRunning = false;
-}
-
-void KeyMsg::wait()
-{
- m_bWaiting = true;
-}
-
-void KeyMsg::notify()
-{
- m_bWaiting = false;
-}
-
-void KeyMsg::__exec()
-{
- if (_kbhit()) // ްϢ
- {
- VK_KEY key = convert(_getch()); // ȡϢ
-
- for (auto l : s_vListeners) // ַϢ
- {
- if (!l->m_bWaiting && l->m_bRunning)
- {
- l->onKbHit(key); // ִаص
- }
- }
- }
-}
-
-void KeyMsg::addListener(TString name, const KEY_CALLBACK & callback)
-{
- // µļ
- auto listener = new KeyMsg(name, callback);
- // ڳ
- listener->m_pParentScene = EApp::getLoadingScene();
- // µİص
- s_vListeners.push_back(listener);
-}
-
-void KeyMsg::startListener(TString name)
-{
- // ͬļ
- for (auto l : s_vListeners)
- {
- if (l->m_sName == name && l->m_pParentScene == EApp::getCurrentScene())
- {
- l->start();
- }
- }
-}
-
-void KeyMsg::stopListener(TString name)
-{
- // ͬļ
- for (auto l : s_vListeners)
- {
- if (l->m_sName == name && l->m_pParentScene == EApp::getCurrentScene())
- {
- l->stop();
- }
- }
-}
-
-void KeyMsg::delListener(TString name)
-{
- //
- std::vector::iterator iter;
- // ѭм
- for (iter = s_vListeners.begin(); iter != s_vListeners.end();)
- {
- // ͬƵļ
- if ((*iter)->m_sName == name && (*iter)->m_pParentScene == EApp::getCurrentScene())
- {
- // ɾöʱ
- delete (*iter);
- iter = s_vListeners.erase(iter);
- }
- else
- {
- iter++;
- }
- }
-}
-
-void KeyMsg::notifyAllSceneListeners(EScene * scene)
-{
- for (auto l : s_vListeners)
- {
- if (l->m_pParentScene == scene)
- {
- l->notify();
- }
- }
-}
-
-void KeyMsg::waitAllSceneListeners(EScene * scene)
-{
- for (auto l : s_vListeners)
- {
- if (l->m_pParentScene == scene)
- {
- l->wait();
- }
- }
-}
-
-void KeyMsg::clearAllSceneListeners(EScene * scene)
-{
- //
- std::vector::iterator iter;
- // ѭм
- for (iter = s_vListeners.begin(); iter != s_vListeners.end();)
- {
- // ͬƵļ
- if ((*iter)->m_pParentScene == scene)
- {
- // ɾöʱ
- delete (*iter);
- iter = s_vListeners.erase(iter);
- }
- else
- {
- iter++;
- }
- }
-}
-
-void KeyMsg::clearAllListeners()
-{
- // ɾм
- for (auto l : s_vListeners)
- {
- delete l;
- }
- //
- s_vListeners.clear();
-}
-
-bool KeyMsg::isKeyDown(VK_KEY key)
-{
- // ȡ key İ
- return (GetAsyncKeyState(key) & 0x8000);
-}
-
-
-VK_KEY convert(int ascii)
-{
- // ĸ
- if (ascii >= 'a' && ascii <= 'z')
- {
- return VK_KEY(ascii - ('a' - 'A'));
- }
- else if (ascii >= 'A' && ascii <= 'Z')
- {
- return VK_KEY(ascii);
- }
- // ּ
- else if (ascii >= '0' && ascii <= '9')
- {
- return VK_KEY(ascii);
- }
- // سոEsc
- else if (ascii == 0x0D || ascii == 0x20 || ascii == 0x1B)
- {
- return VK_KEY(ascii);
- }
- // ܼ
- else if (ascii == 0 || ascii == 0xE0)
- {
- switch (_getch())
- {
- case 72:
- return KeyMsg::Up;
- case 75:
- return KeyMsg::Left;
- case 77:
- return KeyMsg::Right;
- case 80:
- return KeyMsg::Down;
- case 59:
- return KeyMsg::F1;
- case 60:
- return KeyMsg::F2;
- case 61:
- return KeyMsg::F3;
- case 62:
- return KeyMsg::F4;
- case 63:
- return KeyMsg::F5;
- case 64:
- return KeyMsg::F6;
- case 65:
- return KeyMsg::F7;
- case 66:
- return KeyMsg::F8;
- case 67:
- return KeyMsg::F9;
- case 133:
- return KeyMsg::F10;
- case 134:
- return KeyMsg::F11;
- default:
- return 0;
- }
- }
- return 0;
-}
\ No newline at end of file
diff --git a/Easy2D/Msg/MouseMsg.cpp b/Easy2D/Msg/MouseMsg.cpp
deleted file mode 100644
index 8234e7ef..00000000
--- a/Easy2D/Msg/MouseMsg.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-#include "..\easy2d.h"
-#include "..\EasyX\easyx.h"
-
-// ص
-static std::vector s_vListeners;
-
-// Ϣ
-static MOUSEMSG s_mouseMsg;
-
-void MouseMsg::__exec()
-{
- // ȡϢ
- while (MouseHit())
- {
- // ȡϢ
- s_mouseMsg = GetMouseMsg();
- // ִг
- EApp::get()->getCurrentScene()->_exec();
- // ִص
- for (auto l : s_vListeners) // ѭе
- {
- if (!l->m_bWaiting && l->m_bRunning)
- {
- l->onMouseMsg(); // ִлص
- }
- }
- }
-}
-
-MouseMsg::MouseMsg() :
- m_callback([]() {}),
- m_pParentScene(nullptr),
- m_bRunning(true),
- m_bWaiting(false)
-{
-}
-
-MouseMsg::MouseMsg(TString name, const MOUSE_CALLBACK & callback) :
- m_sName(name),
- m_callback(callback),
- m_pParentScene(nullptr),
- m_bRunning(true),
- m_bWaiting(false)
-{
-}
-
-MouseMsg::~MouseMsg()
-{
-}
-
-void MouseMsg::onMouseMsg()
-{
- m_callback();
-}
-
-void MouseMsg::addListener(TString name, const MOUSE_CALLBACK & callback)
-{
- // µļ
- auto listener = new MouseMsg(name, callback);
- // ڳ
- listener->m_pParentScene = EApp::getLoadingScene();
- // µİص
- s_vListeners.push_back(listener);
-}
-
-void MouseMsg::startListener(TString name)
-{
- // ͬļ
- for (auto l : s_vListeners)
- {
- if (l->m_sName == name && l->m_pParentScene == EApp::getCurrentScene())
- {
- l->start();
- }
- }
-}
-
-void MouseMsg::stopListener(TString name)
-{
- // ͬļ
- for (auto l : s_vListeners)
- {
- if (l->m_sName == name && l->m_pParentScene == EApp::getCurrentScene())
- {
- l->stop();
- }
- }
-}
-
-void MouseMsg::delListener(TString name)
-{
- //
- std::vector::iterator iter;
- // ѭм
- for (iter = s_vListeners.begin(); iter != s_vListeners.end();)
- {
- // ͬƵļ
- if ((*iter)->m_sName == name && (*iter)->m_pParentScene == EApp::getCurrentScene())
- {
- // ɾöʱ
- delete (*iter);
- iter = s_vListeners.erase(iter);
- }
- else
- {
- iter++;
- }
- }
-}
-
-void MouseMsg::start()
-{
- m_bRunning = true;
-}
-
-void MouseMsg::stop()
-{
- m_bRunning = false;
-}
-
-void MouseMsg::wait()
-{
- m_bWaiting = true;
-}
-
-void MouseMsg::notify()
-{
- m_bWaiting = false;
-}
-
-void MouseMsg::clearAllListeners()
-{
- // ɾм
- for (auto l : s_vListeners)
- {
- delete l;
- }
- //
- s_vListeners.clear();
-}
-
-void MouseMsg::notifyAllSceneListeners(EScene * scene)
-{
- for (auto l : s_vListeners)
- {
- if (l->m_pParentScene == scene)
- {
- l->notify();
- }
- }
-}
-
-void MouseMsg::waitAllSceneListeners(EScene * scene)
-{
- for (auto l : s_vListeners)
- {
- if (l->m_pParentScene == scene)
- {
- l->wait();
- }
- }
-}
-
-void MouseMsg::clearAllSceneListeners(EScene * scene)
-{
- //
- std::vector::iterator iter;
- // ѭм
- for (iter = s_vListeners.begin(); iter != s_vListeners.end();)
- {
- // ͬƵļ
- if ((*iter)->m_pParentScene == scene)
- {
- // ɾöʱ
- delete (*iter);
- iter = s_vListeners.erase(iter);
- }
- else
- {
- iter++;
- }
- }
-}
-
-bool MouseMsg::isLButtonDown()
-{
- return s_mouseMsg.mkLButton;
-}
-
-bool MouseMsg::isRButtonDown()
-{
- return s_mouseMsg.mkRButton;
-}
-
-bool MouseMsg::isMButtonDown()
-{
- return s_mouseMsg.mkMButton;
-}
-
-int MouseMsg::getX()
-{
- return s_mouseMsg.x;
-}
-
-int MouseMsg::getY()
-{
- return s_mouseMsg.y;
-}
-
-CPoint MouseMsg::getPos()
-{
- return CPoint(s_mouseMsg.x, s_mouseMsg.y);
-}
-
-int MouseMsg::getWheel()
-{
- return s_mouseMsg.wheel;
-}
-
-MouseMsg::MESSAGE MouseMsg::getMsg()
-{
- return MESSAGE(s_mouseMsg.uMsg);
-}
diff --git a/Easy2D/Node/BatchNode.cpp b/Easy2D/Node/BatchNode.cpp
deleted file mode 100644
index 63716580..00000000
--- a/Easy2D/Node/BatchNode.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-#include "..\easy2d.h"
-#include "..\EasyX\easyx.h"
-
-BatchNode::BatchNode()
-{
-}
-
-
-BatchNode::~BatchNode()
-{
- clearAllChildren();
-}
-
-bool BatchNode::_exec(bool active)
-{
- // ڵǷʾ
- if (!m_bDisplay)
- {
- return false;
- }
- // ӽڵ
- for (int i = int(m_vChildren.size() - 1); i >= 0; i--)
- {
- if (m_vChildren[i]->_exec(active))
- {
- active = false;
- }
- }
- // ӽڵȡ˻潹㣬ýڵҲȡ˽
- return !active;
-}
-
-void BatchNode::_onDraw()
-{
- // ڵǷʾ
- if (!m_bDisplay)
- {
- return;
- }
-
- for (auto child : m_vChildren)
- {
- // ӽڵ
- child->_onDraw();
- }
-}
-
-void BatchNode::add(Node * child, int z_Order)
-{
- if (child == nullptr) return;
-
- // ýڵĸ
- child->setParentScene(this->getParentScene());
- // ýڵڵе z ˳
- child->setZOrder(z_Order);
- // üһ
- child->retain();
- // ӽڵλ
- child->move(getPos());
-
- // z ˳ڵ
- size_t size = m_vChildren.size();
- for (unsigned i = 0; i <= size; i++)
- {
- if (i != size)
- {
- if (z_Order < m_vChildren.at(i)->getZOrder())
- {
- m_vChildren.insert(m_vChildren.begin() + i, child);
- break;
- }
- }
- else
- {
- m_vChildren.push_back(child);
- break;
- }
- }
-}
-
-bool BatchNode::del(Node * child)
-{
- if (child == nullptr) return false;
-
- // ѰǷͬڵ
- std::vector::iterator iter;
- for (iter = m_vChildren.begin(); iter != m_vChildren.end(); iter++)
- {
- // ҵͬڵ
- if ((*iter) == child)
- {
- // üһ
- (*iter)->release();
- // ȥýڵ
- m_vChildren.erase(iter);
- return true;
- }
- }
- return false;
-}
-
-int BatchNode::getCount()
-{
- return (int)m_vChildren.size();
-}
-
-std::vector& BatchNode::getChildren()
-{
- return m_vChildren;
-}
-
-void BatchNode::clearAllChildren()
-{
- // нڵüһ
- for (auto child : m_vChildren)
- {
- child->autoRelease();
- child->release();
- }
- // մڵ
- m_vChildren.clear();
-}
-
-void BatchNode::setX(int x)
-{
- // ƶλ
- int var = x - getX();
- // ƶӽڵλ
- for (auto child : m_vChildren)
- {
- child->move(var, 0);
- }
- Node::setX(x);
-}
-
-void BatchNode::setY(int y)
-{
- // ƶλ
- int var = y - getY();
- // ƶӽڵλ
- for (auto child : m_vChildren)
- {
- child->move(0, var);
- }
- Node::setY(y);
-}
-
-void BatchNode::setPos(int x, int y)
-{
- // ƶλ
- CPoint var(x - getX(), y - getY());
- // ƶӽڵλ
- for (auto child : m_vChildren)
- {
- child->move(var);
- }
- Node::setPos(x, y);
-}
-
-void BatchNode::setPos(CPoint p)
-{
- // ƶλ
- CPoint var(p - getPos());
- // ƶӽڵλ
- for (auto child : m_vChildren)
- {
- child->move(var);
- }
- Node::setPos(p);
-}
-
-void BatchNode::move(int x, int y)
-{
- // ƶӽڵλ
- for (auto child : m_vChildren)
- {
- child->move(x, y);
- }
- Node::move(x, y);
-}
-
-void BatchNode::move(CVector v)
-{
- // ƶӽڵλ
- for (auto child : m_vChildren)
- {
- child->move(v);
- }
- Node::move(v);
-}
diff --git a/Easy2D/Node/BatchSprite.cpp b/Easy2D/Node/BatchSprite.cpp
deleted file mode 100644
index edbb9e84..00000000
--- a/Easy2D/Node/BatchSprite.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-#include "..\easy2d.h"
-
-BatchSprite::BatchSprite()
-{
-}
-
-BatchSprite::~BatchSprite()
-{
-}
-
-void BatchSprite::addSprite(Sprite * sprite, int z_Order)
-{
- if (sprite == nullptr) return;
-
- // ýڵĸ
- sprite->setParentScene(this->getParentScene());
- // ýڵڵе z ˳
- sprite->setZOrder(z_Order);
- // üһ
- sprite->retain();
-
- // z ˳ڵ
- size_t size = m_vSprites.size();
- for (unsigned i = 0; i <= size; i++)
- {
- if (i != size)
- {
- if (z_Order < m_vSprites.at(i)->getZOrder())
- {
- m_vSprites.insert(m_vSprites.begin() + i, sprite);
- break;
- }
- }
- else
- {
- m_vSprites.push_back(sprite);
- break;
- }
- }
-}
-
-bool BatchSprite::delSprite(Sprite * sprite)
-{
- if (sprite == nullptr) return false;
-
- // ѰǷͬڵ
- std::vector::iterator iter;
- for (iter = m_vSprites.begin(); iter != m_vSprites.end(); iter++)
- {
- // ҵͬڵ
- if ((*iter) == sprite)
- {
- // üһ
- (*iter)->release();
- // ȥýڵ
- m_vSprites.erase(iter);
- return true;
- }
- }
- return false;
-}
-
-int BatchSprite::getCount()
-{
- return (int)m_vSprites.size();
-}
-
-std::vector& BatchSprite::getChildren()
-{
- return m_vSprites;
-}
-
-void BatchSprite::clearAllSprites()
-{
- // нڵüһ
- for (auto s : m_vSprites)
- {
- s->release();
- }
- // մڵ
- m_vSprites.clear();
-}
-
-bool BatchSprite::_exec(bool active)
-{
- // ڵǷʾ
- if (!m_bDisplay)
- {
- return false;
- }
- // ӽڵ
- for (int i = int(m_vSprites.size() - 1); i >= 0; i--)
- {
- if (m_vSprites[i]->_exec(active))
- {
- active = false;
- }
- }
- // ӽڵȡ˻潹㣬ýڵҲȡ˽
- return !active;
-}
-
-void BatchSprite::_onDraw()
-{
- // ڵǷʾ
- if (!m_bDisplay)
- {
- return;
- }
-
- // λûӽڵ
- for (auto sprite : m_vSprites)
- {
- // ӽڵƶλ
- sprite->move(getX(), getY());
- // ӽڵ
- sprite->_onDraw();
- // ӽڵƻԭλ
- sprite->move(-getX(), -getY());
- }
-}
-
-Sprite * BatchSprite::isCollisionWith(Sprite * sprite)
-{
- for (int i = int(m_vSprites.size() - 1); i >= 0; i--)
- {
- if (m_vSprites[i]->isCollisionWith(sprite))
- {
- return m_vSprites[i];
- }
- }
- return nullptr;
-}
-
-Sprite * BatchSprite::isPointIn(CPoint point)
-{
- for (int i = int(m_vSprites.size() - 1); i >= 0; i--)
- {
- if (m_vSprites[i]->isPointIn(point))
- {
- return m_vSprites[i];
- }
- }
- return nullptr;
-}
-
-void BatchSprite::addAction(Action * action)
-{
- Sprite::addAction(action);
-}
-
-float BatchSprite::getScaleX() const
-{
- return m_fScaleX;
-}
-
-float BatchSprite::getScaleY() const
-{
- return m_fScaleY;
-}
-
-float BatchSprite::getOpacity() const
-{
- return m_nAlpha / 255.0f;
-}
-
-void BatchSprite::setScale(float scaleX, float scaleY)
-{
- m_fScaleX = scaleX;
- m_fScaleY = scaleY;
- for (auto s : m_vSprites)
- {
- s->setScale(scaleX, scaleY);
- }
-}
-
-void BatchSprite::setOpacity(float opacity)
-{
- m_nAlpha = BYTE(min(max(opacity, 0), 1) * 255);
- for (auto s : m_vSprites)
- {
- s->setOpacity(opacity);
- }
-}
-
-void BatchSprite::setImage(Image * image)
-{
- for (auto s : m_vSprites)
- {
- s->setImage(image);
- }
-}
-
-void BatchSprite::setX(int x)
-{
- // ƶλ
- int var = x - getX();
- // ƶӽڵλ
- for (auto s : m_vSprites)
- {
- s->move(var, 0);
- }
- RectNode::setX(x);
-}
-
-void BatchSprite::setY(int y)
-{
- // ƶλ
- int var = y - getY();
- // ƶӽڵλ
- for (auto s : m_vSprites)
- {
- s->move(0, var);
- }
- RectNode::setY(y);
-}
-
-void BatchSprite::setPos(int x, int y)
-{
- // ƶλ
- CPoint var(x - getX(), y - getY());
- // ƶӽڵλ
- for (auto s : m_vSprites)
- {
- s->move(var);
- }
- RectNode::setPos(x, y);
-}
-
-void BatchSprite::setPos(CPoint p)
-{
- // ƶλ
- CPoint var(p - getPos());
- // ƶӽڵλ
- for (auto s : m_vSprites)
- {
- s->move(var);
- }
- RectNode::setPos(p);
-}
-
-void BatchSprite::move(int x, int y)
-{
- // ƶӽڵλ
- for (auto s : m_vSprites)
- {
- s->move(x, y);
- }
- RectNode::move(x, y);
-}
-
-void BatchSprite::move(CVector v)
-{
- // ƶӽڵλ
- for (auto s : m_vSprites)
- {
- s->move(v);
- }
- RectNode::move(v);
-}
\ No newline at end of file
diff --git a/Easy2D/Node/Button/Button.cpp b/Easy2D/Node/Button/Button.cpp
deleted file mode 100644
index 8044d691..00000000
--- a/Easy2D/Node/Button/Button.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "..\..\easy2d.h"
-#include "..\..\EasyX\easyx.h"
-
-
-Button::Button() :
- m_bEnable(true)
-{
-}
-
-Button::~Button()
-{
-}
-
-bool Button::_exec(bool active)
-{
- // ťǷ
- if (!m_bEnable)
- {
- return false;
- }
- return MouseNode::_exec(active);
-}
-
-void Button::_onDraw()
-{
- // ťǷ
- if (!m_bEnable)
- {
- // δʱ Disable ״̬
- _onDisable();
- return;
- }
- MouseNode::_onDraw();
-}
-
-bool Button::isEnable()
-{
- return m_bEnable;
-}
-
-void Button::setEnable(bool enable)
-{
- m_bEnable = enable;
-}
-
-void Button::setX(int x)
-{
- MouseNode::setX(x);
- _resetPosition();
-}
-
-void Button::setY(int y)
-{
- MouseNode::setY(y);
- _resetPosition();
-}
-
-void Button::setPos(int x, int y)
-{
- MouseNode::setPos(x, y);
- _resetPosition();
-}
-
-void Button::setPos(CPoint p)
-{
- MouseNode::setPos(p);
- _resetPosition();
-}
-
-void Button::move(int x, int y)
-{
- MouseNode::move(x, y);
- _resetPosition();
-}
-
-void Button::move(CVector v)
-{
- MouseNode::move(v);
- _resetPosition();
-}
diff --git a/Easy2D/Node/Button/ImageButton.cpp b/Easy2D/Node/Button/ImageButton.cpp
deleted file mode 100644
index 824b8113..00000000
--- a/Easy2D/Node/Button/ImageButton.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-#include "..\..\easy2d.h"
-
-
-ImageButton::ImageButton() :
- m_pNormalImage(nullptr),
- m_pMouseInImage(nullptr),
- m_pSelectedImage(nullptr),
- m_pUnableImage(nullptr)
-{
-}
-
-ImageButton::ImageButton(LPCTSTR image) :
- ImageButton()
-{
- setNormal(new Image(image)); // ðť״̬ʱͼƬ
-}
-
-ImageButton::ImageButton(Image * image) :
- ImageButton()
-{
- setNormal(image); // ðť״̬ʱͼƬ
-}
-
-ImageButton::~ImageButton()
-{
- // ͼƬüһ
- SafeRelease(m_pNormalImage);
- SafeRelease(m_pMouseInImage);
- SafeRelease(m_pSelectedImage);
- SafeRelease(m_pUnableImage);
-}
-
-void ImageButton::_setStatus(Status status)
-{
- if (m_eStatus != status)
- {
- if (status == MOUSEIN)
- {
- if (m_pMouseInImage) setRect(m_pMouseInImage->getRect());
- }
- else if (status == SELECTED)
- {
- if (m_pSelectedImage) setRect(m_pSelectedImage->getRect());
- }
- else
- {
- setRect(m_pNormalImage->getRect());
- }
- }
- MouseNode::_setStatus(status);
-}
-
-void ImageButton::_onNormal()
-{
- if (m_pNormalImage)
- {
- m_pNormalImage->_onDraw();
- }
-}
-
-void ImageButton::_onMouseIn()
-{
- if (m_pMouseInImage)
- {
- m_pMouseInImage->_onDraw();
- }
- else
- {
- _onNormal();
- }
-}
-
-void ImageButton::_onSelected()
-{
- if (m_pSelectedImage)
- {
- m_pSelectedImage->_onDraw();
- }
- else
- {
- _onNormal();
- }
-}
-
-void ImageButton::_onDisable()
-{
- if (m_pUnableImage)
- {
- m_pUnableImage->_onDraw();
- }
- else
- {
- _onNormal();
- }
-}
-
-void ImageButton::setNormal(Image * image)
-{
- if (image)
- {
- // ԭͼƬüһ
- SafeRelease(m_pNormalImage);
- // ͼƬ
- m_pNormalImage = image;
- // ͼƬüһ
- m_pNormalImage->retain();
- // ͼƬ趨ťС
- setSize(m_pNormalImage->getSize());
- // ¼ͼƬλ
- _resetPosition();
- }
-}
-
-void ImageButton::setMouseIn(Image * image)
-{
- if (image)
- {
- SafeRelease(m_pMouseInImage);
- m_pMouseInImage = image;
- m_pMouseInImage->retain();
- _resetPosition();
- }
-}
-
-void ImageButton::setSelected(Image * image)
-{
- if (image)
- {
- SafeRelease(m_pSelectedImage);
- m_pSelectedImage = image;
- m_pSelectedImage->retain();
- _resetPosition();
- }
-}
-
-void ImageButton::setUnable(Image * image)
-{
- if (image)
- {
- SafeRelease(m_pUnableImage);
- m_pUnableImage = image;
- m_pUnableImage->retain();
- _resetPosition();
- }
-}
-
-void ImageButton::_resetPosition()
-{
- if (m_pNormalImage)
- {
- // ݰťλúͼƬͼƬλþʾ
- m_pNormalImage->setPos(getX(), getY());
- }
- if (m_pMouseInImage)
- {
- m_pMouseInImage->setPos(
- getX() + (getWidth() - m_pMouseInImage->getWidth()) / 2,
- getY() + (getHeight() - m_pMouseInImage->getHeight()) / 2);
- }
- if (m_pSelectedImage)
- {
- m_pSelectedImage->setPos(
- getX() + (getWidth() - m_pSelectedImage->getWidth()) / 2,
- getY() + (getHeight() - m_pSelectedImage->getHeight()) / 2);
- }
- if (m_pUnableImage)
- {
- m_pUnableImage->setPos(
- getX() + (getWidth() - m_pUnableImage->getWidth()) / 2,
- getY() + (getHeight() - m_pUnableImage->getHeight()) / 2);
- }
-}
diff --git a/Easy2D/Node/Button/TextButton.cpp b/Easy2D/Node/Button/TextButton.cpp
deleted file mode 100644
index fcebafad..00000000
--- a/Easy2D/Node/Button/TextButton.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-#include "..\..\easy2d.h"
-
-
-TextButton::TextButton() :
- m_pNormalText(nullptr),
- m_pMouseInText(nullptr),
- m_pSelectedText(nullptr),
- m_pUnableText(nullptr)
-{
-}
-
-TextButton::TextButton(TString text) :
- TextButton()
-{
- setNormal(new Text(text)); // ðť״̬ʱ
-}
-
-TextButton::TextButton(Text * text) :
- TextButton()
-{
- setNormal(text); // ðť״̬ʱ
-}
-
-TextButton::~TextButton()
-{
- // ıüһ
- SafeRelease(m_pNormalText);
- SafeRelease(m_pMouseInText);
- SafeRelease(m_pSelectedText);
- SafeRelease(m_pUnableText);
-}
-
-void TextButton::_setStatus(Status status)
-{
- if (m_eStatus != status)
- {
- if (status == MOUSEIN)
- {
- if (m_pMouseInText) setRect(m_pMouseInText->getRect());
- }
- else if (status == SELECTED)
- {
- if (m_pSelectedText) setRect(m_pSelectedText->getRect());
- }
- else
- {
- setRect(m_pNormalText->getRect());
- }
- }
- MouseNode::_setStatus(status);
-}
-
-void TextButton::_onNormal()
-{
- if (m_pNormalText)
- {
- m_pNormalText->_onDraw();
- }
-}
-
-void TextButton::_onMouseIn()
-{
- if (m_pMouseInText)
- {
- m_pMouseInText->_onDraw();
- }
- else
- {
- _onNormal();
- }
-}
-
-void TextButton::_onSelected()
-{
- if (m_pSelectedText)
- {
- m_pSelectedText->_onDraw();
- }
- else
- {
- _onNormal();
- }
-}
-
-void TextButton::_onDisable()
-{
- if (m_pUnableText)
- {
- m_pUnableText->_onDraw();
- }
- else
- {
- _onNormal();
- }
-}
-
-void TextButton::setNormal(Text * text)
-{
- if (text)
- {
- // ԭıüһ
- SafeRelease(m_pNormalText);
- // ı
- m_pNormalText = text;
- // ıüһ
- m_pNormalText->retain();
- // ֿ趨ťС
- setSize(m_pNormalText->getSize());
- // ¼ıλ
- _resetPosition();
- }
-}
-
-void TextButton::setMouseIn(Text * text)
-{
- if (text)
- {
- SafeRelease(m_pMouseInText);
- m_pMouseInText = text;
- m_pMouseInText->retain();
- _resetPosition();
- }
-}
-
-void TextButton::setSelected(Text * text)
-{
- if (text)
- {
- SafeRelease(m_pSelectedText);
- m_pSelectedText = text;
- m_pSelectedText->retain();
- _resetPosition();
- }
-}
-
-void TextButton::setUnable(Text * text)
-{
- if (text)
- {
- SafeRelease(m_pUnableText);
- m_pUnableText = text;
- m_pUnableText->retain();
- _resetPosition();
- }
-}
-
-void TextButton::_resetPosition()
-{
- if (m_pNormalText)
- {
- // ݰťλúֿλþʾ
- m_pNormalText->setPos(getX() , getY());
- }
- if (m_pMouseInText)
- {
- m_pMouseInText->setPos(
- getX() + (getWidth() - m_pMouseInText->getWidth()) / 2,
- getY() + (getHeight() - m_pMouseInText->getHeight()) / 2);
- }
- if (m_pSelectedText)
- {
- m_pSelectedText->setPos(
- getX() + (getWidth() - m_pSelectedText->getWidth()) / 2,
- getY() + (getHeight() - m_pSelectedText->getHeight()) / 2);
- }
- if (m_pUnableText)
- {
- m_pUnableText->setPos(
- getX() + (getWidth() - m_pUnableText->getWidth()) / 2,
- getY() + (getHeight() - m_pUnableText->getHeight()) / 2);
- }
-}
diff --git a/Easy2D/Node/ENode.cpp b/Easy2D/Node/ENode.cpp
index 8f6eea95..10b7b256 100644
--- a/Easy2D/Node/ENode.cpp
+++ b/Easy2D/Node/ENode.cpp
@@ -1,4 +1,5 @@
#include "..\enodes.h"
+#include "..\Win\winbase.h"
e2d::ENode::ENode()
: m_nZOrder(0)
@@ -27,8 +28,20 @@ bool e2d::ENode::_exec(bool active)
return false;
}
-void e2d::ENode::_onDraw()
+void e2d::ENode::_onRender()
{
+ D2D1_RECT_F rectangle = D2D1::RectF(
+ m_Rect.left,
+ m_Rect.top,
+ m_Rect.right,
+ m_Rect.bottom
+ );
+ ID2D1SolidColorBrush* m_pLightSlateGrayBrush;
+ GetRenderTarget()->CreateSolidColorBrush(
+ D2D1::ColorF(D2D1::ColorF::LightSlateGray),
+ &m_pLightSlateGrayBrush
+ );
+ GetRenderTarget()->FillRectangle(&rectangle, m_pLightSlateGrayBrush);
}
int e2d::ENode::getX() const
diff --git a/Easy2D/Node/Image.cpp b/Easy2D/Node/Image.cpp
deleted file mode 100644
index 83b8a0b7..00000000
--- a/Easy2D/Node/Image.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-#include "..\easy2d.h"
-#include "..\EasyX\easyx.h"
-#include