Skip to content

Commit

Permalink
Do not try loading missing videos.
Browse files Browse the repository at this point in the history
Patch by forum member Forgon.
Fixes ticket:4631.
  • Loading branch information
KJeff01 committed Sep 6, 2017
1 parent 18ec97b commit 81bf128
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 23 deletions.
13 changes: 9 additions & 4 deletions src/frontend.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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())
{
Expand Down
48 changes: 29 additions & 19 deletions src/intelmap.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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*/
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 81bf128

Please sign in to comment.