| 59 | } |
| 60 | |
| 61 | void UILoadingScreen::Update(const int stagesCompleted, const int stagesTotal) |
| 62 | { |
| 63 | std::scoped_lock<decltype(loadingLock)> lock(loadingLock); |
| 64 | |
| 65 | const float progress = float(stagesCompleted) / stagesTotal * loadingProgress->GetRange_max(); |
| 66 | |
| 67 | if (loadingProgress->GetProgressPos() < progress) |
| 68 | loadingProgress->SetProgressPos(progress); |
| 69 | |
| 70 | if (loadingProgressPercent) |
| 71 | { |
| 72 | char buf[5]; |
| 73 | xr_sprintf(buf, "%.0f%%", loadingProgress->GetProgressPos()); |
| 74 | loadingProgressPercent->SetText(buf); |
| 75 | } |
| 76 | |
| 77 | CUIWindow::Update(); |
| 78 | Draw(); |
| 79 | } |
| 80 | |
| 81 | void UILoadingScreen::ForceFinish() |
| 82 | { |
no test coverage detected