remove return value; always true and never checked (texture load errors

are handled with warnings and a dummy texture)
This commit is contained in:
Glenn Maynard
2005-10-11 02:15:27 +00:00
parent a736d97aa2
commit a808a49b65
8 changed files with 20 additions and 26 deletions
+3 -5
View File
@@ -22,12 +22,12 @@ Banner::Banner()
}
/* Ugly: if sIsBanner is false, we're actually loading something other than a banner. */
bool Banner::Load( RageTextureID ID, bool bIsBanner )
void Banner::Load( RageTextureID ID, bool bIsBanner )
{
if( ID.filename == "" )
{
LoadFallback();
return true;
return;
}
if( bIsBanner )
@@ -38,10 +38,8 @@ bool Banner::Load( RageTextureID ID, bool bIsBanner )
TEXTUREMAN->DisableOddDimensionWarning();
TEXTUREMAN->VolatileTexture( ID );
bool ret = Sprite::Load( ID );
Sprite::Load( ID );
TEXTUREMAN->EnableOddDimensionWarning();
return ret;
};
void Banner::Update( float fDeltaTime )
+1 -1
View File
@@ -16,7 +16,7 @@ public:
virtual ~Banner() { }
virtual Actor *Copy() const;
virtual bool Load( RageTextureID ID, bool bIsBanner=true );
virtual void Load( RageTextureID ID, bool bIsBanner=true );
virtual void Update( float fDeltaTime );
+2 -3
View File
@@ -69,11 +69,10 @@ void FadingBanner::DrawPrimitives()
}
}
bool FadingBanner::Load( RageTextureID ID, bool bLowResToHighRes )
void FadingBanner::Load( RageTextureID ID, bool bLowResToHighRes )
{
BeforeChange( bLowResToHighRes );
bool bRet = m_Banner[m_iIndexLatest].Load(ID);
return bRet;
m_Banner[m_iIndexLatest].Load(ID);
}
/* If bLowResToHighRes is true, we're fading from a low-res banner to the
+1 -1
View File
@@ -17,7 +17,7 @@ public:
/* If you previously loaded a cached banner, and are now loading the full-
* resolution banner, set bLowResToHighRes to true. */
bool Load( RageTextureID ID, bool bLowResToHighRes=false );
void Load( RageTextureID ID, bool bLowResToHighRes=false );
void LoadFromSong( const Song* pSong ); // NULL means no song
void LoadAllMusic();
void LoadMode();
+1 -2
View File
@@ -23,7 +23,7 @@ GradeDisplay::GradeDisplay()
SetGrade( PLAYER_1, Grade_NoData );
}
bool GradeDisplay::Load( RageTextureID ID )
void GradeDisplay::Load( RageTextureID ID )
{
ID.bStretch = true;
Sprite::Load( ID );
@@ -38,7 +38,6 @@ bool GradeDisplay::Load( RageTextureID ID )
LOG->Warn( sError );
Dialog::OK( sError );
}
return true;
}
void GradeDisplay::Update( float fDeltaTime )
+1 -1
View File
@@ -12,7 +12,7 @@ class GradeDisplay : public Sprite
{
public:
GradeDisplay();
virtual bool Load( RageTextureID ID );
virtual void Load( RageTextureID ID );
virtual void Update( float fDeltaTime );
+9 -11
View File
@@ -103,17 +103,15 @@ RageTextureID Sprite::SongBannerTexture( RageTextureID ID )
}
/* deprecated */
bool Sprite::LoadBG( RageTextureID ID )
void Sprite::LoadBG( RageTextureID ID )
{
return Load( SongBGTexture(ID) );
Load( SongBGTexture(ID) );
}
bool Sprite::Load( RageTextureID ID )
void Sprite::Load( RageTextureID ID )
{
if( ID.filename.empty() )
return true;
else
return LoadFromTexture( ID );
if( !ID.filename.empty() )
LoadFromTexture( ID );
};
void Sprite::LoadFromNode( const CString& sDir, const XNode* pNode )
@@ -937,19 +935,19 @@ public:
static int Load( T* p, lua_State *L )
{
RageTextureID ID( SArg(1) );
lua_pushboolean( L, p->Load(ID) );
return 1;
p->Load( ID );
return 0;
}
static int LoadBackground( T* p, lua_State *L )
{
RageTextureID ID( SArg(1) );
lua_pushboolean( L, p->Load(Sprite::SongBGTexture(ID)) );
p->Load( Sprite::SongBGTexture(ID) );
return 1;
}
static int LoadBanner( T* p, lua_State *L )
{
RageTextureID ID( SArg(1) );
lua_pushboolean( L, p->Load(Sprite::SongBannerTexture(ID)) );
p->Load( Sprite::SongBannerTexture(ID) );
return 1;
}
+2 -2
View File
@@ -32,8 +32,8 @@ public:
/* Just a convenience function; load an image that'll be used in the
* background. */
virtual bool LoadBG( RageTextureID ID );
virtual bool Load( RageTextureID ID );
virtual void LoadBG( RageTextureID ID );
virtual void Load( RageTextureID ID );
void UnloadTexture();
RageTexture* GetTexture() { return m_pTexture; };