change: the name of smart pointers start with 'Sp'
minor fixes minor fixes minor fixes minor fixes
This commit is contained in:
		
							parent
							
								
									c165db986b
								
							
						
					
					
						commit
						22d9e843fe
					
				|  | @ -30,13 +30,13 @@ namespace easy2d | |||
| 
 | ||||
| 	class Action | ||||
| 		: public Object | ||||
| 		, protected intrusive::ListItem<spAction> | ||||
| 		, protected intrusive::ListItem<SpAction> | ||||
| 	{ | ||||
| 		friend class ActionManager; | ||||
| 		friend class Loop; | ||||
| 		friend class Sequence; | ||||
| 		friend class Spawn; | ||||
| 		friend class intrusive::List<spAction>; | ||||
| 		friend class intrusive::List<SpAction>; | ||||
| 
 | ||||
| 	public: | ||||
| 		Action() : running_(false), done_(false), initialized_(false) {} | ||||
|  | @ -56,10 +56,10 @@ namespace easy2d | |||
| 		virtual void Stop() { if (!done_) { done_ = true; if (cb_) cb_(); } } | ||||
| 
 | ||||
| 		// 获取动作的拷贝
 | ||||
| 		virtual spAction Clone() const = 0; | ||||
| 		virtual SpAction Clone() const = 0; | ||||
| 
 | ||||
| 		// 获取动作的倒转
 | ||||
| 		virtual spAction Reverse() const = 0; | ||||
| 		virtual SpAction Reverse() const = 0; | ||||
| 
 | ||||
| 		// 重置动作
 | ||||
| 		virtual void Reset() | ||||
|  |  | |||
|  | @ -27,7 +27,7 @@ namespace easy2d | |||
| 	// Loop
 | ||||
| 	//-------------------------------------------------------
 | ||||
| 
 | ||||
| 	Loop::Loop(spAction const& action, int times) | ||||
| 	Loop::Loop(SpAction const& action, int times) | ||||
| 		: action_(action) | ||||
| 		, times_(0) | ||||
| 		, total_times_(times) | ||||
|  | @ -41,7 +41,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Loop::Clone() const | ||||
| 	SpAction Loop::Clone() const | ||||
| 	{ | ||||
| 		if (action_) | ||||
| 		{ | ||||
|  | @ -53,7 +53,7 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Loop::Reverse() const | ||||
| 	SpAction Loop::Reverse() const | ||||
| 	{ | ||||
| 		if (action_) | ||||
| 		{ | ||||
|  | @ -172,7 +172,7 @@ namespace easy2d | |||
| 		action_index_ = 0; | ||||
| 	} | ||||
| 
 | ||||
| 	void Sequence::Add(spAction const& action) | ||||
| 	void Sequence::Add(SpAction const& action) | ||||
| 	{ | ||||
| 		if (action) | ||||
| 		{ | ||||
|  | @ -188,7 +188,7 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Sequence::Clone() const | ||||
| 	SpAction Sequence::Clone() const | ||||
| 	{ | ||||
| 		auto sequence = new (std::nothrow) Sequence(); | ||||
| 		if (sequence) | ||||
|  | @ -204,7 +204,7 @@ namespace easy2d | |||
| 		return sequence; | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Sequence::Reverse() const | ||||
| 	SpAction Sequence::Reverse() const | ||||
| 	{ | ||||
| 		auto sequence = new (std::nothrow) Sequence(); | ||||
| 		if (sequence && !actions_.empty()) | ||||
|  | @ -281,7 +281,7 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	void Spawn::Add(spAction const& action) | ||||
| 	void Spawn::Add(SpAction const& action) | ||||
| 	{ | ||||
| 		if (action) | ||||
| 		{ | ||||
|  | @ -297,7 +297,7 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Spawn::Clone() const | ||||
| 	SpAction Spawn::Clone() const | ||||
| 	{ | ||||
| 		auto spawn = new (std::nothrow) Spawn(); | ||||
| 		if (spawn) | ||||
|  | @ -313,7 +313,7 @@ namespace easy2d | |||
| 		return spawn; | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Spawn::Reverse() const | ||||
| 	SpAction Spawn::Reverse() const | ||||
| 	{ | ||||
| 		auto spawn = new (std::nothrow) Spawn(); | ||||
| 		if (spawn && !actions_.empty()) | ||||
|  |  | |||
|  | @ -29,17 +29,17 @@ namespace easy2d | |||
| 	{ | ||||
| 	public: | ||||
| 		explicit Loop( | ||||
| 			spAction const& action,	/* 执行循环的动作 */ | ||||
| 			SpAction const& action,	/* 执行循环的动作 */ | ||||
| 			int times = -1			/* 循环次数 */ | ||||
| 		); | ||||
| 
 | ||||
| 		virtual ~Loop(); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 		// 重置动作
 | ||||
| 		virtual void Reset() override; | ||||
|  | @ -54,7 +54,7 @@ namespace easy2d | |||
| 		virtual void Update(Node* target, Duration const& dt) override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		spAction	action_; | ||||
| 		SpAction	action_; | ||||
| 		int			times_; | ||||
| 		int			total_times_; | ||||
| 	}; | ||||
|  | @ -64,7 +64,7 @@ namespace easy2d | |||
| 	class Sequence | ||||
| 		: public Action | ||||
| 	{ | ||||
| 		using Actions = std::vector<spAction>; | ||||
| 		using Actions = std::vector<SpAction>; | ||||
| 
 | ||||
| 	public: | ||||
| 		Sequence(); | ||||
|  | @ -77,7 +77,7 @@ namespace easy2d | |||
| 
 | ||||
| 		// 在结尾添加动作
 | ||||
| 		void Add( | ||||
| 			spAction const& action | ||||
| 			SpAction const& action | ||||
| 		); | ||||
| 
 | ||||
| 		// 在结尾添加多个动作
 | ||||
|  | @ -86,10 +86,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 		// 重置动作
 | ||||
| 		virtual void Reset() override; | ||||
|  | @ -111,7 +111,7 @@ namespace easy2d | |||
| 	class Spawn | ||||
| 		: public Action | ||||
| 	{ | ||||
| 		using Actions = std::vector<spAction>; | ||||
| 		using Actions = std::vector<SpAction>; | ||||
| 
 | ||||
| 	public: | ||||
| 		Spawn(); | ||||
|  | @ -124,7 +124,7 @@ namespace easy2d | |||
| 
 | ||||
| 		// 在结尾添加动作
 | ||||
| 		void Add( | ||||
| 			spAction const& action | ||||
| 			SpAction const& action | ||||
| 		); | ||||
| 
 | ||||
| 		// 在结尾添加多个动作
 | ||||
|  | @ -133,10 +133,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const; | ||||
| 		virtual SpAction Reverse() const; | ||||
| 
 | ||||
| 		// 重置动作
 | ||||
| 		virtual void Reset() override; | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ namespace easy2d | |||
| 		if (actions_.IsEmpty()) | ||||
| 			return; | ||||
| 
 | ||||
| 		spAction next; | ||||
| 		SpAction next; | ||||
| 		for (auto action = actions_.First(); action; action = next) | ||||
| 		{ | ||||
| 			next = action->NextItem(); | ||||
|  | @ -41,14 +41,14 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	void ActionManager::AddAction(spAction const& action) | ||||
| 	void ActionManager::AddAction(SpAction const& action) | ||||
| 	{ | ||||
| 		E2D_ASSERT(action && "AddAction failed, NULL pointer exception"); | ||||
| 
 | ||||
| 		if (action) | ||||
| 		{ | ||||
| 			action->Start(); | ||||
| 			actions_.PushBack(Action::ItemType(action)); | ||||
| 			actions_.PushBack(action); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
|  | @ -25,12 +25,12 @@ namespace easy2d | |||
| { | ||||
| 	class ActionManager | ||||
| 	{ | ||||
| 		using Actions = intrusive::List<spAction>; | ||||
| 		using Actions = intrusive::List<SpAction>; | ||||
| 
 | ||||
| 	public: | ||||
| 		// 执行动作
 | ||||
| 		void AddAction( | ||||
| 			spAction const& action | ||||
| 			SpAction const& action | ||||
| 		); | ||||
| 
 | ||||
| 		// 继续所有暂停动作
 | ||||
|  |  | |||
|  | @ -235,12 +235,12 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	spAction MoveBy::Clone() const | ||||
| 	SpAction MoveBy::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) MoveBy(duration_, delta_pos_, ease_type_); | ||||
| 	} | ||||
| 
 | ||||
| 	spAction MoveBy::Reverse() const | ||||
| 	SpAction MoveBy::Reverse() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) MoveBy(duration_, -delta_pos_, ease_type_); | ||||
| 	} | ||||
|  | @ -251,7 +251,7 @@ namespace easy2d | |||
| 		end_pos_ = pos; | ||||
| 	} | ||||
| 
 | ||||
| 	spAction MoveTo::Clone() const | ||||
| 	SpAction MoveTo::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) MoveTo(duration_, end_pos_, ease_type_); | ||||
| 	} | ||||
|  | @ -275,12 +275,12 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	spAction JumpBy::Clone() const | ||||
| 	SpAction JumpBy::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) JumpBy(duration_, delta_pos_, height_, jumps_, ease_type_); | ||||
| 	} | ||||
| 
 | ||||
| 	spAction JumpBy::Reverse() const | ||||
| 	SpAction JumpBy::Reverse() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) JumpBy(duration_, -delta_pos_, height_, jumps_, ease_type_); | ||||
| 	} | ||||
|  | @ -320,7 +320,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	spAction JumpTo::Clone() const | ||||
| 	SpAction JumpTo::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) JumpTo(duration_, end_pos_, height_, jumps_, ease_type_); | ||||
| 	} | ||||
|  | @ -369,12 +369,12 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	spAction ScaleBy::Clone() const | ||||
| 	SpAction ScaleBy::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) ScaleBy(duration_, delta_x_, delta_y_, ease_type_); | ||||
| 	} | ||||
| 
 | ||||
| 	spAction ScaleBy::Reverse() const | ||||
| 	SpAction ScaleBy::Reverse() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) ScaleBy(duration_, -delta_x_, -delta_y_, ease_type_); | ||||
| 	} | ||||
|  | @ -393,7 +393,7 @@ namespace easy2d | |||
| 		end_scale_y_ = scale_y; | ||||
| 	} | ||||
| 
 | ||||
| 	spAction ScaleTo::Clone() const | ||||
| 	SpAction ScaleTo::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) ScaleTo(duration_, end_scale_x_, end_scale_y_, ease_type_); | ||||
| 	} | ||||
|  | @ -434,12 +434,12 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	spAction OpacityBy::Clone() const | ||||
| 	SpAction OpacityBy::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) OpacityBy(duration_, delta_val_, ease_type_); | ||||
| 	} | ||||
| 
 | ||||
| 	spAction OpacityBy::Reverse() const | ||||
| 	SpAction OpacityBy::Reverse() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) OpacityBy(duration_, -delta_val_, ease_type_); | ||||
| 	} | ||||
|  | @ -450,7 +450,7 @@ namespace easy2d | |||
| 		end_val_ = opacity; | ||||
| 	} | ||||
| 
 | ||||
| 	spAction OpacityTo::Clone() const | ||||
| 	SpAction OpacityTo::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) OpacityTo(duration_, end_val_, ease_type_); | ||||
| 	} | ||||
|  | @ -500,12 +500,12 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	spAction RotateBy::Clone() const | ||||
| 	SpAction RotateBy::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) RotateBy(duration_, delta_val_, ease_type_); | ||||
| 	} | ||||
| 
 | ||||
| 	spAction RotateBy::Reverse() const | ||||
| 	SpAction RotateBy::Reverse() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) RotateBy(duration_, -delta_val_, ease_type_); | ||||
| 	} | ||||
|  | @ -516,7 +516,7 @@ namespace easy2d | |||
| 		end_val_ = rotation; | ||||
| 	} | ||||
| 
 | ||||
| 	spAction RotateTo::Clone() const | ||||
| 	SpAction RotateTo::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) RotateTo(duration_, end_val_, ease_type_); | ||||
| 	} | ||||
|  | @ -532,7 +532,7 @@ namespace easy2d | |||
| 	// PathAction
 | ||||
| 	//-------------------------------------------------------
 | ||||
| 
 | ||||
| 	PathAction::PathAction(Duration const & duration, spGeometry const& geo, bool rotating, float start, float end, EaseFunc func) | ||||
| 	PathAction::PathAction(Duration const & duration, SpGeometry const& geo, bool rotating, float start, float end, EaseFunc func) | ||||
| 		: Tween(duration, func) | ||||
| 		, start_(start) | ||||
| 		, end_(end) | ||||
|  | @ -541,12 +541,12 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	spAction PathAction::Clone() const | ||||
| 	SpAction PathAction::Clone() const | ||||
| 	{ | ||||
| 		return new PathAction(duration_, geo_, rotating_, start_, end_, ease_type_); | ||||
| 	} | ||||
| 
 | ||||
| 	spAction PathAction::Reverse() const | ||||
| 	SpAction PathAction::Reverse() const | ||||
| 	{ | ||||
| 		return new PathAction(duration_, geo_, rotating_, end_, start_, ease_type_); | ||||
| 	} | ||||
|  |  | |||
|  | @ -128,10 +128,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		virtual void Init(Node* target) override; | ||||
|  | @ -157,10 +157,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override | ||||
| 		virtual SpAction Reverse() const override | ||||
| 		{ | ||||
| 			logs::Errorln("Reverse() not supported in MoveTo"); | ||||
| 			return nullptr; | ||||
|  | @ -188,10 +188,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		virtual void Init(Node* target) override; | ||||
|  | @ -221,10 +221,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override | ||||
| 		virtual SpAction Reverse() const override | ||||
| 		{ | ||||
| 			logs::Errorln("Reverse() not supported in JumpTo"); | ||||
| 			return nullptr; | ||||
|  | @ -257,10 +257,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		virtual void Init(Node* target) override; | ||||
|  | @ -294,10 +294,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override | ||||
| 		virtual SpAction Reverse() const override | ||||
| 		{ | ||||
| 			logs::Errorln("Reverse() not supported in ScaleTo"); | ||||
| 			return nullptr; | ||||
|  | @ -324,10 +324,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		virtual void Init(Node* target) override; | ||||
|  | @ -352,10 +352,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override | ||||
| 		virtual SpAction Reverse() const override | ||||
| 		{ | ||||
| 			logs::Errorln("Reverse() not supported in OpacityTo"); | ||||
| 			return nullptr; | ||||
|  | @ -407,10 +407,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		virtual void Init(Node* target) override; | ||||
|  | @ -435,10 +435,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override | ||||
| 		virtual SpAction Reverse() const override | ||||
| 		{ | ||||
| 			logs::Errorln("Reverse() not supported in RotateTo"); | ||||
| 			return nullptr; | ||||
|  | @ -459,7 +459,7 @@ namespace easy2d | |||
| 	public: | ||||
| 		explicit PathAction( | ||||
| 			Duration const& duration,			/* 持续时长 */ | ||||
| 			spGeometry const& geo,				/* ¼¸ºÎͼÐÎ */ | ||||
| 			SpGeometry const& geo,				/* ¼¸ºÎͼÐÎ */ | ||||
| 			bool rotating = false,				/* 沿路径切线方向旋转 */ | ||||
| 			float start = 0.f,					/* 起点 */ | ||||
| 			float end = 1.f,					/* 终点 */ | ||||
|  | @ -467,10 +467,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		virtual void Init(Node* target) override; | ||||
|  | @ -482,6 +482,6 @@ namespace easy2d | |||
| 		float		start_; | ||||
| 		float		end_; | ||||
| 		Point		start_pos_; | ||||
| 		spGeometry	geo_; | ||||
| 		SpGeometry	geo_; | ||||
| 	}; | ||||
| } | ||||
|  |  | |||
|  | @ -31,7 +31,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	Animation::Animation(spFrames const& animation) | ||||
| 	Animation::Animation(SpFrames const& animation) | ||||
| 		: frame_index_(0) | ||||
| 		, frames_(nullptr) | ||||
| 	{ | ||||
|  | @ -42,12 +42,12 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	spFrames Animation::GetAnimation() const | ||||
| 	SpFrames Animation::GetAnimation() const | ||||
| 	{ | ||||
| 		return frames_; | ||||
| 	} | ||||
| 
 | ||||
| 	void Animation::SetAnimation(spFrames const& animation) | ||||
| 	void Animation::SetAnimation(SpFrames const& animation) | ||||
| 	{ | ||||
| 		if (animation && animation != frames_) | ||||
| 		{ | ||||
|  | @ -106,7 +106,7 @@ namespace easy2d | |||
| 		frame_index_ = 0; | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Animation::Clone() const | ||||
| 	SpAction Animation::Clone() const | ||||
| 	{ | ||||
| 		if (frames_) | ||||
| 		{ | ||||
|  | @ -115,7 +115,7 @@ namespace easy2d | |||
| 		return nullptr; | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Animation::Reverse() const | ||||
| 	SpAction Animation::Reverse() const | ||||
| 	{ | ||||
| 		if (frames_) | ||||
| 		{ | ||||
|  |  | |||
|  | @ -31,24 +31,24 @@ namespace easy2d | |||
| 		Animation(); | ||||
| 
 | ||||
| 		explicit Animation( | ||||
| 			spFrames const& animation | ||||
| 			SpFrames const& animation | ||||
| 		); | ||||
| 
 | ||||
| 		virtual ~Animation(); | ||||
| 
 | ||||
| 		// 获取动画
 | ||||
| 		spFrames GetAnimation() const; | ||||
| 		SpFrames GetAnimation() const; | ||||
| 
 | ||||
| 		// 设置动画
 | ||||
| 		void SetAnimation( | ||||
| 			spFrames const& animation | ||||
| 			SpFrames const& animation | ||||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 		// 重置动作
 | ||||
| 		virtual void Reset() override; | ||||
|  | @ -63,6 +63,6 @@ namespace easy2d | |||
| 	protected: | ||||
| 		size_t frame_index_; | ||||
| 		Duration delta_; | ||||
| 		spFrames frames_; | ||||
| 		SpFrames frames_; | ||||
| 	}; | ||||
| } | ||||
|  |  | |||
|  | @ -247,7 +247,7 @@ namespace easy2d | |||
| 		cache_expired_ = true; | ||||
| 	} | ||||
| 
 | ||||
| 	void Canvas::DrawImage(spImage const & image, float opacity) | ||||
| 	void Canvas::DrawImage(SpImage const & image, float opacity) | ||||
| 	{ | ||||
| 		if (image && image->GetBitmap()) | ||||
| 		{ | ||||
|  | @ -267,7 +267,7 @@ namespace easy2d | |||
| 		if (text.empty()) | ||||
| 			return; | ||||
| 
 | ||||
| 		cpTextFormat text_format; | ||||
| 		CpTextFormat text_format; | ||||
| 		ThrowIfFailed( | ||||
| 			Factory::Instance()->CreateTextFormat( | ||||
| 				text_format, | ||||
|  | @ -276,7 +276,7 @@ namespace easy2d | |||
| 			) | ||||
| 		); | ||||
| 
 | ||||
| 		cpTextLayout text_layout; | ||||
| 		CpTextLayout text_layout; | ||||
| 		Size layout_size; | ||||
| 		ThrowIfFailed( | ||||
| 			Factory::Instance()->CreateTextLayout( | ||||
|  | @ -293,7 +293,7 @@ namespace easy2d | |||
| 		); | ||||
| 	} | ||||
| 
 | ||||
| 	void Canvas::DrawGeometry(spGeometry const & geo) | ||||
| 	void Canvas::DrawGeometry(SpGeometry const & geo) | ||||
| 	{ | ||||
| 		if (geo && geo->geo_) | ||||
| 		{ | ||||
|  | @ -371,7 +371,7 @@ namespace easy2d | |||
| 		cache_expired_ = true; | ||||
| 	} | ||||
| 
 | ||||
| 	void Canvas::FillGeometry(spGeometry const & geo) | ||||
| 	void Canvas::FillGeometry(SpGeometry const & geo) | ||||
| 	{ | ||||
| 		if (geo && geo->geo_) | ||||
| 		{ | ||||
|  | @ -493,14 +493,14 @@ namespace easy2d | |||
| 		cache_expired_ = true; | ||||
| 	} | ||||
| 
 | ||||
| 	spImage Canvas::ExportToImage() const | ||||
| 	SpImage Canvas::ExportToImage() const | ||||
| 	{ | ||||
| 		auto image = new Image(GetBitmap()); | ||||
| 		image->Crop(Rect(Point{}, this->GetSize())); | ||||
| 		return image; | ||||
| 	} | ||||
| 
 | ||||
| 	cpBitmap const& easy2d::Canvas::GetBitmap() const | ||||
| 	CpBitmap const& easy2d::Canvas::GetBitmap() const | ||||
| 	{ | ||||
| 		if (cache_expired_) | ||||
| 		{ | ||||
|  |  | |||
|  | @ -85,7 +85,7 @@ namespace easy2d | |||
| 
 | ||||
| 		// 画图片
 | ||||
| 		void DrawImage( | ||||
| 			spImage const& image, | ||||
| 			SpImage const& image, | ||||
| 			float opacity = 1.f | ||||
| 		); | ||||
| 
 | ||||
|  | @ -97,7 +97,7 @@ namespace easy2d | |||
| 
 | ||||
| 		// 画几何图形边框
 | ||||
| 		void DrawGeometry( | ||||
| 			spGeometry const& geo | ||||
| 			SpGeometry const& geo | ||||
| 		); | ||||
| 
 | ||||
| 		// 填充圆形
 | ||||
|  | @ -127,7 +127,7 @@ namespace easy2d | |||
| 
 | ||||
| 		// 填充几何图形
 | ||||
| 		void FillGeometry( | ||||
| 			spGeometry const& geo | ||||
| 			SpGeometry const& geo | ||||
| 		); | ||||
| 
 | ||||
| 		// 开始绘制路径
 | ||||
|  | @ -216,26 +216,26 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 导出为图片
 | ||||
| 		spImage ExportToImage() const; | ||||
| 		SpImage ExportToImage() const; | ||||
| 
 | ||||
| 		virtual void OnRender() override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		cpBitmap const& GetBitmap() const; | ||||
| 		CpBitmap const& GetBitmap() const; | ||||
| 
 | ||||
| 	protected: | ||||
| 		mutable bool			cache_expired_; | ||||
| 		mutable cpBitmap		bitmap_cached_; | ||||
| 		mutable CpBitmap		bitmap_cached_; | ||||
| 		float					stroke_width_; | ||||
| 		Font					text_font_; | ||||
| 		TextStyle				text_style_; | ||||
| 		cpPathGeometry			current_geometry_; | ||||
| 		cpGeometrySink			current_sink_; | ||||
| 		cpStrokeStyle			outline_join_style_; | ||||
| 		cpSolidColorBrush		fill_brush_; | ||||
| 		cpSolidColorBrush		stroke_brush_; | ||||
| 		cpSolidColorBrush		text_brush_; | ||||
| 		cpTextRenderer			text_renderer_; | ||||
| 		cpBitmapRenderTarget	render_target_; | ||||
| 		CpPathGeometry			current_geometry_; | ||||
| 		CpGeometrySink			current_sink_; | ||||
| 		CpStrokeStyle			outline_join_style_; | ||||
| 		CpSolidColorBrush		fill_brush_; | ||||
| 		CpSolidColorBrush		stroke_brush_; | ||||
| 		CpSolidColorBrush		text_brush_; | ||||
| 		CpTextRenderer			text_renderer_; | ||||
| 		CpBitmapRenderTarget	render_target_; | ||||
| 	}; | ||||
| } | ||||
|  | @ -44,7 +44,7 @@ namespace easy2d | |||
| 		void OnUpdate(Duration const& dt) override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		spText debug_text_; | ||||
| 		SpText debug_text_; | ||||
| 		std::vector<TimePoint> frame_time_; | ||||
| 		std::vector<std::wstring> texts_; | ||||
| 	}; | ||||
|  |  | |||
|  | @ -51,12 +51,12 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Delay::Clone() const | ||||
| 	SpAction Delay::Clone() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) Delay(delay_); | ||||
| 	} | ||||
| 
 | ||||
| 	spAction Delay::Reverse() const | ||||
| 	SpAction Delay::Reverse() const | ||||
| 	{ | ||||
| 		return new (std::nothrow) Delay(delay_); | ||||
| 	} | ||||
|  |  | |||
|  | @ -33,10 +33,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取该动作的拷贝对象
 | ||||
| 		virtual spAction Clone() const override; | ||||
| 		virtual SpAction Clone() const override; | ||||
| 
 | ||||
| 		// 获取该动作的倒转
 | ||||
| 		virtual spAction Reverse() const override; | ||||
| 		virtual SpAction Reverse() const override; | ||||
| 
 | ||||
| 		// 重置动作
 | ||||
| 		virtual void Reset() override; | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ namespace easy2d | |||
| 		if (listeners_.IsEmpty()) | ||||
| 			return; | ||||
| 
 | ||||
| 		spEventListener next; | ||||
| 		SpEventListener next; | ||||
| 		for (auto listener = listeners_.First(); listener; listener = next) | ||||
| 		{ | ||||
| 			next = listener->NextItem(); | ||||
|  | @ -40,22 +40,22 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	void EventDispatcher::AddListener(spEventListener const & listener) | ||||
| 	void EventDispatcher::AddListener(SpEventListener const & listener) | ||||
| 	{ | ||||
| 		E2D_ASSERT(listener && "AddListener failed, NULL pointer exception"); | ||||
| 
 | ||||
| 		if (listener) | ||||
| 		{ | ||||
| 			listeners_.PushBack(EventListener::ItemType(listener)); | ||||
| 			listeners_.PushBack(listener); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	void EventDispatcher::AddListener(EventType type, EventCallback callback, std::wstring const& name) | ||||
| 	{ | ||||
| 		spEventListener listener = new EventListener(type, callback, name); | ||||
| 		SpEventListener listener = new EventListener(type, callback, name); | ||||
| 		if (listener) | ||||
| 		{ | ||||
| 			listeners_.PushBack(EventListener::ItemType(listener)); | ||||
| 			listeners_.PushBack(listener); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
|  | @ -83,7 +83,7 @@ namespace easy2d | |||
| 
 | ||||
| 	void EventDispatcher::RemoveListeners(std::wstring const & listener_name) | ||||
| 	{ | ||||
| 		spEventListener next; | ||||
| 		SpEventListener next; | ||||
| 		for (auto listener = listeners_.First(); listener; listener = next) | ||||
| 		{ | ||||
| 			next = listener->NextItem(); | ||||
|  | @ -119,7 +119,7 @@ namespace easy2d | |||
| 
 | ||||
| 	void EventDispatcher::RemoveListeners(EventType type) | ||||
| 	{ | ||||
| 		spEventListener next; | ||||
| 		SpEventListener next; | ||||
| 		for (auto listener = listeners_.First(); listener; listener = next) | ||||
| 		{ | ||||
| 			next = listener->NextItem(); | ||||
|  |  | |||
|  | @ -25,12 +25,12 @@ namespace easy2d | |||
| { | ||||
| 	class EventDispatcher | ||||
| 	{ | ||||
| 		using Listeners = intrusive::List<spEventListener>; | ||||
| 		using Listeners = intrusive::List<SpEventListener>; | ||||
| 
 | ||||
| 	public: | ||||
| 		// 添加监听器
 | ||||
| 		void AddListener( | ||||
| 			spEventListener const& listener | ||||
| 			SpEventListener const& listener | ||||
| 		); | ||||
| 
 | ||||
| 		// 添加监听器
 | ||||
|  |  | |||
|  | @ -32,10 +32,10 @@ namespace easy2d | |||
| 
 | ||||
| 	class EventListener | ||||
| 		: public Object | ||||
| 		, protected intrusive::ListItem<spEventListener> | ||||
| 		, protected intrusive::ListItem<SpEventListener> | ||||
| 	{ | ||||
| 		friend class EventDispatcher; | ||||
| 		friend class intrusive::List<spEventListener>; | ||||
| 		friend class intrusive::List<SpEventListener>; | ||||
| 
 | ||||
| 	public: | ||||
| 		EventListener( | ||||
|  |  | |||
|  | @ -111,12 +111,12 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateHwndRenderTarget(cpHwndRenderTarget & hwnd_render_target, D2D1_RENDER_TARGET_PROPERTIES const & properties, D2D1_HWND_RENDER_TARGET_PROPERTIES const & hwnd_rt_properties) const | ||||
| 	HRESULT FactoryImpl::CreateHwndRenderTarget(CpHwndRenderTarget & hwnd_render_target, D2D1_RENDER_TARGET_PROPERTIES const & properties, D2D1_HWND_RENDER_TARGET_PROPERTIES const & hwnd_rt_properties) const | ||||
| 	{ | ||||
| 		if (!factory_) | ||||
| 			return E_UNEXPECTED; | ||||
| 
 | ||||
| 		cpHwndRenderTarget hwnd_render_target_tmp; | ||||
| 		CpHwndRenderTarget hwnd_render_target_tmp; | ||||
| 		HRESULT hr = factory_->CreateHwndRenderTarget( | ||||
| 			properties, | ||||
| 			hwnd_rt_properties, | ||||
|  | @ -129,15 +129,15 @@ namespace easy2d | |||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateTextRenderer( | ||||
| 		cpTextRenderer& text_renderer, | ||||
| 		cpRenderTarget const& render_target, | ||||
| 		cpSolidColorBrush const& brush | ||||
| 		CpTextRenderer& text_renderer, | ||||
| 		CpRenderTarget const& render_target, | ||||
| 		CpSolidColorBrush const& brush | ||||
| 	) | ||||
| 	{ | ||||
| 		if (!factory_) | ||||
| 			return E_UNEXPECTED; | ||||
| 
 | ||||
| 		cpTextRenderer text_renderer_tmp; | ||||
| 		CpTextRenderer text_renderer_tmp; | ||||
| 		HRESULT hr = ITextRenderer::Create( | ||||
| 			&text_renderer_tmp, | ||||
| 			factory_.Get(), | ||||
|  | @ -150,7 +150,7 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateBitmapFromFile(cpBitmap & bitmap, cpRenderTarget const & rt, std::wstring const & file_path) | ||||
| 	HRESULT FactoryImpl::CreateBitmapFromFile(CpBitmap & bitmap, CpRenderTarget const & rt, std::wstring const & file_path) | ||||
| 	{ | ||||
| 		if (imaging_factory_ == nullptr) | ||||
| 		{ | ||||
|  | @ -211,7 +211,7 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateBitmapFromResource(cpBitmap & bitmap, cpRenderTarget const & rt, Resource const & res) | ||||
| 	HRESULT FactoryImpl::CreateBitmapFromResource(CpBitmap & bitmap, CpRenderTarget const & rt, Resource const & res) | ||||
| 	{ | ||||
| 		if (imaging_factory_ == nullptr) | ||||
| 		{ | ||||
|  | @ -293,12 +293,12 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateRectangleGeometry(cpRectangleGeometry & geo, Rect const& rect) const | ||||
| 	HRESULT FactoryImpl::CreateRectangleGeometry(CpRectangleGeometry & geo, Rect const& rect) const | ||||
| 	{ | ||||
| 		if (!factory_) | ||||
| 			return E_UNEXPECTED; | ||||
| 
 | ||||
| 		cpRectangleGeometry rectangle; | ||||
| 		CpRectangleGeometry rectangle; | ||||
| 		HRESULT hr = factory_->CreateRectangleGeometry( | ||||
| 			rect, | ||||
| 			&rectangle | ||||
|  | @ -309,12 +309,12 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateRoundedRectangleGeometry(cpRoundedRectangleGeometry & geo, Rect const & rect, float radius_x, float radius_y) const | ||||
| 	HRESULT FactoryImpl::CreateRoundedRectangleGeometry(CpRoundedRectangleGeometry & geo, Rect const & rect, float radius_x, float radius_y) const | ||||
| 	{ | ||||
| 		if (!factory_) | ||||
| 			return E_UNEXPECTED; | ||||
| 
 | ||||
| 		cpRoundedRectangleGeometry rounded_rect; | ||||
| 		CpRoundedRectangleGeometry rounded_rect; | ||||
| 		HRESULT hr = factory_->CreateRoundedRectangleGeometry( | ||||
| 			D2D1::RoundedRect( | ||||
| 				rect, | ||||
|  | @ -329,12 +329,12 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateEllipseGeometry(cpEllipseGeometry & geo, Point const & center, float radius_x, float radius_y) const | ||||
| 	HRESULT FactoryImpl::CreateEllipseGeometry(CpEllipseGeometry & geo, Point const & center, float radius_x, float radius_y) const | ||||
| 	{ | ||||
| 		if (!factory_) | ||||
| 			return E_UNEXPECTED; | ||||
| 
 | ||||
| 		cpEllipseGeometry ellipse; | ||||
| 		CpEllipseGeometry ellipse; | ||||
| 		HRESULT hr = factory_->CreateEllipseGeometry( | ||||
| 			D2D1::Ellipse( | ||||
| 				center, | ||||
|  | @ -350,15 +350,15 @@ namespace easy2d | |||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateTransformedGeometry( | ||||
| 		cpTransformedGeometry& transformed, | ||||
| 		CpTransformedGeometry& transformed, | ||||
| 		Matrix const& matrix, | ||||
| 		cpGeometry const& geo | ||||
| 		CpGeometry const& geo | ||||
| 	) const | ||||
| 	{ | ||||
| 		if (!factory_) | ||||
| 			return E_UNEXPECTED; | ||||
| 
 | ||||
| 		cpTransformedGeometry transformed_tmp; | ||||
| 		CpTransformedGeometry transformed_tmp; | ||||
| 		HRESULT hr = factory_->CreateTransformedGeometry( | ||||
| 			geo.Get(), | ||||
| 			matrix, | ||||
|  | @ -372,7 +372,7 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreatePathGeometry(cpPathGeometry & geometry) const | ||||
| 	HRESULT FactoryImpl::CreatePathGeometry(CpPathGeometry & geometry) const | ||||
| 	{ | ||||
| 		if (!factory_) | ||||
| 			return E_UNEXPECTED; | ||||
|  | @ -380,12 +380,12 @@ namespace easy2d | |||
| 		return factory_->CreatePathGeometry(&geometry); | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateTextFormat(cpTextFormat & text_format, Font const & font, TextStyle const & text_style) const | ||||
| 	HRESULT FactoryImpl::CreateTextFormat(CpTextFormat & text_format, Font const & font, TextStyle const & text_style) const | ||||
| 	{ | ||||
| 		if (!write_factory_) | ||||
| 			return E_UNEXPECTED; | ||||
| 
 | ||||
| 		cpTextFormat text_format_tmp; | ||||
| 		CpTextFormat text_format_tmp; | ||||
| 		HRESULT hr = write_factory_->CreateTextFormat( | ||||
| 			font.family.c_str(), | ||||
| 			nullptr, | ||||
|  | @ -418,7 +418,7 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT FactoryImpl::CreateTextLayout(cpTextLayout & text_layout, Size& layout_size, std::wstring const & text, cpTextFormat const& text_format, TextStyle const & text_style) const | ||||
| 	HRESULT FactoryImpl::CreateTextLayout(CpTextLayout & text_layout, Size& layout_size, std::wstring const & text, CpTextFormat const& text_format, TextStyle const & text_style) const | ||||
| 	{ | ||||
| 		if (!write_factory_) | ||||
| 			return E_UNEXPECTED; | ||||
|  | @ -426,7 +426,7 @@ namespace easy2d | |||
| 		text_layout = nullptr; | ||||
| 
 | ||||
| 		HRESULT hr; | ||||
| 		cpTextLayout text_layout_tmp; | ||||
| 		CpTextLayout text_layout_tmp; | ||||
| 		UINT32 length = static_cast<UINT32>(text.length()); | ||||
| 
 | ||||
| 		if (text_style.wrap) | ||||
|  | @ -496,7 +496,7 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	cpStrokeStyle const& FactoryImpl::GetStrokeStyle(StrokeStyle stroke) const | ||||
| 	CpStrokeStyle const& FactoryImpl::GetStrokeStyle(StrokeStyle stroke) const | ||||
| 	{ | ||||
| 		switch (stroke) | ||||
| 		{ | ||||
|  |  | |||
|  | @ -38,73 +38,73 @@ namespace easy2d | |||
| 		HRESULT Init(bool debug); | ||||
| 
 | ||||
| 		HRESULT CreateHwndRenderTarget( | ||||
| 			cpHwndRenderTarget& hwnd_render_target, | ||||
| 			CpHwndRenderTarget& hwnd_render_target, | ||||
| 			D2D1_RENDER_TARGET_PROPERTIES const& properties, | ||||
| 			D2D1_HWND_RENDER_TARGET_PROPERTIES const& hwnd_rt_properties | ||||
| 		) const; | ||||
| 
 | ||||
| 		HRESULT CreateTextRenderer( | ||||
| 			cpTextRenderer& text_renderer, | ||||
| 			cpRenderTarget const& render_target, | ||||
| 			cpSolidColorBrush const& brush | ||||
| 			CpTextRenderer& text_renderer, | ||||
| 			CpRenderTarget const& render_target, | ||||
| 			CpSolidColorBrush const& brush | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT CreateBitmapFromFile( | ||||
| 			cpBitmap& bitmap, | ||||
| 			cpRenderTarget const& rt, | ||||
| 			CpBitmap& bitmap, | ||||
| 			CpRenderTarget const& rt, | ||||
| 			std::wstring const& file_path | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT CreateBitmapFromResource( | ||||
| 			cpBitmap& bitmap, | ||||
| 			cpRenderTarget const& rt, | ||||
| 			CpBitmap& bitmap, | ||||
| 			CpRenderTarget const& rt, | ||||
| 			Resource const& res | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT CreateRectangleGeometry( | ||||
| 			cpRectangleGeometry& geo, | ||||
| 			CpRectangleGeometry& geo, | ||||
| 			Rect const& rect | ||||
| 		) const; | ||||
| 
 | ||||
| 		HRESULT CreateRoundedRectangleGeometry( | ||||
| 			cpRoundedRectangleGeometry& geo, | ||||
| 			CpRoundedRectangleGeometry& geo, | ||||
| 			Rect const& rect, | ||||
| 			float radius_x, | ||||
| 			float radius_y | ||||
| 		) const; | ||||
| 
 | ||||
| 		HRESULT CreateEllipseGeometry( | ||||
| 			cpEllipseGeometry& geo, | ||||
| 			CpEllipseGeometry& geo, | ||||
| 			Point const& center, | ||||
| 			float radius_x, | ||||
| 			float radius_y | ||||
| 		) const; | ||||
| 
 | ||||
| 		HRESULT CreateTransformedGeometry( | ||||
| 			cpTransformedGeometry& transformed, | ||||
| 			CpTransformedGeometry& transformed, | ||||
| 			Matrix const& matrix, | ||||
| 			cpGeometry const& geo | ||||
| 			CpGeometry const& geo | ||||
| 		) const; | ||||
| 
 | ||||
| 		HRESULT CreatePathGeometry( | ||||
| 			cpPathGeometry& geometry | ||||
| 			CpPathGeometry& geometry | ||||
| 		) const; | ||||
| 
 | ||||
| 		HRESULT CreateTextFormat( | ||||
| 			cpTextFormat& text_format, | ||||
| 			CpTextFormat& text_format, | ||||
| 			Font const& font, | ||||
| 			TextStyle const& text_style | ||||
| 		) const; | ||||
| 
 | ||||
| 		HRESULT CreateTextLayout( | ||||
| 			cpTextLayout& text_layout, | ||||
| 			CpTextLayout& text_layout, | ||||
| 			Size& layout_size, | ||||
| 			std::wstring const& text, | ||||
| 			cpTextFormat const& text_format, | ||||
| 			CpTextFormat const& text_format, | ||||
| 			TextStyle const& text_style | ||||
| 		) const; | ||||
| 
 | ||||
| 		cpStrokeStyle const& GetStrokeStyle( | ||||
| 		CpStrokeStyle const& GetStrokeStyle( | ||||
| 			StrokeStyle stroke | ||||
| 		) const; | ||||
| 
 | ||||
|  | @ -114,12 +114,12 @@ namespace easy2d | |||
| 		~FactoryImpl(); | ||||
| 
 | ||||
| 	protected: | ||||
| 		cpFactory			factory_; | ||||
| 		cpImagingFactory	imaging_factory_; | ||||
| 		cpWriteFactory		write_factory_; | ||||
| 		cpStrokeStyle		miter_stroke_style_; | ||||
| 		cpStrokeStyle		bevel_stroke_style_; | ||||
| 		cpStrokeStyle		round_stroke_style_; | ||||
| 		CpFactory			factory_; | ||||
| 		CpImagingFactory	imaging_factory_; | ||||
| 		CpWriteFactory		write_factory_; | ||||
| 		CpStrokeStyle		miter_stroke_style_; | ||||
| 		CpStrokeStyle		bevel_stroke_style_; | ||||
| 		CpStrokeStyle		round_stroke_style_; | ||||
| 	}; | ||||
| 
 | ||||
| 	E2D_DECLARE_SINGLETON_TYPE(FactoryImpl, Factory); | ||||
|  |  | |||
|  | @ -55,7 +55,7 @@ namespace easy2d | |||
| 		interval_ = interval; | ||||
| 	} | ||||
| 
 | ||||
| 	void Frames::Add(spImage const& frame) | ||||
| 	void Frames::Add(SpImage const& frame) | ||||
| 	{ | ||||
| 		E2D_ASSERT(frame && "Frames::Add failed, NULL pointer exception"); | ||||
| 
 | ||||
|  | @ -83,7 +83,7 @@ namespace easy2d | |||
| 		return frames_; | ||||
| 	} | ||||
| 
 | ||||
| 	spFrames Frames::Clone() const | ||||
| 	SpFrames Frames::Clone() const | ||||
| 	{ | ||||
| 		auto animation = new (std::nothrow) Frames(interval_); | ||||
| 		if (animation) | ||||
|  | @ -96,7 +96,7 @@ namespace easy2d | |||
| 		return animation; | ||||
| 	} | ||||
| 
 | ||||
| 	spFrames Frames::Reverse() const | ||||
| 	SpFrames Frames::Reverse() const | ||||
| 	{ | ||||
| 		auto animation = new (std::nothrow) Frames(interval_); | ||||
| 		if (!frames_.empty()) | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ namespace easy2d | |||
| 	class Frames | ||||
| 		: public Object | ||||
| 	{ | ||||
| 		using Images = std::vector< spImage >; | ||||
| 		using Images = std::vector< SpImage >; | ||||
| 
 | ||||
| 	public: | ||||
| 		Frames(); | ||||
|  | @ -50,7 +50,7 @@ namespace easy2d | |||
| 
 | ||||
| 		// 添加关键帧
 | ||||
| 		void Add( | ||||
| 			spImage const& frame		/* 关键帧 */ | ||||
| 			SpImage const& frame		/* 关键帧 */ | ||||
| 		); | ||||
| 
 | ||||
| 		// 添加多个关键帧
 | ||||
|  | @ -70,10 +70,10 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取帧动画的拷贝对象
 | ||||
| 		spFrames Clone() const; | ||||
| 		SpFrames Clone() const; | ||||
| 
 | ||||
| 		// 获取帧动画的倒转
 | ||||
| 		spFrames Reverse() const; | ||||
| 		SpFrames Reverse() const; | ||||
| 
 | ||||
| 	protected: | ||||
| 		Duration	interval_; | ||||
|  |  | |||
|  | @ -154,7 +154,7 @@ namespace easy2d | |||
| 		Window::Instance()->Destroy(); | ||||
| 	} | ||||
| 
 | ||||
| 	void Game::EnterScene(spScene const & scene) | ||||
| 	void Game::EnterScene(SpScene const & scene) | ||||
| 	{ | ||||
| 		E2D_ASSERT(scene && "Game::EnterScene failed, NULL pointer exception"); | ||||
| 
 | ||||
|  | @ -164,7 +164,7 @@ namespace easy2d | |||
| 		next_scene_ = scene; | ||||
| 	} | ||||
| 
 | ||||
| 	void Game::EnterScene(spScene const& scene, spTransition const& transition) | ||||
| 	void Game::EnterScene(SpScene const& scene, SpTransition const& transition) | ||||
| 	{ | ||||
| 		EnterScene(scene); | ||||
| 		 | ||||
|  | @ -179,7 +179,7 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	spScene const& Game::GetCurrentScene() | ||||
| 	SpScene const& Game::GetCurrentScene() | ||||
| 	{ | ||||
| 		return curr_scene_; | ||||
| 	} | ||||
|  | @ -199,26 +199,15 @@ namespace easy2d | |||
| 
 | ||||
| 		Input::Instance()->Update(); | ||||
| 
 | ||||
| 		if (curr_scene_) | ||||
| 			curr_scene_->Update(dt); | ||||
| 
 | ||||
| 		if (next_scene_) | ||||
| 			next_scene_->Update(dt); | ||||
| 
 | ||||
| 		if (debug_) | ||||
| 			DebugNode::Instance()->Update(dt); | ||||
| 
 | ||||
| 		if (transition_) | ||||
| 		{ | ||||
| 			transition_->Update(dt); | ||||
| 
 | ||||
| 			if (transition_->IsDone()) | ||||
| 				transition_ = nullptr; | ||||
| 			else | ||||
| 				return; | ||||
| 		} | ||||
| 
 | ||||
| 		if (next_scene_) | ||||
| 		if (next_scene_ && !transition_) | ||||
| 		{ | ||||
| 			if (curr_scene_) | ||||
| 			{ | ||||
|  | @ -230,6 +219,15 @@ namespace easy2d | |||
| 			curr_scene_ = next_scene_; | ||||
| 			next_scene_ = nullptr; | ||||
| 		} | ||||
| 
 | ||||
| 		if (curr_scene_) | ||||
| 			curr_scene_->Update(dt); | ||||
| 
 | ||||
| 		if (next_scene_) | ||||
| 			next_scene_->Update(dt); | ||||
| 
 | ||||
| 		if (debug_) | ||||
| 			DebugNode::Instance()->Update(dt); | ||||
| 	} | ||||
| 
 | ||||
| 	void Game::Render(HWND hwnd) | ||||
|  |  | |||
|  | @ -80,17 +80,17 @@ namespace easy2d | |||
| 
 | ||||
| 		// Çл»³¡¾°
 | ||||
| 		void EnterScene( | ||||
| 			spScene const& scene			/* 场景 */ | ||||
| 			SpScene const& scene			/* 场景 */ | ||||
| 		); | ||||
| 
 | ||||
| 		// Çл»³¡¾°
 | ||||
| 		void EnterScene( | ||||
| 			spScene const& scene,			/* 场景 */ | ||||
| 			spTransition const& transition	/* 场景动画 */ | ||||
| 			SpScene const& scene,			/* 场景 */ | ||||
| 			SpTransition const& transition	/* 场景动画 */ | ||||
| 		); | ||||
| 
 | ||||
| 		// »ñÈ¡µ±Ç°³¡¾°
 | ||||
| 		spScene const& GetCurrentScene(); | ||||
| 		SpScene const& GetCurrentScene(); | ||||
| 
 | ||||
| 		// ÉèÖñäËÙ
 | ||||
| 		void SetTimeScale(float scale); | ||||
|  | @ -117,8 +117,8 @@ namespace easy2d | |||
| 		bool			debug_; | ||||
| 		bool			active_; | ||||
| 		float			time_scale_; | ||||
| 		spScene			curr_scene_; | ||||
| 		spScene			next_scene_; | ||||
| 		spTransition	transition_; | ||||
| 		SpScene			curr_scene_; | ||||
| 		SpScene			next_scene_; | ||||
| 		SpTransition	transition_; | ||||
| 	}; | ||||
| } | ||||
|  |  | |||
|  | @ -126,8 +126,8 @@ namespace easy2d | |||
| 
 | ||||
| 	void LineGeometry::SetLine(Point const & begin, Point const & end) | ||||
| 	{ | ||||
| 		cpPathGeometry path_geo; | ||||
| 		cpGeometrySink path_sink; | ||||
| 		CpPathGeometry path_geo; | ||||
| 		CpGeometrySink path_sink; | ||||
| 
 | ||||
| 		HRESULT hr = Factory::Instance()->CreatePathGeometry(path_geo); | ||||
| 
 | ||||
|  | @ -185,7 +185,7 @@ namespace easy2d | |||
| 
 | ||||
| 	void RectangleGeometry::SetRect(Rect const & rect) | ||||
| 	{ | ||||
| 		cpRectangleGeometry geo; | ||||
| 		CpRectangleGeometry geo; | ||||
| 		if (SUCCEEDED(Factory::Instance()->CreateRectangleGeometry(geo, rect))) | ||||
| 		{ | ||||
| 			geo_ = geo; | ||||
|  | @ -224,7 +224,7 @@ namespace easy2d | |||
| 
 | ||||
| 	void CircleGeometry::SetCircle(Point const & center, float radius) | ||||
| 	{ | ||||
| 		cpEllipseGeometry geo; | ||||
| 		CpEllipseGeometry geo; | ||||
| 		if (SUCCEEDED(Factory::Instance()->CreateEllipseGeometry(geo, center, radius, radius))) | ||||
| 		{ | ||||
| 			geo_ = geo; | ||||
|  | @ -265,7 +265,7 @@ namespace easy2d | |||
| 
 | ||||
| 	void EllipseGeometry::SetEllipse(Point const & center, float radius_x, float radius_y) | ||||
| 	{ | ||||
| 		cpEllipseGeometry geo; | ||||
| 		CpEllipseGeometry geo; | ||||
| 		if (SUCCEEDED(Factory::Instance()->CreateEllipseGeometry(geo, center, radius_x, radius_y))) | ||||
| 		{ | ||||
| 			geo_ = geo; | ||||
|  | @ -414,7 +414,7 @@ namespace easy2d | |||
| 
 | ||||
| 	void RoundedRectGeometry::SetRoundedRect(Rect const & rect, float radius_x, float radius_y) | ||||
| 	{ | ||||
| 		cpRoundedRectangleGeometry geo; | ||||
| 		CpRoundedRectangleGeometry geo; | ||||
| 		if (SUCCEEDED(Factory::Instance()->CreateRoundedRectangleGeometry(geo, rect, radius_x, radius_y))) | ||||
| 		{ | ||||
| 			geo_ = geo; | ||||
|  |  | |||
|  | @ -57,7 +57,7 @@ namespace easy2d | |||
| 		float ComputeArea(); | ||||
| 
 | ||||
| 	protected: | ||||
| 		cpGeometry geo_; | ||||
| 		CpGeometry geo_; | ||||
| 	}; | ||||
| 
 | ||||
| 
 | ||||
|  | @ -254,8 +254,8 @@ namespace easy2d | |||
| 		void ClearPath(); | ||||
| 
 | ||||
| 	protected: | ||||
| 		cpPathGeometry	current_geometry_; | ||||
| 		cpGeometrySink	current_sink_; | ||||
| 		CpPathGeometry	current_geometry_; | ||||
| 		CpGeometrySink	current_sink_; | ||||
| 	}; | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -31,7 +31,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	GeometryNode::GeometryNode(spGeometry const& geometry) | ||||
| 	GeometryNode::GeometryNode(SpGeometry const& geometry) | ||||
| 		: GeometryNode() | ||||
| 	{ | ||||
| 		SetGeometry(geometry); | ||||
|  | @ -41,7 +41,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	void GeometryNode::SetGeometry(spGeometry const& geometry) | ||||
| 	void GeometryNode::SetGeometry(SpGeometry const& geometry) | ||||
| 	{ | ||||
| 		geometry_ = geometry; | ||||
| 	} | ||||
|  |  | |||
|  | @ -32,14 +32,14 @@ namespace easy2d | |||
| 		GeometryNode(); | ||||
| 
 | ||||
| 		GeometryNode( | ||||
| 			spGeometry const& geometry | ||||
| 			SpGeometry const& geometry | ||||
| 		); | ||||
| 
 | ||||
| 		virtual ~GeometryNode(); | ||||
| 
 | ||||
| 		// ÉčÖĂĐÎ×´
 | ||||
| 		void SetGeometry( | ||||
| 			spGeometry const& geometry | ||||
| 			SpGeometry const& geometry | ||||
| 		); | ||||
| 
 | ||||
| 		// ÉčÖĂĚîłäŃŐÉŤ
 | ||||
|  | @ -63,7 +63,7 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// ťńČĄĐÎ×´
 | ||||
| 		spGeometry const& GetGeometry() const { return geometry_; } | ||||
| 		SpGeometry const& GetGeometry() const { return geometry_; } | ||||
| 
 | ||||
| 		// ťńČĄĚîłäŃŐÉŤ
 | ||||
| 		Color GetFillColor() const { return fill_color_; } | ||||
|  | @ -84,6 +84,6 @@ namespace easy2d | |||
| 		Color		stroke_color_; | ||||
| 		float		stroke_width_; | ||||
| 		StrokeStyle	outline_join_; | ||||
| 		spGeometry	geometry_; | ||||
| 		SpGeometry	geometry_; | ||||
| 	}; | ||||
| } | ||||
|  |  | |||
|  | @ -58,7 +58,7 @@ namespace easy2d | |||
| 		this->Crop(crop_rect); | ||||
| 	} | ||||
| 
 | ||||
| 	Image::Image(cpBitmap const & bitmap) | ||||
| 	Image::Image(CpBitmap const & bitmap) | ||||
| 		: Image() | ||||
| 	{ | ||||
| 		SetBitmap(bitmap); | ||||
|  | @ -70,7 +70,7 @@ namespace easy2d | |||
| 
 | ||||
| 	bool Image::Load(Resource const& res) | ||||
| 	{ | ||||
| 		cpBitmap bitmap; | ||||
| 		CpBitmap bitmap; | ||||
| 		HRESULT hr = Graphics::Instance()->CreateBitmapFromResource(bitmap, res); | ||||
| 		if (FAILED(hr)) | ||||
| 		{ | ||||
|  | @ -94,7 +94,7 @@ namespace easy2d | |||
| 		// 默认搜索路径,所以需要通过 File::GetPath 获取完整路径
 | ||||
| 		std::wstring image_file_path = image_file.GetPath(); | ||||
| 
 | ||||
| 		cpBitmap bitmap; | ||||
| 		CpBitmap bitmap; | ||||
| 		HRESULT hr = Graphics::Instance()->CreateBitmapFromFile(bitmap, image_file_path); | ||||
| 		if (FAILED(hr)) | ||||
| 		{ | ||||
|  | @ -181,12 +181,12 @@ namespace easy2d | |||
| 		return crop_rect_; | ||||
| 	} | ||||
| 
 | ||||
| 	cpBitmap const& Image::GetBitmap() const | ||||
| 	CpBitmap const& Image::GetBitmap() const | ||||
| 	{ | ||||
| 		return bitmap_; | ||||
| 	} | ||||
| 
 | ||||
| 	void Image::SetBitmap(cpBitmap const & bitmap) | ||||
| 	void Image::SetBitmap(CpBitmap const & bitmap) | ||||
| 	{ | ||||
| 		if (bitmap) | ||||
| 		{ | ||||
|  |  | |||
|  | @ -50,7 +50,7 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		explicit Image( | ||||
| 			cpBitmap const& bitmap | ||||
| 			CpBitmap const& bitmap | ||||
| 		); | ||||
| 
 | ||||
| 		virtual ~Image(); | ||||
|  | @ -100,15 +100,15 @@ namespace easy2d | |||
| 		// »ñÈ¡²Ã¼ô¾ØÐÎ
 | ||||
| 		Rect const& GetCropRect() const; | ||||
| 
 | ||||
| 		cpBitmap const& GetBitmap() const; | ||||
| 		CpBitmap const& GetBitmap() const; | ||||
| 
 | ||||
| 	protected: | ||||
| 		void SetBitmap( | ||||
| 			cpBitmap const& bitmap | ||||
| 			CpBitmap const& bitmap | ||||
| 		); | ||||
| 
 | ||||
| 	protected: | ||||
| 		Rect		crop_rect_; | ||||
| 		cpBitmap	bitmap_; | ||||
| 		CpBitmap	bitmap_; | ||||
| 	}; | ||||
| } | ||||
|  |  | |||
|  | @ -62,7 +62,7 @@ namespace easy2d | |||
| 
 | ||||
| 		if (!children_.IsEmpty()) | ||||
| 		{ | ||||
| 			spNode next; | ||||
| 			SpNode next; | ||||
| 			for (auto child = children_.First(); child; child = next) | ||||
| 			{ | ||||
| 				next = child->NextItem(); | ||||
|  | @ -118,7 +118,7 @@ namespace easy2d | |||
| 		if (!visible_) | ||||
| 			return; | ||||
| 
 | ||||
| 		spNode prev; | ||||
| 		SpNode prev; | ||||
| 		for (auto child = children_.Last(); child; child = prev) | ||||
| 		{ | ||||
| 			prev = child->PrevItem(); | ||||
|  | @ -255,7 +255,7 @@ namespace easy2d | |||
| 
 | ||||
| 		if (parent_) | ||||
| 		{ | ||||
| 			spNode me = this; | ||||
| 			SpNode me = this; | ||||
| 
 | ||||
| 			parent_->children_.Remove(me); | ||||
| 
 | ||||
|  | @ -272,7 +272,7 @@ namespace easy2d | |||
| 
 | ||||
| 			if (sibling) | ||||
| 			{ | ||||
| 				parent_->children_.InsertAfter(me, spNode(sibling)); | ||||
| 				parent_->children_.InsertAfter(me, SpNode(sibling)); | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
|  | @ -444,7 +444,7 @@ namespace easy2d | |||
| 		dirty_transform_ = true; | ||||
| 	} | ||||
| 
 | ||||
| 	void Node::AddChild(spNode const& child) | ||||
| 	void Node::AddChild(SpNode const& child) | ||||
| 	{ | ||||
| 		E2D_ASSERT(child && "Node::AddChild failed, NULL pointer exception"); | ||||
| 
 | ||||
|  | @ -461,7 +461,7 @@ namespace easy2d | |||
| 
 | ||||
| #endif // E2D_DEBUG
 | ||||
| 
 | ||||
| 			children_.PushBack(Node::ItemType(child)); | ||||
| 			children_.PushBack(child); | ||||
| 			child->parent_ = this; | ||||
| 			child->SetScene(this->scene_); | ||||
| 			child->dirty_transform_ = true; | ||||
|  | @ -498,7 +498,7 @@ namespace easy2d | |||
| 		return children; | ||||
| 	} | ||||
| 
 | ||||
| 	spNode Node::GetChild(std::wstring const& name) const | ||||
| 	SpNode Node::GetChild(std::wstring const& name) const | ||||
| 	{ | ||||
| 		size_t hash_code = std::hash<std::wstring>{}(name); | ||||
| 
 | ||||
|  | @ -525,7 +525,7 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	bool Node::RemoveChild(spNode const& child) | ||||
| 	bool Node::RemoveChild(SpNode const& child) | ||||
| 	{ | ||||
| 		return RemoveChild(child.Get()); | ||||
| 	} | ||||
|  | @ -541,7 +541,7 @@ namespace easy2d | |||
| 		{ | ||||
| 			child->parent_ = nullptr; | ||||
| 			if (child->scene_) child->SetScene(nullptr); | ||||
| 			children_.Remove(spNode(child)); | ||||
| 			children_.Remove(SpNode(child)); | ||||
| 			return true; | ||||
| 		} | ||||
| 		return false; | ||||
|  |  | |||
|  | @ -37,15 +37,15 @@ namespace easy2d | |||
| 		, public TaskManager | ||||
| 		, public ActionManager | ||||
| 		, public EventDispatcher | ||||
| 		, protected intrusive::ListItem<spNode> | ||||
| 		, protected intrusive::ListItem<SpNode> | ||||
| 	{ | ||||
| 		friend class Game; | ||||
| 		friend class Scene; | ||||
| 		friend class Transition; | ||||
| 		friend class intrusive::List<spNode>; | ||||
| 		friend class intrusive::List<SpNode>; | ||||
| 
 | ||||
| 		using Nodes = std::vector<spNode>; | ||||
| 		using Children = intrusive::List<spNode>; | ||||
| 		using Nodes = std::vector<SpNode>; | ||||
| 		using Children = intrusive::List<SpNode>; | ||||
| 
 | ||||
| 	public: | ||||
| 		Node(); | ||||
|  | @ -292,7 +292,7 @@ namespace easy2d | |||
| 
 | ||||
| 		// 添加子节点
 | ||||
| 		void AddChild( | ||||
| 			spNode const& child | ||||
| 			SpNode const& child | ||||
| 		); | ||||
| 
 | ||||
| 		// 添加多个子节点
 | ||||
|  | @ -306,7 +306,7 @@ namespace easy2d | |||
| 		) const; | ||||
| 
 | ||||
| 		// 获取名称相同的子节点
 | ||||
| 		spNode GetChild( | ||||
| 		SpNode GetChild( | ||||
| 			std::wstring const& name | ||||
| 		) const; | ||||
| 
 | ||||
|  | @ -315,7 +315,7 @@ namespace easy2d | |||
| 
 | ||||
| 		// 移除子节点
 | ||||
| 		bool RemoveChild( | ||||
| 			spNode const& child | ||||
| 			SpNode const& child | ||||
| 		); | ||||
| 
 | ||||
| 		// 移除子节点
 | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	Sprite::Sprite(spImage const& image) | ||||
| 	Sprite::Sprite(SpImage const& image) | ||||
| 		: image_(nullptr) | ||||
| 	{ | ||||
| 		Load(image); | ||||
|  | @ -64,7 +64,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	bool Sprite::Load(spImage const& image) | ||||
| 	bool Sprite::Load(SpImage const& image) | ||||
| 	{ | ||||
| 		if (image) | ||||
| 		{ | ||||
|  | @ -121,7 +121,7 @@ namespace easy2d | |||
| 		); | ||||
| 	} | ||||
| 
 | ||||
| 	spImage const& Sprite::GetImage() const | ||||
| 	SpImage const& Sprite::GetImage() const | ||||
| 	{ | ||||
| 		return image_; | ||||
| 	} | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ namespace easy2d | |||
| 		Sprite(); | ||||
| 
 | ||||
| 		explicit Sprite( | ||||
| 			spImage const& image | ||||
| 			SpImage const& image | ||||
| 		); | ||||
| 
 | ||||
| 		explicit Sprite( | ||||
|  | @ -67,7 +67,7 @@ namespace easy2d | |||
| 
 | ||||
| 		// 加载图片
 | ||||
| 		bool Load( | ||||
| 			spImage const& image | ||||
| 			SpImage const& image | ||||
| 		); | ||||
| 
 | ||||
| 		// 将图片裁剪为矩形
 | ||||
|  | @ -76,12 +76,12 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		// 获取 Image 对象
 | ||||
| 		spImage const& GetImage() const; | ||||
| 		SpImage const& GetImage() const; | ||||
| 
 | ||||
| 		// 渲染精灵
 | ||||
| 		virtual void OnRender() override; | ||||
| 
 | ||||
| 	protected: | ||||
| 		spImage image_; | ||||
| 		SpImage image_; | ||||
| 	}; | ||||
| } | ||||
|  |  | |||
|  | @ -22,7 +22,7 @@ | |||
| 
 | ||||
| namespace easy2d | ||||
| { | ||||
| 	Task::Task(const Callback & func, std::wstring const& name) | ||||
| 	Task::Task(Callback const& func, std::wstring const& name) | ||||
| 		: Task(func, Duration{}, -1, name) | ||||
| 	{ | ||||
| 	} | ||||
|  |  | |||
|  | @ -31,16 +31,16 @@ namespace easy2d | |||
|     // 定时任务
 | ||||
| 	class Task | ||||
| 		: public Object | ||||
| 		, protected intrusive::ListItem<spTask> | ||||
| 		, protected intrusive::ListItem<SpTask> | ||||
| 	{ | ||||
| 		friend class TaskManager; | ||||
| 		friend class intrusive::List<spTask>; | ||||
| 		friend class intrusive::List<SpTask>; | ||||
| 
 | ||||
| 		using Callback = std::function<void()>; | ||||
| 
 | ||||
| 	public: | ||||
| 		explicit Task( | ||||
| 			const Callback& func,		/* 执行函数 */ | ||||
| 			Callback const& func,			/* 执行函数 */ | ||||
| 			std::wstring const& name = L""	/* 任务名称 */ | ||||
| 		); | ||||
| 
 | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ namespace easy2d | |||
| 		if (tasks_.IsEmpty()) | ||||
| 			return; | ||||
| 
 | ||||
| 		spTask next; | ||||
| 		SpTask next; | ||||
| 		for (auto task = tasks_.First(); task; task = next) | ||||
| 		{ | ||||
| 			next = task->NextItem(); | ||||
|  | @ -41,14 +41,14 @@ namespace easy2d | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	void TaskManager::AddTask(spTask const& task) | ||||
| 	void TaskManager::AddTask(SpTask const& task) | ||||
| 	{ | ||||
| 		E2D_ASSERT(task && "AddTask failed, NULL pointer exception"); | ||||
| 
 | ||||
| 		if (task) | ||||
| 		{ | ||||
| 			task->Reset(); | ||||
| 			tasks_.PushBack(Task::ItemType(task)); | ||||
| 			tasks_.PushBack(task); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
|  | @ -85,7 +85,7 @@ namespace easy2d | |||
| 		if (tasks_.IsEmpty()) | ||||
| 			return; | ||||
| 
 | ||||
| 		spTask next; | ||||
| 		SpTask next; | ||||
| 		for (auto task = tasks_.First(); task; task = next) | ||||
| 		{ | ||||
| 			next = task->NextItem(); | ||||
|  |  | |||
|  | @ -25,12 +25,12 @@ namespace easy2d | |||
| { | ||||
| 	class TaskManager | ||||
| 	{ | ||||
| 		using Tasks = intrusive::List<spTask>; | ||||
| 		using Tasks = intrusive::List<SpTask>; | ||||
| 
 | ||||
| 	public: | ||||
| 		// 添加任务
 | ||||
| 		void AddTask( | ||||
| 			spTask const& task | ||||
| 			SpTask const& task | ||||
| 		); | ||||
| 
 | ||||
| 		// 启动任务
 | ||||
|  |  | |||
|  | @ -208,7 +208,7 @@ namespace easy2d | |||
| 		std::wstring			text_; | ||||
| 		Font			font_; | ||||
| 		TextStyle		style_; | ||||
| 		cpTextFormat	text_format_; | ||||
| 		cpTextLayout	text_layout_; | ||||
| 		CpTextFormat	text_format_; | ||||
| 		CpTextLayout	text_layout_; | ||||
| 	}; | ||||
| } | ||||
|  | @ -123,4 +123,4 @@ namespace easy2d | |||
| 	}; | ||||
| } | ||||
| 
 | ||||
| E2D_DECLARE_D2D_SMART_PTR(easy2d::ITextRenderer, cpTextRenderer); | ||||
| E2D_DECLARE_D2D_SMART_PTR(easy2d::ITextRenderer, CpTextRenderer); | ||||
|  |  | |||
|  | @ -55,7 +55,7 @@ namespace easy2d | |||
| 		return done_; | ||||
| 	} | ||||
| 
 | ||||
| 	void Transition::Init(spScene const& prev, spScene const& next) | ||||
| 	void Transition::Init(SpScene const& prev, SpScene const& next) | ||||
| 	{ | ||||
| 		process_ = 0; | ||||
| 		delta_ = Duration{}; | ||||
|  | @ -147,7 +147,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	void BoxTransition::Init(spScene const& prev, spScene const& next) | ||||
| 	void BoxTransition::Init(SpScene const& prev, SpScene const& next) | ||||
| 	{ | ||||
| 		Transition::Init(prev, next); | ||||
| 
 | ||||
|  | @ -189,7 +189,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	void EmergeTransition::Init(spScene const& prev, spScene const& next) | ||||
| 	void EmergeTransition::Init(SpScene const& prev, SpScene const& next) | ||||
| 	{ | ||||
| 		Transition::Init(prev, next); | ||||
| 
 | ||||
|  | @ -214,7 +214,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	void FadeTransition::Init(spScene const& prev, spScene const& next) | ||||
| 	void FadeTransition::Init(SpScene const& prev, SpScene const& next) | ||||
| 	{ | ||||
| 		Transition::Init(prev, next); | ||||
| 
 | ||||
|  | @ -248,7 +248,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	void MoveTransition::Init(spScene const& prev, spScene const& next) | ||||
| 	void MoveTransition::Init(SpScene const& prev, SpScene const& next) | ||||
| 	{ | ||||
| 		Transition::Init(prev, next); | ||||
| 
 | ||||
|  | @ -327,7 +327,7 @@ namespace easy2d | |||
| 	{ | ||||
| 	} | ||||
| 
 | ||||
| 	void RotationTransition::Init(spScene const& prev, spScene const& next) | ||||
| 	void RotationTransition::Init(SpScene const& prev, SpScene const& next) | ||||
| 	{ | ||||
| 		Transition::Init(prev, next); | ||||
| 
 | ||||
|  |  | |||
|  | @ -43,8 +43,8 @@ namespace easy2d | |||
| 
 | ||||
| 	protected: | ||||
| 		virtual void Init( | ||||
| 			spScene const& prev, | ||||
| 			spScene const& next | ||||
| 			SpScene const& prev, | ||||
| 			SpScene const& next | ||||
| 		); | ||||
| 
 | ||||
| 		virtual void Update(Duration const& dt); | ||||
|  | @ -61,10 +61,10 @@ namespace easy2d | |||
| 		Duration		duration_; | ||||
| 		Duration		delta_; | ||||
| 		Size			window_size_; | ||||
| 		spScene			out_scene_; | ||||
| 		spScene			in_scene_; | ||||
| 		cpLayer			out_layer_; | ||||
| 		cpLayer			in_layer_; | ||||
| 		SpScene			out_scene_; | ||||
| 		SpScene			in_scene_; | ||||
| 		CpLayer			out_layer_; | ||||
| 		CpLayer			in_layer_; | ||||
| 		LayerProperties out_layer_prop_; | ||||
| 		LayerProperties in_layer_prop_; | ||||
| 	}; | ||||
|  | @ -84,8 +84,8 @@ namespace easy2d | |||
| 		virtual void Update(Duration const& dt) override; | ||||
| 
 | ||||
| 		virtual void Init( | ||||
| 			spScene const& prev, | ||||
| 			spScene const& next | ||||
| 			SpScene const& prev, | ||||
| 			SpScene const& next | ||||
| 		) override; | ||||
| 	}; | ||||
| 
 | ||||
|  | @ -103,8 +103,8 @@ namespace easy2d | |||
| 		virtual void Update(Duration const& dt) override; | ||||
| 
 | ||||
| 		virtual void Init( | ||||
| 			spScene const& prev, | ||||
| 			spScene const& next | ||||
| 			SpScene const& prev, | ||||
| 			SpScene const& next | ||||
| 		) override; | ||||
| 	}; | ||||
| 
 | ||||
|  | @ -122,8 +122,8 @@ namespace easy2d | |||
| 		virtual void Update(Duration const& dt) override; | ||||
| 
 | ||||
| 		virtual void Init( | ||||
| 			spScene const& prev, | ||||
| 			spScene const& next | ||||
| 			SpScene const& prev, | ||||
| 			SpScene const& next | ||||
| 		) override; | ||||
| 	}; | ||||
| 
 | ||||
|  | @ -142,8 +142,8 @@ namespace easy2d | |||
| 		virtual void Update(Duration const& dt) override; | ||||
| 
 | ||||
| 		virtual void Init( | ||||
| 			spScene const& prev, | ||||
| 			spScene const& next | ||||
| 			SpScene const& prev, | ||||
| 			SpScene const& next | ||||
| 		) override; | ||||
| 
 | ||||
| 		virtual void Reset() override; | ||||
|  | @ -169,8 +169,8 @@ namespace easy2d | |||
| 		virtual void Update(Duration const& dt) override; | ||||
| 
 | ||||
| 		virtual void Init( | ||||
| 			spScene const& prev, | ||||
| 			spScene const& next | ||||
| 			SpScene const& prev, | ||||
| 			SpScene const& next | ||||
| 		) override; | ||||
| 
 | ||||
| 		virtual void Reset() override; | ||||
|  |  | |||
|  | @ -31,28 +31,30 @@ | |||
| 
 | ||||
| namespace easy2d | ||||
| { | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1Factory, cpFactory); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(IWICImagingFactory, cpImagingFactory); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(IDWriteFactory, cpWriteFactory); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1SolidColorBrush, cpSolidColorBrush); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1RenderTarget, cpRenderTarget); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1HwndRenderTarget, cpHwndRenderTarget); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1BitmapRenderTarget, cpBitmapRenderTarget); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1StrokeStyle, cpStrokeStyle); | ||||
| 	// "Cp" is a shorthand for "COM Pointer"
 | ||||
| 
 | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1Geometry, cpGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1RectangleGeometry, cpRectangleGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1RoundedRectangleGeometry, cpRoundedRectangleGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1EllipseGeometry, cpEllipseGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1GeometryGroup, cpGeometryGroup); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1PathGeometry, cpPathGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1TransformedGeometry, cpTransformedGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1GeometrySink, cpGeometrySink); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1Factory, CpFactory); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(IWICImagingFactory, CpImagingFactory); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(IDWriteFactory, CpWriteFactory); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1SolidColorBrush, CpSolidColorBrush); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1RenderTarget, CpRenderTarget); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1HwndRenderTarget, CpHwndRenderTarget); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1BitmapRenderTarget, CpBitmapRenderTarget); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1StrokeStyle, CpStrokeStyle); | ||||
| 
 | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1Layer, cpLayer); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1Bitmap, cpBitmap); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(IDWriteTextFormat, cpTextFormat); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(IDWriteTextLayout, cpTextLayout); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1Geometry, CpGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1RectangleGeometry, CpRectangleGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1RoundedRectangleGeometry, CpRoundedRectangleGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1EllipseGeometry, CpEllipseGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1GeometryGroup, CpGeometryGroup); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1PathGeometry, CpPathGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1TransformedGeometry, CpTransformedGeometry); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1GeometrySink, CpGeometrySink); | ||||
| 
 | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1Layer, CpLayer); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(ID2D1Bitmap, CpBitmap); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(IDWriteTextFormat, CpTextFormat); | ||||
| 	E2D_DECLARE_D2D_SMART_PTR(IDWriteTextLayout, CpTextLayout); | ||||
| 
 | ||||
| 	inline void IntrusivePtrAddRef(IUnknown* ptr) | ||||
| 	{ | ||||
|  |  | |||
|  | @ -28,18 +28,20 @@ | |||
| #ifndef E2D_DECLARE_SMART_PTR | ||||
| #define E2D_DECLARE_SMART_PTR(class_name)\ | ||||
| 	class class_name;\ | ||||
| 	using sp##class_name = ::easy2d::intrusive::SmartPointer< class_name > | ||||
| 	using Sp##class_name = ::easy2d::intrusive::SmartPointer< class_name > | ||||
| 
 | ||||
| #define E2D_DECLARE_NS_SMART_PTR(ns_name, class_name)\ | ||||
| 	namespace ns_name\ | ||||
| 	{\ | ||||
| 		class class_name; \ | ||||
| 		using sp##class_name = ::easy2d::intrusive::SmartPointer< class_name >;\ | ||||
| 		using Sp##class_name = ::easy2d::intrusive::SmartPointer< class_name >;\ | ||||
| 	} | ||||
| #endif | ||||
| 
 | ||||
| namespace easy2d | ||||
| { | ||||
| 	// "Sp" is a shorthand for "Smart Pointer"
 | ||||
| 
 | ||||
| 	E2D_DECLARE_SMART_PTR(Image); | ||||
| 	E2D_DECLARE_SMART_PTR(Music); | ||||
| 	E2D_DECLARE_SMART_PTR(Task); | ||||
|  | @ -97,19 +99,4 @@ namespace easy2d | |||
| 	using Size = math::Vector2; | ||||
| 	using Rect = math::Rect; | ||||
| 	using Matrix = math::Matrix; | ||||
| 
 | ||||
| 	template <typename Dest, typename Src> | ||||
| 	inline Dest SafeCast(Src ptr) | ||||
| 	{ | ||||
| 		if (!ptr) | ||||
| 			return nullptr; | ||||
| 
 | ||||
| #ifdef E2D_DEBUG | ||||
| 		Dest cast = dynamic_cast<Dest>(ptr); | ||||
| 		E2D_ASSERT(cast); | ||||
| 		return cast; | ||||
| #else | ||||
| 		return static_cast<Dest>(ptr); | ||||
| #endif | ||||
| 	} | ||||
| } | ||||
|  |  | |||
|  | @ -82,7 +82,7 @@ namespace easy2d | |||
| 
 | ||||
| 			bool IsEmpty() const { return !first_; } | ||||
| 
 | ||||
| 			void PushBack(T& child) | ||||
| 			void PushBack(T const& child) | ||||
| 			{ | ||||
| 				if (child->prev_) | ||||
| 					child->prev_->next_ = child->next_; | ||||
|  | @ -106,7 +106,7 @@ namespace easy2d | |||
| 				DEBUG_CHECK_LIST(this); | ||||
| 			} | ||||
| 
 | ||||
| 			void PushFront(T& child) | ||||
| 			void PushFront(T const& child) | ||||
| 			{ | ||||
| 				if (child->prev_) | ||||
| 					child->prev_->next_ = child->next_; | ||||
|  | @ -130,7 +130,7 @@ namespace easy2d | |||
| 				DEBUG_CHECK_LIST(this); | ||||
| 			} | ||||
| 
 | ||||
| 			void InsertBefore(T& child, T& before) | ||||
| 			void InsertBefore(T const& child, T const& before) | ||||
| 			{ | ||||
| 				if (child->prev_) | ||||
| 					child->prev_->next_ = child->next_; | ||||
|  | @ -149,7 +149,7 @@ namespace easy2d | |||
| 				DEBUG_CHECK_LIST(this); | ||||
| 			} | ||||
| 
 | ||||
| 			void InsertAfter(T& child, T& after) | ||||
| 			void InsertAfter(T const& child, T const& after) | ||||
| 			{ | ||||
| 				if (child->prev_) | ||||
| 					child->prev_->next_ = child->next_; | ||||
|  | @ -168,7 +168,7 @@ namespace easy2d | |||
| 				DEBUG_CHECK_LIST(this); | ||||
| 			} | ||||
| 
 | ||||
| 			void Remove(T& child) | ||||
| 			void Remove(T const& child) | ||||
| 			{ | ||||
| #ifdef E2D_DEBUG | ||||
| 				T tmp = first_; | ||||
|  |  | |||
|  | @ -192,7 +192,7 @@ namespace easy2d | |||
| 	} | ||||
| 
 | ||||
| 	template<class T> | ||||
| 	inline intrusive::SmartPointer<T> make_intrusive(T* ptr) E2D_NOEXCEPT | ||||
| 	inline intrusive::SmartPointer<T> MakeSmart(T* ptr) E2D_NOEXCEPT | ||||
| 	{ | ||||
| 		return intrusive::SmartPointer<T>(ptr); | ||||
| 	} | ||||
|  |  | |||
|  | @ -32,6 +32,9 @@ namespace easy2d | |||
| 			{ | ||||
| 				PathFileExistsW = (PFN_PathFileExistsW) | ||||
| 					GetProcAddress(shlwapi, "PathFileExistsW"); | ||||
| 
 | ||||
| 				SHCreateMemStream = (PFN_SHCreateMemStream) | ||||
| 					GetProcAddress(shlwapi, "SHCreateMemStream"); | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
|  |  | |||
|  | @ -37,11 +37,13 @@ namespace easy2d | |||
| 
 | ||||
| 			// Shlwapi functions
 | ||||
| 			typedef BOOL(WINAPI *PFN_PathFileExistsW)(LPCWSTR); | ||||
| 			typedef IStream*(WINAPI *PFN_SHCreateMemStream)(const BYTE*, UINT); | ||||
| 
 | ||||
| 		public: | ||||
| 			Shlwapi(); | ||||
| 
 | ||||
| 			PFN_PathFileExistsW PathFileExistsW; | ||||
| 			PFN_SHCreateMemStream SHCreateMemStream; | ||||
| 		}; | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -108,17 +108,17 @@ namespace easy2d | |||
| 		bitmap_cache_.clear(); | ||||
| 	} | ||||
| 
 | ||||
| 	cpHwndRenderTarget const & GraphicsDevice::GetRenderTarget() const | ||||
| 	CpHwndRenderTarget const & GraphicsDevice::GetRenderTarget() const | ||||
| 	{ | ||||
| 		return render_target_; | ||||
| 	} | ||||
| 
 | ||||
| 	cpSolidColorBrush const & GraphicsDevice::GetSolidBrush() const | ||||
| 	CpSolidColorBrush const & GraphicsDevice::GetSolidBrush() const | ||||
| 	{ | ||||
| 		return solid_brush_; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::CreateLayer(cpLayer& layer) | ||||
| 	HRESULT GraphicsDevice::CreateLayer(CpLayer& layer) | ||||
| 	{ | ||||
| 		if (!render_target_) | ||||
| 			return E_UNEXPECTED; | ||||
|  | @ -127,7 +127,7 @@ namespace easy2d | |||
| 		return render_target_->CreateLayer(&layer); | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::CreateSolidColorBrush(cpSolidColorBrush & brush) const | ||||
| 	HRESULT GraphicsDevice::CreateSolidColorBrush(CpSolidColorBrush & brush) const | ||||
| 	{ | ||||
| 		if (!render_target_) | ||||
| 			return E_UNEXPECTED; | ||||
|  | @ -140,7 +140,7 @@ namespace easy2d | |||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::DrawGeometry( | ||||
| 		cpGeometry const& geometry, | ||||
| 		CpGeometry const& geometry, | ||||
| 		Color const& stroke_color, | ||||
| 		float stroke_width, | ||||
| 		StrokeStyle stroke | ||||
|  | @ -167,7 +167,7 @@ namespace easy2d | |||
| 		return S_OK; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::FillGeometry(cpGeometry const & geometry, const Color & fill_color) | ||||
| 	HRESULT GraphicsDevice::FillGeometry(CpGeometry const & geometry, const Color & fill_color) | ||||
| 	{ | ||||
| 		if (!solid_brush_ || | ||||
| 			!render_target_) | ||||
|  | @ -187,7 +187,7 @@ namespace easy2d | |||
| 		return S_OK; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::DrawImage(spImage const & image) | ||||
| 	HRESULT GraphicsDevice::DrawImage(SpImage const & image) | ||||
| 	{ | ||||
| 		if (!render_target_) | ||||
| 			return E_UNEXPECTED; | ||||
|  | @ -212,7 +212,7 @@ namespace easy2d | |||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::DrawBitmap( | ||||
| 		cpBitmap const& bitmap | ||||
| 		CpBitmap const& bitmap | ||||
| 	) | ||||
| 	{ | ||||
| 		if (!render_target_) | ||||
|  | @ -236,7 +236,7 @@ namespace easy2d | |||
| 		return S_OK; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::DrawTextLayout(cpTextLayout const& text_layout) | ||||
| 	HRESULT GraphicsDevice::DrawTextLayout(CpTextLayout const& text_layout) | ||||
| 	{ | ||||
| 		if (!text_renderer_) | ||||
| 			return E_UNEXPECTED; | ||||
|  | @ -277,7 +277,7 @@ namespace easy2d | |||
| 		return S_OK; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::PushLayer(cpLayer const& layer, LayerProperties const& properties) | ||||
| 	HRESULT GraphicsDevice::PushLayer(CpLayer const& layer, LayerProperties const& properties) | ||||
| 	{ | ||||
| 		if (!render_target_ || | ||||
| 			!solid_brush_) | ||||
|  | @ -324,7 +324,7 @@ namespace easy2d | |||
| 		return S_OK; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::CreateBitmapFromFile(cpBitmap& bitmap, std::wstring const& file_path) | ||||
| 	HRESULT GraphicsDevice::CreateBitmapFromFile(CpBitmap& bitmap, std::wstring const& file_path) | ||||
| 	{ | ||||
| 		if (render_target_ == nullptr) | ||||
| 		{ | ||||
|  | @ -338,7 +338,7 @@ namespace easy2d | |||
| 			return S_OK; | ||||
| 		} | ||||
| 
 | ||||
| 		cpBitmap bitmap_tmp; | ||||
| 		CpBitmap bitmap_tmp; | ||||
| 		HRESULT hr = Factory::Instance()->CreateBitmapFromFile( | ||||
| 			bitmap, | ||||
| 			render_target_, | ||||
|  | @ -353,7 +353,7 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::CreateBitmapFromResource(cpBitmap& bitmap, Resource const& res) | ||||
| 	HRESULT GraphicsDevice::CreateBitmapFromResource(CpBitmap& bitmap, Resource const& res) | ||||
| 	{ | ||||
| 		if (render_target_ == nullptr) | ||||
| 		{ | ||||
|  | @ -381,7 +381,7 @@ namespace easy2d | |||
| 		return hr; | ||||
| 	} | ||||
| 
 | ||||
| 	HRESULT GraphicsDevice::CreateBitmapRenderTarget(cpBitmapRenderTarget & brt) | ||||
| 	HRESULT GraphicsDevice::CreateBitmapRenderTarget(CpBitmapRenderTarget & brt) | ||||
| 	{ | ||||
| 		if (!render_target_) | ||||
| 			return E_UNEXPECTED; | ||||
|  |  | |||
|  | @ -43,7 +43,7 @@ namespace easy2d | |||
| 			int primitives; | ||||
| 		}; | ||||
| 
 | ||||
| 		using BitmapMap = std::unordered_map<size_t, cpBitmap>; | ||||
| 		using BitmapMap = std::unordered_map<size_t, CpBitmap>; | ||||
| 
 | ||||
| 	public: | ||||
| 		HRESULT Init(HWND hwnd, bool vsync, bool debug); | ||||
|  | @ -78,25 +78,25 @@ namespace easy2d | |||
| 		void DiscardResources(); | ||||
| 
 | ||||
| 		HRESULT CreateLayer( | ||||
| 			cpLayer& layer | ||||
| 			CpLayer& layer | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT CreateSolidColorBrush( | ||||
| 			cpSolidColorBrush& brush | ||||
| 			CpSolidColorBrush& brush | ||||
| 		) const; | ||||
| 
 | ||||
| 		HRESULT CreateBitmapFromFile( | ||||
| 			cpBitmap& bitmap, | ||||
| 			CpBitmap& bitmap, | ||||
| 			std::wstring const& file_path | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT CreateBitmapFromResource( | ||||
| 			cpBitmap& bitmap, | ||||
| 			CpBitmap& bitmap, | ||||
| 			Resource const& res | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT CreateBitmapRenderTarget( | ||||
| 			cpBitmapRenderTarget& brt | ||||
| 			CpBitmapRenderTarget& brt | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT SetTransform( | ||||
|  | @ -116,27 +116,27 @@ namespace easy2d | |||
| 		); | ||||
| 
 | ||||
| 		HRESULT DrawGeometry( | ||||
| 			cpGeometry const& geometry, | ||||
| 			CpGeometry const& geometry, | ||||
| 			const Color& stroke_color, | ||||
| 			float stroke_width, | ||||
| 			StrokeStyle stroke = StrokeStyle::Miter | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT FillGeometry( | ||||
| 			cpGeometry const& geometry, | ||||
| 			CpGeometry const& geometry, | ||||
| 			const Color& fill_color | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT DrawImage( | ||||
| 			spImage const& image | ||||
| 			SpImage const& image | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT DrawBitmap( | ||||
| 			cpBitmap const& bitmap | ||||
| 			CpBitmap const& bitmap | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT DrawTextLayout( | ||||
| 			cpTextLayout const& text_layout | ||||
| 			CpTextLayout const& text_layout | ||||
| 		); | ||||
| 
 | ||||
| 		HRESULT PushClip( | ||||
|  | @ -147,7 +147,7 @@ namespace easy2d | |||
| 		HRESULT PopClip(); | ||||
| 
 | ||||
| 		HRESULT PushLayer( | ||||
| 			cpLayer const& layer, | ||||
| 			CpLayer const& layer, | ||||
| 			LayerProperties const& properties | ||||
| 		); | ||||
| 
 | ||||
|  | @ -164,9 +164,9 @@ namespace easy2d | |||
| 
 | ||||
| 		void ClearImageCache(); | ||||
| 
 | ||||
| 		cpHwndRenderTarget const& GetRenderTarget() const; | ||||
| 		CpHwndRenderTarget const& GetRenderTarget() const; | ||||
| 
 | ||||
| 		cpSolidColorBrush const& GetSolidBrush() const; | ||||
| 		CpSolidColorBrush const& GetSolidBrush() const; | ||||
| 
 | ||||
| 	protected: | ||||
| 		GraphicsDevice(); | ||||
|  | @ -182,11 +182,11 @@ namespace easy2d | |||
| 		D2D1_COLOR_F		clear_color_; | ||||
| 		TextAntialias		text_antialias_; | ||||
| 		Status				status_; | ||||
| 		cpTextRenderer		text_renderer_; | ||||
| 		cpSolidColorBrush	solid_brush_; | ||||
| 		cpHwndRenderTarget	render_target_; | ||||
| 		cpTextFormat		fps_text_format_; | ||||
| 		cpTextLayout		fps_text_layout_; | ||||
| 		CpTextRenderer		text_renderer_; | ||||
| 		CpSolidColorBrush	solid_brush_; | ||||
| 		CpHwndRenderTarget	render_target_; | ||||
| 		CpTextFormat		fps_text_format_; | ||||
| 		CpTextLayout		fps_text_layout_; | ||||
| 		BitmapMap			bitmap_cache_; | ||||
| 	}; | ||||
| 
 | ||||
|  |  | |||
|  | @ -35,7 +35,7 @@ namespace easy2d | |||
| 		{ | ||||
| 		} | ||||
| 
 | ||||
| 		TimePoint::TimePoint(long long dur) | ||||
| 		TimePoint::TimePoint(long dur) | ||||
| 			: dur(dur) | ||||
| 		{ | ||||
| 		} | ||||
|  | @ -124,7 +124,7 @@ namespace easy2d | |||
| 		{ | ||||
| 		} | ||||
| 
 | ||||
| 		Duration::Duration(long long milliseconds) | ||||
| 		Duration::Duration(long milliseconds) | ||||
| 			: milliseconds_(milliseconds) | ||||
| 		{ | ||||
| 		} | ||||
|  | @ -257,42 +257,32 @@ namespace easy2d | |||
| 
 | ||||
| 		const Duration easy2d::time::Duration::operator*(unsigned long long val) const | ||||
| 		{ | ||||
| 			return Duration(static_cast<long long>(milliseconds_ * val)); | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration easy2d::time::Duration::operator/(unsigned long long val) const | ||||
| 		{ | ||||
| 			return Duration(static_cast<long long>(milliseconds_ / val)); | ||||
| 			return Duration(static_cast<long>(milliseconds_ * val)); | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration Duration::operator*(float val) const | ||||
| 		{ | ||||
| 			return Duration(static_cast<long long>(milliseconds_ * val)); | ||||
| 			return Duration(static_cast<long>(milliseconds_ * val)); | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration Duration::operator/(float val) const | ||||
| 		{ | ||||
| 			return Duration(static_cast<long long>(milliseconds_ / val)); | ||||
| 			return Duration(static_cast<long>(milliseconds_ / val)); | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration Duration::operator*(double val) const | ||||
| 		{ | ||||
| 			return Duration(static_cast<long long>(milliseconds_ * val)); | ||||
| 			return Duration(static_cast<long>(milliseconds_ * val)); | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration Duration::operator*(long double val) const | ||||
| 		{ | ||||
| 			return Duration(static_cast<long long>(milliseconds_ * val)); | ||||
| 			return Duration(static_cast<long>(milliseconds_ * val)); | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration Duration::operator/(double val) const | ||||
| 		{ | ||||
| 			return Duration(static_cast<long long>(milliseconds_ / val)); | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration Duration::operator/(long double val) const | ||||
| 		{ | ||||
| 			return Duration(static_cast<long long>(milliseconds_ / val)); | ||||
| 			return Duration(static_cast<long>(milliseconds_ / val)); | ||||
| 		} | ||||
| 
 | ||||
| 		Duration & Duration::operator+=(const Duration &other) | ||||
|  | @ -315,55 +305,31 @@ namespace easy2d | |||
| 
 | ||||
| 		Duration & Duration::operator/=(int val) | ||||
| 		{ | ||||
| 			milliseconds_ = static_cast<long long>(milliseconds_ / val); | ||||
| 			return (*this); | ||||
| 		} | ||||
| 
 | ||||
| 		Duration & easy2d::time::Duration::operator*=(unsigned long long val) | ||||
| 		{ | ||||
| 			milliseconds_ = static_cast<long long>(milliseconds_ * val); | ||||
| 			return (*this); | ||||
| 		} | ||||
| 
 | ||||
| 		Duration & easy2d::time::Duration::operator/=(unsigned long long val) | ||||
| 		{ | ||||
| 			milliseconds_ = static_cast<long long>(milliseconds_ * val); | ||||
| 			milliseconds_ = static_cast<long>(milliseconds_ / val); | ||||
| 			return (*this); | ||||
| 		} | ||||
| 
 | ||||
| 		Duration & Duration::operator*=(float val) | ||||
| 		{ | ||||
| 			milliseconds_ = static_cast<long long>(milliseconds_ * val); | ||||
| 			milliseconds_ = static_cast<long>(milliseconds_ * val); | ||||
| 			return (*this); | ||||
| 		} | ||||
| 
 | ||||
| 		Duration & Duration::operator/=(float val) | ||||
| 		{ | ||||
| 			milliseconds_ = static_cast<long long>(milliseconds_ / val); | ||||
| 			milliseconds_ = static_cast<long>(milliseconds_ / val); | ||||
| 			return (*this); | ||||
| 		} | ||||
| 
 | ||||
| 		Duration & Duration::operator*=(double val) | ||||
| 		{ | ||||
| 			milliseconds_ = static_cast<long long>(milliseconds_ * val); | ||||
| 			return (*this); | ||||
| 		} | ||||
| 
 | ||||
| 		Duration & Duration::operator*=(long double val) | ||||
| 		{ | ||||
| 			milliseconds_ = static_cast<long long>(milliseconds_ * val); | ||||
| 			milliseconds_ = static_cast<long>(milliseconds_ * val); | ||||
| 			return (*this); | ||||
| 		} | ||||
| 
 | ||||
| 		Duration & Duration::operator/=(double val) | ||||
| 		{ | ||||
| 			milliseconds_ = static_cast<long long>(milliseconds_ / val); | ||||
| 			return (*this); | ||||
| 		} | ||||
| 
 | ||||
| 		Duration & Duration::operator/=(long double val) | ||||
| 		{ | ||||
| 			milliseconds_ = static_cast<long long>(milliseconds_ / val); | ||||
| 			milliseconds_ = static_cast<long>(milliseconds_ / val); | ||||
| 			return (*this); | ||||
| 		} | ||||
| 
 | ||||
|  | @ -372,21 +338,11 @@ namespace easy2d | |||
| 			return dur * val; | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration easy2d::time::operator*(unsigned long long val, const Duration & dur) | ||||
| 		{ | ||||
| 			return dur / val; | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration easy2d::time::operator/(int val, const Duration & dur) | ||||
| 		{ | ||||
| 			return dur / val; | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration easy2d::time::operator/(unsigned long long val, const Duration & dur) | ||||
| 		{ | ||||
| 			return dur * val; | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration easy2d::time::operator*(float val, const Duration & dur) | ||||
| 		{ | ||||
| 			return dur * val; | ||||
|  | @ -412,11 +368,6 @@ namespace easy2d | |||
| 			return dur * val; | ||||
| 		} | ||||
| 
 | ||||
| 		const Duration easy2d::time::operator/(long double val, const Duration & dur) | ||||
| 		{ | ||||
| 			return dur / val; | ||||
| 		} | ||||
| 
 | ||||
| 		std::wostream & easy2d::time::operator<<(std::wostream & out, const Duration & dur) | ||||
| 		{ | ||||
| 			return out << dur.ToString(); | ||||
|  | @ -449,7 +400,7 @@ namespace easy2d | |||
| 
 | ||||
| 			const long long whole = (count.QuadPart / freq.QuadPart) * 1000LL; | ||||
| 			const long long part = (count.QuadPart % freq.QuadPart) * 1000LL / freq.QuadPart; | ||||
| 			return TimePoint{ whole + part }; | ||||
| 			return TimePoint{ static_cast<long>(whole + part) }; | ||||
| 		} | ||||
| 
 | ||||
| 		Duration easy2d::time::ParseDuration(const std::wstring & str) | ||||
|  |  | |||
|  | @ -20,7 +20,6 @@ | |||
| 
 | ||||
| #pragma once | ||||
| #include "macros.h" | ||||
| #include <cstdint> | ||||
| 
 | ||||
| namespace easy2d | ||||
| { | ||||
|  | @ -45,11 +44,11 @@ namespace easy2d | |||
| 			Duration(); | ||||
| 
 | ||||
| 			explicit Duration( | ||||
| 				long long milliseconds | ||||
| 				long milliseconds | ||||
| 			); | ||||
| 
 | ||||
| 			// 转化为毫秒
 | ||||
| 			inline long long Milliseconds() const { return milliseconds_; } | ||||
| 			inline long Milliseconds() const { return milliseconds_; } | ||||
| 
 | ||||
| 			// 转化为秒
 | ||||
| 			float Seconds() const; | ||||
|  | @ -84,40 +83,31 @@ namespace easy2d | |||
| 			const Duration operator * (double) const; | ||||
| 			const Duration operator * (long double) const; | ||||
| 			const Duration operator / (int) const; | ||||
| 			const Duration operator / (unsigned long long) const; | ||||
| 			const Duration operator / (float) const; | ||||
| 			const Duration operator / (double) const; | ||||
| 			const Duration operator / (long double) const; | ||||
| 
 | ||||
| 			Duration& operator += (const Duration &); | ||||
| 			Duration& operator -= (const Duration &); | ||||
| 			Duration& operator *= (int); | ||||
| 			Duration& operator *= (unsigned long long); | ||||
| 			Duration& operator *= (float); | ||||
| 			Duration& operator *= (double); | ||||
| 			Duration& operator *= (long double); | ||||
| 			Duration& operator /= (int); | ||||
| 			Duration& operator /= (unsigned long long); | ||||
| 			Duration& operator /= (float); | ||||
| 			Duration& operator /= (double); | ||||
| 			Duration& operator /= (long double); | ||||
| 
 | ||||
| 			friend const Duration operator* (int, const Duration &); | ||||
| 			friend const Duration operator* (unsigned long long, const Duration &); | ||||
| 			friend const Duration operator* (float, const Duration &); | ||||
| 			friend const Duration operator* (double, const Duration &); | ||||
| 			friend const Duration operator* (long double, const Duration &); | ||||
| 			friend const Duration operator/ (int, const Duration &); | ||||
| 			friend const Duration operator/ (unsigned long long, const Duration &); | ||||
| 			friend const Duration operator/ (float, const Duration &); | ||||
| 			friend const Duration operator/ (double, const Duration &); | ||||
| 			friend const Duration operator/ (long double, const Duration &); | ||||
| 
 | ||||
| 			friend std::wostream& operator<< (std::wostream &, const Duration &); | ||||
| 			friend std::wistream& operator>> (std::wistream &, Duration &); | ||||
| 
 | ||||
| 		private: | ||||
| 			long long milliseconds_; | ||||
| 			long milliseconds_; | ||||
| 		}; | ||||
| 
 | ||||
| 		extern const Duration Millisecond;	// 毫秒
 | ||||
|  | @ -129,12 +119,12 @@ namespace easy2d | |||
| 		// 时间
 | ||||
| 		//
 | ||||
| 		// Usage:
 | ||||
| 		//     »ñÈ¡µ±Ç°Ê±¼ä: Time now = time::Now();
 | ||||
| 		//     获取当前时间: TimePoint now = time::Now();
 | ||||
| 		//     时间操作:
 | ||||
| 		//         两时间相减, 得到一个 Duration 对象, 例如:
 | ||||
| 		//         Time t1 = time::Now();
 | ||||
| 		//         TimePoint t1 = time::Now();
 | ||||
| 		//         ...  // 做些什么
 | ||||
| 		//         Time t2 = time::Now();
 | ||||
| 		//         TimePoint t2 = time::Now();
 | ||||
| 		//         auto duration = t2 - t1;
 | ||||
| 		//         获取两时间相差的毫秒数:
 | ||||
| 		//         int ms = duration.Milliseconds();
 | ||||
|  | @ -147,7 +137,7 @@ namespace easy2d | |||
| 			TimePoint(); | ||||
| 
 | ||||
| 			explicit TimePoint( | ||||
| 				long long | ||||
| 				long | ||||
| 			); | ||||
| 
 | ||||
| 			TimePoint( | ||||
|  | @ -173,7 +163,7 @@ namespace easy2d | |||
| 			TimePoint& operator = (TimePoint &&) E2D_NOEXCEPT; | ||||
| 
 | ||||
| 		private: | ||||
| 			long long dur; | ||||
| 			long dur; | ||||
| 		}; | ||||
| 
 | ||||
| 		// 获取当前时间
 | ||||
|  |  | |||
|  | @ -55,7 +55,7 @@ namespace easy2d | |||
| 		WNDCLASSEX wcex		= { 0 }; | ||||
| 		wcex.cbSize			= sizeof(WNDCLASSEX); | ||||
| 		wcex.lpszClassName	= REGISTER_CLASS; | ||||
| 		wcex.style			= CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; | ||||
| 		wcex.style			= CS_HREDRAW | CS_VREDRAW /* | CS_DBLCLKS */; | ||||
| 		wcex.lpfnWndProc	= proc; | ||||
| 		wcex.hIcon			= nullptr; | ||||
| 		wcex.cbClsExtra		= 0; | ||||
|  |  | |||
|  | @ -29,7 +29,7 @@ namespace easy2d | |||
| 		{ | ||||
| 		} | ||||
| 
 | ||||
| 		Menu::Menu(const std::vector<spButton>& buttons) | ||||
| 		Menu::Menu(const std::vector<SpButton>& buttons) | ||||
| 			: enabled_(true) | ||||
| 		{ | ||||
| 			for (const auto& button : buttons) | ||||
|  | @ -61,7 +61,7 @@ namespace easy2d | |||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		void Menu::AddButton(spButton const& button) | ||||
| 		void Menu::AddButton(SpButton const& button) | ||||
| 		{ | ||||
| 			if (button) | ||||
| 			{ | ||||
|  | @ -71,7 +71,7 @@ namespace easy2d | |||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		bool Menu::RemoveButton(spButton const& button) | ||||
| 		bool Menu::RemoveButton(SpButton const& button) | ||||
| 		{ | ||||
| 			if (buttons_.empty()) | ||||
| 			{ | ||||
|  | @ -94,7 +94,7 @@ namespace easy2d | |||
| 			return false; | ||||
| 		} | ||||
| 
 | ||||
| 		const std::vector<spButton>& Menu::GetAllButtons() const | ||||
| 		const std::vector<SpButton>& Menu::GetAllButtons() const | ||||
| 		{ | ||||
| 			return buttons_; | ||||
| 		} | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ namespace easy2d | |||
| 			Menu(); | ||||
| 
 | ||||
| 			explicit Menu( | ||||
| 				const std::vector<spButton>& buttons	/* 按钮数组 */ | ||||
| 				const std::vector<SpButton>& buttons	/* 按钮数组 */ | ||||
| 			); | ||||
| 
 | ||||
| 			// 获取菜单是否禁用
 | ||||
|  | @ -49,20 +49,20 @@ namespace easy2d | |||
| 
 | ||||
| 			// 添加按钮
 | ||||
| 			void AddButton( | ||||
| 				spButton const& button | ||||
| 				SpButton const& button | ||||
| 			); | ||||
| 
 | ||||
| 			// 移除按钮
 | ||||
| 			bool RemoveButton( | ||||
| 				spButton const& button | ||||
| 				SpButton const& button | ||||
| 			); | ||||
| 
 | ||||
| 			// 获取所有按钮
 | ||||
| 			const std::vector<spButton>& GetAllButtons() const; | ||||
| 			const std::vector<SpButton>& GetAllButtons() const; | ||||
| 
 | ||||
| 		private: | ||||
| 			bool enabled_; | ||||
| 			std::vector<spButton> buttons_; | ||||
| 			std::vector<SpButton> buttons_; | ||||
| 		}; | ||||
| 	} | ||||
| } | ||||
|  | @ -38,7 +38,7 @@ namespace easy2d | |||
| 		if (file_path.empty()) | ||||
| 			return false; | ||||
| 
 | ||||
| 		spMusic music = new (std::nothrow) Music(); | ||||
| 		SpMusic music = new (std::nothrow) Music(); | ||||
| 
 | ||||
| 		if (music) | ||||
| 		{ | ||||
|  | @ -117,7 +117,7 @@ namespace easy2d | |||
| 		if (musics_cache_.end() != musics_cache_.find(hash_code)) | ||||
| 			return true; | ||||
| 
 | ||||
| 		spMusic music = new (std::nothrow) Music(); | ||||
| 		SpMusic music = new (std::nothrow) Music(); | ||||
| 
 | ||||
| 		if (music) | ||||
| 		{ | ||||
|  |  | |||
|  | @ -29,7 +29,7 @@ namespace easy2d | |||
| 	class Player | ||||
| 		: protected Noncopyable | ||||
| 	{ | ||||
| 		using MusicMap = std::unordered_map<size_t, spMusic>; | ||||
| 		using MusicMap = std::unordered_map<size_t, SpMusic>; | ||||
| 
 | ||||
| 	public: | ||||
| 		Player(); | ||||
|  |  | |||
|  | @ -79,7 +79,7 @@ namespace easy2d | |||
| 		ResourceData buffer; | ||||
| 		if (!res.Load(&buffer)) { return false; } | ||||
| 
 | ||||
| 		stream = SHCreateMemStream( | ||||
| 		stream = modules::Shlwapi{}.SHCreateMemStream( | ||||
| 			static_cast<const BYTE*>(buffer.buffer), | ||||
| 			static_cast<UINT>(buffer.buffer_size) | ||||
| 		); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue