diff options
| author | LillyJadeKatrin <lilly.kitty.1988@gmail.com> | 2024-05-13 00:15:21 -0400 |
|---|---|---|
| committer | LillyJadeKatrin <lilly.kitty.1988@gmail.com> | 2024-05-23 10:41:45 -0400 |
| commit | dc8f3f6eaea51d054be6007713959426763b611d (patch) | |
| tree | ec797d12dbed263f9d9a189e3a3c982d36854a10 /Source/Core/VideoCommon/Assets/CustomTextureData.cpp | |
| parent | 75465f00ccf8694bbae37fccb106a7aaf233e3ac (diff) | |
Refactored Achievement Badges into Texture Layers
Achievement badges/icons are refactored into the type CustomTextureData::ArraySlice::Level as that is the data type images loaded from the filesystem will be. This includes everything that uses the badges in the Qt UI and OnScreenDisplay, and similarly removes the OSD::Icon type because Level already contains that information.
Diffstat (limited to 'Source/Core/VideoCommon/Assets/CustomTextureData.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Assets/CustomTextureData.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Assets/CustomTextureData.cpp b/Source/Core/VideoCommon/Assets/CustomTextureData.cpp index 23af429d11..d30532142a 100644 --- a/Source/Core/VideoCommon/Assets/CustomTextureData.cpp +++ b/Source/Core/VideoCommon/Assets/CustomTextureData.cpp @@ -574,6 +574,14 @@ bool LoadPNGTexture(CustomTextureData::ArraySlice::Level* level, const std::stri std::vector<u8> buffer(file.GetSize()); file.ReadBytes(buffer.data(), file.GetSize()); + return LoadPNGTexture(level, buffer); +} + +bool LoadPNGTexture(CustomTextureData::ArraySlice::Level* level, const std::vector<u8>& buffer) +{ + if (!level) [[unlikely]] + return false; + if (!Common::LoadPNG(buffer, &level->data, &level->width, &level->height)) return false; |
