-fixed codedump on game boot/exit if no banner was playing

before
This commit is contained in:
fix94.1 2012-07-03 17:33:24 +00:00
parent 686c3e8726
commit b7e4646985
4 changed files with 9 additions and 15 deletions

View File

@ -29,19 +29,20 @@ distribution.
#include "lz77.h"
#include "ash.h"
AnimatedBanner::AnimatedBanner(u8 *font1, u8 *font2)
AnimatedBanner::AnimatedBanner()
{
first = true;
layout_banner = NULL;
newBanner = NULL;
}
void AnimatedBanner::LoadFont(u8 *font1, u8 *font2)
{
sysFont1 = font1;
sysFont2 = font2;
}
void AnimatedBanner::Clear()
{
if(first)
return;
if(layout_banner)
{
delete layout_banner;
@ -56,9 +57,7 @@ void AnimatedBanner::Clear()
bool AnimatedBanner::LoadBanner(Banner *banner)
{
first = false;
Clear();
u32 banner_bin_size;
const u8 *banner_bin = banner->GetFile((char*)"banner.bin", &banner_bin_size);
if(banner_bin == NULL)

View File

@ -32,7 +32,8 @@ distribution.
class AnimatedBanner
{
public:
AnimatedBanner(u8 *font1, u8 *font2);
AnimatedBanner();
void LoadFont(u8 *font1, u8 *font2);
void Clear();
bool LoadBanner(Banner *banner);
@ -45,7 +46,6 @@ protected:
u8 *newBanner;
u8 *sysFont1;
u8 *sysFont2;
bool first;
};
#endif

View File

@ -55,17 +55,13 @@ BannerWindow::BannerWindow()
{
AnimStep = 20;
gameSelected = 0;
firstRun = true;
gameBanner = new AnimatedBanner;
}
void BannerWindow::ChangeGame(Banner *banner)
{
gameSelected = 0;
if(firstRun)
{
gameBanner = new AnimatedBanner(sysFont1, sysFont2);
firstRun = false;
}
gameBanner->LoadFont(sysFont1, sysFont2);
gameBanner->LoadBanner(banner);
}

View File

@ -64,7 +64,6 @@ class BannerWindow
bool AnimZoomOut;
bool AnimationRunning;
bool oldAnimationRunning;
bool firstRun;
u8 BGAlpha;
u8 BannerAlpha;