diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/loading_screen.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/yuzu/loading_screen.cpp b/src/yuzu/loading_screen.cpp index 4e2d988cd..4f2bfab48 100644 --- a/src/yuzu/loading_screen.cpp +++ b/src/yuzu/loading_screen.cpp | |||
| @@ -30,11 +30,11 @@ | |||
| 30 | #include <QMovie> | 30 | #include <QMovie> |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | constexpr const char PROGRESSBAR_STYLE_PREPARE[] = R"( | 33 | constexpr char PROGRESSBAR_STYLE_PREPARE[] = R"( |
| 34 | QProgressBar {} | 34 | QProgressBar {} |
| 35 | QProgressBar::chunk {})"; | 35 | QProgressBar::chunk {})"; |
| 36 | 36 | ||
| 37 | constexpr const char PROGRESSBAR_STYLE_DECOMPILE[] = R"( | 37 | constexpr char PROGRESSBAR_STYLE_DECOMPILE[] = R"( |
| 38 | QProgressBar { | 38 | QProgressBar { |
| 39 | background-color: black; | 39 | background-color: black; |
| 40 | border: 2px solid white; | 40 | border: 2px solid white; |
| @@ -46,7 +46,7 @@ QProgressBar::chunk { | |||
| 46 | width: 1px; | 46 | width: 1px; |
| 47 | })"; | 47 | })"; |
| 48 | 48 | ||
| 49 | constexpr const char PROGRESSBAR_STYLE_BUILD[] = R"( | 49 | constexpr char PROGRESSBAR_STYLE_BUILD[] = R"( |
| 50 | QProgressBar { | 50 | QProgressBar { |
| 51 | background-color: black; | 51 | background-color: black; |
| 52 | border: 2px solid white; | 52 | border: 2px solid white; |
| @@ -58,7 +58,7 @@ QProgressBar::chunk { | |||
| 58 | width: 1px; | 58 | width: 1px; |
| 59 | })"; | 59 | })"; |
| 60 | 60 | ||
| 61 | constexpr const char PROGRESSBAR_STYLE_COMPLETE[] = R"( | 61 | constexpr char PROGRESSBAR_STYLE_COMPLETE[] = R"( |
| 62 | QProgressBar { | 62 | QProgressBar { |
| 63 | background-color: #0ab9e6; | 63 | background-color: #0ab9e6; |
| 64 | border: 2px solid white; | 64 | border: 2px solid white; |
| @@ -149,10 +149,10 @@ void LoadingScreen::OnLoadComplete() { | |||
| 149 | void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value, | 149 | void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value, |
| 150 | std::size_t total) { | 150 | std::size_t total) { |
| 151 | using namespace std::chrono; | 151 | using namespace std::chrono; |
| 152 | auto now = high_resolution_clock::now(); | 152 | const auto now = high_resolution_clock::now(); |
| 153 | // reset the timer if the stage changes | 153 | // reset the timer if the stage changes |
| 154 | if (stage != previous_stage) { | 154 | if (stage != previous_stage) { |
| 155 | ui->progress_bar->setStyleSheet(progressbar_style[stage]); | 155 | ui->progress_bar->setStyleSheet(QString::fromUtf8(progressbar_style[stage])); |
| 156 | // Hide the progress bar during the prepare stage | 156 | // Hide the progress bar during the prepare stage |
| 157 | if (stage == VideoCore::LoadCallbackStage::Prepare) { | 157 | if (stage == VideoCore::LoadCallbackStage::Prepare) { |
| 158 | ui->progress_bar->hide(); | 158 | ui->progress_bar->hide(); |
| @@ -178,16 +178,16 @@ void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size | |||
| 178 | slow_shader_first_value = value; | 178 | slow_shader_first_value = value; |
| 179 | } | 179 | } |
| 180 | // only calculate an estimate time after a second has passed since stage change | 180 | // only calculate an estimate time after a second has passed since stage change |
| 181 | auto diff = duration_cast<milliseconds>(now - slow_shader_start); | 181 | const auto diff = duration_cast<milliseconds>(now - slow_shader_start); |
| 182 | if (diff > seconds{1}) { | 182 | if (diff > seconds{1}) { |
| 183 | auto eta_mseconds = | 183 | const auto eta_mseconds = |
| 184 | static_cast<long>(static_cast<double>(total - slow_shader_first_value) / | 184 | static_cast<long>(static_cast<double>(total - slow_shader_first_value) / |
| 185 | (value - slow_shader_first_value) * diff.count()); | 185 | (value - slow_shader_first_value) * diff.count()); |
| 186 | estimate = | 186 | estimate = |
| 187 | tr("Estimated Time %1") | 187 | tr("Estimated Time %1") |
| 188 | .arg(QTime(0, 0, 0, 0) | 188 | .arg(QTime(0, 0, 0, 0) |
| 189 | .addMSecs(std::max<long>(eta_mseconds - diff.count() + 1000, 1000)) | 189 | .addMSecs(std::max<long>(eta_mseconds - diff.count() + 1000, 1000)) |
| 190 | .toString("mm:ss")); | 190 | .toString(QStringLiteral("mm:ss"))); |
| 191 | } | 191 | } |
| 192 | } | 192 | } |
| 193 | 193 | ||