Permalink
Browse files

Do not try loading missing videos.

Patch by forum member Forgon.
Fixes ticket:4631.
  • Loading branch information...
KJeff01 committed Sep 6, 2017
1 parent 18ec97b commit 81bf12847181ce7ddc7b096f2049e2c8bb949e35
Showing with 38 additions and 23 deletions.
  1. +9 −4 src/frontend.cpp
  2. +29 −19 src/intelmap.cpp
View
@@ -145,6 +145,7 @@ static bool startTitleMenu()
addTextButton(FRONTEND_MULTIPLAYER, FRONTEND_POS3X, FRONTEND_POS3Y, _("Multi Player"), WBUT_TXTCENTRE);
addTextButton(FRONTEND_TUTORIAL, FRONTEND_POS4X, FRONTEND_POS4Y, _("Tutorial"), WBUT_TXTCENTRE);
addTextButton(FRONTEND_OPTIONS, FRONTEND_POS5X, FRONTEND_POS5Y, _("Options"), WBUT_TXTCENTRE);
// check whether video sequences are installed
if (PHYSFS_exists("sequences/devastation.ogg"))
{
addTextButton(FRONTEND_PLAYINTRO, FRONTEND_POS6X, FRONTEND_POS6Y, _("View Intro"), WBUT_TXTCENTRE);
@@ -397,11 +398,15 @@ static void frontEndNewGame(int which)
{
QList<CAMPAIGN_FILE> list = readCampaignFiles();
sstrcpy(aLevelName, list[which].level.toUtf8().constData());
if (!list[which].video.isEmpty())
// show this only when the video sequences are installed
if (PHYSFS_exists("sequences/devastation.ogg"))
{
seq_ClearSeqList();
seq_AddSeqToList(list[which].video.toUtf8().constData(), nullptr, list[which].captions.toUtf8().constData(), false);
seq_StartNextFullScreenVideo();
if (!list[which].video.isEmpty())
{
seq_ClearSeqList();
seq_AddSeqToList(list[which].video.toUtf8().constData(), nullptr, list[which].captions.toUtf8().constData(), false);
seq_StartNextFullScreenVideo();
}
}
if (!list[which].package.isEmpty())
{
View
@@ -368,7 +368,7 @@ static bool intAddMessageForm(bool playCurrent)
return true;
}
/*Add the 3D world view for the particular message (only research nmessages now) */
/*Add the 3D world view for the particular message */
bool intAddMessageView(MESSAGE *psMessage)
{
bool Animate = true;
@@ -476,20 +476,23 @@ bool intAddMessageView(MESSAGE *psMessage)
return false;
}
/*Add the Flic box */
sFormInit = W_FORMINIT();
sFormInit.formID = IDINTMAP_MSGVIEW;
sFormInit.id = IDINTMAP_FLICVIEW;
sFormInit.style = WFORM_PLAIN;
sFormInit.x = INTMAP_FLICX;
sFormInit.y = INTMAP_FLICY;
sFormInit.width = INTMAP_FLICWIDTH;
sFormInit.height = INTMAP_FLICHEIGHT;
sFormInit.pDisplay = intDisplayFLICView;
sFormInit.pUserData = psMessage;
if (!widgAddForm(psWScreen, &sFormInit))
/*Add the Flic box if videos are installed */
if (PHYSFS_exists("sequences/devastation.ogg"))
{
return false;
sFormInit = W_FORMINIT();
sFormInit.formID = IDINTMAP_MSGVIEW;
sFormInit.id = IDINTMAP_FLICVIEW;
sFormInit.style = WFORM_PLAIN;
sFormInit.x = INTMAP_FLICX;
sFormInit.y = INTMAP_FLICY;
sFormInit.width = INTMAP_FLICWIDTH;
sFormInit.height = INTMAP_FLICHEIGHT;
sFormInit.pDisplay = intDisplayFLICView;
sFormInit.pUserData = psMessage;
if (!widgAddForm(psWScreen, &sFormInit))
{
return false;
}
}
/*Add the text box*/
@@ -738,15 +741,18 @@ void intIntelButtonPressed(bool proxMsg, UDWORD id)
if (psMessage->pViewData)
{
// If its a video sequence then play it anyway
// If it's a video sequence then play it anyway
if (psMessage->pViewData->type == VIEW_RPL)
{
if (psMessage->pViewData)
{
intAddMessageView(psMessage);
}
StartMessageSequences(psMessage, true);
// only attempt to show videos if they are installed
if (PHYSFS_exists("sequences/devastation.ogg"))
{
StartMessageSequences(psMessage, true);
}
}
else if (psMessage->pViewData->type == VIEW_RES)
{
@@ -1223,8 +1229,12 @@ void displayImmediateMessage(MESSAGE *psMessage)
This has to be changed to support a script calling a message in the intelligence screen
*/
psCurrentMsg = psMessage;
StartMessageSequences(psMessage, true);
// only attempt to show videos if they are installed
if (PHYSFS_exists("sequences/devastation.ogg"))
{
psCurrentMsg = psMessage;
StartMessageSequences(psMessage, true);
}
// remind the player that the message can be seen again from
// the intelligence screen
addConsoleMessage(_("New Intelligence Report"), CENTRE_JUSTIFY, SYSTEM_MESSAGE);

0 comments on commit 81bf128

Please sign in to comment.