mirror of
https://github.com/stenzek/duckstation.git
synced 2025-07-24 19:10:20 +00:00
FullscreenUI: Use game path for loading screen image
Makes it work with custom titles.
This commit is contained in:
parent
4440ae3b78
commit
311e93fae4
@ -1189,7 +1189,7 @@ bool Achievements::IdentifyCurrentGame()
|
||||
|
||||
// this crap is only needed because we can't grab the image from the reader...
|
||||
std::unique_ptr<CDImage> temp_image;
|
||||
if (const std::string& disc_path = System::GetDiscPath(); !disc_path.empty())
|
||||
if (const std::string& disc_path = System::GetGamePath(); !disc_path.empty())
|
||||
{
|
||||
Error error;
|
||||
temp_image = CDImage::Open(disc_path.c_str(), g_settings.cdrom_load_image_patches, &error);
|
||||
@ -1856,7 +1856,7 @@ bool Achievements::DoState(StateWrapper& sw)
|
||||
{
|
||||
// Messy because GPU-thread, but at least it looks pretty.
|
||||
GPUThread::RunOnThread([]() {
|
||||
FullscreenUI::OpenLoadingScreen(System::GetImageForLoadingScreen(GPUThread::GetGameSerial()),
|
||||
FullscreenUI::OpenLoadingScreen(System::GetImageForLoadingScreen(GPUThread::GetGamePath()),
|
||||
TRANSLATE_SV("Achievements", "Downloading achievements data..."));
|
||||
});
|
||||
|
||||
|
@ -1690,7 +1690,7 @@ void FullscreenUI::BeginChangeDiscOnCPUThread(bool needs_pause)
|
||||
std::vector<std::string> paths;
|
||||
paths.reserve(matches.size());
|
||||
|
||||
const std::string& current_path = System::GetDiscPath();
|
||||
const std::string& current_path = System::GetGamePath();
|
||||
for (auto& [title, glentry] : matches)
|
||||
{
|
||||
options.emplace_back(std::move(title), current_path == glentry->path);
|
||||
@ -9129,8 +9129,7 @@ void FullscreenUI::BackgroundProgressCallback::SetCancelled()
|
||||
LoadingScreenProgressCallback::LoadingScreenProgressCallback()
|
||||
: ProgressCallback(), m_open_time(Timer::GetCurrentValue()), m_on_gpu_thread(GPUThread::IsOnThread())
|
||||
{
|
||||
m_image = System::GetImageForLoadingScreen(
|
||||
std::string_view(m_on_gpu_thread ? GPUThread::GetGameSerial() : System::GetGameSerial()));
|
||||
m_image = System::GetImageForLoadingScreen(m_on_gpu_thread ? GPUThread::GetGamePath() : System::GetGamePath());
|
||||
}
|
||||
|
||||
LoadingScreenProgressCallback::~LoadingScreenProgressCallback()
|
||||
|
@ -185,7 +185,7 @@ class ShaderCompileProgressTracker
|
||||
{
|
||||
public:
|
||||
ShaderCompileProgressTracker(std::string title, u32 total)
|
||||
: m_title(std::move(title)), m_image(System::GetImageForLoadingScreen(GPUThread::GetGameSerial())),
|
||||
: m_title(std::move(title)), m_image(System::GetImageForLoadingScreen(GPUThread::GetGamePath())),
|
||||
m_min_time(Timer::ConvertSecondsToValue(1.0)), m_update_interval(Timer::ConvertSecondsToValue(0.1)),
|
||||
m_start_time(Timer::GetCurrentValue()), m_last_update_time(0), m_progress(0), m_total(total)
|
||||
{
|
||||
|
@ -3455,7 +3455,7 @@ void GPUTextureCache::PreloadReplacementTextures()
|
||||
u32 num_textures_loaded = 0;
|
||||
const size_t total_textures = s_state.vram_replacements.size() + s_state.vram_write_texture_replacements.size() +
|
||||
s_state.texture_page_texture_replacements.size();
|
||||
std::string image_path = System::GetImageForLoadingScreen(GPUThread::GetGameSerial());
|
||||
std::string image_path = System::GetImageForLoadingScreen(GPUThread::GetGamePath());
|
||||
|
||||
#define UPDATE_PROGRESS() \
|
||||
if (last_update_time.GetTimeSeconds() >= UPDATE_INTERVAL) \
|
||||
|
@ -763,18 +763,19 @@ u32 System::GetInternalFrameNumber()
|
||||
return s_state.internal_frame_number;
|
||||
}
|
||||
|
||||
const std::string& System::GetDiscPath()
|
||||
const std::string& System::GetGameTitle()
|
||||
{
|
||||
return s_state.running_game_path;
|
||||
return s_state.running_game_title;
|
||||
}
|
||||
|
||||
const std::string& System::GetGameSerial()
|
||||
{
|
||||
return s_state.running_game_serial;
|
||||
}
|
||||
|
||||
const std::string& System::GetGameTitle()
|
||||
const std::string& System::GetGamePath()
|
||||
{
|
||||
return s_state.running_game_title;
|
||||
return s_state.running_game_path;
|
||||
}
|
||||
|
||||
const std::string& System::GetExeOverride()
|
||||
@ -6006,12 +6007,12 @@ bool System::ChangeGPUDump(std::string new_path)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string System::GetImageForLoadingScreen(std::string_view serial)
|
||||
std::string System::GetImageForLoadingScreen(const std::string& game_path)
|
||||
{
|
||||
std::string ret;
|
||||
|
||||
const auto lock = GameList::GetLock();
|
||||
const GameList::Entry* entry = GameList::GetEntryBySerial(serial);
|
||||
const GameList::Entry* entry = GameList::GetEntryForPath(game_path);
|
||||
|
||||
if (entry)
|
||||
ret = GameList::GetCoverImagePathForEntry(entry);
|
||||
|
@ -219,9 +219,9 @@ GlobalTicks GetGlobalTickCounter();
|
||||
u32 GetFrameNumber();
|
||||
u32 GetInternalFrameNumber();
|
||||
|
||||
const std::string& GetDiscPath();
|
||||
const std::string& GetGameSerial();
|
||||
const std::string& GetGameTitle();
|
||||
const std::string& GetGameSerial();
|
||||
const std::string& GetGamePath();
|
||||
const std::string& GetExeOverride();
|
||||
const GameDatabase::Entry* GetGameDatabaseEntry();
|
||||
GameHash GetGameHash();
|
||||
@ -424,8 +424,7 @@ void ToggleSoftwareRendering();
|
||||
void RequestDisplaySize(float scale = 0.0f);
|
||||
|
||||
/// Returns the path to a possible cover image for the current serial.
|
||||
/// Only intended to be used for loading screens, so it may not be correct with custom titles and such.
|
||||
std::string GetImageForLoadingScreen(std::string_view serial);
|
||||
std::string GetImageForLoadingScreen(const std::string& game_path);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Memory Save States (Rewind and Runahead)
|
||||
|
@ -2570,7 +2570,7 @@ void MainWindow::openGamePropertiesForCurrentGame(const char* category /* = null
|
||||
return;
|
||||
|
||||
Host::RunOnCPUThread([category]() {
|
||||
const std::string& path = System::GetDiscPath();
|
||||
const std::string& path = System::GetGamePath();
|
||||
const std::string& serial = System::GetGameSerial();
|
||||
if (path.empty() || serial.empty())
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user