Skip to content

Commit 81bf128

Browse files
committedSep 6, 2017
Do not try loading missing videos.
Patch by forum member Forgon. Fixes ticket:4631.
1 parent 18ec97b commit 81bf128

File tree

2 files changed

+38
-23
lines changed

2 files changed

+38
-23
lines changed
 

‎src/frontend.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ static bool startTitleMenu()
145145
addTextButton(FRONTEND_MULTIPLAYER, FRONTEND_POS3X, FRONTEND_POS3Y, _("Multi Player"), WBUT_TXTCENTRE);
146146
addTextButton(FRONTEND_TUTORIAL, FRONTEND_POS4X, FRONTEND_POS4Y, _("Tutorial"), WBUT_TXTCENTRE);
147147
addTextButton(FRONTEND_OPTIONS, FRONTEND_POS5X, FRONTEND_POS5Y, _("Options"), WBUT_TXTCENTRE);
148+
// check whether video sequences are installed
148149
if (PHYSFS_exists("sequences/devastation.ogg"))
149150
{
150151
addTextButton(FRONTEND_PLAYINTRO, FRONTEND_POS6X, FRONTEND_POS6Y, _("View Intro"), WBUT_TXTCENTRE);
@@ -397,11 +398,15 @@ static void frontEndNewGame(int which)
397398
{
398399
QList<CAMPAIGN_FILE> list = readCampaignFiles();
399400
sstrcpy(aLevelName, list[which].level.toUtf8().constData());
400-
if (!list[which].video.isEmpty())
401+
// show this only when the video sequences are installed
402+
if (PHYSFS_exists("sequences/devastation.ogg"))
401403
{
402-
seq_ClearSeqList();
403-
seq_AddSeqToList(list[which].video.toUtf8().constData(), nullptr, list[which].captions.toUtf8().constData(), false);
404-
seq_StartNextFullScreenVideo();
404+
if (!list[which].video.isEmpty())
405+
{
406+
seq_ClearSeqList();
407+
seq_AddSeqToList(list[which].video.toUtf8().constData(), nullptr, list[which].captions.toUtf8().constData(), false);
408+
seq_StartNextFullScreenVideo();
409+
}
405410
}
406411
if (!list[which].package.isEmpty())
407412
{

‎src/intelmap.cpp

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ static bool intAddMessageForm(bool playCurrent)
368368
return true;
369369
}
370370

371-
/*Add the 3D world view for the particular message (only research nmessages now) */
371+
/*Add the 3D world view for the particular message */
372372
bool intAddMessageView(MESSAGE *psMessage)
373373
{
374374
bool Animate = true;
@@ -476,20 +476,23 @@ bool intAddMessageView(MESSAGE *psMessage)
476476
return false;
477477
}
478478

479-
/*Add the Flic box */
480-
sFormInit = W_FORMINIT();
481-
sFormInit.formID = IDINTMAP_MSGVIEW;
482-
sFormInit.id = IDINTMAP_FLICVIEW;
483-
sFormInit.style = WFORM_PLAIN;
484-
sFormInit.x = INTMAP_FLICX;
485-
sFormInit.y = INTMAP_FLICY;
486-
sFormInit.width = INTMAP_FLICWIDTH;
487-
sFormInit.height = INTMAP_FLICHEIGHT;
488-
sFormInit.pDisplay = intDisplayFLICView;
489-
sFormInit.pUserData = psMessage;
490-
if (!widgAddForm(psWScreen, &sFormInit))
479+
/*Add the Flic box if videos are installed */
480+
if (PHYSFS_exists("sequences/devastation.ogg"))
491481
{
492-
return false;
482+
sFormInit = W_FORMINIT();
483+
sFormInit.formID = IDINTMAP_MSGVIEW;
484+
sFormInit.id = IDINTMAP_FLICVIEW;
485+
sFormInit.style = WFORM_PLAIN;
486+
sFormInit.x = INTMAP_FLICX;
487+
sFormInit.y = INTMAP_FLICY;
488+
sFormInit.width = INTMAP_FLICWIDTH;
489+
sFormInit.height = INTMAP_FLICHEIGHT;
490+
sFormInit.pDisplay = intDisplayFLICView;
491+
sFormInit.pUserData = psMessage;
492+
if (!widgAddForm(psWScreen, &sFormInit))
493+
{
494+
return false;
495+
}
493496
}
494497

495498
/*Add the text box*/
@@ -738,15 +741,18 @@ void intIntelButtonPressed(bool proxMsg, UDWORD id)
738741

739742
if (psMessage->pViewData)
740743
{
741-
// If its a video sequence then play it anyway
744+
// If it's a video sequence then play it anyway
742745
if (psMessage->pViewData->type == VIEW_RPL)
743746
{
744747
if (psMessage->pViewData)
745748
{
746749
intAddMessageView(psMessage);
747750
}
748-
749-
StartMessageSequences(psMessage, true);
751+
// only attempt to show videos if they are installed
752+
if (PHYSFS_exists("sequences/devastation.ogg"))
753+
{
754+
StartMessageSequences(psMessage, true);
755+
}
750756
}
751757
else if (psMessage->pViewData->type == VIEW_RES)
752758
{
@@ -1223,8 +1229,12 @@ void displayImmediateMessage(MESSAGE *psMessage)
12231229
This has to be changed to support a script calling a message in the intelligence screen
12241230
*/
12251231

1226-
psCurrentMsg = psMessage;
1227-
StartMessageSequences(psMessage, true);
1232+
// only attempt to show videos if they are installed
1233+
if (PHYSFS_exists("sequences/devastation.ogg"))
1234+
{
1235+
psCurrentMsg = psMessage;
1236+
StartMessageSequences(psMessage, true);
1237+
}
12281238
// remind the player that the message can be seen again from
12291239
// the intelligence screen
12301240
addConsoleMessage(_("New Intelligence Report"), CENTRE_JUSTIFY, SYSTEM_MESSAGE);

0 commit comments

Comments
 (0)