Skip to content

Commit d81e743

Browse files
authored
bugfix(movie): Fix Campaign, Challenge, Score movie cancellation or decompression artifacts when tabbing out of the game (#1927)
1 parent 1ee44db commit d81e743

File tree

4 files changed

+15
-37
lines changed

4 files changed

+15
-37
lines changed

Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,9 @@ void PlayMovieAndBlock(AsciiString movieTitle)
633633
return;
634634
}
635635

636+
// TheSuperHackers @bugfix Originally this movie render loop stopped rendering when the game window was inactive.
637+
// This either skipped the movie or caused decompression artifacts. Now the video just keeps playing until it done.
638+
636639
GameWindow *movieWindow = s_blankLayout->getFirstWindow();
637640
TheWritableGlobalData->m_loadScreenRender = TRUE;
638641
while (videoStream->frameIndex() < videoStream->frameCount() - 1)
@@ -645,13 +648,6 @@ void PlayMovieAndBlock(AsciiString movieTitle)
645648
continue;
646649
}
647650

648-
if (!TheGameEngine->isActive())
649-
{ //we are alt-tabbed out, so just increment the frame
650-
videoStream->frameNext();
651-
videoStream->frameDecompress();
652-
continue;
653-
}
654-
655651
videoStream->frameDecompress();
656652
videoStream->frameRender(videoBuffer);
657653
videoStream->frameNext();

Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
483483

484484
if(TheGameLODManager && TheGameLODManager->didMemPass())
485485
{
486+
// TheSuperHackers @bugfix Originally this movie render loop stopped rendering when the game window was inactive.
487+
// This either skipped the movie or caused decompression artifacts. Now the video just keeps playing until it done.
488+
486489
Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD;
487490
Int shiftedPercent = -FRAME_FUDGE_ADD + 1;
488491
while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 )
@@ -495,13 +498,6 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
495498
continue;
496499
}
497500

498-
if (!TheGameEngine->isActive())
499-
{ //we are alt-tabbed out, so just increment the frame
500-
m_videoStream->frameNext();
501-
m_videoStream->frameDecompress();
502-
continue;
503-
}
504-
505501
m_videoStream->frameDecompress();
506502
m_videoStream->frameRender(m_videoBuffer);
507503
moveWindows( m_videoStream->frameIndex());

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,9 @@ void PlayMovieAndBlock(AsciiString movieTitle)
727727
return;
728728
}
729729

730+
// TheSuperHackers @bugfix Originally this movie render loop stopped rendering when the game window was inactive.
731+
// This either skipped the movie or caused decompression artifacts. Now the video just keeps playing until it done.
732+
730733
GameWindow *movieWindow = s_blankLayout->getFirstWindow();
731734
TheWritableGlobalData->m_loadScreenRender = TRUE;
732735
while (videoStream->frameIndex() < videoStream->frameCount() - 1)
@@ -739,13 +742,6 @@ void PlayMovieAndBlock(AsciiString movieTitle)
739742
continue;
740743
}
741744

742-
if (!TheGameEngine->isActive())
743-
{ //we are alt-tabbed out, so just increment the frame
744-
videoStream->frameNext();
745-
videoStream->frameDecompress();
746-
continue;
747-
}
748-
749745
videoStream->frameDecompress();
750746
videoStream->frameRender(videoBuffer);
751747
videoStream->frameNext();

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,9 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
526526

527527
if(TheGameLODManager && TheGameLODManager->didMemPass())
528528
{
529+
// TheSuperHackers @bugfix Originally this movie render loop stopped rendering when the game window was inactive.
530+
// This either skipped the movie or caused decompression artifacts. Now the video just keeps playing until it done.
531+
529532
Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD;
530533
Int shiftedPercent = -FRAME_FUDGE_ADD + 1;
531534
while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 )
@@ -538,15 +541,6 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
538541
continue;
539542
}
540543

541-
if (!TheGameEngine->isActive())
542-
{/* //we are alt-tabbed out, so just increment the frame
543-
m_videoStream->frameNext();
544-
m_videoStream->frameDecompress();*/
545-
546-
//Changing for MissionDisk, just skip to end.
547-
break;
548-
}
549-
550544
m_videoStream->frameDecompress();
551545
m_videoStream->frameRender(m_videoBuffer);
552546

@@ -1046,6 +1040,9 @@ void ChallengeLoadScreen::init( GameInfo *game )
10461040

10471041
if(TheGameLODManager && TheGameLODManager->didMemPass())
10481042
{
1043+
// TheSuperHackers @bugfix Originally this movie render loop stopped rendering when the game window was inactive.
1044+
// This either skipped the movie or caused decompression artifacts. Now the video just keeps playing until it done.
1045+
10491046
Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD;
10501047
Int shiftedPercent = -FRAME_FUDGE_ADD + 1;
10511048
while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 )
@@ -1058,13 +1055,6 @@ void ChallengeLoadScreen::init( GameInfo *game )
10581055
continue;
10591056
}
10601057

1061-
if (!TheGameEngine->isActive())
1062-
{ //we are alt-tabbed out, so just increment the frame
1063-
m_videoStream->frameNext();
1064-
m_videoStream->frameDecompress();
1065-
continue;
1066-
}
1067-
10681058
m_videoStream->frameDecompress();
10691059
m_videoStream->frameRender(m_videoBuffer);
10701060
m_videoStream->frameNext();

0 commit comments

Comments
 (0)