Browse Source

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.
tickets/14/14/1
Adam Johnson 4 years ago
parent
commit
53eb7af1b7
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 11
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp

11
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp

@ -216,16 +216,17 @@ pfGUIListPicture::pfGUIListPicture( plKey mipKey, hsBool respectAlpha ) : pfGUIL
fMipmapKey = mipKey;
fRespectAlpha = respectAlpha;
plMipmap *mip = plMipmap::ConvertNoRef( fMipmapKey->ObjectIsLoaded() );
if( mip != nil && mip->IsCompressed() )
plMipmap* mip = plMipmap::ConvertNoRef(fMipmapKey->ObjectIsLoaded());
if (mip != nil && mip->IsCompressed())
{
// Gotta make and grab an uncompressed one
plMipmap *uncompBuffer = hsCodecManager::Instance().CreateUncompressedMipmap( mip, hsCodecManager::k32BitDepth );
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 = hsgResMgr::ResMgr()->NewKey(str, uncompBuffer, fMipmapKey->GetUoid().GetLocation());
}
fMipmapKey->RefObject();
}
pfGUIListPicture::~pfGUIListPicture()

Loading…
Cancel
Save