remove .sprite file support. Use .xml instead
This commit is contained in:
@@ -440,7 +440,6 @@ void ActorUtil::SortByZPosition( vector<Actor*> &vActors )
|
|||||||
static const CString FileTypeNames[] = {
|
static const CString FileTypeNames[] = {
|
||||||
"Actor",
|
"Actor",
|
||||||
"Bitmap",
|
"Bitmap",
|
||||||
"Sprite",
|
|
||||||
"Movie",
|
"Movie",
|
||||||
"Directory",
|
"Directory",
|
||||||
"Xml",
|
"Xml",
|
||||||
@@ -468,8 +467,6 @@ FileType ActorUtil::GetFileType( const CString &sPath )
|
|||||||
sExt=="avi" ||
|
sExt=="avi" ||
|
||||||
sExt=="mpeg" ||
|
sExt=="mpeg" ||
|
||||||
sExt=="mpg" ) return FT_Movie;
|
sExt=="mpg" ) return FT_Movie;
|
||||||
else if(
|
|
||||||
sExt=="sprite" ) return FT_Sprite;
|
|
||||||
else if(
|
else if(
|
||||||
sExt=="txt" ) return FT_Model;
|
sExt=="txt" ) return FT_Model;
|
||||||
else return FT_Invalid;
|
else return FT_Invalid;
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ enum FileType
|
|||||||
{
|
{
|
||||||
FT_Actor,
|
FT_Actor,
|
||||||
FT_Bitmap,
|
FT_Bitmap,
|
||||||
FT_Sprite,
|
|
||||||
FT_Movie,
|
FT_Movie,
|
||||||
FT_Directory,
|
FT_Directory,
|
||||||
FT_Xml,
|
FT_Xml,
|
||||||
|
|||||||
@@ -111,9 +111,8 @@ bool Sprite::LoadBG( RageTextureID ID )
|
|||||||
bool Sprite::Load( RageTextureID ID )
|
bool Sprite::Load( RageTextureID ID )
|
||||||
{
|
{
|
||||||
bool result;
|
bool result;
|
||||||
if( ID.filename == "" ) result = true;
|
if( ID.filename == "" )
|
||||||
if( ID.filename.Right(7) == ".sprite" )
|
result = true;
|
||||||
result = LoadFromSpriteFile( ID );
|
|
||||||
else
|
else
|
||||||
result = LoadFromTexture( ID );
|
result = LoadFromTexture( ID );
|
||||||
|
|
||||||
@@ -138,7 +137,7 @@ retry:
|
|||||||
GetDirListing( sPath + "*", asElementPaths, false, true );
|
GetDirListing( sPath + "*", asElementPaths, false, true );
|
||||||
if( asElementPaths.size() == 0 )
|
if( asElementPaths.size() == 0 )
|
||||||
{
|
{
|
||||||
CString sMessage = ssprintf( "The sprite file '%s' points to a texture '%s' which doesn't exist.", m_sSpritePath.c_str(), sPath.c_str() );
|
CString sMessage = ssprintf( "A Sprite in '%s' points to a texture '%s' which doesn't exist.", sDir.c_str(), sPath.c_str() );
|
||||||
switch( Dialog::AbortRetryIgnore(sMessage) )
|
switch( Dialog::AbortRetryIgnore(sMessage) )
|
||||||
{
|
{
|
||||||
case Dialog::abort:
|
case Dialog::abort:
|
||||||
@@ -196,37 +195,6 @@ retry:
|
|||||||
Actor::LoadFromNode( sDir, pNode );
|
Actor::LoadFromNode( sDir, pNode );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sprite file has the format:
|
|
||||||
//
|
|
||||||
// [Sprite]
|
|
||||||
// Texture=Textures\Logo.bmp
|
|
||||||
// Frame0000=0
|
|
||||||
// Delay0000=1.0
|
|
||||||
// Frame0001=3
|
|
||||||
// Delay0000=2.0
|
|
||||||
// BaseRotationXDegrees=0
|
|
||||||
// BaseRotationYDegrees=0
|
|
||||||
// BaseRotationZDegrees=0
|
|
||||||
// BaseZoomX=1
|
|
||||||
// BaseZoomY=1
|
|
||||||
// BaseZoomZ=1
|
|
||||||
bool Sprite::LoadFromSpriteFile( RageTextureID ID )
|
|
||||||
{
|
|
||||||
LOG->Trace( ssprintf("Sprite::LoadFromSpriteFile(%s)", ID.filename.c_str()) );
|
|
||||||
|
|
||||||
//Init();
|
|
||||||
m_sSpritePath = ID.filename;
|
|
||||||
|
|
||||||
// read sprite file
|
|
||||||
IniFile ini;
|
|
||||||
if( !ini.ReadFile( m_sSpritePath ) )
|
|
||||||
RageException::Throw( "Error opening Sprite file '%s'.", m_sSpritePath.c_str() );
|
|
||||||
|
|
||||||
LoadFromNode( Dirname(m_sSpritePath), ini.GetChild("Sprite") );
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sprite::UnloadTexture()
|
void Sprite::UnloadTexture()
|
||||||
{
|
{
|
||||||
if( m_pTexture != NULL ) // If there was a previous bitmap...
|
if( m_pTexture != NULL ) // If there was a previous bitmap...
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool LoadFromTexture( RageTextureID ID );
|
virtual bool LoadFromTexture( RageTextureID ID );
|
||||||
virtual bool LoadFromSpriteFile( RageTextureID ID );
|
|
||||||
|
|
||||||
void DrawTexture( const TweenState *state );
|
void DrawTexture( const TweenState *state );
|
||||||
|
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ try_element_again:
|
|||||||
static const char *masks[NUM_ElementCategory][14] = {
|
static const char *masks[NUM_ElementCategory][14] = {
|
||||||
{ "redir", "", "actor", "xml", NULL },
|
{ "redir", "", "actor", "xml", NULL },
|
||||||
{ "redir", "ini", NULL },
|
{ "redir", "ini", NULL },
|
||||||
{ "redir", "xml", "actor", "sprite", "png", "jpg", "bmp", "gif","avi", "mpg", "mpeg", "txt", "", NULL},
|
{ "redir", "xml", "actor", "png", "jpg", "bmp", "gif","avi", "mpg", "mpeg", "txt", "", NULL},
|
||||||
{ "redir", "png", NULL },
|
{ "redir", "png", NULL },
|
||||||
{ "redir", "mp3", "ogg", "wav", NULL },
|
{ "redir", "mp3", "ogg", "wav", NULL },
|
||||||
{ "*", NULL },
|
{ "*", NULL },
|
||||||
|
|||||||
Reference in New Issue
Block a user