Skip to content

Commit d629c3f

Browse files
committed
bugfix(movie): Fix Campaign, Challenge, Score movie stop or decompression artifacts when tabbing out of the game
1 parent fe4a589 commit d629c3f

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
@@ -634,6 +634,9 @@ void PlayMovieAndBlock(AsciiString movieTitle)
634634
return;
635635
}
636636

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

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

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

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

487487
if(TheGameLODManager && TheGameLODManager->didMemPass())
488488
{
489+
// TheSuperHackers @bugfix Originally this movie render loop stopped rendering when the game window was inactive.
490+
// This either skipped the movie or caused decompression artifacts. Now the video just keeps playing until it done.
491+
489492
Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD;
490493
Int shiftedPercent = -FRAME_FUDGE_ADD + 1;
491494
while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 )
@@ -498,13 +501,6 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
498501
continue;
499502
}
500503

501-
if (!TheGameEngine->isActive())
502-
{ //we are alt-tabbed out, so just increment the frame
503-
m_videoStream->frameNext();
504-
m_videoStream->frameDecompress();
505-
continue;
506-
}
507-
508504
m_videoStream->frameDecompress();
509505
m_videoStream->frameRender(m_videoBuffer);
510506
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
@@ -529,6 +529,9 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
529529

530530
if(TheGameLODManager && TheGameLODManager->didMemPass())
531531
{
532+
// TheSuperHackers @bugfix Originally this movie render loop stopped rendering when the game window was inactive.
533+
// This either skipped the movie or caused decompression artifacts. Now the video just keeps playing until it done.
534+
532535
Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD;
533536
Int shiftedPercent = -FRAME_FUDGE_ADD + 1;
534537
while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 )
@@ -541,15 +544,6 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
541544
continue;
542545
}
543546

544-
if (!TheGameEngine->isActive())
545-
{/* //we are alt-tabbed out, so just increment the frame
546-
m_videoStream->frameNext();
547-
m_videoStream->frameDecompress();*/
548-
549-
//Changing for MissionDisk, just skip to end.
550-
break;
551-
}
552-
553547
m_videoStream->frameDecompress();
554548
m_videoStream->frameRender(m_videoBuffer);
555549

@@ -1049,6 +1043,9 @@ void ChallengeLoadScreen::init( GameInfo *game )
10491043

10501044
if(TheGameLODManager && TheGameLODManager->didMemPass())
10511045
{
1046+
// TheSuperHackers @bugfix Originally this movie render loop stopped rendering when the game window was inactive.
1047+
// This either skipped the movie or caused decompression artifacts. Now the video just keeps playing until it done.
1048+
10521049
Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD;
10531050
Int shiftedPercent = -FRAME_FUDGE_ADD + 1;
10541051
while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 )
@@ -1061,13 +1058,6 @@ void ChallengeLoadScreen::init( GameInfo *game )
10611058
continue;
10621059
}
10631060

1064-
if (!TheGameEngine->isActive())
1065-
{ //we are alt-tabbed out, so just increment the frame
1066-
m_videoStream->frameNext();
1067-
m_videoStream->frameDecompress();
1068-
continue;
1069-
}
1070-
10711061
m_videoStream->frameDecompress();
10721062
m_videoStream->frameRender(m_videoBuffer);
10731063
m_videoStream->frameNext();

0 commit comments

Comments
 (0)