diff --git a/src/gameplay/DeathMix.h b/src/gameplay/DeathMix.h index 143d47cc..f48f6c05 100644 --- a/src/gameplay/DeathMix.h +++ b/src/gameplay/DeathMix.h @@ -31,6 +31,7 @@ class DeathMix { bool isInitialSong() { return next == 1; } SongChart getNextSongChart(); + u32 getCurrentSongNumber() { return next - 1; } private: const GBFS_FILE* fs; diff --git a/src/scenes/SongScene.cpp b/src/scenes/SongScene.cpp index 3f7c8dd5..5aabe5f9 100644 --- a/src/scenes/SongScene.cpp +++ b/src/scenes/SongScene.cpp @@ -767,6 +767,11 @@ void SongScene::continueDeathMix() { deathMix->points = scores[0]->getPoints(); deathMix->longNotes = scores[0]->getLongNotes(); + scores[0]->getCombo()->setValue(deathMix->getCurrentSongNumber()); + scores[0]->getCombo()->show(); + SPRITE_hide(scores[0]->getFeedback()->get()); + SPRITE_hide(scores[0]->getCombo()->getTitle()->get()); + #ifdef SENV_DEVELOPMENT auto stageBreak = GameState.mods.stageBreak; #endif @@ -778,7 +783,7 @@ void SongScene::continueDeathMix() { engine->transitionIntoScene( new SongScene(engine, fs, songChart.song, songChart.chart, NULL, std::move(deathMix)), - new PixelTransitionEffect()); + new FadeOutPixelTransitionEffect()); } else { auto evaluation = scores[localPlayerId]->evaluate(); auto grade = evaluation->getGrade(); diff --git a/src/utils/FadeOutPixelTransitionEffect.h b/src/utils/FadeOutPixelTransitionEffect.h new file mode 100644 index 00000000..427ed585 --- /dev/null +++ b/src/utils/FadeOutPixelTransitionEffect.h @@ -0,0 +1,37 @@ +#ifndef FADE_OUT_PIXEL_TRANSITION_EFFECT_H +#define FADE_OUT_PIXEL_TRANSITION_EFFECT_H + +#include +#include + +#include "utils/EffectUtils.h" +#include "utils/SceneUtils.h" + +const u32 FINAL_OPACITY = 15; +const u32 FINAL_MOSAIC = 10; + +class FadeOutPixelTransitionEffect : public SceneEffect { + public: + FadeOutPixelTransitionEffect(){}; + + void update() override { + EFFECT_setBlendAlpha(opacity * 3 / 4); + EFFECT_setMosaic(mosaic); + + if (opacity * 3 / 4 < FINAL_OPACITY) + opacity++; + else + mosaic++; + + if (isDone()) + BACKGROUND_enable(false, false, false, false); + } + + bool isDone() override { return mosaic >= FINAL_MOSAIC; } + + private: + u32 opacity = 0; + u32 mosaic = 0; +}; + +#endif // FADE_OUT_PIXEL_TRANSITION_EFFECT_H diff --git a/src/utils/PixelTransitionEffect.h b/src/utils/PixelTransitionEffect.h index 33314bb7..255fcace 100644 --- a/src/utils/PixelTransitionEffect.h +++ b/src/utils/PixelTransitionEffect.h @@ -1,3 +1,6 @@ +#ifndef PIXEL_TRANSITION_EFFECT_H +#define PIXEL_TRANSITION_EFFECT_H + #include #include @@ -12,7 +15,9 @@ class PixelTransitionEffect : public SceneEffect { void update() override { EFFECT_setMosaic(value); + value++; + if (isDone()) BACKGROUND_enable(false, false, false, false); } @@ -22,3 +27,5 @@ class PixelTransitionEffect : public SceneEffect { private: u32 value = 0; }; + +#endif // PIXEL_TRANSITION_EFFECT_H diff --git a/src/utils/SceneUtils.h b/src/utils/SceneUtils.h index f073dcee..4608cd96 100644 --- a/src/utils/SceneUtils.h +++ b/src/utils/SceneUtils.h @@ -7,6 +7,7 @@ #include "BackgroundUtils.h" #include "EffectUtils.h" +#include "FadeOutPixelTransitionEffect.h" #include "PixelTransitionEffect.h" #include "SpriteUtils.h" #include "utils/IOPort.h"