Refactoring : header files name

This commit is contained in:
Nomango 2018-09-05 13:17:07 +08:00
parent 860e0fe08e
commit 745bd994a8
55 changed files with 90 additions and 100 deletions

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::Animate::Animate() e2d::Animate::Animate()
: frame_index_(0) : frame_index_(0)

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::JumpBy::JumpBy(float duration, const Point & vec, float height, int jumps) e2d::JumpBy::JumpBy(float duration, const Point & vec, float height, int jumps)
: FiniteTimeAction(duration) : FiniteTimeAction(duration)

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::JumpTo::JumpTo(float duration, const Point & pos, float height, int jumps) e2d::JumpTo::JumpTo(float duration, const Point & pos, float height, int jumps)
: JumpBy(duration, Point(), height, jumps) : JumpBy(duration, Point(), height, jumps)

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::MoveBy::MoveBy(float duration, Point vector) e2d::MoveBy::MoveBy(float duration, Point vector)

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::MoveTo::MoveTo(float duration, Point pos) e2d::MoveTo::MoveTo(float duration, Point pos)
: MoveBy(duration, Point()) : MoveBy(duration, Point())

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::OpacityBy::OpacityBy(float duration, float opacity) e2d::OpacityBy::OpacityBy(float duration, float opacity)

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::OpacityTo::OpacityTo(float duration, float opacity) e2d::OpacityTo::OpacityTo(float duration, float opacity)

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::RotateBy::RotateBy(float duration, float rotation) e2d::RotateBy::RotateBy(float duration, float rotation)

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::RotateTo::RotateTo(float duration, float rotation) e2d::RotateTo::RotateTo(float duration, float rotation)

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::ScaleBy::ScaleBy(float duration, float scale) e2d::ScaleBy::ScaleBy(float duration, float scale)

View File

@ -1,5 +1,5 @@
#include "..\e2daction.h" #include "..\e2daction.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::ScaleTo::ScaleTo(float duration, float scale) e2d::ScaleTo::ScaleTo(float duration, float scale)
: ScaleBy(duration, 0, 0) : ScaleBy(duration, 0, 0)

View File

@ -1,4 +1,4 @@
#include "..\e2dbase.h" #include "..\e2dmodule.h"
e2d::Audio * e2d::Audio::instance_ = nullptr; e2d::Audio * e2d::Audio::instance_ = nullptr;

View File

@ -1,5 +1,5 @@
#include "..\e2dbase.h" #include "..\e2dmodule.h"
#include "..\e2dtool.h" #include "..\e2dutil.h"
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
using namespace e2d; using namespace e2d;
@ -38,8 +38,6 @@ e2d::GC::GC()
e2d::GC::~GC() e2d::GC::~GC()
{ {
// 删除所有对象 // 删除所有对象
Timer::GetInstance()->ClearAllTasks();
cleanup_ = true; cleanup_ = true;
for (const auto& ref : pool_) for (const auto& ref : pool_)
{ {

View File

@ -1,8 +1,8 @@
#include "..\e2dbase.h" #include "..\e2dmodule.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2dtransition.h" #include "..\e2dtransition.h"
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
#include "..\e2dtool.h" #include "..\e2dutil.h"
#include <thread> #include <thread>

View File

@ -1,5 +1,5 @@
#include "..\e2dbase.h" #include "..\e2dmodule.h"
#include "..\e2dtool.h" #include "..\e2dutil.h"
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
#pragma comment(lib, "dinput8.lib") #pragma comment(lib, "dinput8.lib")

View File

@ -1,6 +1,6 @@
#include "..\e2dbase.h" #include "..\e2dmodule.h"
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::Renderer* e2d::Renderer::instance_ = nullptr; e2d::Renderer* e2d::Renderer::instance_ = nullptr;

View File

@ -1,6 +1,6 @@
#include "..\e2dbase.h" #include "..\e2dmodule.h"
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include <imm.h> #include <imm.h>
#pragma comment (lib ,"imm32.lib") #pragma comment (lib ,"imm32.lib")

View File

@ -1,6 +1,8 @@
#include "..\e2dcommon.h" #include "..\e2dcommon.h"
#include "..\e2dimpl.h"
#include "..\e2dmodule.h"
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::Collider::Collider(Node * parent) e2d::Collider::Collider(Node * parent)
: visible_(true) : visible_(true)

View File

@ -1,6 +1,6 @@
#include "..\e2dcommon.h" #include "..\e2dcommon.h"
#include "..\e2dbase.h" #include "..\e2dmodule.h"
#include "..\e2dtool.h" #include "..\e2dutil.h"
std::map<size_t, ID2D1Bitmap*> e2d::Image::bitmap_cache_; std::map<size_t, ID2D1Bitmap*> e2d::Image::bitmap_cache_;

View File

@ -1,4 +1,4 @@
#include "..\e2dtool.h" #include "..\e2dutil.h"
e2d::Resource::Resource(size_t resource_name, const String & resource_type) e2d::Resource::Resource(size_t resource_name, const String & resource_type)

View File

@ -1,4 +1,4 @@
#include "..\e2dcustom.h" #include "..\e2dimpl.h"
e2d::Exception::Exception() E2D_NOEXCEPT e2d::Exception::Exception() E2D_NOEXCEPT

View File

@ -1,4 +1,4 @@
#include "..\e2dcustom.h" #include "..\e2dimpl.h"
e2d::SystemException::SystemException() E2D_NOEXCEPT e2d::SystemException::SystemException() E2D_NOEXCEPT
: Exception("Unknown system exception") : Exception("Unknown system exception")

View File

@ -1,5 +1,5 @@
#include "..\e2dcustom.h" #include "..\e2dimpl.h"
#include "..\e2dbase.h" #include "..\e2dmodule.h"
using namespace e2d; using namespace e2d;

View File

@ -1,4 +1,4 @@
#include "..\e2dcustom.h" #include "..\e2dimpl.h"
#include "..\e2dcommon.h" #include "..\e2dcommon.h"
e2d::VoiceCallback::VoiceCallback() e2d::VoiceCallback::VoiceCallback()

View File

@ -1,5 +1,5 @@
#include "..\e2devent.h" #include "..\e2devent.h"
#include "..\e2dbase.h" #include "..\e2dmodule.h"
e2d::MouseEvent::MouseEvent(HWND hWnd, UINT message, WPARAM w_param, LPARAM l_param, float dpi) e2d::MouseEvent::MouseEvent(HWND hWnd, UINT message, WPARAM w_param, LPARAM l_param, float dpi)
: message_(message) : message_(message)

View File

@ -1,6 +1,7 @@
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2dtool.h" #include "..\e2dutil.h"
#include "..\e2dmodule.h"
e2d::CollisionManager * e2d::CollisionManager::GetInstance() e2d::CollisionManager * e2d::CollisionManager::GetInstance()

View File

@ -1,5 +1,6 @@
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
#include "..\e2dmodule.h"
#define SAFE_SET(pointer, func, ...) if (pointer) { pointer->##func(__VA_ARGS__); } #define SAFE_SET(pointer, func, ...) if (pointer) { pointer->##func(__VA_ARGS__); }

View File

@ -1,4 +1,5 @@
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2dmodule.h"
e2d::Canvas::Canvas(float width, float height) e2d::Canvas::Canvas(float width, float height)
: render_target_(nullptr) : render_target_(nullptr)

View File

@ -1,4 +1,4 @@
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::Menu::Menu() e2d::Menu::Menu()
: enabled_(true) : enabled_(true)

View File

@ -1,4 +1,4 @@
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2devent.h" #include "..\e2devent.h"
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
#include "..\e2daction.h" #include "..\e2daction.h"

View File

@ -1,5 +1,5 @@
#include "..\e2dbase.h" #include "..\e2dmodule.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2dmanager.h" #include "..\e2dmanager.h"
e2d::Scene::Scene() e2d::Scene::Scene()

View File

@ -1,5 +1,5 @@
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2dmodule.h"
e2d::Sprite::Sprite() e2d::Sprite::Sprite()
: image_(nullptr) : image_(nullptr)

View File

@ -1,4 +1,5 @@
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2dmodule.h"
//------------------------------------------------------- //-------------------------------------------------------
// Style // Style

View File

@ -1,4 +1,4 @@
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#define SAFE_SET(pointer, func, ...) if (pointer) { pointer->##func(__VA_ARGS__); } #define SAFE_SET(pointer, func, ...) if (pointer) { pointer->##func(__VA_ARGS__); }

View File

@ -1,4 +1,4 @@
#include "..\e2dtool.h" #include "..\e2dutil.h"
e2d::Data::Data(const String & key, const String & field) e2d::Data::Data(const String & key, const String & field)

View File

@ -1,4 +1,5 @@
#include "..\e2dtool.h" #include "..\e2dutil.h"
#include "..\e2dmodule.h"
#include <shobjidl.h> #include <shobjidl.h>
std::list<e2d::String> e2d::File::search_paths_; std::list<e2d::String> e2d::File::search_paths_;

View File

@ -1,4 +1,5 @@
#include "..\e2dtool.h" #include "..\e2dutil.h"
#include "..\e2dmodule.h"
#ifndef SAFE_DELETE #ifndef SAFE_DELETE

View File

@ -1,4 +1,5 @@
#include "..\e2dtool.h" #include "..\e2dutil.h"
#include "..\e2dmodule.h"
#include <shlobj.h> #include <shlobj.h>
const e2d::String& e2d::Path::GetDataPath() const e2d::String& e2d::Path::GetDataPath()

View File

@ -1,4 +1,4 @@
#include "..\e2dtool.h" #include "..\e2dutil.h"
e2d::Player * e2d::Player::instance_ = nullptr; e2d::Player * e2d::Player::instance_ = nullptr;

View File

@ -1,4 +1,4 @@
#include "..\e2dtool.h" #include "..\e2dutil.h"
std::default_random_engine &e2d::Random::GetEngine() std::default_random_engine &e2d::Random::GetEngine()
{ {

View File

@ -1,4 +1,4 @@
#include "..\e2dtool.h" #include "..\e2dutil.h"
e2d::Task::Task(const Function & func, const String & name) e2d::Task::Task(const Function & func, const String & name)

View File

@ -1,4 +1,4 @@
#include "..\e2dtool.h" #include "..\e2dutil.h"
e2d::Timer * e2d::Timer::GetInstance() e2d::Timer * e2d::Timer::GetInstance()
@ -87,18 +87,6 @@ void e2d::Timer::RemoveAllTasks()
} }
} }
void e2d::Timer::ClearAllTasks()
{
if (tasks_.empty())
return;
for (const auto& task : tasks_)
{
task->Release();
}
tasks_.clear();
}
void e2d::Timer::Update() void e2d::Timer::Update()
{ {
if (tasks_.empty()) if (tasks_.empty())

View File

@ -1,5 +1,6 @@
#include "..\e2dtransition.h" #include "..\e2dtransition.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2dmodule.h"
e2d::BoxTransition::BoxTransition(Scene* scene, float duration) e2d::BoxTransition::BoxTransition(Scene* scene, float duration)
: Transition(scene, duration) : Transition(scene, duration)

View File

@ -1,5 +1,5 @@
#include "..\e2dtransition.h" #include "..\e2dtransition.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::EmergeTransition::EmergeTransition(Scene* scene, float duration) e2d::EmergeTransition::EmergeTransition(Scene* scene, float duration)
: Transition(scene, duration) : Transition(scene, duration)

View File

@ -1,5 +1,5 @@
#include "..\e2dtransition.h" #include "..\e2dtransition.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::FadeTransition::FadeTransition(Scene* scene, float duration) e2d::FadeTransition::FadeTransition(Scene* scene, float duration)
: Transition(scene, duration) : Transition(scene, duration)

View File

@ -1,5 +1,6 @@
#include "..\e2dtransition.h" #include "..\e2dtransition.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
#include "..\e2dmodule.h"
e2d::MoveTransition::MoveTransition(Scene* scene, float duration, Direction direction) e2d::MoveTransition::MoveTransition(Scene* scene, float duration, Direction direction)
: Transition(scene, duration) : Transition(scene, duration)

View File

@ -1,6 +1,6 @@
#include "..\e2dbase.h" #include "..\e2dmodule.h"
#include "..\e2dtransition.h" #include "..\e2dtransition.h"
#include "..\e2dnode.h" #include "..\e2dcomponent.h"
e2d::Transition::Transition(Scene* scene, float duration) e2d::Transition::Transition(Scene* scene, float duration)
: done_(false) : done_(false)

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "e2dcommon.h" #include "e2dcommon.h"
#include "e2dbase.h" #include "e2dmodule.h"
namespace e2d namespace e2d
{ {

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "e2dbase.h" #include "e2dcommon.h"
#include "e2devent.h" #include "e2devent.h"
namespace e2d namespace e2d
@ -7,6 +7,7 @@ namespace e2d
class Action; class Action;
class Scene;
// »æÍ¼½Ó¿Ú // »æÍ¼½Ó¿Ú

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include "e2dmacros.h"
#include "e2dcommon.h" #include "e2dcommon.h"
namespace e2d namespace e2d

View File

@ -1,11 +1,9 @@
#pragma once #pragma once
#include "e2dmacros.h" #include "e2dimpl.h"
#include "e2dcommon.h" #include "e2dcomponent.h"
#include "e2dcustom.h" #include "e2dtransition.h"
// Base Classes
namespace e2d namespace e2d
{ {
@ -314,9 +312,6 @@ protected:
}; };
class Scene;
class Transition;
// ÓÎÏ· // ÓÎÏ·
class Game class Game
{ {

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include "e2dbase.h" #include "e2dcommon.h"
#include "e2dimpl.h"
namespace e2d namespace e2d
{ {
@ -292,7 +293,7 @@ protected:
// 任务是否就绪 // 任务是否就绪
bool IsReady() const; bool IsReady() const;
private: protected:
bool running_; bool running_;
bool stopped_; bool stopped_;
int run_times_; int run_times_;
@ -340,9 +341,6 @@ public:
// 移除所有任务 // 移除所有任务
void RemoveAllTasks(); void RemoveAllTasks();
// 强制清空所有任务
void ClearAllTasks();
// 更新定时器 // 更新定时器
void Update(); void Update();

View File

@ -19,12 +19,12 @@
#include "e2dmacros.h" #include "e2dmacros.h"
#include "e2dcommon.h" #include "e2dcommon.h"
#include "e2dbase.h"
#include "e2dmanager.h" #include "e2dmanager.h"
#include "e2dnode.h" #include "e2dcomponent.h"
#include "e2dtool.h" #include "e2dutil.h"
#include "e2daction.h" #include "e2daction.h"
#include "e2dtransition.h" #include "e2dtransition.h"
#include "e2dmodule.h"
#if defined(DEBUG) || defined(_DEBUG) #if defined(DEBUG) || defined(_DEBUG)

View File

@ -268,15 +268,15 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\core\e2daction.h" /> <ClInclude Include="..\..\core\e2daction.h" />
<ClInclude Include="..\..\core\e2dcustom.h" /> <ClInclude Include="..\..\core\e2dimpl.h" />
<ClInclude Include="..\..\core\e2devent.h" /> <ClInclude Include="..\..\core\e2devent.h" />
<ClInclude Include="..\..\core\easy2d.h" /> <ClInclude Include="..\..\core\easy2d.h" />
<ClInclude Include="..\..\core\e2dbase.h" /> <ClInclude Include="..\..\core\e2dmodule.h" />
<ClInclude Include="..\..\core\e2dcommon.h" /> <ClInclude Include="..\..\core\e2dcommon.h" />
<ClInclude Include="..\..\core\e2dmacros.h" /> <ClInclude Include="..\..\core\e2dmacros.h" />
<ClInclude Include="..\..\core\e2dmanager.h" /> <ClInclude Include="..\..\core\e2dmanager.h" />
<ClInclude Include="..\..\core\e2dnode.h" /> <ClInclude Include="..\..\core\e2dcomponent.h" />
<ClInclude Include="..\..\core\e2dtool.h" /> <ClInclude Include="..\..\core\e2dutil.h" />
<ClInclude Include="..\..\core\e2dtransition.h" /> <ClInclude Include="..\..\core\e2dtransition.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -241,14 +241,14 @@
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\core\easy2d.h" /> <ClInclude Include="..\..\core\easy2d.h" />
<ClInclude Include="..\..\core\e2daction.h" /> <ClInclude Include="..\..\core\e2daction.h" />
<ClInclude Include="..\..\core\e2dbase.h" />
<ClInclude Include="..\..\core\e2dcommon.h" /> <ClInclude Include="..\..\core\e2dcommon.h" />
<ClInclude Include="..\..\core\e2dmacros.h" /> <ClInclude Include="..\..\core\e2dmacros.h" />
<ClInclude Include="..\..\core\e2dmanager.h" /> <ClInclude Include="..\..\core\e2dmanager.h" />
<ClInclude Include="..\..\core\e2dnode.h" />
<ClInclude Include="..\..\core\e2dtool.h" />
<ClInclude Include="..\..\core\e2dtransition.h" /> <ClInclude Include="..\..\core\e2dtransition.h" />
<ClInclude Include="..\..\core\e2dcustom.h" />
<ClInclude Include="..\..\core\e2devent.h" /> <ClInclude Include="..\..\core\e2devent.h" />
<ClInclude Include="..\..\core\e2dutil.h" />
<ClInclude Include="..\..\core\e2dmodule.h" />
<ClInclude Include="..\..\core\e2dcomponent.h" />
<ClInclude Include="..\..\core\e2dimpl.h" />
</ItemGroup> </ItemGroup>
</Project> </Project>