RageTextureManager::CopyTexture

This commit is contained in:
Glenn Maynard
2005-07-03 02:30:45 +00:00
parent 78eba6aef0
commit 7c7ad81638
2 changed files with 8 additions and 1 deletions
+7 -1
View File
@@ -134,6 +134,12 @@ RageTexture* RageTextureManager::LoadTexture( RageTextureID ID )
return pTexture;
}
RageTexture* RageTextureManager::CopyTexture( RageTexture *pCopy )
{
++pCopy->m_iRefCount;
return pCopy;
}
void RageTextureManager::VolatileTexture( RageTextureID ID )
{
RageTexture* pTexture = LoadTextureInternal( ID );
@@ -147,7 +153,7 @@ void RageTextureManager::UnloadTexture( RageTexture *t )
return;
t->m_iRefCount--;
ASSERT( t->m_iRefCount >= 0 );
ASSERT_M( t->m_iRefCount >= 0, ssprintf("%i, %s", t->m_iRefCount, t->GetID().filename.c_str()) );
if( t->m_iRefCount )
return; /* Can't unload textures that are still referenced. */
+1
View File
@@ -56,6 +56,7 @@ public:
void Update( float fDeltaTime );
RageTexture* LoadTexture( RageTextureID ID );
RageTexture* CopyTexture( RageTexture *pCopy ); // returns a ref to the same texture, not a deep copy
bool IsTextureRegistered( RageTextureID ID ) const;
void RegisterTexture( RageTextureID ID, RageTexture *p );
void VolatileTexture( RageTextureID ID );