summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.h
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2022-06-28 13:35:39 -0400
committerGitHub <noreply@github.com>2022-06-28 13:35:39 -0400
commit5d04e1e1de8248da8366f6f99ff4cdbe5467c789 (patch)
tree47ff1e96f099cef3443635b982d03e2bf1ce3f04 /Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.h
parente50e45f400856191eafb5f0c6044a8efbf152321 (diff)
parent8aef0015fd8903b92cf0aab8a98ee669ec97b5ef (diff)
Merge pull request #10518 from iwubcode/draw-mod
Introducing a 'GraphicsMod' system for creators
Diffstat (limited to 'Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.h')
-rw-r--r--Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.h b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.h
new file mode 100644
index 0000000000..5151b85dbd
--- /dev/null
+++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.h
@@ -0,0 +1,54 @@
+// Copyright 2022 Dolphin Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <list>
+#include <memory>
+#include <string>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include "VideoCommon/GraphicsModSystem/Runtime/FBInfo.h"
+#include "VideoCommon/GraphicsModSystem/Runtime/GraphicsModAction.h"
+#include "VideoCommon/TextureInfo.h"
+#include "VideoCommon/XFMemory.h"
+
+class GraphicsModGroupConfig;
+class GraphicsModManager
+{
+public:
+ const std::vector<GraphicsModAction*>& GetProjectionActions(ProjectionType projection_type) const;
+ const std::vector<GraphicsModAction*>&
+ GetProjectionTextureActions(ProjectionType projection_type,
+ const std::string& texture_name) const;
+ const std::vector<GraphicsModAction*>&
+ GetDrawStartedActions(const std::string& texture_name) const;
+ const std::vector<GraphicsModAction*>&
+ GetTextureLoadActions(const std::string& texture_name) const;
+ const std::vector<GraphicsModAction*>& GetEFBActions(const FBInfo& efb) const;
+ const std::vector<GraphicsModAction*>& GetXFBActions(const FBInfo& xfb) const;
+
+ void Load(const GraphicsModGroupConfig& config);
+
+ void EndOfFrame();
+
+private:
+ void Reset();
+
+ class DecoratedAction;
+
+ static inline const std::vector<GraphicsModAction*> m_default = {};
+ std::list<std::unique_ptr<GraphicsModAction>> m_actions;
+ std::unordered_map<ProjectionType, std::vector<GraphicsModAction*>>
+ m_projection_target_to_actions;
+ std::unordered_map<std::string, std::vector<GraphicsModAction*>>
+ m_projection_texture_target_to_actions;
+ std::unordered_map<std::string, std::vector<GraphicsModAction*>> m_draw_started_target_to_actions;
+ std::unordered_map<std::string, std::vector<GraphicsModAction*>> m_load_target_to_actions;
+ std::unordered_map<FBInfo, std::vector<GraphicsModAction*>, FBInfoHasher> m_efb_target_to_actions;
+ std::unordered_map<FBInfo, std::vector<GraphicsModAction*>, FBInfoHasher> m_xfb_target_to_actions;
+
+ std::unordered_set<std::string> m_groups;
+};