From 21f1c9b95b89c890fe020227b275226152902c92 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 26 Jun 2021 13:53:38 -0400 Subject: [PATCH] Fix H-uru/Plasma#941. Fixes a reference counting issue that prevents non-DirectXCompressed mipmaps from being used in GUI Lists (eg as icons for avatar clothing). All future clothing PRPs produced by CreateClothingPRP.py will depend on this change. --- Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp index 031fab5c..6dee67c6 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp @@ -217,15 +217,16 @@ pfGUIListPicture::pfGUIListPicture( plKey mipKey, hsBool respectAlpha ) : pfGUIL fRespectAlpha = respectAlpha; plMipmap *mip = plMipmap::ConvertNoRef( fMipmapKey->ObjectIsLoaded() ); - if( mip != nil && mip->IsCompressed() ) + if ( mip != nil && mip->IsCompressed() ) { // Gotta make and grab an uncompressed one plMipmap *uncompBuffer = hsCodecManager::Instance().CreateUncompressedMipmap( mip, hsCodecManager::k32BitDepth ); char str[ 512 ]; sprintf( str, "%s_uncomp", mip->GetKeyName() ); fMipmapKey = hsgResMgr::ResMgr()->NewKey( str, uncompBuffer, fMipmapKey->GetUoid().GetLocation() ); - fMipmapKey->RefObject(); } + + fMipmapKey->RefObject(); } pfGUIListPicture::~pfGUIListPicture()