[intro] add fading, refactor abort, align intro gfx

This commit is contained in:
sbird 2023-02-15 01:06:24 +01:00 committed by Philipp AUER
parent e4045a7a5f
commit fea54c9277
3 changed files with 24 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,6 +1,5 @@
#include "global.h" #include "global.h"
#include "bg.h" #include "bg.h"
#include "clear_save_data_menu.h"
#include "decompress.h" #include "decompress.h"
#include "palette.h" #include "palette.h"
#include "sound.h" #include "sound.h"
@ -10,6 +9,7 @@
#include "trig.h" #include "trig.h"
#include "main.h" #include "main.h"
#include "intro.h" #include "intro.h"
#include "m4a.h"
#include "expansion_intro.h" #include "expansion_intro.h"
#include "constants/rgb.h" #include "constants/rgb.h"
#include "constants/songs.h" #include "constants/songs.h"
@ -253,17 +253,34 @@ void Task_HandleExpansionIntro(u8 taskId)
tState++; tState++;
break; break;
case 2: case 2:
if (tFrameCounter == 208 || gMain.newKeys != 0) if (tFrameCounter == 208)
{
tState++; tState++;
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
}
else if (gMain.newKeys != 0)
{
CpuFill16(0, gPlttBufferFaded, sizeof(gPlttBufferFaded));
if (IsCryPlaying())
StopCry();
m4aSongNumStop(SE_BIKE_HOP);
m4aSongNumStop(SE_M_DOUBLE_SLAP);
tState++;
}
else else
{
tFrameCounter++; tFrameCounter++;
}
break; break;
case 3: case 3:
ResetSpriteData(); if (!gPaletteFade.active)
FreeAllSpritePalettes(); {
DestroyTask(taskId); ResetSpriteData();
CreateTask(Task_Scene1_Load, 0); FreeAllSpritePalettes();
SetMainCallback2(MainCB2_Intro); DestroyTask(taskId);
CreateTask(Task_Scene1_Load, 0);
SetMainCallback2(MainCB2_Intro);
}
break; break;
} }
} }