Minor tweaks, comments and fixes

This commit is contained in:
Henrik Rydgård 2025-03-06 13:37:38 +01:00
parent fd09a2be27
commit 87199bacaa
5 changed files with 11 additions and 10 deletions

View file

@ -72,11 +72,11 @@ void RequestManager::ForgetRequestsWithToken(RequesterToken token) {
}
}
void RequestManager::PostSystemSuccess(int requestId, const char *responseString, int responseValue) {
void RequestManager::PostSystemSuccess(int requestId, std::string_view responseString, int responseValue) {
std::lock_guard<std::mutex> guard(callbackMutex_);
auto iter = callbackMap_.find(requestId);
if (iter == callbackMap_.end()) {
ERROR_LOG(Log::System, "PostSystemSuccess: Unexpected request ID %d (responseString=%s)", requestId, responseString);
ERROR_LOG(Log::System, "PostSystemSuccess: Unexpected request ID %d (responseString=%.*s)", requestId, (int)responseString.size(), responseString.data());
return;
}
@ -86,7 +86,7 @@ void RequestManager::PostSystemSuccess(int requestId, const char *responseString
response.responseString = responseString;
response.responseValue = responseValue;
pendingSuccesses_.push_back(response);
DEBUG_LOG(Log::System, "PostSystemSuccess: Request %d (%s, %d)", requestId, responseString, responseValue);
DEBUG_LOG(Log::System, "PostSystemSuccess: Request %d (%.*s, %d)", requestId, (int)responseString.size(), responseString.data(), responseValue);
callbackMap_.erase(iter);
}

View file

@ -4,6 +4,7 @@
#include <mutex>
#include <map>
#include <functional>
#include <string_view>
#include "Common/System/System.h"
@ -32,7 +33,7 @@ public:
bool MakeSystemRequest(SystemRequestType type, RequesterToken token, RequestCallback callback, RequestFailedCallback failedCallback, std::string_view param1, std::string_view param2, int64_t param3, int64_t param4 = 0);
// Called by the platform implementation, when it's finished with a request.
void PostSystemSuccess(int requestId, const char *responseString, int responseValue = 0);
void PostSystemSuccess(int requestId, std::string_view responseString, int responseValue = 0);
void PostSystemFailure(int requestId);
// This must be called every frame from the beginning of NativeFrame().

View file

@ -68,7 +68,7 @@ struct SceMpegRingBuffer {
u32_le callback_addr; // see sceMpegRingbufferPut
s32_le callback_args;
s32_le dataUpperBound;
s32_le semaID; // unused?
s32_le semaID; // unused? No, probably not, see #20084. Though when should we signal it?
u32_le mpeg; // pointer to mpeg struct, fixed up in sceMpegCreate
// Note: not available in all versions.
u32_le gp;

View file

@ -310,6 +310,7 @@ void OnScreenMessagesView::Draw(UIContext &dc) {
typeEdges[(size_t)OSDType::MESSAGE_CENTERED_WARNING] = ScreenEdgePosition::CENTER;
typeEdges[(size_t)OSDType::MESSAGE_CENTERED_ERROR] = ScreenEdgePosition::CENTER;
typeEdges[(size_t)OSDType::TRANSPARENT_STATUS] = ScreenEdgePosition::TOP_LEFT;
typeEdges[(size_t)OSDType::PROGRESS_BAR] = ScreenEdgePosition::TOP_CENTER; // These only function at the top currently, needs fixing.
dc.SetFontStyle(dc.theme->uiFont);
dc.SetFontScale(1.0f, 1.0f);

View file

@ -638,7 +638,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
// Unsupported.
return false;
}
bool load = type == SystemRequestType::BROWSE_FOR_FILE;
const bool load = type == SystemRequestType::BROWSE_FOR_FILE;
std::thread([=] {
std::string out;
if (W32Util::BrowseForFileName(load, MainWindow::GetHWND(), ConvertUTF8ToWString(param1).c_str(), nullptr, filter.c_str(), L"", out)) {
@ -689,8 +689,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
case SystemRequestType::CREATE_GAME_SHORTCUT:
{
// Get the game info to get our hands on the icon png
Path gamePath(param1);
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, gamePath, GameInfoFlags::ICON);
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, Path(param1), GameInfoFlags::ICON);
Path icoPath;
if (info->icon.dataLoaded) {
// Write the icon png out as a .ICO file so the shortcut can point to it
@ -710,8 +709,8 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
}
case SystemRequestType::RUN_CALLBACK_IN_WNDPROC:
{
auto func = reinterpret_cast<void (*)(void *window, void *userdata)>(param3);
void *userdata = reinterpret_cast<void *>(param4);
auto func = reinterpret_cast<void (*)(void *window, void *userdata)>((uintptr_t)param3);
void *userdata = reinterpret_cast<void *>((uintptr_t)param4);
MainWindow::RunCallbackInWndProc(func, userdata);
return true;
}