| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <list> |
| 7 |
#include <memory> |
| 8 |
#include <string> |
| 9 |
#include <unordered_map> |
| 10 |
#include <unordered_set> |
| 11 |
#include <vector> |
| 12 |
|
| 13 |
#include "Common/HookableEvent.h" |
| 14 |
|
| 15 |
#include "VideoCommon/GraphicsModSystem/Runtime/FBInfo.h" |
| 16 |
#include "VideoCommon/GraphicsModSystem/Runtime/GraphicsModAction.h" |
| 17 |
#include "VideoCommon/XFMemory.h" |
| 18 |
|
| 19 |
class GraphicsModGroupConfig; |
| 20 |
class GraphicsModManager |
| 21 |
{ |
| 22 |
public: |
| 23 |
bool Initialize(); |
| 24 |
|
| 25 |
const std::vector<GraphicsModAction*>& GetProjectionActions(ProjectionType projection_type) const; |
| 26 |
const std::vector<GraphicsModAction*>& |
| 27 |
GetProjectionTextureActions(ProjectionType projection_type, |
| 28 |
const std::string& texture_name) const; |
| 29 |
const std::vector<GraphicsModAction*>& |
| 30 |
GetDrawStartedActions(const std::string& texture_name) const; |
| 31 |
const std::vector<GraphicsModAction*>& |
| 32 |
GetTextureLoadActions(const std::string& texture_name) const; |
| 33 |
const std::vector<GraphicsModAction*>& |
| 34 |
GetTextureCreateActions(const std::string& texture_name) const; |
| 35 |
const std::vector<GraphicsModAction*>& GetEFBActions(const FBInfo& efb) const; |
| 36 |
const std::vector<GraphicsModAction*>& GetXFBActions(const FBInfo& xfb) const; |
| 37 |
|
| 38 |
void Load(const GraphicsModGroupConfig& config); |
| 39 |
|
| 40 |
private: |
| 41 |
void EndOfFrame(); |
| 42 |
void Reset(); |
| 43 |
|
| 44 |
class DecoratedAction; |
| 45 |
|
| 46 |
static inline const std::vector<GraphicsModAction*> m_default = {}; |
| 47 |
std::list<std::unique_ptr<GraphicsModAction>> m_actions; |
| 48 |
std::unordered_map<ProjectionType, std::vector<GraphicsModAction*>> |
| 49 |
m_projection_target_to_actions; |
| 50 |
std::unordered_map<std::string, std::vector<GraphicsModAction*>> |
| 51 |
m_projection_texture_target_to_actions; |
| 52 |
std::unordered_map<std::string, std::vector<GraphicsModAction*>> m_draw_started_target_to_actions; |
| 53 |
std::unordered_map<std::string, std::vector<GraphicsModAction*>> m_load_texture_target_to_actions; |
| 54 |
std::unordered_map<std::string, std::vector<GraphicsModAction*>> |
| 55 |
m_create_texture_target_to_actions; |
| 56 |
std::unordered_map<FBInfo, std::vector<GraphicsModAction*>, FBInfoHasher> m_efb_target_to_actions; |
| 57 |
std::unordered_map<FBInfo, std::vector<GraphicsModAction*>, FBInfoHasher> m_xfb_target_to_actions; |
| 58 |
|
| 59 |
std::unordered_set<std::string> m_groups; |
| 60 |
|
| 61 |
Common::EventHook m_end_of_frame_event; |
| 62 |
}; |
| 63 |
|
| 64 |
extern std::unique_ptr<GraphicsModManager> g_graphics_mod_manager; |