Textures loading screen (#6478)

* Add a loading screen for the preloading textures

*The PreloadTextures() function is called from the EmuThread to prevent citra to freezing

*Add a the preloading textures loadingscreen in loading_screen.cpp

*Add custom_tex_manager.reset() in core.cpp to release ram memory after exiting a game

* Add custom textures loading in EmuThread

* Remove useless variable

* Revert "Add custom textures loading in EmuThread"

This reverts commit 45ed46fa09159f782c5d20a4330b4eb7cfcdc253.

* Moved include from bootmanager.h to bootmanager.cpp
This commit is contained in:
luc-git
2023-05-07 01:34:14 +02:00
committed by GitHub
parent 62792b6b0e
commit 322d7a8287
6 changed files with 29 additions and 7 deletions

View File

@ -23,6 +23,7 @@
#include "input_common/keyboard.h"
#include "input_common/main.h"
#include "input_common/motion_emu.h"
#include "video_core/custom_textures/custom_tex_manager.h"
#include "video_core/renderer_base.h"
#include "video_core/video_core.h"
@ -60,10 +61,17 @@ static GMainWindow* GetMainWindow() {
void EmuThread::run() {
MicroProfileOnThreadCreate("EmuThread");
const auto scope = core_context.Acquire();
Core::System& system = Core::System::GetInstance();
if (Settings::values.preload_textures) {
emit LoadProgress(VideoCore::LoadCallbackStage::Preload, 0, 0);
system.CustomTexManager().PreloadTextures(
stop_run, [this](VideoCore::LoadCallbackStage stage, std::size_t value,
std::size_t total) { emit LoadProgress(stage, value, total); });
}
emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
Core::System& system = Core::System::GetInstance();
system.Renderer().Rasterizer()->LoadDiskResources(
stop_run, [this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) {
emit LoadProgress(stage, value, total);