mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-01-30 11:03:31 +00:00
Merge pull request #14294 from JosJuice/textureinfo-getters-header
VideoCommon: Move TextureInfo getters to header
This commit is contained in:
commit
2a771937cf
@ -175,101 +175,6 @@ TextureInfo::NameDetails TextureInfo::CalculateTextureName() const
|
||||
.format_name = fmt::to_string(static_cast<int>(m_texture_format))};
|
||||
}
|
||||
|
||||
bool TextureInfo::IsDataValid() const
|
||||
{
|
||||
return m_data_valid;
|
||||
}
|
||||
|
||||
const u8* TextureInfo::GetData() const
|
||||
{
|
||||
return m_data.data();
|
||||
}
|
||||
|
||||
const u8* TextureInfo::GetTlutAddress() const
|
||||
{
|
||||
return m_tlut_data.data();
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetRawAddress() const
|
||||
{
|
||||
return m_address;
|
||||
}
|
||||
|
||||
bool TextureInfo::IsFromTmem() const
|
||||
{
|
||||
return m_from_tmem;
|
||||
}
|
||||
|
||||
const u8* TextureInfo::GetTmemOddAddress() const
|
||||
{
|
||||
return m_tmem_odd.data();
|
||||
}
|
||||
|
||||
TextureFormat TextureInfo::GetTextureFormat() const
|
||||
{
|
||||
return m_texture_format;
|
||||
}
|
||||
|
||||
TLUTFormat TextureInfo::GetTlutFormat() const
|
||||
{
|
||||
return m_tlut_format;
|
||||
}
|
||||
|
||||
std::optional<u32> TextureInfo::GetPaletteSize() const
|
||||
{
|
||||
return m_palette_size;
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetTextureSize() const
|
||||
{
|
||||
return m_texture_size;
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetBlockWidth() const
|
||||
{
|
||||
return m_block_width;
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetBlockHeight() const
|
||||
{
|
||||
return m_block_height;
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetExpandedWidth() const
|
||||
{
|
||||
return m_expanded_width;
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetExpandedHeight() const
|
||||
{
|
||||
return m_expanded_height;
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetRawWidth() const
|
||||
{
|
||||
return m_raw_width;
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetRawHeight() const
|
||||
{
|
||||
return m_raw_height;
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetStage() const
|
||||
{
|
||||
return m_stage;
|
||||
}
|
||||
|
||||
bool TextureInfo::HasMipMaps() const
|
||||
{
|
||||
return m_limited_mip_count != 0;
|
||||
}
|
||||
|
||||
u32 TextureInfo::GetLevelCount() const
|
||||
{
|
||||
return m_limited_mip_count + 1;
|
||||
}
|
||||
|
||||
TextureInfo::MipLevels TextureInfo::GetMipMapLevels() const
|
||||
{
|
||||
MipLevelIterator begin;
|
||||
@ -314,46 +219,6 @@ TextureInfo::MipLevel::MipLevel(u32 level, const TextureInfo& parent, std::span<
|
||||
*data = Common::SafeSubspan(*data, m_texture_size);
|
||||
}
|
||||
|
||||
bool TextureInfo::MipLevel::IsDataValid() const
|
||||
{
|
||||
return m_data_valid;
|
||||
}
|
||||
|
||||
const u8* TextureInfo::MipLevel::GetData() const
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
u32 TextureInfo::MipLevel::GetTextureSize() const
|
||||
{
|
||||
return m_texture_size;
|
||||
}
|
||||
|
||||
u32 TextureInfo::MipLevel::GetExpandedWidth() const
|
||||
{
|
||||
return m_expanded_width;
|
||||
}
|
||||
|
||||
u32 TextureInfo::MipLevel::GetExpandedHeight() const
|
||||
{
|
||||
return m_expanded_height;
|
||||
}
|
||||
|
||||
u32 TextureInfo::MipLevel::GetRawWidth() const
|
||||
{
|
||||
return m_raw_width;
|
||||
}
|
||||
|
||||
u32 TextureInfo::MipLevel::GetRawHeight() const
|
||||
{
|
||||
return m_raw_height;
|
||||
}
|
||||
|
||||
u32 TextureInfo::MipLevel::GetLevel() const
|
||||
{
|
||||
return m_level;
|
||||
}
|
||||
|
||||
TextureInfo::MipLevelIterator& TextureInfo::MipLevelIterator::operator++()
|
||||
{
|
||||
++m_level_index;
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
enum class TextureFormat;
|
||||
enum class TLUTFormat;
|
||||
|
||||
class TextureInfo
|
||||
class TextureInfo final
|
||||
{
|
||||
public:
|
||||
static TextureInfo FromStage(u32 stage);
|
||||
@ -33,32 +33,32 @@ public:
|
||||
};
|
||||
NameDetails CalculateTextureName() const;
|
||||
|
||||
bool IsDataValid() const;
|
||||
bool IsDataValid() const { return m_data_valid; }
|
||||
|
||||
const u8* GetData() const;
|
||||
const u8* GetTlutAddress() const;
|
||||
const u8* GetData() const { return m_data.data(); }
|
||||
const u8* GetTlutAddress() const { return m_tlut_data.data(); }
|
||||
|
||||
u32 GetRawAddress() const;
|
||||
u32 GetRawAddress() const { return m_address; }
|
||||
|
||||
bool IsFromTmem() const;
|
||||
const u8* GetTmemOddAddress() const;
|
||||
bool IsFromTmem() const { return m_from_tmem; }
|
||||
const u8* GetTmemOddAddress() const { return m_tmem_odd.data(); }
|
||||
|
||||
TextureFormat GetTextureFormat() const;
|
||||
TLUTFormat GetTlutFormat() const;
|
||||
TextureFormat GetTextureFormat() const { return m_texture_format; }
|
||||
TLUTFormat GetTlutFormat() const { return m_tlut_format; }
|
||||
|
||||
std::optional<u32> GetPaletteSize() const;
|
||||
u32 GetTextureSize() const;
|
||||
std::optional<u32> GetPaletteSize() const { return m_palette_size; }
|
||||
u32 GetTextureSize() const { return m_texture_size; }
|
||||
|
||||
u32 GetBlockWidth() const;
|
||||
u32 GetBlockHeight() const;
|
||||
u32 GetBlockWidth() const { return m_block_width; }
|
||||
u32 GetBlockHeight() const { return m_block_height; }
|
||||
|
||||
u32 GetExpandedWidth() const;
|
||||
u32 GetExpandedHeight() const;
|
||||
u32 GetExpandedWidth() const { return m_expanded_width; }
|
||||
u32 GetExpandedHeight() const { return m_expanded_height; }
|
||||
|
||||
u32 GetRawWidth() const;
|
||||
u32 GetRawHeight() const;
|
||||
u32 GetRawWidth() const { return m_raw_width; }
|
||||
u32 GetRawHeight() const { return m_raw_height; }
|
||||
|
||||
u32 GetStage() const;
|
||||
u32 GetStage() const { return m_stage; }
|
||||
|
||||
class MipLevel final
|
||||
{
|
||||
@ -66,18 +66,18 @@ public:
|
||||
MipLevel() = default;
|
||||
MipLevel(u32 level, const TextureInfo& parent, std::span<const u8>* data);
|
||||
|
||||
bool IsDataValid() const;
|
||||
bool IsDataValid() const { return m_data_valid; }
|
||||
|
||||
const u8* GetData() const;
|
||||
u32 GetTextureSize() const;
|
||||
const u8* GetData() const { return m_ptr; }
|
||||
u32 GetTextureSize() const { return m_texture_size; }
|
||||
|
||||
u32 GetExpandedWidth() const;
|
||||
u32 GetExpandedHeight() const;
|
||||
u32 GetExpandedWidth() const { return m_expanded_width; }
|
||||
u32 GetExpandedHeight() const { return m_expanded_height; }
|
||||
|
||||
u32 GetRawWidth() const;
|
||||
u32 GetRawHeight() const;
|
||||
u32 GetRawWidth() const { return m_raw_width; }
|
||||
u32 GetRawHeight() const { return m_raw_height; }
|
||||
|
||||
u32 GetLevel() const;
|
||||
u32 GetLevel() const { return m_level; }
|
||||
|
||||
private:
|
||||
bool m_data_valid = false;
|
||||
@ -147,8 +147,8 @@ public:
|
||||
MipLevelIterator m_end;
|
||||
};
|
||||
|
||||
bool HasMipMaps() const;
|
||||
u32 GetLevelCount() const;
|
||||
bool HasMipMaps() const { return m_limited_mip_count != 0; }
|
||||
u32 GetLevelCount() const { return m_limited_mip_count + 1; }
|
||||
MipLevels GetMipMapLevels() const;
|
||||
u32 GetFullLevelSize() const;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user