Skip to content

Commit 56776a7

Browse files
authored
Merge branch 'master' into tessssst
2 parents 663dade + 2893b42 commit 56776a7

15 files changed

Lines changed: 545 additions & 22 deletions

Utilities/date_time.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace date_time
4747

4848
std::string parse_buf;
4949

50-
if constexpr(separator != 0)
50+
if constexpr (separator != 0)
5151
parse_buf = std::string("%Y") + separator + "%m" + separator + "%d" + separator + "%H" + separator + "%M" + separator + "%S";
5252
else
5353
parse_buf = "%Y%m%d%H%M%S";

rpcs3/Emu/NP/rpcn_client.cpp

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ void fmt_class_string<rpcn::CommandType>::format(std::string& out, u64 arg)
163163
case rpcn::CommandType::SearchJoinRoomGUI: return "SearchJoinRoomGUI";
164164
case rpcn::CommandType::UnlockTrophy: return "UnlockTrophy";
165165
case rpcn::CommandType::SyncTrophies: return "SyncTrophies";
166+
case rpcn::CommandType::DeleteTrophies: return "DeleteTrophies";
166167
}
167168

168169
return unknown;
@@ -259,7 +260,7 @@ namespace rpcn
259260
rpcn_log.notice("online: %s, pr_com_id: %s, pr_title: %s, pr_status: %s, pr_comment: %s, pr_data: %s", online ? "true" : "false", pr_com_id.data, pr_title, pr_status, pr_comment, fmt::buf_to_hexstring(pr_data.data(), pr_data.size()));
260261
}
261262

262-
constexpr u32 RPCN_PROTOCOL_VERSION = 31;
263+
constexpr u32 RPCN_PROTOCOL_VERSION = 32;
263264
constexpr usz RPCN_HEADER_SIZE = 15;
264265

265266
const char* error_to_explanation(rpcn::ErrorType error)
@@ -676,7 +677,7 @@ namespace rpcn
676677
command == CommandType::SendMessage || command == CommandType::SendToken ||
677678
command == CommandType::SendResetToken || command == CommandType::ResetPassword ||
678679
command == CommandType::GetNetworkTime || command == CommandType::SetPresence || command == CommandType::Terminate ||
679-
command == CommandType::SyncTrophies)
680+
command == CommandType::SyncTrophies || command == CommandType::DeleteTrophies)
680681
{
681682
std::lock_guard lock(mutex_replies_sync);
682683
replies_sync.insert(std::make_pair(packet_id, std::make_pair(command, std::move(data))));
@@ -1482,6 +1483,37 @@ namespace rpcn
14821483
return error;
14831484
}
14841485

1486+
ErrorType rpcn_client::delete_trophies(std::string_view communication_id)
1487+
{
1488+
std::vector<u8> data;
1489+
std::copy(communication_id.begin(), communication_id.end(), std::back_inserter(data));
1490+
data.push_back(0);
1491+
1492+
std::vector<u8> packet_data;
1493+
1494+
if (!forge_send_reply(CommandType::DeleteTrophies, rpcn_request_counter.fetch_add(1), data, packet_data))
1495+
{
1496+
return ErrorType::Malformed;
1497+
}
1498+
1499+
vec_stream reply(packet_data);
1500+
const auto error = static_cast<ErrorType>(reply.get<u8>());
1501+
1502+
if (error == rpcn::ErrorType::NoError)
1503+
{
1504+
if (communication_id.empty())
1505+
{
1506+
rpcn_log.success("RPCN trophies were successfully deleted!");
1507+
}
1508+
else
1509+
{
1510+
rpcn_log.success("RPCN trophies for %s were successfully deleted!", communication_id);
1511+
}
1512+
}
1513+
1514+
return error;
1515+
}
1516+
14851517
std::optional<ErrorType> rpcn_client::add_friend(std::string_view friend_username)
14861518
{
14871519
std::vector<u8> data;

rpcs3/Emu/NP/rpcn_client.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ namespace rpcn
301301
ErrorType send_reset_token(std::string_view npid, std::string_view email);
302302
ErrorType reset_password(std::string_view npid, std::string_view token, std::string_view password);
303303
ErrorType delete_account();
304+
ErrorType delete_trophies(std::string_view communication_id = {});
304305
std::optional<ErrorType> add_friend(std::string_view friend_username);
305306
bool remove_friend(std::string_view friend_username);
306307

rpcs3/Emu/NP/rpcn_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ namespace rpcn
7171
GetRoomMemberDataExternalList,
7272
UnlockTrophy,
7373
SyncTrophies,
74+
DeleteTrophies,
7475
};
7576

7677
enum class NotificationType : u16

rpcs3/Emu/RSX/GL/GLShaderInterpreter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "Emu/RSX/rsx_methods.h"
99
#include "Emu/RSX/Overlays/Shaders/shader_loading_dialog.h"
1010
#include "Emu/RSX/Program/GLSLCommon.h"
11+
#include "Emu/localized_string.h"
1112

1213
namespace gl
1314
{
@@ -17,7 +18,7 @@ namespace gl
1718

1819
void shader_interpreter::create(rsx::shader_loading_dialog* dlg)
1920
{
20-
dlg->create("Precompiling interpreter variants.\nPlease wait...", "Shader Compilation");
21+
dlg->create(get_localized_string(localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS), get_localized_string(localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS_TITLE));
2122

2223
const auto variants = program_common::interpreter::get_interpreter_variants();
2324
const u32 limit1 = ::size32(variants.base_pipelines);
@@ -32,7 +33,7 @@ namespace gl
3233
{
3334
const auto completed = ctr.load();
3435
const auto limit = stage ? limit2 : limit1;
35-
const auto message = fmt::format("%s variant %u of %u...", stage ? "Linking" : "Building", ctr.load(), limit);
36+
const auto message = get_localized_string(stage ? localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS_OPENGL_LINK : localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS_OPENGL_BUILD, "%u %s %u", ctr.load(), get_localized_string(localized_string_id::PROGRESS_DIALOG_OF), limit);
3637
dlg->update_msg(stage, message);
3738
dlg->set_value(stage, completed);
3839
};

rpcs3/Emu/RSX/VK/VKShaderInterpreter.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
#include "VKHelpers.h"
77
#include "VKRenderPass.h"
88

9-
#include "../Overlays/Shaders/shader_loading_dialog.h"
10-
#include "../Program/GLSLCommon.h"
11-
#include "../Program/ShaderInterpreter.h"
12-
#include "../rsx_methods.h"
9+
#include "Emu/RSX/Overlays/Shaders/shader_loading_dialog.h"
10+
#include "Emu/RSX/Program/GLSLCommon.h"
11+
#include "Emu/RSX/Program/ShaderInterpreter.h"
12+
#include "Emu/RSX/rsx_methods.h"
13+
#include "Emu/localized_string.h"
1314

1415
#include <thread>
1516

@@ -719,7 +720,7 @@ namespace vk
719720

720721
void shader_interpreter::preload(rsx::shader_loading_dialog* dlg)
721722
{
722-
dlg->create("Precompiling interpreter variants.\nPlease wait...", "Shader Compilation");
723+
dlg->create(get_localized_string(localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS), get_localized_string(localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS_TITLE));
723724

724725
// Create some basic pipelines that we'll use to seed the base pipeline queue
725726
std::vector<vk::pipeline_props> pipe_properties;
@@ -778,7 +779,7 @@ namespace vk
778779
std::this_thread::sleep_for(16ms);
779780

780781
const auto completed = ctr.load();
781-
dlg->update_msg(0, fmt::format("Building base variant %u of %u...", completed, limit1));
782+
dlg->update_msg(0, get_localized_string(localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS_VULKAN, "%u %s %u", completed, get_localized_string(localized_string_id::PROGRESS_DIALOG_OF), limit1));
782783
dlg->set_value(0, completed);
783784
}
784785
while (ctr.load() < limit1);

rpcs3/Emu/localized_string_id.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ enum class localized_string_id
1010
RSX_OVERLAYS_TROPHY_GOLD,
1111
RSX_OVERLAYS_TROPHY_PLATINUM,
1212
RSX_OVERLAYS_COMPILING_SHADERS,
13+
RSX_OVERLAYS_COMPILING_SHADERS_TITLE,
14+
RSX_OVERLAYS_COMPILING_SHADERS_VULKAN,
15+
RSX_OVERLAYS_COMPILING_SHADERS_OPENGL_BUILD,
16+
RSX_OVERLAYS_COMPILING_SHADERS_OPENGL_LINK,
1317
RSX_OVERLAYS_COMPILING_PPU_MODULES,
1418
RSX_OVERLAYS_MSG_DIALOG_YES,
1519
RSX_OVERLAYS_MSG_DIALOG_NO,

rpcs3/rpcs3qt/gs_frame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ void gs_frame::show()
722722
{
723723
setVisibility(FullScreen);
724724
}
725-
else if (const QVariant var = m_gui_settings->GetValue(gui::gs_visibility); var.canConvert<QString>())
725+
else if (const QVariant var = m_gui_settings->GetValue(gui::gs_visibility); var.canConvert<QString>() && !m_gui_settings->GetValue(gui::gs_resize).toBool())
726726
{
727727
// Restore saved visibility from last time. Make sure not to hide the window, or the user can't access it anymore.
728728
if (const Visibility visibility = gui::string_to_visibility(var.value<QString>()); visibility != Visibility::Hidden)

rpcs3/rpcs3qt/gui_application.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,10 +629,11 @@ std::unique_ptr<gs_frame> gui_application::get_gs_frame()
629629
auto [w, h] = ::at32(g_video_out_resolution_map, g_cfg.video.resolution);
630630

631631
const bool resize_game_window = m_gui_settings->GetValue(gui::gs_resize).toBool();
632+
const bool resize_manually = m_gui_settings->GetValue(gui::gs_resize_manual).toBool();
632633

633634
if (resize_game_window)
634635
{
635-
if (m_gui_settings->GetValue(gui::gs_resize_manual).toBool())
636+
if (resize_manually)
636637
{
637638
w = m_gui_settings->GetValue(gui::gs_width).toInt();
638639
h = m_gui_settings->GetValue(gui::gs_height).toInt();
@@ -700,6 +701,8 @@ std::unique_ptr<gs_frame> gui_application::get_gs_frame()
700701
frame_geometry.setSize(QSize(w, h));
701702
}
702703

704+
gui_log.notice("gui_application: game window geometry: x=%d, y=%d, w=%d, h=%d, screen=%d, resize=%d, manually=%d", frame_geometry.left(), frame_geometry.top(), frame_geometry.width(), frame_geometry.height(), screen_index, resize_game_window, resize_manually);
705+
703706
gs_frame* frame = nullptr;
704707

705708
switch (g_cfg.video.renderer.get())

rpcs3/rpcs3qt/localized_emu.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ class localized_emu : public QObject
4343
case localized_string_id::RSX_OVERLAYS_TROPHY_SILVER: return tr("You have earned a silver trophy.\n%0", "Trophy text").arg(std::forward<Args>(args)...);
4444
case localized_string_id::RSX_OVERLAYS_TROPHY_GOLD: return tr("You have earned a gold trophy.\n%0", "Trophy text").arg(std::forward<Args>(args)...);
4545
case localized_string_id::RSX_OVERLAYS_TROPHY_PLATINUM: return tr("You have earned a platinum trophy.\n%0", "Trophy text").arg(std::forward<Args>(args)...);
46-
case localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS: return tr("Compiling shaders");
46+
case localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS: return tr("Precompiling shader interpreter variants.\nPlease wait...");
47+
case localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS_TITLE: return tr("Shader Compilation");
48+
case localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS_VULKAN: return tr("Building base variant %0...").arg(std::forward<Args>(args)...);
49+
case localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS_OPENGL_BUILD: return tr("Building variant %0...").arg(std::forward<Args>(args)...);
50+
case localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS_OPENGL_LINK: return tr("Linking variant %0...").arg(std::forward<Args>(args)...);
4751
case localized_string_id::RSX_OVERLAYS_COMPILING_PPU_MODULES: return tr("Compiling PPU Modules");
4852
case localized_string_id::RSX_OVERLAYS_MSG_DIALOG_YES: return tr("Yes", "Message Dialog");
4953
case localized_string_id::RSX_OVERLAYS_MSG_DIALOG_NO: return tr("No", "Message Dialog");

0 commit comments

Comments
 (0)