From 33771ff869102982dfd314473b99a1eeb188d05f Mon Sep 17 00:00:00 2001 From: N2614 Date: Tue, 1 Nov 2011 01:31:51 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=AD=E3=82=B4=E8=A1=A8=E7=A4=BA=E3=81=8C?= =?UTF-8?q?=E5=AE=8C=E4=BA=86=E3=81=97=E3=81=A6=E3=81=8B=E3=82=89=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E8=A1=A8=E7=A4=BA=E3=82=A2=E3=83=97=E3=83=AC?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=82=92=E5=91=BC=E3=81=B6=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@468 385bec56-5757-e545-9c3a-d8741f4650f1 --- branches/CardCupForNBD/CardCup/Drawer.cpp | 26 ++++++++++------------- branches/CardCupForNBD/CardCup/Drawer.h | 1 - branches/CardCupForNBD/CardCup/main.cpp | 2 +- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/branches/CardCupForNBD/CardCup/Drawer.cpp b/branches/CardCupForNBD/CardCup/Drawer.cpp index cb0b704..41fdba8 100644 --- a/branches/CardCupForNBD/CardCup/Drawer.cpp +++ b/branches/CardCupForNBD/CardCup/Drawer.cpp @@ -56,9 +56,6 @@ nn::os::StackBuffer s_DrawerThreadStack; // 終了処理をしても良いかどうか bool s_IsExpectedToFinalize = false; -// 終了処理が完了したかどうか -bool s_IsPreparedToFinalize = false; - // エラーコード表示が必要かどうか bool s_NeedShowErrorCode = false; // エラーコード @@ -425,13 +422,12 @@ void StartDrawerThread() s_DrawerThread.Start(DrawThreadMain, s_DrawerThreadStack); } -bool IsDrawerThreadFinished() -{ - return s_IsPreparedToFinalize; -} - void FinalizeDrawerThread() { + if(s_DrawerThread.IsAlive()) + { + nn::os::Thread::Sleep(nn::fnd::TimeSpan::FromMilliSeconds(0)); + } s_DrawerThread.Join(); s_DrawerThread.Finalize(); } @@ -452,6 +448,7 @@ void NotifyFailed(s32 error) void NotifyFinished() { s_IsExpectedToFinalize = true; + s_NeedShowErrorCode = false; } void ShowError() @@ -568,7 +565,8 @@ DrawThreadMain() pUpperLayoutAnim = &layoutAnim[upperLayoutAnimIndex.layoutType]; pLowerLayoutAnim = &layoutAnim[lowerLayoutAnimIndex.layoutType]; - nn::os::Tick startTick = nn::os::Tick::GetSystemCurrent(); + // ロゴ表示中の待ちフレーム数をカウント + u32 waitCounter = 0; while (mainloop) { padReader.ReadLatest(&padStatus); @@ -598,6 +596,7 @@ DrawThreadMain() { const nw::ut::FloatColor white(1.0f, 1.0f, 1.0f, 1.0f); demoApp.GetFrameBufferObject().ClearBuffer(white, clearDepth); + waitCounter++; } else { @@ -678,18 +677,15 @@ DrawThreadMain() demoApp.SwapBuffer(demoApp.DISPLAY_BOTH); - if(s_NeedShowErrorCode && DRAW_STATE_LOGO_DRAW <= drawState) + // ロゴが表示されてからエラー表示を行う + if(s_NeedShowErrorCode && DRAW_STATE_LOGO_DRAW == drawState && 1 < waitCounter) { - if((nn::os::Tick::GetSystemCurrent() - startTick).ToTimeSpan().GetSeconds() > 1) - { - ShowError(); - } + ShowError(); } } delete pResAccessor; demoApp.GetDeviceAllocator().Free(fileLayout.Buffer()); - s_IsPreparedToFinalize = true; } diff --git a/branches/CardCupForNBD/CardCup/Drawer.h b/branches/CardCupForNBD/CardCup/Drawer.h index b02d7f4..0c4daf4 100644 --- a/branches/CardCupForNBD/CardCup/Drawer.h +++ b/branches/CardCupForNBD/CardCup/Drawer.h @@ -17,7 +17,6 @@ #define DRAWER_H_ void StartDrawerThread(); -bool IsDrawerThreadFinished(); void FinalizeDrawerThread(); void NotifyFailed(s32 error); void NotifyFinished(); diff --git a/branches/CardCupForNBD/CardCup/main.cpp b/branches/CardCupForNBD/CardCup/main.cpp index a084361..447a664 100644 --- a/branches/CardCupForNBD/CardCup/main.cpp +++ b/branches/CardCupForNBD/CardCup/main.cpp @@ -201,7 +201,7 @@ extern "C" void nnMain() // 画面描画 if (result.IsSuccess() || result == nn::cup::CTR::ResultUpdateNotRequired()) { - // TODO:成功したので終了処理に入る + // 成功したので終了処理に入る nn::os::Tick current = nn::os::Tick::GetSystemCurrent(); if ((current - before).ToTimeSpan().GetSeconds() > SHUTDOWN_WAIT_SECONDS) {