fix: project error
This commit is contained in:
parent
83d0b3f5cf
commit
f26f385854
|
|
@ -146,7 +146,7 @@ void e2d::Game::EnterScene(Scene * scene, Transition * transition)
|
||||||
transition_ = transition;
|
transition_ = transition;
|
||||||
transition_->Retain();
|
transition_->Retain();
|
||||||
|
|
||||||
transition_->Init(curr_scene_, next_scene_)
|
transition_->Init(curr_scene_, next_scene_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,11 @@ e2d::BoxTransition::BoxTransition(float duration)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool e2d::BoxTransition::Init(Scene * prev, Scene * next)
|
void e2d::BoxTransition::Init(Scene * prev, Scene * next)
|
||||||
{
|
{
|
||||||
if (Transition::Init(prev, next))
|
Transition::Init(prev, next);
|
||||||
{
|
|
||||||
in_layer_param_.opacity = 0;
|
in_layer_param_.opacity = 0;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void e2d::BoxTransition::Update()
|
void e2d::BoxTransition::Update()
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,12 @@ e2d::EmergeTransition::EmergeTransition(float duration)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool e2d::EmergeTransition::Init(Scene * prev, Scene * next)
|
void e2d::EmergeTransition::Init(Scene * prev, Scene * next)
|
||||||
{
|
{
|
||||||
if (Transition::Init(prev, next))
|
Transition::Init(prev, next);
|
||||||
{
|
|
||||||
out_layer_param_.opacity = 1;
|
out_layer_param_.opacity = 1;
|
||||||
in_layer_param_.opacity = 0;
|
in_layer_param_.opacity = 0;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void e2d::EmergeTransition::Update()
|
void e2d::EmergeTransition::Update()
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,12 @@ e2d::FadeTransition::FadeTransition(float duration)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool e2d::FadeTransition::Init(Scene * prev, Scene * next)
|
void e2d::FadeTransition::Init(Scene * prev, Scene * next)
|
||||||
{
|
{
|
||||||
if (Transition::Init(prev, next))
|
Transition::Init(prev, next);
|
||||||
{
|
|
||||||
out_layer_param_.opacity = 1;
|
out_layer_param_.opacity = 1;
|
||||||
in_layer_param_.opacity = 0;
|
in_layer_param_.opacity = 0;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void e2d::FadeTransition::Update()
|
void e2d::FadeTransition::Update()
|
||||||
|
|
|
||||||
|
|
@ -8,37 +8,34 @@ e2d::MoveTransition::MoveTransition(float duration, Direction direction)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool e2d::MoveTransition::Init(Scene * prev, Scene * next)
|
void e2d::MoveTransition::Init(Scene * prev, Scene * next)
|
||||||
{
|
{
|
||||||
if (Transition::Init(prev, next))
|
Transition::Init(prev, next);
|
||||||
|
|
||||||
|
auto size = Window::GetInstance()->GetSize();
|
||||||
|
if (direction_ == Direction::Up)
|
||||||
{
|
{
|
||||||
auto size = Window::GetInstance()->GetSize();
|
pos_delta_ = Point(0, -size.height);
|
||||||
if (direction_ == Direction::Up)
|
start_pos_ = Point(0, size.height);
|
||||||
{
|
|
||||||
pos_delta_ = Point(0, -size.height);
|
|
||||||
start_pos_ = Point(0, size.height);
|
|
||||||
}
|
|
||||||
else if (direction_ == Direction::Down)
|
|
||||||
{
|
|
||||||
pos_delta_ = Point(0, size.height);
|
|
||||||
start_pos_ = Point(0, -size.height);
|
|
||||||
}
|
|
||||||
else if (direction_ == Direction::Left)
|
|
||||||
{
|
|
||||||
pos_delta_ = Point(-size.width, 0);
|
|
||||||
start_pos_ = Point(size.width, 0);
|
|
||||||
}
|
|
||||||
else if (direction_ == Direction::Right)
|
|
||||||
{
|
|
||||||
pos_delta_ = Point(size.width, 0);
|
|
||||||
start_pos_ = Point(-size.width, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (out_scene_ && out_scene_->GetRoot()) out_scene_->GetRoot()->SetPos(0, 0);
|
|
||||||
if (in_scene_->GetRoot()) in_scene_->GetRoot()->SetPos(start_pos_);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
else if (direction_ == Direction::Down)
|
||||||
|
{
|
||||||
|
pos_delta_ = Point(0, size.height);
|
||||||
|
start_pos_ = Point(0, -size.height);
|
||||||
|
}
|
||||||
|
else if (direction_ == Direction::Left)
|
||||||
|
{
|
||||||
|
pos_delta_ = Point(-size.width, 0);
|
||||||
|
start_pos_ = Point(size.width, 0);
|
||||||
|
}
|
||||||
|
else if (direction_ == Direction::Right)
|
||||||
|
{
|
||||||
|
pos_delta_ = Point(size.width, 0);
|
||||||
|
start_pos_ = Point(-size.width, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (out_scene_ && out_scene_->GetRoot()) out_scene_->GetRoot()->SetPos(0, 0);
|
||||||
|
if (in_scene_->GetRoot()) in_scene_->GetRoot()->SetPos(start_pos_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void e2d::MoveTransition::Update()
|
void e2d::MoveTransition::Update()
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ e2d::Transition::Transition(float duration)
|
||||||
, started_()
|
, started_()
|
||||||
, delta_(0)
|
, delta_(0)
|
||||||
, out_scene_(nullptr)
|
, out_scene_(nullptr)
|
||||||
, in_scene_(scene)
|
, in_scene_(nullptr)
|
||||||
, out_layer_(nullptr)
|
, out_layer_(nullptr)
|
||||||
, in_layer_(nullptr)
|
, in_layer_(nullptr)
|
||||||
, out_layer_param_()
|
, out_layer_param_()
|
||||||
|
|
@ -65,8 +65,6 @@ void e2d::Transition::Init(Scene * prev, Scene * next)
|
||||||
renderer->GetSolidBrush(),
|
renderer->GetSolidBrush(),
|
||||||
D2D1_LAYER_OPTIONS_NONE
|
D2D1_LAYER_OPTIONS_NONE
|
||||||
);
|
);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void e2d::Transition::Update()
|
void e2d::Transition::Update()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue