mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-01 14:24:02 +00:00
Make it possible to override dialog fade out.
Useful to show multiple osk dialogs. Not sure if any game actually uses this feature...
This commit is contained in:
parent
bdf94a8909
commit
e30e8937c1
@ -101,30 +101,28 @@ void PSPDialog::StartFade(bool fadeIn_)
|
||||
fadeIn = fadeIn_;
|
||||
}
|
||||
|
||||
void PSPDialog::UpdateFade(int animSpeed)
|
||||
{
|
||||
if (isFading)
|
||||
{
|
||||
void PSPDialog::UpdateFade(int animSpeed) {
|
||||
if (isFading) {
|
||||
fadeTimer += 1.0f/30.0f * animSpeed; // Probably need a more real value of delta time
|
||||
if (fadeTimer < FADE_TIME)
|
||||
{
|
||||
if (fadeTimer < FADE_TIME) {
|
||||
if (fadeIn)
|
||||
fadeValue = (u32) (fadeTimer / FADE_TIME * 255);
|
||||
else
|
||||
fadeValue = 255 - (u32) (fadeTimer / FADE_TIME * 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
fadeValue = (fadeIn ? 255 : 0);
|
||||
isFading = false;
|
||||
if (!fadeIn)
|
||||
{
|
||||
ChangeStatus(SCE_UTILITY_STATUS_FINISHED, 0);
|
||||
if (!fadeIn) {
|
||||
FinishFadeOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PSPDialog::FinishFadeOut() {
|
||||
ChangeStatus(SCE_UTILITY_STATUS_FINISHED, 0);
|
||||
}
|
||||
|
||||
u32 PSPDialog::CalcFadedColor(u32 inColor)
|
||||
{
|
||||
u32 alpha = inColor >> 24;
|
||||
|
@ -94,6 +94,7 @@ protected:
|
||||
|
||||
void StartFade(bool fadeIn_);
|
||||
void UpdateFade(int animSpeed);
|
||||
virtual void FinishFadeOut();
|
||||
u32 CalcFadedColor(u32 inColor);
|
||||
|
||||
DialogStatus status;
|
||||
|
Loading…
x
Reference in New Issue
Block a user