Skip to content

Commit

Permalink
Possible fix to a 2D camera bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Natashi committed Jan 21, 2021
1 parent 10c0005 commit 27d2b6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions source/GcLib/directx/DirectGraphics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ namespace directx {

void SetResetFocus(gstd::ref_count_ptr<D3DXVECTOR2>& pos) { posReset_ = pos; }
void Reset();
void ResetAll() {
posReset_ = nullptr;
Reset();
}

inline D3DXVECTOR2 GetLeftTopPosition();
inline static D3DXVECTOR2 GetLeftTopPosition(const D3DXVECTOR2& focus, float ratio);
inline static D3DXVECTOR2 GetLeftTopPosition(const D3DXVECTOR2& focus, float ratioX, float ratioY);
Expand Down
6 changes: 3 additions & 3 deletions source/TouhouDanmakufu/DnhExecutor/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void SceneManager::TransStgScene(ref_count_ptr<ScriptInformation> infoMain, ref_
Logger::WriteTop(e.what());

DirectGraphics* graphics = DirectGraphics::GetBase();
graphics->GetCamera2D()->Reset();
graphics->GetCamera2D()->ResetAll();

SystemController* system = SystemController::GetInstance();
system->ShowErrorDialog(e.what());
Expand Down Expand Up @@ -214,7 +214,7 @@ void SceneManager::TransStgScene(ref_count_ptr<ScriptInformation> infoMain, ref_
Logger::WriteTop(e.what());

DirectGraphics* graphics = DirectGraphics::GetBase();
graphics->GetCamera2D()->Reset();
graphics->GetCamera2D()->ResetAll();

SystemController* system = SystemController::GetInstance();
system->ShowErrorDialog(e.what());
Expand Down Expand Up @@ -261,7 +261,7 @@ void SceneManager::TransPackageScene(ref_count_ptr<ScriptInformation> infoMain,
Logger::WriteTop(e.what());

DirectGraphics* graphics = DirectGraphics::GetBase();
graphics->GetCamera2D()->Reset();
graphics->GetCamera2D()->ResetAll();

SystemController* system = SystemController::GetInstance();
system->ShowErrorDialog(e.what());
Expand Down

0 comments on commit 27d2b6a

Please sign in to comment.