osu-ds/source/Modes/ModeLoader.cpp
KonPet 183228e28e Change stuff to make it build
Removed the arm7 section
Changed the makefile to only use the arm9 stuff
Epicpkmn: Fix source/Graphics/GraphicsManager.cpp

Co-Authored-By: Pk11 <epicpkmn11@outlook.com>
Co-Authored-By: Kaisaan <34224128+Kaisaan@users.noreply.github.com>
2021-10-21 00:03:39 +02:00

54 lines
943 B
C++

#include "Mode.h"
#include "Player.h"
#include "SongSelect.h"
#include "System/GameClock.h"
#include "System/TextManager.h"
void ChangeMode(ModeType mode)
{
//dim screen
if (Mode::sCurrentMode != NULL)
{
for (s32 b = 0; b >= -16; --b)
{
setBrightness(1, b);
swiWaitForVBlank();
}
}
else
{
setBrightness(1, -16);
}
TextManager::Bottom().Clear();
TextManager::Top().Clear();
//must reset clock before calling constructors
//otherwise bad things happen with sprites
GameClock::Clock().Reset();
if (Mode::sCurrentMode != NULL)
delete Mode::sCurrentMode;
switch (mode)
{
case MODE_PLAYER:
Mode::sCurrentMode = new Player();
break;
case MODE_SONGSELECT:
Mode::sCurrentMode = new SongSelect();
break;
}
swiWaitForVBlank();
Mode::CurrentMode().Update();
glFlush(1);
//return screen to full brightness
for (s32 b = -16; b <= 0; ++b)
{
setBrightness(1, b);
swiWaitForVBlank();
}
}