cleanup
This commit is contained in:
@@ -9,12 +9,9 @@
|
|||||||
RageTexture::RageTexture( RageTextureID name ):
|
RageTexture::RageTexture( RageTextureID name ):
|
||||||
m_ID(name)
|
m_ID(name)
|
||||||
{
|
{
|
||||||
// LOG->Trace( "RageTexture::RageTexture()" );
|
|
||||||
|
|
||||||
m_iRefCount = 1;
|
m_iRefCount = 1;
|
||||||
m_bWasUsed = false;
|
m_bWasUsed = false;
|
||||||
|
|
||||||
// SetActualID();
|
|
||||||
m_iSourceWidth = m_iSourceHeight = 0;
|
m_iSourceWidth = m_iSourceHeight = 0;
|
||||||
m_iTextureWidth = m_iTextureHeight = 0;
|
m_iTextureWidth = m_iTextureHeight = 0;
|
||||||
m_iImageWidth = m_iImageHeight = 0;
|
m_iImageWidth = m_iImageHeight = 0;
|
||||||
@@ -22,21 +19,6 @@ RageTexture::RageTexture( RageTextureID name ):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set the initial ActualID; this is what the actual texture will start
|
|
||||||
* from. */
|
|
||||||
//void RageTexture::SetActualID()
|
|
||||||
//{
|
|
||||||
// m_ActualID = m_ID;
|
|
||||||
//
|
|
||||||
// /* Texture color depth preference can be overridden. */
|
|
||||||
// if(m_ID.iColorDepth == -1)
|
|
||||||
// m_ActualID.iColorDepth = TEXTUREMAN->GetTextureColorDepth();
|
|
||||||
//
|
|
||||||
// /* The max texture size can never be higher than the preference,
|
|
||||||
// * since it might be set to something to fix driver problems. */
|
|
||||||
// m_ActualID.iMaxSize = min(m_ActualID.iMaxSize, TEXTUREMAN->GetMaxTextureResolution());
|
|
||||||
//}
|
|
||||||
|
|
||||||
RageTexture::~RageTexture()
|
RageTexture::~RageTexture()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -47,9 +29,9 @@ void RageTexture::CreateFrameRects()
|
|||||||
{
|
{
|
||||||
GetFrameDimensionsFromFileName( GetID().filename, &m_iFramesWide, &m_iFramesHigh );
|
GetFrameDimensionsFromFileName( GetID().filename, &m_iFramesWide, &m_iFramesHigh );
|
||||||
|
|
||||||
///////////////////////////////////
|
//
|
||||||
// Fill in the m_FrameRects with the bounds of each frame in the animation.
|
// Fill in the m_FrameRects with the bounds of each frame in the animation.
|
||||||
///////////////////////////////////
|
//
|
||||||
m_TextureCoordRects.clear();
|
m_TextureCoordRects.clear();
|
||||||
|
|
||||||
for( int j=0; j<m_iFramesHigh; j++ ) // traverse along Y
|
for( int j=0; j<m_iFramesHigh; j++ ) // traverse along Y
|
||||||
@@ -78,7 +60,6 @@ void RageTexture::GetFrameDimensionsFromFileName( CString sPath, int* piFramesWi
|
|||||||
CStringArray arrayBits;
|
CStringArray arrayBits;
|
||||||
split( sFName, " ", arrayBits, false );
|
split( sFName, " ", arrayBits, false );
|
||||||
|
|
||||||
/* XXX: allow dims to be in parens */
|
|
||||||
for( unsigned i=0; i<arrayBits.size(); i++ )
|
for( unsigned i=0; i<arrayBits.size(); i++ )
|
||||||
{
|
{
|
||||||
CString &sBit = arrayBits[ i ];
|
CString &sBit = arrayBits[ i ];
|
||||||
@@ -102,14 +83,14 @@ void RageTexture::GetFrameDimensionsFromFileName( CString sPath, int* piFramesWi
|
|||||||
|
|
||||||
int RageTexture::GetFrameCountFromFileName( CString sPath )
|
int RageTexture::GetFrameCountFromFileName( CString sPath )
|
||||||
{
|
{
|
||||||
int wide, high;
|
int iWide, iHigh;
|
||||||
GetFrameDimensionsFromFileName(sPath, &wide, &high );
|
GetFrameDimensionsFromFileName( sPath, &iWide, &iHigh );
|
||||||
return wide*high;
|
return iWide * iHigh;
|
||||||
}
|
}
|
||||||
|
|
||||||
const RectF *RageTexture::GetTextureCoordRect( int frameNo ) const
|
const RectF *RageTexture::GetTextureCoordRect( int iFrameNo ) const
|
||||||
{
|
{
|
||||||
return &m_TextureCoordRects[frameNo];
|
return &m_TextureCoordRects[iFrameNo];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -183,12 +183,7 @@ void RageTextureManager::UnloadTexture( RageTexture *t )
|
|||||||
return; /* Never unload TEX_PERMANENT textures. */
|
return; /* Never unload TEX_PERMANENT textures. */
|
||||||
bool bDeleteThis = false;
|
bool bDeleteThis = false;
|
||||||
|
|
||||||
/* Always unload movies, so we don't waste time decoding.
|
/* Always unload movies, so we don't waste time decoding. */
|
||||||
*
|
|
||||||
* Actually, multiple refs to a movie won't work; they should play independently,
|
|
||||||
* but they'll actually share settings. Not worth fixing, since we don't currently
|
|
||||||
* using movies for anything except BGAs (though we could).
|
|
||||||
*/
|
|
||||||
if( t->IsAMovie() )
|
if( t->IsAMovie() )
|
||||||
bDeleteThis = true;
|
bDeleteThis = true;
|
||||||
|
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ class RageTextureManager
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RageTextureManager();
|
RageTextureManager();
|
||||||
void Update( float fDeltaTime );
|
|
||||||
~RageTextureManager();
|
~RageTextureManager();
|
||||||
|
void Update( float fDeltaTime );
|
||||||
|
|
||||||
RageTexture* LoadTexture( RageTextureID ID );
|
RageTexture* LoadTexture( RageTextureID ID );
|
||||||
bool IsTextureRegistered( RageTextureID ID ) const;
|
bool IsTextureRegistered( RageTextureID ID ) const;
|
||||||
@@ -85,15 +85,13 @@ public:
|
|||||||
void EnableOddDimensionWarning() { m_iNoWarnAboutOddDimensions--; }
|
void EnableOddDimensionWarning() { m_iNoWarnAboutOddDimensions--; }
|
||||||
bool GetOddDimensionWarning() const { return m_iNoWarnAboutOddDimensions == 0; }
|
bool GetOddDimensionWarning() const { return m_iNoWarnAboutOddDimensions == 0; }
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
void DeleteTexture( RageTexture *t );
|
void DeleteTexture( RageTexture *t );
|
||||||
enum GCType { screen_changed, delayed_delete };
|
enum GCType { screen_changed, delayed_delete };
|
||||||
void GarbageCollect( GCType type );
|
void GarbageCollect( GCType type );
|
||||||
|
|
||||||
RageTextureManagerPrefs m_Prefs;
|
|
||||||
|
|
||||||
RageTexture* LoadTextureInternal( RageTextureID ID );
|
RageTexture* LoadTextureInternal( RageTextureID ID );
|
||||||
|
|
||||||
|
RageTextureManagerPrefs m_Prefs;
|
||||||
std::map<RageTextureID, RageTexture*> m_mapPathToTexture;
|
std::map<RageTextureID, RageTexture*> m_mapPathToTexture;
|
||||||
int m_iNoWarnAboutOddDimensions;
|
int m_iNoWarnAboutOddDimensions;
|
||||||
RageTextureID::TexPolicy m_TexturePolicy;
|
RageTextureID::TexPolicy m_TexturePolicy;
|
||||||
|
|||||||
Reference in New Issue
Block a user