mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Prevent black screen (glitch) when a movie is not found
This commit is contained in:
parent
7f9761e069
commit
b25259df51
@ -180,13 +180,14 @@ ReadConfig ()
|
||||
/**
|
||||
* \brief Main frame update.
|
||||
*/
|
||||
static void
|
||||
static bool
|
||||
UpdateFrame (void)
|
||||
{
|
||||
Rect clip, rcRect;
|
||||
Uint32 phase;
|
||||
Point posMouse;
|
||||
Sint32 i, term, speed;
|
||||
bool display = true;
|
||||
|
||||
posMouse = g_pEvent->GetLastMousePos ();
|
||||
|
||||
@ -259,7 +260,7 @@ UpdateFrame (void)
|
||||
phase == EV_PHASE_H2MOVIE || phase == EV_PHASE_PLAYMOVIE ||
|
||||
phase == EV_PHASE_WINMOVIE)
|
||||
{
|
||||
g_pEvent->MovieToStart (); // start a movie if necessary
|
||||
display = g_pEvent->MovieToStart (); // start a movie if necessary
|
||||
}
|
||||
|
||||
if (phase == EV_PHASE_INSERT)
|
||||
@ -273,6 +274,8 @@ UpdateFrame (void)
|
||||
if (term == 2)
|
||||
g_pEvent->ChangePhase (EV_PHASE_WINMOVIE); // win
|
||||
}
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -387,10 +390,12 @@ HandleEvent (const SDL_Event & event)
|
||||
case EV_UPDATE:
|
||||
if (!g_pEvent->IsMovie ()) // pas de film en cours ?
|
||||
{
|
||||
if (!g_pause)
|
||||
UpdateFrame ();
|
||||
bool display = true;
|
||||
|
||||
if (!g_pEvent->IsMovie ())
|
||||
if (!g_pause)
|
||||
display = UpdateFrame ();
|
||||
|
||||
if (!g_pEvent->IsMovie () && display)
|
||||
g_pPixmap->Display ();
|
||||
}
|
||||
break;
|
||||
|
@ -3454,15 +3454,16 @@ CEvent::TryInsert ()
|
||||
|
||||
// Fait démarrer un film si nécessaire.
|
||||
|
||||
void
|
||||
bool
|
||||
CEvent::MovieToStart ()
|
||||
{
|
||||
bool movie = false;
|
||||
|
||||
if (m_movieToStart[0] != 0) // y a-t-il un film à démarrer ?
|
||||
{
|
||||
HideMouse (true); // cache la souris
|
||||
|
||||
if (StartMovie (m_movieToStart))
|
||||
{
|
||||
movie = true;
|
||||
m_phase = m_phaseAfterMovie; // prochaine phase normale
|
||||
}
|
||||
else
|
||||
@ -3470,6 +3471,8 @@ CEvent::MovieToStart ()
|
||||
|
||||
m_movieToStart[0] = 0;
|
||||
}
|
||||
|
||||
return movie;
|
||||
}
|
||||
|
||||
// Décale le décor.
|
||||
@ -4322,6 +4325,7 @@ CEvent::StartMovie (const std::string & pFilename)
|
||||
if (!m_pMovie->IsExist (pFilename))
|
||||
return false;
|
||||
|
||||
HideMouse (true);
|
||||
m_pSound->StopMusic ();
|
||||
|
||||
if (!m_pMovie->Play (pFilename))
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
Sint32 GetImageWorld ();
|
||||
bool IsHelpHide ();
|
||||
bool ChangePhase (Uint32 phase);
|
||||
void MovieToStart ();
|
||||
bool MovieToStart ();
|
||||
Uint32 GetPhase ();
|
||||
void TryInsert ();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user