From dc8f3f6eaea51d054be6007713959426763b611d Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Mon, 13 May 2024 00:15:21 -0400 Subject: 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. --- Source/Core/VideoCommon/Assets/CustomTextureData.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/Core/VideoCommon/Assets/CustomTextureData.cpp') 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 buffer(file.GetSize()); file.ReadBytes(buffer.data(), file.GetSize()); + return LoadPNGTexture(level, buffer); +} + +bool LoadPNGTexture(CustomTextureData::ArraySlice::Level* level, const std::vector& buffer) +{ + if (!level) [[unlikely]] + return false; + if (!Common::LoadPNG(buffer, &level->data, &level->width, &level->height)) return false; -- cgit v1.2.3