From 887024f916a6fdb50ef4104cc78c08211a6dffcb Mon Sep 17 00:00:00 2001 From: Nomango Date: Sun, 11 Oct 2020 17:10:14 +0800 Subject: [PATCH] add transitions --- projects/kiwano/kiwano.vcxproj | 14 +- projects/kiwano/kiwano.vcxproj.filters | 45 +- src/kiwano/2d/Transition.cpp | 388 ------------------ src/kiwano/2d/Transition.h | 256 ------------ src/kiwano/2d/transition/BoxTransition.cpp | 58 +++ src/kiwano/2d/transition/BoxTransition.h | 52 +++ src/kiwano/2d/transition/FadeTransition.cpp | 66 +++ src/kiwano/2d/transition/FadeTransition.h | 56 +++ src/kiwano/2d/transition/MoveTransition.cpp | 106 +++++ src/kiwano/2d/transition/MoveTransition.h | 72 ++++ .../2d/transition/RotationTransition.cpp | 104 +++++ src/kiwano/2d/transition/RotationTransition.h | 58 +++ src/kiwano/2d/transition/Transition.cpp | 118 ++++++ src/kiwano/2d/transition/Transition.h | 121 ++++++ src/kiwano/base/Director.cpp | 1 - src/kiwano/base/Director.h | 2 +- src/kiwano/event/KeyEvent.h | 2 +- src/kiwano/event/MouseEvent.h | 2 +- src/kiwano/kiwano.h | 11 +- src/kiwano/platform/Input.h | 2 +- src/kiwano/{core => platform}/Keys.h | 0 src/kiwano/platform/win32/WindowImpl.cpp | 2 +- 22 files changed, 873 insertions(+), 663 deletions(-) delete mode 100644 src/kiwano/2d/Transition.cpp delete mode 100644 src/kiwano/2d/Transition.h create mode 100644 src/kiwano/2d/transition/BoxTransition.cpp create mode 100644 src/kiwano/2d/transition/BoxTransition.h create mode 100644 src/kiwano/2d/transition/FadeTransition.cpp create mode 100644 src/kiwano/2d/transition/FadeTransition.h create mode 100644 src/kiwano/2d/transition/MoveTransition.cpp create mode 100644 src/kiwano/2d/transition/MoveTransition.h create mode 100644 src/kiwano/2d/transition/RotationTransition.cpp create mode 100644 src/kiwano/2d/transition/RotationTransition.h create mode 100644 src/kiwano/2d/transition/Transition.cpp create mode 100644 src/kiwano/2d/transition/Transition.h rename src/kiwano/{core => platform}/Keys.h (100%) diff --git a/projects/kiwano/kiwano.vcxproj b/projects/kiwano/kiwano.vcxproj index f9b99476..7d53d52c 100644 --- a/projects/kiwano/kiwano.vcxproj +++ b/projects/kiwano/kiwano.vcxproj @@ -15,6 +15,11 @@ + + + + + @@ -35,7 +40,6 @@ - @@ -60,7 +64,6 @@ - @@ -75,6 +78,7 @@ + @@ -139,7 +143,11 @@ - + + + + + diff --git a/projects/kiwano/kiwano.vcxproj.filters b/projects/kiwano/kiwano.vcxproj.filters index 377c5eca..5b33f584 100644 --- a/projects/kiwano/kiwano.vcxproj.filters +++ b/projects/kiwano/kiwano.vcxproj.filters @@ -37,6 +37,9 @@ {9314f30d-5742-48b6-94e5-e3b4284106f6} + + {f70cecd8-6d5b-405d-8466-d3ca2db9b806} + @@ -45,9 +48,6 @@ 2d - - 2d - core @@ -111,9 +111,6 @@ core - - core - core @@ -381,6 +378,24 @@ 2d + + platform + + + 2d\transition + + + 2d\transition + + + 2d\transition + + + 2d\transition + + + 2d\transition + @@ -389,9 +404,6 @@ 2d - - 2d - core @@ -623,6 +635,21 @@ 2d + + 2d\transition + + + 2d\transition + + + 2d\transition + + + 2d\transition + + + 2d\transition + diff --git a/src/kiwano/2d/Transition.cpp b/src/kiwano/2d/Transition.cpp deleted file mode 100644 index b62167e3..00000000 --- a/src/kiwano/2d/Transition.cpp +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) 2016-2018 Kiwano - Nomango -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include -#include -#include -#include -#include -#include - -namespace kiwano -{ -//------------------------------------------------------- -// Transition -//------------------------------------------------------- - -Transition::Transition() - : done_(false) - , duration_() - , delta_() - , process_(0) - , window_size_() - , out_stage_(nullptr) - , in_stage_(nullptr) - , out_layer_() - , in_layer_() -{ -} - -Transition::~Transition() {} - -bool Transition::IsDone() -{ - return done_; -} - -void Transition::Init(Stage* prev, Stage* next) -{ - process_ = 0; - delta_ = Duration{}; - - out_stage_ = prev; - in_stage_ = next; - window_size_ = Renderer::GetInstance().GetOutputSize(); - - if (in_stage_) - { - in_layer_.SetClipRect(Rect{ Point(), window_size_ }); - } - - if (out_stage_) - { - out_layer_.SetClipRect(Rect{ Point(), window_size_ }); - } -} - -void Transition::Update(Duration dt) -{ - if (duration_.IsZero()) - { - process_ = 1; - } - else - { - delta_ += dt; - process_ = std::min(delta_ / duration_, 1.f); - } - - if (process_ >= 1) - { - this->Stop(); - } -} - -void Transition::Render(RenderContext& ctx) -{ - if (out_stage_) - { - out_stage_->PrepareToRender(ctx); - ctx.PushClipRect(Rect{ Point{}, window_size_ }); - ctx.PushLayer(out_layer_); - - out_stage_->Render(ctx); - - ctx.PopLayer(); - ctx.PopClipRect(); - } - - if (in_stage_) - { - in_stage_->PrepareToRender(ctx); - ctx.PushClipRect(Rect{ Point{}, window_size_ }); - ctx.PushLayer(in_layer_); - - in_stage_->Render(ctx); - - ctx.PopLayer(); - ctx.PopClipRect(); - } -} - -void Transition::Stop() -{ - done_ = true; - Reset(); -} - -//------------------------------------------------------- -// BoxTransition -//------------------------------------------------------- - -BoxTransition::BoxTransition(Duration duration) -{ - SetDuration(duration); -} - -BoxTransition::BoxTransition() {} - -void BoxTransition::Init(Stage* prev, Stage* next) -{ - Transition::Init(prev, next); - - in_layer_.SetOpacity(0.f); -} - -void BoxTransition::Update(Duration dt) -{ - Transition::Update(dt); - - if (process_ < .5f) - { - out_layer_.SetClipRect(Rect(window_size_.x * process_, window_size_.y * process_, - window_size_.x * (1 - process_), window_size_.y * (1 - process_))); - } - else - { - out_layer_.SetOpacity(0.f); - in_layer_.SetOpacity(1.f); - in_layer_.SetClipRect(Rect(window_size_.x * (1 - process_), window_size_.y * (1 - process_), - window_size_.x * process_, window_size_.y * process_)); - } -} - -//------------------------------------------------------- -// EmergeTransition -//------------------------------------------------------- - -EmergeTransition::EmergeTransition(Duration duration) -{ - SetDuration(duration); -} - -EmergeTransition::EmergeTransition() {} - -void EmergeTransition::Init(Stage* prev, Stage* next) -{ - Transition::Init(prev, next); - - out_layer_.SetOpacity(1.f); - in_layer_.SetOpacity(0.f); -} - -void EmergeTransition::Update(Duration dt) -{ - Transition::Update(dt); - - out_layer_.SetOpacity(1 - process_); - in_layer_.SetOpacity(process_); -} - -//------------------------------------------------------- -// FadeTransition -//------------------------------------------------------- - -FadeTransition::FadeTransition(Duration duration) -{ - SetDuration(duration); -} - -FadeTransition::FadeTransition() {} - -void FadeTransition::Init(Stage* prev, Stage* next) -{ - Transition::Init(prev, next); - - out_layer_.SetOpacity(1.f); - in_layer_.SetOpacity(0.f); -} - -void FadeTransition::Update(Duration dt) -{ - Transition::Update(dt); - - if (process_ < 0.5) - { - out_layer_.SetOpacity(1 - process_ * 2); - in_layer_.SetOpacity(0.f); - } - else - { - out_layer_.SetOpacity(0.f); - in_layer_.SetOpacity((process_ - 0.5f) * 2); - } -} - -//------------------------------------------------------- -// MoveTransition -//------------------------------------------------------- - -MoveTransition::MoveTransition(Duration duration, Type type) - : type_(type) -{ - SetDuration(duration); -} - -MoveTransition::MoveTransition() - : type_(Type::Left) -{ -} - -void MoveTransition::Init(Stage* prev, Stage* next) -{ - Transition::Init(prev, next); - - switch (type_) - { - case Type::Up: - pos_delta_ = Point(0, -window_size_.y); - start_pos_ = Point(0, window_size_.y); - break; - case Type::Down: - pos_delta_ = Point(0, window_size_.y); - start_pos_ = Point(0, -window_size_.y); - break; - case Type::Left: - pos_delta_ = Point(-window_size_.x, 0); - start_pos_ = Point(window_size_.x, 0); - break; - case Type::Right: - pos_delta_ = Point(window_size_.x, 0); - start_pos_ = Point(-window_size_.x, 0); - break; - } - - if (out_stage_) - { - out_stage_->SetTransform(Transform{}); - } - - if (in_stage_) - { - auto transform = Transform{}; - transform.position = start_pos_; - in_stage_->SetTransform(transform); - } -} - -void MoveTransition::Update(Duration dt) -{ - Transition::Update(dt); - - if (out_stage_) - { - auto transform = Transform{}; - transform.position = pos_delta_ * process_; - out_stage_->SetTransform(transform); - } - - if (in_stage_) - { - auto transform = Transform{}; - transform.position = start_pos_ + pos_delta_ * process_; - in_stage_->SetTransform(transform); - } -} - -void MoveTransition::Reset() -{ - if (out_stage_) - { - out_stage_->SetTransform(Transform{}); - } - - if (in_stage_) - { - in_stage_->SetTransform(Transform{}); - } -} - -//------------------------------------------------------- -// RotationTransition -//------------------------------------------------------- - -RotationTransition::RotationTransition(Duration duration, float rotation) - : rotation_(rotation) -{ - SetDuration(duration); -} - -RotationTransition::RotationTransition() - : rotation_(0.0f) -{ -} - -void RotationTransition::Init(Stage* prev, Stage* next) -{ - Transition::Init(prev, next); - - auto transform = Transform{}; - transform.position = Point{ window_size_.x / 2, window_size_.y / 2 }; - - if (out_stage_) - { - out_stage_->SetTransform(transform); - out_stage_->SetAnchor(Vec2{ 0.5f, 0.5f }); - } - - if (in_stage_) - { - in_stage_->SetTransform(transform); - in_stage_->SetAnchor(Vec2{ 0.5f, 0.5f }); - } - - in_layer_.SetOpacity(0.f); -} - -void RotationTransition::Update(Duration dt) -{ - Transition::Update(dt); - - if (process_ < .5f) - { - if (out_stage_) - { - auto transform = out_stage_->GetTransform(); - transform.scale = Point{ (.5f - process_) * 2, (.5f - process_) * 2 }; - transform.rotation = rotation_ * (.5f - process_) * 2; - out_stage_->SetTransform(transform); - } - } - else - { - if (in_stage_) - { - out_layer_.SetOpacity(0.f); - in_layer_.SetOpacity(1.f); - - auto transform = in_stage_->GetTransform(); - transform.scale = Point{ (process_ - .5f) * 2, (process_ - .5f) * 2 }; - transform.rotation = rotation_ * (process_ - .5f) * 2; - - in_stage_->SetTransform(transform); - } - } -} - -void RotationTransition::Reset() -{ - if (out_stage_) - { - out_stage_->SetTransform(Transform{}); - out_stage_->SetAnchor(Vec2{ 0.f, 0.f }); - } - - if (in_stage_) - { - in_stage_->SetTransform(Transform{}); - in_stage_->SetAnchor(Vec2{ 0.f, 0.f }); - } -} -} // namespace kiwano diff --git a/src/kiwano/2d/Transition.h b/src/kiwano/2d/Transition.h deleted file mode 100644 index 86ced945..00000000 --- a/src/kiwano/2d/Transition.h +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) 2016-2018 Kiwano - Nomango -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#pragma once -#include -#include - -namespace kiwano -{ -class Director; -class RenderContext; - -KGE_DECLARE_SMART_PTR(Transition); -KGE_DECLARE_SMART_PTR(FadeTransition); -KGE_DECLARE_SMART_PTR(EmergeTransition); -KGE_DECLARE_SMART_PTR(BoxTransition); -KGE_DECLARE_SMART_PTR(MoveTransition); -KGE_DECLARE_SMART_PTR(RotationTransition); - -/** - * \~chinese - * @brief 舞台过渡动画 - */ -class KGE_API Transition : public ObjectBase -{ - friend class Director; - -public: - Transition(); - - virtual ~Transition(); - - /** - * \~chinese - * @brief 设置动画时长 - */ - void SetDuration(Duration dt); - - /** - * \~chinese - * @brief 场景过渡动画是否已结束 - */ - bool IsDone(); - -protected: - /** - * \~chinese - * @brief 初始化场景过渡动画 - * @param[in] prev 转出场景 - * @param[in] next 转入场景 - */ - virtual void Init(Stage* prev, Stage* next); - - /** - * \~chinese - * @brief 更新过渡动画 - * @param dt 距上一次更新的时间间隔 - */ - virtual void Update(Duration dt); - - /** - * \~chinese - * @brief 渲染过度动画 - * @param[in] ctx 渲染上下文 - */ - virtual void Render(RenderContext& ctx); - - /** - * \~chinese - * @brief 停止动画 - */ - virtual void Stop(); - - /** - * \~chinese - * @brief 重置动画 - */ - virtual void Reset() {} - -protected: - bool done_; - float process_; - Duration duration_; - Duration delta_; - Size window_size_; - StagePtr out_stage_; - StagePtr in_stage_; - Layer out_layer_; - Layer in_layer_; -}; - -/** - * \~chinese - * @brief 淡入淡出过渡动画 - * @details 前一场景淡出动画结束后,后一场景淡入 - */ -class FadeTransition : public Transition -{ -public: - /** - * \~chinese - * @brief 创建淡入淡出过渡动画 - * @param duration 动画时长 - */ - FadeTransition(Duration duration); - - FadeTransition(); - -protected: - void Update(Duration dt) override; - - virtual void Init(Stage* prev, Stage* next) override; -}; - -/** - * \~chinese - * @brief 渐变过渡动画 - * @details 前一场景淡出动画的同时,后一场景淡入 - */ -class EmergeTransition : public Transition -{ -public: - /** - * \~chinese - * @brief 创建渐变过渡动画 - * @param duration 动画时长 - */ - EmergeTransition(Duration duration); - - EmergeTransition(); - -protected: - void Update(Duration dt) override; - - virtual void Init(Stage* prev, Stage* next) override; -}; - -/** - * \~chinese - * @brief 盒状过渡动画 - * @details 前一场景以盒状收缩至消失,后一场景以盒状扩大 - */ -class BoxTransition : public Transition -{ -public: - /** - * \~chinese - * @brief 创建盒状过渡动画 - * @param duration 动画时长 - */ - BoxTransition(Duration duration); - - BoxTransition(); - -protected: - void Update(Duration dt) override; - - virtual void Init(Stage* prev, Stage* next) override; -}; - -/** - * \~chinese - * @brief 位移过渡动画 - * @details 两场景以位移的方式切换 - */ -class MoveTransition : public Transition -{ -public: - /** - * \~chinese - * @brief 位移方式 - */ - enum class Type : int - { - Up, ///< 上移 - Down, ///< 下移 - Left, ///< 左移 - Right ///< 右移 - }; - - /** - * \~chinese - * @brief 创建位移过渡动画 - * @param duration 动画时长 - * @param type 位移方式 - */ - MoveTransition(Duration duration, Type type); - - MoveTransition(); - -protected: - void Update(Duration dt) override; - - virtual void Init(Stage* prev, Stage* next) override; - - void Reset() override; - -private: - Type type_; - Point pos_delta_; - Point start_pos_; -}; - -/** - * \~chinese - * @brief 旋转过渡动画 - * @details 前一场景以旋转方式收缩至消失,后一场景以旋转方式扩大 - */ -class RotationTransition : public Transition -{ -public: - /** - * \~chinese - * @brief 创建旋转过渡动画 - * @param duration 动画时长 - * @param rotation 旋转度数 - */ - RotationTransition(Duration duration, float rotation = 360.0f); - - RotationTransition(); - -protected: - void Update(Duration dt) override; - - virtual void Init(Stage* prev, Stage* next) override; - - void Reset() override; - -private: - float rotation_; -}; - - -inline void Transition::SetDuration(Duration dt) -{ - duration_ = dt; -} - -} // namespace kiwano diff --git a/src/kiwano/2d/transition/BoxTransition.cpp b/src/kiwano/2d/transition/BoxTransition.cpp new file mode 100644 index 00000000..24438541 --- /dev/null +++ b/src/kiwano/2d/transition/BoxTransition.cpp @@ -0,0 +1,58 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include + +namespace kiwano +{ + +BoxTransition::BoxTransition(Duration duration) +{ + SetDuration(duration); +} + +BoxTransition::BoxTransition() {} + +void BoxTransition::Init(Stage* prev, Stage* next) +{ + Transition::Init(prev, next); + + in_layer_.SetOpacity(0.f); +} + +void BoxTransition::Update(Duration dt) +{ + Transition::Update(dt); + + if (process_ < .5f) + { + out_layer_.SetClipRect(Rect(window_size_.x * process_, window_size_.y * process_, + window_size_.x * (1 - process_), window_size_.y * (1 - process_))); + } + else + { + out_layer_.SetOpacity(0.f); + in_layer_.SetOpacity(1.f); + in_layer_.SetClipRect(Rect(window_size_.x * (1 - process_), window_size_.y * (1 - process_), + window_size_.x * process_, window_size_.y * process_)); + } +} + +} // namespace kiwano diff --git a/src/kiwano/2d/transition/BoxTransition.h b/src/kiwano/2d/transition/BoxTransition.h new file mode 100644 index 00000000..54020f23 --- /dev/null +++ b/src/kiwano/2d/transition/BoxTransition.h @@ -0,0 +1,52 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma once +#include + +namespace kiwano +{ + +KGE_DECLARE_SMART_PTR(BoxTransition); + +/** + * \~chinese + * @brief 盒状过渡动画 + * @details 前一场景以盒状收缩至消失,后一场景以盒状扩大 + */ +class BoxTransition : public Transition +{ +public: + /** + * \~chinese + * @brief 创建盒状过渡动画 + * @param duration 动画时长 + */ + BoxTransition(Duration duration); + + BoxTransition(); + +protected: + void Update(Duration dt) override; + + virtual void Init(Stage* prev, Stage* next) override; +}; + +} // namespace kiwano diff --git a/src/kiwano/2d/transition/FadeTransition.cpp b/src/kiwano/2d/transition/FadeTransition.cpp new file mode 100644 index 00000000..06353e62 --- /dev/null +++ b/src/kiwano/2d/transition/FadeTransition.cpp @@ -0,0 +1,66 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include + +namespace kiwano +{ + +FadeTransition::FadeTransition(Duration duration, bool parallel) + : parallel_(parallel) +{ + SetDuration(duration); +} + +FadeTransition::FadeTransition() {} + +void FadeTransition::Init(Stage* prev, Stage* next) +{ + Transition::Init(prev, next); + + out_layer_.SetOpacity(1.f); + in_layer_.SetOpacity(0.f); +} + +void FadeTransition::Update(Duration dt) +{ + Transition::Update(dt); + + if (parallel_) + { + out_layer_.SetOpacity(1 - process_); + in_layer_.SetOpacity(process_); + } + else + { + if (process_ < 0.5) + { + out_layer_.SetOpacity(1 - process_ * 2); + in_layer_.SetOpacity(0.f); + } + else + { + out_layer_.SetOpacity(0.f); + in_layer_.SetOpacity((process_ - 0.5f) * 2); + } + } +} + +} // namespace kiwano diff --git a/src/kiwano/2d/transition/FadeTransition.h b/src/kiwano/2d/transition/FadeTransition.h new file mode 100644 index 00000000..983e7a18 --- /dev/null +++ b/src/kiwano/2d/transition/FadeTransition.h @@ -0,0 +1,56 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma once +#include + +namespace kiwano +{ + +KGE_DECLARE_SMART_PTR(FadeTransition); + +/** + * \~chinese + * @brief 淡入淡出过渡动画 + * @details 前一场景淡出动画结束后,后一场景淡入 + */ +class FadeTransition : public Transition +{ +public: + /** + * \~chinese + * @brief 创建淡入淡出过渡动画 + * @param duration 动画时长 + * @param parallel 淡入和淡出同时进行 + */ + FadeTransition(Duration duration, bool parallel = false); + + FadeTransition(); + +protected: + void Update(Duration dt) override; + + virtual void Init(Stage* prev, Stage* next) override; + +private: + bool parallel_; +}; + +} // namespace kiwano diff --git a/src/kiwano/2d/transition/MoveTransition.cpp b/src/kiwano/2d/transition/MoveTransition.cpp new file mode 100644 index 00000000..34275cc8 --- /dev/null +++ b/src/kiwano/2d/transition/MoveTransition.cpp @@ -0,0 +1,106 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include + +namespace kiwano +{ + +MoveTransition::MoveTransition(Duration duration, Type type) + : type_(type) +{ + SetDuration(duration); +} + +MoveTransition::MoveTransition() + : type_(Type::Left) +{ +} + +void MoveTransition::Init(Stage* prev, Stage* next) +{ + Transition::Init(prev, next); + + switch (type_) + { + case Type::Up: + pos_delta_ = Point(0, -window_size_.y); + start_pos_ = Point(0, window_size_.y); + break; + case Type::Down: + pos_delta_ = Point(0, window_size_.y); + start_pos_ = Point(0, -window_size_.y); + break; + case Type::Left: + pos_delta_ = Point(-window_size_.x, 0); + start_pos_ = Point(window_size_.x, 0); + break; + case Type::Right: + pos_delta_ = Point(window_size_.x, 0); + start_pos_ = Point(-window_size_.x, 0); + break; + } + + if (out_stage_) + { + out_stage_->SetTransform(Transform{}); + } + + if (in_stage_) + { + auto transform = Transform{}; + transform.position = start_pos_; + in_stage_->SetTransform(transform); + } +} + +void MoveTransition::Update(Duration dt) +{ + Transition::Update(dt); + + if (out_stage_) + { + auto transform = Transform{}; + transform.position = pos_delta_ * process_; + out_stage_->SetTransform(transform); + } + + if (in_stage_) + { + auto transform = Transform{}; + transform.position = start_pos_ + pos_delta_ * process_; + in_stage_->SetTransform(transform); + } +} + +void MoveTransition::Reset() +{ + if (out_stage_) + { + out_stage_->SetTransform(Transform{}); + } + + if (in_stage_) + { + in_stage_->SetTransform(Transform{}); + } +} + +} // namespace kiwano diff --git a/src/kiwano/2d/transition/MoveTransition.h b/src/kiwano/2d/transition/MoveTransition.h new file mode 100644 index 00000000..899ee0b2 --- /dev/null +++ b/src/kiwano/2d/transition/MoveTransition.h @@ -0,0 +1,72 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma once +#include + +namespace kiwano +{ + +KGE_DECLARE_SMART_PTR(MoveTransition); + +/** + * \~chinese + * @brief 位移过渡动画 + * @details 两场景以位移的方式切换 + */ +class MoveTransition : public Transition +{ +public: + /** + * \~chinese + * @brief 位移方式 + */ + enum class Type : int + { + Up, ///< 上移 + Down, ///< 下移 + Left, ///< 左移 + Right ///< 右移 + }; + + /** + * \~chinese + * @brief 创建位移过渡动画 + * @param duration 动画时长 + * @param type 位移方式 + */ + MoveTransition(Duration duration, Type type); + + MoveTransition(); + +protected: + void Update(Duration dt) override; + + virtual void Init(Stage* prev, Stage* next) override; + + void Reset() override; + +private: + Type type_; + Point pos_delta_; + Point start_pos_; +}; + +} // namespace kiwano diff --git a/src/kiwano/2d/transition/RotationTransition.cpp b/src/kiwano/2d/transition/RotationTransition.cpp new file mode 100644 index 00000000..4a407296 --- /dev/null +++ b/src/kiwano/2d/transition/RotationTransition.cpp @@ -0,0 +1,104 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include + +namespace kiwano +{ + +RotationTransition::RotationTransition(Duration duration, float rotation) + : rotation_(rotation) +{ + SetDuration(duration); +} + +RotationTransition::RotationTransition() + : rotation_(0.0f) +{ +} + +void RotationTransition::Init(Stage* prev, Stage* next) +{ + Transition::Init(prev, next); + + auto transform = Transform{}; + transform.position = Point{ window_size_.x / 2, window_size_.y / 2 }; + + if (out_stage_) + { + out_stage_->SetTransform(transform); + out_stage_->SetAnchor(Vec2{ 0.5f, 0.5f }); + } + + if (in_stage_) + { + in_stage_->SetTransform(transform); + in_stage_->SetAnchor(Vec2{ 0.5f, 0.5f }); + } + + in_layer_.SetOpacity(0.f); +} + +void RotationTransition::Update(Duration dt) +{ + Transition::Update(dt); + + if (process_ < .5f) + { + if (out_stage_) + { + auto transform = out_stage_->GetTransform(); + transform.scale = Point{ (.5f - process_) * 2, (.5f - process_) * 2 }; + transform.rotation = rotation_ * (.5f - process_) * 2; + out_stage_->SetTransform(transform); + } + } + else + { + if (in_stage_) + { + out_layer_.SetOpacity(0.f); + in_layer_.SetOpacity(1.f); + + auto transform = in_stage_->GetTransform(); + transform.scale = Point{ (process_ - .5f) * 2, (process_ - .5f) * 2 }; + transform.rotation = rotation_ * (process_ - .5f) * 2; + + in_stage_->SetTransform(transform); + } + } +} + +void RotationTransition::Reset() +{ + if (out_stage_) + { + out_stage_->SetTransform(Transform{}); + out_stage_->SetAnchor(Vec2{ 0.f, 0.f }); + } + + if (in_stage_) + { + in_stage_->SetTransform(Transform{}); + in_stage_->SetAnchor(Vec2{ 0.f, 0.f }); + } +} + +} // namespace kiwano diff --git a/src/kiwano/2d/transition/RotationTransition.h b/src/kiwano/2d/transition/RotationTransition.h new file mode 100644 index 00000000..6be27d34 --- /dev/null +++ b/src/kiwano/2d/transition/RotationTransition.h @@ -0,0 +1,58 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma once +#include + +namespace kiwano +{ + +KGE_DECLARE_SMART_PTR(RotationTransition); + +/** + * \~chinese + * @brief 旋转过渡动画 + * @details 前一场景以旋转方式收缩至消失,后一场景以旋转方式扩大 + */ +class RotationTransition : public Transition +{ +public: + /** + * \~chinese + * @brief 创建旋转过渡动画 + * @param duration 动画时长 + * @param rotation 旋转度数 + */ + RotationTransition(Duration duration, float rotation = 360.0f); + + RotationTransition(); + +protected: + void Update(Duration dt) override; + + virtual void Init(Stage* prev, Stage* next) override; + + void Reset() override; + +private: + float rotation_; +}; + +} // namespace kiwano diff --git a/src/kiwano/2d/transition/Transition.cpp b/src/kiwano/2d/transition/Transition.cpp new file mode 100644 index 00000000..4b3b7040 --- /dev/null +++ b/src/kiwano/2d/transition/Transition.cpp @@ -0,0 +1,118 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include +#include + +namespace kiwano +{ + +Transition::Transition() + : done_(false) + , duration_() + , delta_() + , process_(0) + , window_size_() + , out_stage_(nullptr) + , in_stage_(nullptr) + , out_layer_() + , in_layer_() +{ +} + +Transition::~Transition() {} + +bool Transition::IsDone() +{ + return done_; +} + +void Transition::Init(Stage* prev, Stage* next) +{ + process_ = 0; + delta_ = Duration{}; + + out_stage_ = prev; + in_stage_ = next; + window_size_ = Renderer::GetInstance().GetOutputSize(); + + if (in_stage_) + { + in_layer_.SetClipRect(Rect{ Point(), window_size_ }); + } + + if (out_stage_) + { + out_layer_.SetClipRect(Rect{ Point(), window_size_ }); + } +} + +void Transition::Update(Duration dt) +{ + if (duration_.IsZero()) + { + process_ = 1; + } + else + { + delta_ += dt; + process_ = std::min(delta_ / duration_, 1.f); + } + + if (process_ >= 1) + { + this->Stop(); + } +} + +void Transition::Render(RenderContext& ctx) +{ + if (out_stage_) + { + out_stage_->PrepareToRender(ctx); + ctx.PushClipRect(Rect{ Point{}, window_size_ }); + ctx.PushLayer(out_layer_); + + out_stage_->Render(ctx); + + ctx.PopLayer(); + ctx.PopClipRect(); + } + + if (in_stage_) + { + in_stage_->PrepareToRender(ctx); + ctx.PushClipRect(Rect{ Point{}, window_size_ }); + ctx.PushLayer(in_layer_); + + in_stage_->Render(ctx); + + ctx.PopLayer(); + ctx.PopClipRect(); + } +} + +void Transition::Stop() +{ + done_ = true; + Reset(); +} + +} // namespace kiwano diff --git a/src/kiwano/2d/transition/Transition.h b/src/kiwano/2d/transition/Transition.h new file mode 100644 index 00000000..e648405f --- /dev/null +++ b/src/kiwano/2d/transition/Transition.h @@ -0,0 +1,121 @@ +// Copyright (c) 2016-2018 Kiwano - Nomango +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma once +#include +#include + +namespace kiwano +{ +class Director; +class RenderContext; + +KGE_DECLARE_SMART_PTR(Transition); + +/** + * \~chinese + * \defgroup Transition 舞台过渡动画 + */ + +/** + * \addtogroup Transition + * @{ + */ + +/** + * \~chinese + * @brief 舞台过渡动画 + */ +class KGE_API Transition : public ObjectBase +{ + friend class Director; + +public: + Transition(); + + virtual ~Transition(); + + /** + * \~chinese + * @brief 设置动画时长 + */ + void SetDuration(Duration dt); + + /** + * \~chinese + * @brief 场景过渡动画是否已结束 + */ + bool IsDone(); + +protected: + /** + * \~chinese + * @brief 初始化场景过渡动画 + * @param[in] prev 转出场景 + * @param[in] next 转入场景 + */ + virtual void Init(Stage* prev, Stage* next); + + /** + * \~chinese + * @brief 更新过渡动画 + * @param dt 距上一次更新的时间间隔 + */ + virtual void Update(Duration dt); + + /** + * \~chinese + * @brief 渲染过度动画 + * @param[in] ctx 渲染上下文 + */ + virtual void Render(RenderContext& ctx); + + /** + * \~chinese + * @brief 停止动画 + */ + virtual void Stop(); + + /** + * \~chinese + * @brief 重置动画 + */ + virtual void Reset() {} + +protected: + bool done_; + float process_; + Duration duration_; + Duration delta_; + Size window_size_; + StagePtr out_stage_; + StagePtr in_stage_; + Layer out_layer_; + Layer in_layer_; +}; + +/** @} */ + +inline void Transition::SetDuration(Duration dt) +{ + duration_ = dt; +} + +} // namespace kiwano diff --git a/src/kiwano/base/Director.cpp b/src/kiwano/base/Director.cpp index 340076a6..534cb1ec 100644 --- a/src/kiwano/base/Director.cpp +++ b/src/kiwano/base/Director.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include namespace kiwano diff --git a/src/kiwano/base/Director.h b/src/kiwano/base/Director.h index c216e590..a4b91420 100644 --- a/src/kiwano/base/Director.h +++ b/src/kiwano/base/Director.h @@ -21,7 +21,7 @@ #pragma once #include #include -#include +#include #include namespace kiwano diff --git a/src/kiwano/event/KeyEvent.h b/src/kiwano/event/KeyEvent.h index 390cd01d..b97b4d11 100644 --- a/src/kiwano/event/KeyEvent.h +++ b/src/kiwano/event/KeyEvent.h @@ -19,7 +19,7 @@ // THE SOFTWARE. #pragma once -#include +#include #include namespace kiwano diff --git a/src/kiwano/event/MouseEvent.h b/src/kiwano/event/MouseEvent.h index 6a308d93..013ea032 100644 --- a/src/kiwano/event/MouseEvent.h +++ b/src/kiwano/event/MouseEvent.h @@ -19,7 +19,7 @@ // THE SOFTWARE. #pragma once -#include +#include #include #include diff --git a/src/kiwano/kiwano.h b/src/kiwano/kiwano.h index 9e55dbc0..4b7c65b2 100644 --- a/src/kiwano/kiwano.h +++ b/src/kiwano/kiwano.h @@ -102,7 +102,16 @@ #include #include #include -#include + +// +// transition +// + +#include +#include +#include +#include +#include // // animation diff --git a/src/kiwano/platform/Input.h b/src/kiwano/platform/Input.h index 1b63d734..86537540 100644 --- a/src/kiwano/platform/Input.h +++ b/src/kiwano/platform/Input.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/kiwano/core/Keys.h b/src/kiwano/platform/Keys.h similarity index 100% rename from src/kiwano/core/Keys.h rename to src/kiwano/platform/Keys.h diff --git a/src/kiwano/platform/win32/WindowImpl.cpp b/src/kiwano/platform/win32/WindowImpl.cpp index 1b2ab925..93206243 100644 --- a/src/kiwano/platform/win32/WindowImpl.cpp +++ b/src/kiwano/platform/win32/WindowImpl.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include