summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureInfo.cpp
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/TextureInfo.cpp
parente50e45f400856191eafb5f0c6044a8efbf152321 (diff)
parent8aef0015fd8903b92cf0aab8a98ee669ec97b5ef (diff)
Merge pull request #10518 from iwubcode/draw-mod
Introducing a 'GraphicsMod' system for creators
Diffstat (limited to 'Source/Core/VideoCommon/TextureInfo.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureInfo.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/TextureInfo.cpp b/Source/Core/VideoCommon/TextureInfo.cpp
index 696f5b904c..ff117c6926 100644
--- a/Source/Core/VideoCommon/TextureInfo.cpp
+++ b/Source/Core/VideoCommon/TextureInfo.cpp
@@ -39,20 +39,20 @@ TextureInfo TextureInfo::FromStage(u32 stage)
if (from_tmem)
{
- return TextureInfo(&texMem[tmem_address_even], tlut_ptr, address, texture_format, tlut_format,
- width, height, true, &texMem[tmem_address_odd], &texMem[tmem_address_even],
- mip_count);
+ return TextureInfo(stage, &texMem[tmem_address_even], tlut_ptr, address, texture_format,
+ tlut_format, width, height, true, &texMem[tmem_address_odd],
+ &texMem[tmem_address_even], mip_count);
}
- return TextureInfo(Memory::GetPointer(address), tlut_ptr, address, texture_format, tlut_format,
- width, height, false, nullptr, nullptr, mip_count);
+ return TextureInfo(stage, Memory::GetPointer(address), tlut_ptr, address, texture_format,
+ tlut_format, width, height, false, nullptr, nullptr, mip_count);
}
-TextureInfo::TextureInfo(const u8* ptr, const u8* tlut_ptr, u32 address,
+TextureInfo::TextureInfo(u32 stage, const u8* ptr, const u8* tlut_ptr, u32 address,
TextureFormat texture_format, TLUTFormat tlut_format, u32 width,
u32 height, bool from_tmem, const u8* tmem_odd, const u8* tmem_even,
std::optional<u32> mip_count)
- : m_ptr(ptr), m_tlut_ptr(tlut_ptr), m_address(address), m_from_tmem(from_tmem),
+ : m_stage(stage), m_ptr(ptr), m_tlut_ptr(tlut_ptr), m_address(address), m_from_tmem(from_tmem),
m_tmem_odd(tmem_odd), m_texture_format(texture_format), m_tlut_format(tlut_format),
m_raw_width(width), m_raw_height(height)
{
@@ -100,7 +100,7 @@ std::string TextureInfo::NameDetails::GetFullName() const
return fmt::format("{}_{}{}_{}", base_name, texture_name, tlut_name, format_name);
}
-TextureInfo::NameDetails TextureInfo::CalculateTextureName()
+TextureInfo::NameDetails TextureInfo::CalculateTextureName() const
{
if (!m_ptr)
return NameDetails{};
@@ -240,6 +240,11 @@ u32 TextureInfo::GetRawHeight() const
return m_raw_height;
}
+u32 TextureInfo::GetStage() const
+{
+ return m_stage;
+}
+
bool TextureInfo::HasMipMaps() const
{
return !m_mip_levels.empty();