summaryrefslogtreecommitdiff
path: root/src/yuzu
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu')
-rw-r--r--src/yuzu/bootmanager.cpp9
-rw-r--r--src/yuzu/bootmanager.h8
-rw-r--r--src/yuzu/main.cpp3
3 files changed, 19 insertions, 1 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index f74cb693a..73b04b749 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -29,6 +29,15 @@ void EmuThread::run() {
stop_run = false;
+ emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
+
+ Core::System::GetInstance().Renderer().Rasterizer().LoadDiskResources(
+ stop_run, [this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) {
+ emit LoadProgress(stage, value, total);
+ });
+
+ emit LoadProgress(VideoCore::LoadCallbackStage::Complete, 0, 0);
+
// holds whether the cpu was running during the last iteration,
// so that the DebugModeLeft signal can be emitted before the
// next execution step
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h
index d1f37e503..7226e690e 100644
--- a/src/yuzu/bootmanager.h
+++ b/src/yuzu/bootmanager.h
@@ -22,6 +22,10 @@ class GGLWidgetInternal;
class GMainWindow;
class GRenderWindow;
+namespace VideoCore {
+enum class LoadCallbackStage;
+}
+
class EmuThread : public QThread {
Q_OBJECT
@@ -75,7 +79,7 @@ public:
private:
bool exec_step = false;
bool running = false;
- std::atomic<bool> stop_run{false};
+ std::atomic_bool stop_run{false};
std::mutex running_mutex;
std::condition_variable running_cv;
@@ -101,6 +105,8 @@ signals:
void DebugModeLeft();
void ErrorThrown(Core::System::ResultStatus, std::string);
+
+ void LoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total);
};
class GRenderWindow : public QWidget, public Core::Frontend::EmuWindow {
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 485e29de2..1d460c189 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -887,6 +887,9 @@ void GMainWindow::BootGame(const QString& filename) {
connect(emu_thread.get(), &EmuThread::DebugModeLeft, waitTreeWidget,
&WaitTreeWidget::OnDebugModeLeft, Qt::BlockingQueuedConnection);
+ connect(emu_thread.get(), &EmuThread::LoadProgress, loading_screen,
+ &LoadingScreen::OnLoadProgress, Qt::QueuedConnection);
+
// Update the GUI
if (ui.action_Single_Window_Mode->isChecked()) {
game_list->hide();