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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 7 deletions

View file

@ -62,6 +62,8 @@ QProgressBar::chunk {
// Definitions for the differences in text and styling for each stage
const static std::unordered_map<VideoCore::LoadCallbackStage, const char*> stage_translations{
{VideoCore::LoadCallbackStage::Prepare, QT_TRANSLATE_NOOP("LoadingScreen", "Loading...")},
{VideoCore::LoadCallbackStage::Preload,
QT_TRANSLATE_NOOP("LoadingScreen", "Preloading Textures %1 / %2")},
{VideoCore::LoadCallbackStage::Decompile,
QT_TRANSLATE_NOOP("LoadingScreen", "Preparing Shaders %1 / %2")},
{VideoCore::LoadCallbackStage::Build,
@ -70,6 +72,7 @@ const static std::unordered_map<VideoCore::LoadCallbackStage, const char*> stage
};
const static std::unordered_map<VideoCore::LoadCallbackStage, const char*> progressbar_style{
{VideoCore::LoadCallbackStage::Prepare, PROGRESSBAR_STYLE_PREPARE},
{VideoCore::LoadCallbackStage::Preload, PROGRESSBAR_STYLE_BUILD},
{VideoCore::LoadCallbackStage::Decompile, PROGRESSBAR_STYLE_DECOMPILE},
{VideoCore::LoadCallbackStage::Build, PROGRESSBAR_STYLE_BUILD},
{VideoCore::LoadCallbackStage::Complete, PROGRESSBAR_STYLE_COMPLETE},
@ -186,7 +189,8 @@ void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size
// update labels and progress bar
const auto& stg = tr(stage_translations.at(stage));
if (stage == VideoCore::LoadCallbackStage::Decompile ||
stage == VideoCore::LoadCallbackStage::Build) {
stage == VideoCore::LoadCallbackStage::Build ||
stage == VideoCore::LoadCallbackStage::Preload) {
ui->stage->setText(stg.arg(value).arg(total));
} else {
ui->stage->setText(stg);