mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
move overlays code to headers
This commit is contained in:
parent
762c106e19
commit
ee46ad1ca9
23 changed files with 193 additions and 126 deletions
|
@ -2,7 +2,7 @@
|
|||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/Cell/lv2/sys_sync.h"
|
||||
#include "Emu/RSX/Overlays/overlays.h"
|
||||
#include "Emu/RSX/Overlays/overlay_message_dialog.h"
|
||||
|
||||
#include "Input/pad_thread.h"
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "GLGSRender.h"
|
||||
#include "GLCompute.h"
|
||||
#include "GLVertexProgram.h"
|
||||
#include "../Overlays/overlay_shader_compile_notification.h"
|
||||
#include "../Overlays/Shaders/shader_loading_dialog_native.h"
|
||||
#include "../rsx_methods.h"
|
||||
#include "../Common/BufferUtils.h"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "shader_loading_dialog_native.h"
|
||||
#include "../overlay_message_dialog.h"
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
|
|
|
@ -5,6 +5,11 @@
|
|||
|
||||
namespace rsx
|
||||
{
|
||||
namespace overlays
|
||||
{
|
||||
class message_dialog;
|
||||
}
|
||||
|
||||
struct shader_loading_dialog_native : rsx::shader_loading_dialog
|
||||
{
|
||||
rsx::thread* owner = nullptr;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "Utilities/File.h"
|
||||
#include "overlay_utils.h"
|
||||
#include "overlay_fonts.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include "stdafx.h"
|
||||
#include "overlays.h"
|
||||
#include "overlay_message_dialog.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/system_config.h"
|
||||
#include "Emu/Cell/ErrorCodes.h"
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
|
|
47
rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h
Normal file
47
rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
#pragma once
|
||||
|
||||
#include "overlays.h"
|
||||
#include "Emu/Cell/Modules/cellMsgDialog.h"
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
namespace overlays
|
||||
{
|
||||
struct message_dialog : public user_interface
|
||||
{
|
||||
private:
|
||||
label text_display;
|
||||
image_button btn_ok;
|
||||
image_button btn_cancel;
|
||||
|
||||
overlay_element bottom_bar, background;
|
||||
image_view background_poster;
|
||||
progress_bar progress_1, progress_2;
|
||||
u8 num_progress_bars = 0;
|
||||
s32 taskbar_index = 0;
|
||||
s32 taskbar_limit = 0;
|
||||
|
||||
bool interactive = false;
|
||||
bool ok_only = false;
|
||||
bool cancel_only = false;
|
||||
|
||||
std::unique_ptr<image_info> background_image;
|
||||
|
||||
public:
|
||||
message_dialog(bool use_custom_background = false);
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
|
||||
void on_button_pressed(pad_button button_press) override;
|
||||
|
||||
error_code show(bool is_blocking, const std::string& text, const MsgDialogType& type, std::function<void(s32 status)> on_close);
|
||||
|
||||
u32 progress_bar_count();
|
||||
void progress_bar_set_taskbar_index(s32 index);
|
||||
error_code progress_bar_set_message(u32 index, const std::string& msg);
|
||||
error_code progress_bar_increment(u32 index, f32 value);
|
||||
error_code progress_bar_reset(u32 index);
|
||||
error_code progress_bar_set_limit(u32 index, u32 limit);
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
#include "stdafx.h"
|
||||
#include "overlays.h"
|
||||
#include "overlay_save_dialog.h"
|
||||
#include "Utilities/date_time.h"
|
||||
|
||||
namespace rsx
|
||||
|
|
41
rpcs3/Emu/RSX/Overlays/overlay_save_dialog.h
Normal file
41
rpcs3/Emu/RSX/Overlays/overlay_save_dialog.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
#pragma once
|
||||
|
||||
#include "overlays.h"
|
||||
#include "Emu/Cell/Modules/cellSaveData.h"
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
namespace overlays
|
||||
{
|
||||
struct save_dialog : public user_interface
|
||||
{
|
||||
private:
|
||||
struct save_dialog_entry : horizontal_layout
|
||||
{
|
||||
private:
|
||||
std::unique_ptr<image_info> icon_data;
|
||||
|
||||
public:
|
||||
save_dialog_entry(const std::string& text1, const std::string& text2, const std::string& text3, u8 resource_id, const std::vector<u8>& icon_buf);
|
||||
};
|
||||
|
||||
std::unique_ptr<overlay_element> m_dim_background;
|
||||
std::unique_ptr<list_view> m_list;
|
||||
std::unique_ptr<label> m_description;
|
||||
std::unique_ptr<label> m_time_thingy;
|
||||
std::unique_ptr<label> m_no_saves_text;
|
||||
|
||||
bool m_no_saves = false;
|
||||
|
||||
public:
|
||||
save_dialog();
|
||||
|
||||
void update() override;
|
||||
void on_button_pressed(pad_button button_press) override;
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
|
||||
s32 show(std::vector<SaveDataEntry>& save_entries, u32 focused, u32 op, vm::ptr<CellSaveDataListSet> listSet);
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
#include "stdafx.h"
|
||||
#include "overlays.h"
|
||||
#include "overlay_shader_compile_notification.h"
|
||||
#include "Emu/system_config.h"
|
||||
|
||||
namespace rsx
|
||||
|
|
29
rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.h
Normal file
29
rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include "overlays.h"
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
namespace overlays
|
||||
{
|
||||
struct shader_compile_notification : user_interface
|
||||
{
|
||||
label m_text;
|
||||
|
||||
overlay_element dots[3];
|
||||
u8 current_dot = 255;
|
||||
|
||||
u64 creation_time = 0;
|
||||
u64 expire_time = 0; // Time to end the prompt
|
||||
u64 urgency_ctr = 0; // How critical it is to show to the user
|
||||
|
||||
shader_compile_notification();
|
||||
|
||||
void update_animation(u64 t);
|
||||
void touch();
|
||||
void update() override;
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
#include "stdafx.h"
|
||||
#include "overlays.h"
|
||||
#include "overlay_trophy_notification.h"
|
||||
#include "Emu/RSX/RSXThread.h"
|
||||
|
||||
namespace rsx
|
||||
|
|
33
rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.h
Normal file
33
rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include "overlays.h"
|
||||
#include "Emu/Cell/Modules/sceNpTrophy.h"
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
namespace overlays
|
||||
{
|
||||
struct trophy_notification : public user_interface
|
||||
{
|
||||
private:
|
||||
overlay_element frame;
|
||||
image_view image;
|
||||
label text_view;
|
||||
|
||||
u64 display_sched_id = 0;
|
||||
u64 creation_time = 0;
|
||||
std::unique_ptr<image_info> icon_info;
|
||||
|
||||
animation_translate sliding_animation;
|
||||
|
||||
public:
|
||||
trophy_notification();
|
||||
|
||||
void update() override;
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
|
||||
s32 show(const SceNpTrophyDetails& trophy, const std::vector<uchar>& trophy_icon_buffer);
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "overlays.h"
|
||||
#include "overlay_message_dialog.h"
|
||||
#include "../GSRender.h"
|
||||
#include "Input/pad_thread.h"
|
||||
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
#include "Emu/Memory/vm.h"
|
||||
#include "Emu/IdManager.h"
|
||||
|
||||
#include "Emu/Cell/ErrorCodes.h"
|
||||
#include "Emu/Cell/Modules/cellSaveData.h"
|
||||
#include "Emu/Cell/Modules/cellMsgDialog.h"
|
||||
#include "Emu/Cell/Modules/sceNpTrophy.h"
|
||||
#include "Utilities/Timer.h"
|
||||
|
||||
#include <list>
|
||||
|
@ -81,7 +77,7 @@ namespace rsx
|
|||
std::function<void(s32 status)> on_close;
|
||||
|
||||
public:
|
||||
s32 return_code = CELL_OK;
|
||||
s32 return_code = 0; // CELL_OK
|
||||
|
||||
public:
|
||||
void update() override {}
|
||||
|
@ -325,116 +321,5 @@ namespace rsx
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct save_dialog : public user_interface
|
||||
{
|
||||
private:
|
||||
struct save_dialog_entry : horizontal_layout
|
||||
{
|
||||
private:
|
||||
std::unique_ptr<image_info> icon_data;
|
||||
|
||||
public:
|
||||
save_dialog_entry(const std::string& text1, const std::string& text2, const std::string& text3, u8 resource_id, const std::vector<u8>& icon_buf);
|
||||
};
|
||||
|
||||
std::unique_ptr<overlay_element> m_dim_background;
|
||||
std::unique_ptr<list_view> m_list;
|
||||
std::unique_ptr<label> m_description;
|
||||
std::unique_ptr<label> m_time_thingy;
|
||||
std::unique_ptr<label> m_no_saves_text;
|
||||
|
||||
bool m_no_saves = false;
|
||||
|
||||
public:
|
||||
save_dialog();
|
||||
|
||||
void update() override;
|
||||
void on_button_pressed(pad_button button_press) override;
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
|
||||
s32 show(std::vector<SaveDataEntry>& save_entries, u32 focused, u32 op, vm::ptr<CellSaveDataListSet> listSet);
|
||||
};
|
||||
|
||||
struct message_dialog : public user_interface
|
||||
{
|
||||
private:
|
||||
label text_display;
|
||||
image_button btn_ok;
|
||||
image_button btn_cancel;
|
||||
|
||||
overlay_element bottom_bar, background;
|
||||
image_view background_poster;
|
||||
progress_bar progress_1, progress_2;
|
||||
u8 num_progress_bars = 0;
|
||||
s32 taskbar_index = 0;
|
||||
s32 taskbar_limit = 0;
|
||||
|
||||
bool interactive = false;
|
||||
bool ok_only = false;
|
||||
bool cancel_only = false;
|
||||
|
||||
std::unique_ptr<image_info> background_image;
|
||||
|
||||
public:
|
||||
message_dialog(bool use_custom_background = false);
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
|
||||
void on_button_pressed(pad_button button_press) override;
|
||||
|
||||
error_code show(bool is_blocking, const std::string& text, const MsgDialogType& type, std::function<void(s32 status)> on_close);
|
||||
|
||||
u32 progress_bar_count();
|
||||
void progress_bar_set_taskbar_index(s32 index);
|
||||
error_code progress_bar_set_message(u32 index, const std::string& msg);
|
||||
error_code progress_bar_increment(u32 index, f32 value);
|
||||
error_code progress_bar_reset(u32 index);
|
||||
error_code progress_bar_set_limit(u32 index, u32 limit);
|
||||
};
|
||||
|
||||
struct trophy_notification : public user_interface
|
||||
{
|
||||
private:
|
||||
overlay_element frame;
|
||||
image_view image;
|
||||
label text_view;
|
||||
|
||||
u64 display_sched_id = 0;
|
||||
u64 creation_time = 0;
|
||||
std::unique_ptr<image_info> icon_info;
|
||||
|
||||
animation_translate sliding_animation;
|
||||
|
||||
public:
|
||||
trophy_notification();
|
||||
|
||||
void update() override;
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
|
||||
s32 show(const SceNpTrophyDetails& trophy, const std::vector<uchar>& trophy_icon_buffer);
|
||||
};
|
||||
|
||||
struct shader_compile_notification : user_interface
|
||||
{
|
||||
label m_text;
|
||||
|
||||
overlay_element dots[3];
|
||||
u8 current_dot = 255;
|
||||
|
||||
u64 creation_time = 0;
|
||||
u64 expire_time = 0; // Time to end the prompt
|
||||
u64 urgency_ctr = 0; // How critical it is to show to the user
|
||||
|
||||
shader_compile_notification();
|
||||
|
||||
void update_animation(u64 t);
|
||||
void touch();
|
||||
void update() override;
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "Emu/Cell/Modules/cellGcmSys.h"
|
||||
#include "Overlays/overlay_perf_metrics.h"
|
||||
#include "Utilities/date_time.h"
|
||||
|
||||
#include "Utilities/span.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "RSXFragmentProgram.h"
|
||||
#include "rsx_methods.h"
|
||||
#include "rsx_utils.h"
|
||||
#include "Overlays/overlays.h"
|
||||
#include "Common/texture_cache_utils.h"
|
||||
|
||||
#include "Utilities/Thread.h"
|
||||
|
@ -34,6 +33,11 @@ extern rsx::frame_capture_data frame_capture;
|
|||
|
||||
namespace rsx
|
||||
{
|
||||
namespace overlays
|
||||
{
|
||||
class display_manager;
|
||||
}
|
||||
|
||||
struct rsx_iomap_table
|
||||
{
|
||||
std::array<atomic_t<u32>, 4096> ea;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "VKGSRender.h"
|
||||
#include "../Overlays/overlay_shader_compile_notification.h"
|
||||
#include "../Overlays/Shaders/shader_loading_dialog_native.h"
|
||||
#include "../rsx_methods.h"
|
||||
#include "../rsx_utils.h"
|
||||
|
|
|
@ -423,8 +423,12 @@
|
|||
<ClInclude Include="Emu\Io\pad_config_types.h" />
|
||||
<ClInclude Include="Emu\RSX\Common\texture_cache_helpers.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_fonts.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_message_dialog.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_osk.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_perf_metrics.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_save_dialog.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_shader_compile_notification.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_trophy_notification.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_utils.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\Shaders\shader_loading_dialog.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\Shaders\shader_loading_dialog_native.h" />
|
||||
|
|
|
@ -1720,5 +1720,17 @@
|
|||
<ClInclude Include="Emu\RSX\Overlays\overlay_utils.h">
|
||||
<Filter>Emu\GPU\RSX\Overlays</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_save_dialog.h">
|
||||
<Filter>Emu\GPU\RSX\Overlays</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_message_dialog.h">
|
||||
<Filter>Emu\GPU\RSX\Overlays</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_trophy_notification.h">
|
||||
<Filter>Emu\GPU\RSX\Overlays</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_shader_compile_notification.h">
|
||||
<Filter>Emu\GPU\RSX\Overlays</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,6 +1,10 @@
|
|||
#include "headless_application.h"
|
||||
|
||||
#include "Emu/RSX/GSRender.h"
|
||||
#include "Emu/Cell/Modules/cellMsgDialog.h"
|
||||
#include "Emu/Cell/Modules/cellOskDialog.h"
|
||||
#include "Emu/Cell/Modules/cellSaveData.h"
|
||||
#include "Emu/Cell/Modules/sceNpTrophy.h"
|
||||
|
||||
#include <clocale>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <Emu/System.h>
|
||||
#include <Emu/IdManager.h>
|
||||
#include <Emu/RSX/Overlays/overlays.h>
|
||||
#include <Emu/RSX/Overlays/overlay_save_dialog.h>
|
||||
|
||||
#include "Input/pad_thread.h"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "trophy_notification_frame.h"
|
||||
|
||||
#include "../Emu/System.h"
|
||||
#include "../Emu/RSX/Overlays/overlays.h"
|
||||
#include "../Emu/RSX/Overlays/overlay_trophy_notification.h"
|
||||
|
||||
s32 trophy_notification_helper::ShowTrophyNotification(const SceNpTrophyDetails& trophy, const std::vector<uchar>& trophy_icon_buffer)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue