mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 21:58:45 +00:00
show title splash while the game is loading
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/config.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/libraries/error_codes.h"
|
||||
#include "core/libraries/libs.h"
|
||||
@@ -8,6 +9,12 @@
|
||||
|
||||
namespace Libraries::SystemService {
|
||||
|
||||
bool g_splash_status{true};
|
||||
|
||||
bool IsSplashVisible() {
|
||||
return Config::showSplash() && g_splash_status;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceAppMessagingClearEventFlag() {
|
||||
LOG_ERROR(Lib_SystemService, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
@@ -1787,7 +1794,8 @@ int PS4_SYSV_ABI sceSystemServiceGetVersionNumberOfCameraCalibrationData() {
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceSystemServiceHideSplashScreen() {
|
||||
LOG_WARNING(Lib_SystemService, "called");
|
||||
LOG_INFO(Lib_SystemService, "called");
|
||||
g_splash_status = false;
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ struct OrbisSystemServiceDisplaySafeAreaInfo {
|
||||
uint8_t reserved[128];
|
||||
};
|
||||
|
||||
bool IsSplashVisible();
|
||||
|
||||
int PS4_SYSV_ABI sceAppMessagingClearEventFlag();
|
||||
int PS4_SYSV_ABI sceAppMessagingReceiveMsg();
|
||||
int PS4_SYSV_ABI sceAppMessagingSendMsg();
|
||||
|
||||
@@ -167,6 +167,7 @@ void VideoOutDriver::Flip(std::chrono::microseconds timeout) {
|
||||
std::unique_lock lock{mutex};
|
||||
submit_cond.wait_for(lock, timeout, [&] { return !requests.empty(); });
|
||||
if (requests.empty()) {
|
||||
renderer->ShowSplash();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -175,8 +176,11 @@ void VideoOutDriver::Flip(std::chrono::microseconds timeout) {
|
||||
requests.pop();
|
||||
}
|
||||
|
||||
// Present the frame.
|
||||
renderer->Present(req.frame);
|
||||
if (!renderer->ShowSplash(
|
||||
req.frame)) { // Whatever the game is rendering show splash if it is active
|
||||
// Present the frame.
|
||||
renderer->Present(req.frame);
|
||||
}
|
||||
|
||||
std::scoped_lock lock{mutex};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user