#include "global.h" #include "RageTexture.h" #include "RageUtil.h" #include "RageTextureManager.h" #include RageTexture::RageTexture( RageTextureID name ): m_ID(name) { m_iRefCount = 1; m_bWasUsed = false; m_iSourceWidth = m_iSourceHeight = 0; m_iTextureWidth = m_iTextureHeight = 0; m_iImageWidth = m_iImageHeight = 0; m_iFramesWide = m_iFramesHigh = 0; } RageTexture::~RageTexture() { } void RageTexture::CreateFrameRects() { GetFrameDimensionsFromFileName( GetID().filename, &m_iFramesWide, &m_iFramesHigh ); // // Fill in the m_FrameRects with the bounds of each frame in the animation. // m_TextureCoordRects.clear(); for( int j=0; jTrace( "Adding frect%d %f %f %f %f", (i + j*m_iFramesWide), frect.left, frect.top, frect.right, frect.bottom ); } } } void RageTexture::GetFrameDimensionsFromFileName( CString sPath, int* piFramesWide, int* piFramesHigh ) { *piFramesWide = *piFramesHigh = 1; // set default values in case we don't find the dimension in the file name sPath.MakeLower(); const CString sFName = SetExtension( sPath, "" ); CStringArray arrayBits; split( sFName, " ", arrayBits, false ); for( unsigned i=0; i