From a808a49b6574c915835d645f2f9e8a4a5c69fcfe Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 11 Oct 2005 02:15:27 +0000 Subject: [PATCH] remove return value; always true and never checked (texture load errors are handled with warnings and a dummy texture) --- stepmania/src/Banner.cpp | 8 +++----- stepmania/src/Banner.h | 2 +- stepmania/src/FadingBanner.cpp | 5 ++--- stepmania/src/FadingBanner.h | 2 +- stepmania/src/GradeDisplay.cpp | 3 +-- stepmania/src/GradeDisplay.h | 2 +- stepmania/src/Sprite.cpp | 20 +++++++++----------- stepmania/src/Sprite.h | 4 ++-- 8 files changed, 20 insertions(+), 26 deletions(-) diff --git a/stepmania/src/Banner.cpp b/stepmania/src/Banner.cpp index c7ce85dedd..dcee65d147 100644 --- a/stepmania/src/Banner.cpp +++ b/stepmania/src/Banner.cpp @@ -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 ) diff --git a/stepmania/src/Banner.h b/stepmania/src/Banner.h index 8f9b52c2ab..4eaf76764d 100644 --- a/stepmania/src/Banner.h +++ b/stepmania/src/Banner.h @@ -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 ); diff --git a/stepmania/src/FadingBanner.cpp b/stepmania/src/FadingBanner.cpp index 6182470f97..cce66c11d8 100644 --- a/stepmania/src/FadingBanner.cpp +++ b/stepmania/src/FadingBanner.cpp @@ -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 diff --git a/stepmania/src/FadingBanner.h b/stepmania/src/FadingBanner.h index 527ab6c971..bf21d1bee5 100644 --- a/stepmania/src/FadingBanner.h +++ b/stepmania/src/FadingBanner.h @@ -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(); diff --git a/stepmania/src/GradeDisplay.cpp b/stepmania/src/GradeDisplay.cpp index 8ac5f75293..8738b3a040 100644 --- a/stepmania/src/GradeDisplay.cpp +++ b/stepmania/src/GradeDisplay.cpp @@ -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 ) diff --git a/stepmania/src/GradeDisplay.h b/stepmania/src/GradeDisplay.h index 45414e2d9c..8ce12b3764 100644 --- a/stepmania/src/GradeDisplay.h +++ b/stepmania/src/GradeDisplay.h @@ -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 ); diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 8e62e438a0..332695105b 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -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; } diff --git a/stepmania/src/Sprite.h b/stepmania/src/Sprite.h index d4c64f31dd..283b9f411f 100644 --- a/stepmania/src/Sprite.h +++ b/stepmania/src/Sprite.h @@ -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; };