From 315e3f8edbe8647e0e3e0c16ba05209f625595a4 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sun, 23 Nov 2025 12:55:49 -0500 Subject: [PATCH 01/31] Add skip video functionality to SinglePlayerLoadScreen --- .../GameEngine/Include/GameClient/LoadScreen.h | 4 ++++ .../Source/GameClient/GUI/LoadScreen.cpp | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h index f0f2ac53fe..bde66b8762 100644 --- a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -91,6 +91,9 @@ class SinglePlayerLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); + Bool isVideoPlaying( void ) const; + void skipVideo( void ); + private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window GameWindow *m_percent; @@ -109,6 +112,7 @@ class SinglePlayerLoadScreen : public LoadScreen VideoBuffer *m_videoBuffer; VideoStreamInterface *m_videoStream; + Bool m_skipVideo; void moveWindows( Int frame ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 0c453dce3e..2f3bb701d5 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -165,6 +165,7 @@ SinglePlayerLoadScreen::SinglePlayerLoadScreen( void ) m_percent = NULL; m_videoStream = NULL; m_videoBuffer = NULL; + m_skipVideo = FALSE; m_objectiveWin = NULL; for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i) m_objectiveLines[i] = NULL; @@ -193,6 +194,16 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) } +Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const +{ + return m_videoStream != NULL && m_videoBuffer != NULL; +} + +void SinglePlayerLoadScreen::skipVideo( void ) +{ + m_skipVideo = TRUE; +} + void SinglePlayerLoadScreen::moveWindows( Int frame ) { enum{ @@ -490,6 +501,12 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) Int shiftedPercent = -FRAME_FUDGE_ADD + 1; while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 ) { + if ( m_skipVideo ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + break; + } + TheGameEngine->serviceWindowsOS(); if(!m_videoStream->isFrameReady()) @@ -587,6 +604,7 @@ void SinglePlayerLoadScreen::reset( void ) { setLoadScreen(NULL); m_progressBar = NULL; + m_skipVideo = FALSE; } void SinglePlayerLoadScreen::update( Int percent ) From 1cc48f2b81282da8e21678202218f42eaabb7ddc Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sun, 23 Nov 2025 12:55:55 -0500 Subject: [PATCH 02/31] Add ESC key handler to skip campaign Bink videos --- .../GameClient/MessageStream/WindowXlat.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index cd30ff3c2c..495ae0500f 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -54,6 +54,8 @@ #include "GameClient/WindowXlat.h" #include "GameClient/Shell.h" #include "GameClient/Display.h" +#include "GameLogic/GameLogic.h" +#include "GameClient/LoadScreen.h" // DEFINES //////////////////////////////////////////////////////////////////// @@ -308,6 +310,20 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage returnCode = WIN_INPUT_USED; } + if(returnCode != WIN_INPUT_USED + && (key == KEY_ESC) + && (BitIsSet( state, KEY_STATE_UP )) + && TheGameLogic + && TheGameLogic->m_loadScreen ) + { + SinglePlayerLoadScreen *singlePlayerLoadScreen = dynamic_cast(TheGameLogic->m_loadScreen); + if( singlePlayerLoadScreen && singlePlayerLoadScreen->isVideoPlaying() ) + { + singlePlayerLoadScreen->skipVideo(); + returnCode = WIN_INPUT_USED; + } + } + if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) From 8ddcebc81c00d146d99168b9c555dc17edd784c1 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sun, 23 Nov 2025 12:55:59 -0500 Subject: [PATCH 03/31] Add skip video functionality to SinglePlayerLoadScreen --- .../GameEngine/Include/GameClient/LoadScreen.h | 4 ++++ .../Source/GameClient/GUI/LoadScreen.cpp | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h index a70892d2f5..4e25bde494 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -94,6 +94,9 @@ class SinglePlayerLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); + Bool isVideoPlaying( void ) const; + void skipVideo( void ); + private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window GameWindow *m_percent; @@ -112,6 +115,7 @@ class SinglePlayerLoadScreen : public LoadScreen VideoBuffer *m_videoBuffer; VideoStreamInterface *m_videoStream; + Bool m_skipVideo; void moveWindows( Int frame ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 2613bcf697..3aa2161c60 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -186,6 +186,7 @@ SinglePlayerLoadScreen::SinglePlayerLoadScreen( void ) m_percent = NULL; m_videoStream = NULL; m_videoBuffer = NULL; + m_skipVideo = FALSE; m_objectiveWin = NULL; for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i) m_objectiveLines[i] = NULL; @@ -214,6 +215,16 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) } +Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const +{ + return m_videoStream != NULL && m_videoBuffer != NULL; +} + +void SinglePlayerLoadScreen::skipVideo( void ) +{ + m_skipVideo = TRUE; +} + void SinglePlayerLoadScreen::moveWindows( Int frame ) { enum{ @@ -619,6 +630,7 @@ void SinglePlayerLoadScreen::reset( void ) { setLoadScreen(NULL); m_progressBar = NULL; + m_skipVideo = FALSE; } void SinglePlayerLoadScreen::update( Int percent ) @@ -1053,6 +1065,12 @@ void ChallengeLoadScreen::init( GameInfo *game ) Int shiftedPercent = -FRAME_FUDGE_ADD + 1; while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 ) { + if ( m_skipVideo ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + break; + } + TheGameEngine->serviceWindowsOS(); if(!m_videoStream->isFrameReady()) From d81a844468cc44f46515f1dd896d57ed3b5a5fac Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sun, 23 Nov 2025 12:56:07 -0500 Subject: [PATCH 04/31] Add ESC key handler to skip campaign Bink videos --- .../GameClient/MessageStream/WindowXlat.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 29d30e2873..b44e11e5c4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -54,6 +54,8 @@ #include "GameClient/WindowXlat.h" #include "GameClient/Shell.h" #include "GameClient/Display.h" +#include "GameLogic/GameLogic.h" +#include "GameClient/LoadScreen.h" // DEFINES //////////////////////////////////////////////////////////////////// @@ -326,6 +328,20 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage returnCode = WIN_INPUT_USED; } + if(returnCode != WIN_INPUT_USED + && (key == KEY_ESC) + && (BitIsSet( state, KEY_STATE_UP )) + && TheGameLogic + && TheGameLogic->m_loadScreen ) + { + SinglePlayerLoadScreen *singlePlayerLoadScreen = dynamic_cast(TheGameLogic->m_loadScreen); + if( singlePlayerLoadScreen && singlePlayerLoadScreen->isVideoPlaying() ) + { + singlePlayerLoadScreen->skipVideo(); + returnCode = WIN_INPUT_USED; + } + } + if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) From 881a2083ec1076d53a11af120b368d151b0c4c65 Mon Sep 17 00:00:00 2001 From: bobtista Date: Mon, 24 Nov 2025 01:22:26 -0500 Subject: [PATCH 05/31] feat: Add ESC key support to skip campaign videos --- .../GameEngine/Include/GameLogic/GameLogic.h | 1 + .../GameClient/MessageStream/WindowXlat.cpp | 4 +- .../Include/GameClient/LoadScreen.h | 4 ++ .../GameEngine/Include/GameLogic/GameLogic.h | 1 + .../Source/GameClient/GUI/LoadScreen.cpp | 60 ++++++++++++++++++- .../GameClient/MessageStream/WindowXlat.cpp | 43 ++++++++----- 6 files changed, 94 insertions(+), 19 deletions(-) diff --git a/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h b/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h index abfc552b96..d163ecb155 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h +++ b/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h @@ -157,6 +157,7 @@ class GameLogic : public SubsystemInterface, public Snapshot void updateLoadProgress( Int progress ); void deleteLoadScreen( void ); + LoadScreen *getLoadScreen( void ) const { return m_loadScreen; } void setGameLoading( Bool loading ); void setGameMode( GameMode mode ); diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 495ae0500f..567e2f3991 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -314,9 +314,9 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) && TheGameLogic - && TheGameLogic->m_loadScreen ) + && TheGameLogic->getLoadScreen() ) { - SinglePlayerLoadScreen *singlePlayerLoadScreen = dynamic_cast(TheGameLogic->m_loadScreen); + SinglePlayerLoadScreen *singlePlayerLoadScreen = dynamic_cast(TheGameLogic->getLoadScreen()); if( singlePlayerLoadScreen && singlePlayerLoadScreen->isVideoPlaying() ) { singlePlayerLoadScreen->skipVideo(); diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h index 4e25bde494..f19508a198 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -148,11 +148,15 @@ class ChallengeLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); + Bool isVideoPlaying( void ) const; + void skipVideo( void ); + private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window VideoBuffer *m_videoBuffer; VideoStreamInterface *m_videoStream; + Bool m_skipVideo; WindowVideoManager *m_wndVideoManager; diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h index 49bbfffc9a..1959d79936 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h @@ -162,6 +162,7 @@ class GameLogic : public SubsystemInterface, public Snapshot void updateLoadProgress( Int progress ); void deleteLoadScreen( void ); + LoadScreen *getLoadScreen( void ) const { return m_loadScreen; } //Kris: Cut setGameLoading() and replaced with setLoadingMap() and setLoadingSave() -- reason: nomenclature //void setGameLoading( Bool loading ) { m_loadingScene = loading; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 3aa2161c60..618aea8db6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -74,6 +74,7 @@ #include "GameClient/LoadScreen.h" #include "GameClient/MapUtil.h" #include "GameClient/Mouse.h" +#include "GameClient/Keyboard.h" #include "GameClient/Shell.h" #include "GameClient/VideoPlayer.h" #include "GameClient/WindowLayout.h" @@ -85,6 +86,7 @@ #include "GameNetwork/GameSpy/PersistentStorageThread.h" #include "GameNetwork/NetworkInterface.h" #include "GameNetwork/RankPointValue.h" +#include "Common/MessageStream.h" //----------------------------------------------------------------------------- // DEFINES //////////////////////////////////////////////////////////////////// @@ -537,15 +539,39 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) } // else leave the default background screen + m_skipVideo = FALSE; if(TheGameLODManager && TheGameLODManager->didMemPass()) { Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD; Int shiftedPercent = -FRAME_FUDGE_ADD + 1; + while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 ) { TheGameEngine->serviceWindowsOS(); + if( TheKeyboard ) + { + TheKeyboard->UPDATE(); + TheKeyboard->createStreamMessages(); + } + + if ( m_skipVideo ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + break; + } + + // NOTE: This may process stale messages, so we check m_skipVideo again after + if( TheMessageStream ) + TheMessageStream->propagateMessages(); + + if ( m_skipVideo ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + break; + } + if(!m_videoStream->isFrameReady()) { Sleep(1); @@ -658,6 +684,7 @@ ChallengeLoadScreen::ChallengeLoadScreen( void ) m_progressBar = NULL; m_videoStream = NULL; m_videoBuffer = NULL; + m_skipVideo = FALSE; m_bioNameLeft = NULL; m_bioAgeLeft = NULL; @@ -745,6 +772,16 @@ ChallengeLoadScreen::~ChallengeLoadScreen( void ) m_ambientLoopHandle = NULL; } +Bool ChallengeLoadScreen::isVideoPlaying( void ) const +{ + return m_videoStream != NULL && m_videoBuffer != NULL; +} + +void ChallengeLoadScreen::skipVideo( void ) +{ + m_skipVideo = TRUE; +} + // accepts the number of chars to advance, the window we're concerned with, the total text for final display, and the current position of the readout // returns the updated position of the readout Int updateTeletypeText( Int num_chars, GameWindow* window, UnicodeString full_text, Int current_text_pos ) @@ -1059,19 +1096,38 @@ void ChallengeLoadScreen::init( GameInfo *game ) m_wndVideoManager = NEW WindowVideoManager; m_wndVideoManager->init(); + m_skipVideo = FALSE; + if(TheGameLODManager && TheGameLODManager->didMemPass()) { Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD; Int shiftedPercent = -FRAME_FUDGE_ADD + 1; + while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 ) { + TheGameEngine->serviceWindowsOS(); + if ( m_skipVideo ) { m_videoStream->frameGoto(m_videoStream->frameCount() - 1); break; } - TheGameEngine->serviceWindowsOS(); + if ( TheKeyboard ) + { + TheKeyboard->UPDATE(); + TheKeyboard->createStreamMessages(); + } + if ( TheMessageStream ) + { + TheMessageStream->propagateMessages(); + } + + if ( m_skipVideo ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + break; + } if(!m_videoStream->isFrameReady()) { @@ -1162,8 +1218,10 @@ void ChallengeLoadScreen::reset( void ) { setLoadScreen(NULL); m_progressBar = NULL; + m_skipVideo = FALSE; } + void ChallengeLoadScreen::update( Int percent ) { percent = (percent + FRAME_FUDGE_ADD)/1.3; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index b44e11e5c4..4a0b7a7f95 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -312,8 +312,33 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage UnsignedByte key = msg->getArgument( 0 )->integer; UnsignedByte state = msg->getArgument( 1 )->integer; - // process event through window system - if( TheWindowManager ) + Bool videoSkipHandled = FALSE; + if( (key == KEY_ESC) + && (BitIsSet( state, KEY_STATE_UP )) ) + { + if( TheGameLogic && TheGameLogic->getLoadScreen() ) + { + LoadScreen *loadScreen = TheGameLogic->getLoadScreen(); + SinglePlayerLoadScreen *singlePlayerLoadScreen = dynamic_cast(loadScreen); + ChallengeLoadScreen *challengeLoadScreen = dynamic_cast(loadScreen); + + if( singlePlayerLoadScreen ) + { + singlePlayerLoadScreen->skipVideo(); + returnCode = WIN_INPUT_USED; + videoSkipHandled = TRUE; + } + else if( challengeLoadScreen ) + { + challengeLoadScreen->skipVideo(); + returnCode = WIN_INPUT_USED; + videoSkipHandled = TRUE; + } + } + } + + // process event through window system (but skip if we already handled video skip) + if( TheWindowManager && !videoSkipHandled ) returnCode = TheWindowManager->winProcessKey( key, state ); @@ -328,20 +353,6 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage returnCode = WIN_INPUT_USED; } - if(returnCode != WIN_INPUT_USED - && (key == KEY_ESC) - && (BitIsSet( state, KEY_STATE_UP )) - && TheGameLogic - && TheGameLogic->m_loadScreen ) - { - SinglePlayerLoadScreen *singlePlayerLoadScreen = dynamic_cast(TheGameLogic->m_loadScreen); - if( singlePlayerLoadScreen && singlePlayerLoadScreen->isVideoPlaying() ) - { - singlePlayerLoadScreen->skipVideo(); - returnCode = WIN_INPUT_USED; - } - } - if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) From 40f1e0fe41e76811028028c66a6b377f41c3c445 Mon Sep 17 00:00:00 2001 From: bobtista Date: Mon, 24 Nov 2025 11:43:28 -0500 Subject: [PATCH 06/31] Add virtual functions to LoadScreen base class for video skipping --- .../Code/GameEngine/Include/GameClient/LoadScreen.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h index f19508a198..6b119b6595 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -63,6 +63,8 @@ class LoadScreen virtual void update( Int percent ); ///< Update the state of the slider bars virtual void processProgress(Int playerId, Int percentage) = 0; virtual void setProgressRange( Int min, Int max ) = 0; + virtual Bool isVideoPlaying( void ) const { return FALSE; } + virtual void skipVideo( void ) { } protected: void setLoadScreen( GameWindow *g ) { m_loadScreen = g; } GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen @@ -94,8 +96,8 @@ class SinglePlayerLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); - Bool isVideoPlaying( void ) const; - void skipVideo( void ); + virtual Bool isVideoPlaying( void ) const; + virtual void skipVideo( void ); private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window @@ -115,7 +117,6 @@ class SinglePlayerLoadScreen : public LoadScreen VideoBuffer *m_videoBuffer; VideoStreamInterface *m_videoStream; - Bool m_skipVideo; void moveWindows( Int frame ); @@ -148,15 +149,14 @@ class ChallengeLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); - Bool isVideoPlaying( void ) const; - void skipVideo( void ); + virtual Bool isVideoPlaying( void ) const; + virtual void skipVideo( void ); private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window VideoBuffer *m_videoBuffer; VideoStreamInterface *m_videoStream; - Bool m_skipVideo; WindowVideoManager *m_wndVideoManager; From c92688426e4f38fd37a280ad8f183d0675b1de41 Mon Sep 17 00:00:00 2001 From: bobtista Date: Mon, 24 Nov 2025 11:43:46 -0500 Subject: [PATCH 07/31] Simplify skipVideo() to directly call frameGoto() and remove m_skipVideo flag --- .../Source/GameClient/GUI/LoadScreen.cpp | 43 ++++--------------- 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 618aea8db6..8cb48d8a24 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -188,7 +188,6 @@ SinglePlayerLoadScreen::SinglePlayerLoadScreen( void ) m_percent = NULL; m_videoStream = NULL; m_videoBuffer = NULL; - m_skipVideo = FALSE; m_objectiveWin = NULL; for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i) m_objectiveLines[i] = NULL; @@ -224,7 +223,10 @@ Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const void SinglePlayerLoadScreen::skipVideo( void ) { - m_skipVideo = TRUE; + if ( m_videoStream ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + } } void SinglePlayerLoadScreen::moveWindows( Int frame ) @@ -539,8 +541,6 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) } // else leave the default background screen - m_skipVideo = FALSE; - if(TheGameLODManager && TheGameLODManager->didMemPass()) { Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD; @@ -556,22 +556,9 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) TheKeyboard->createStreamMessages(); } - if ( m_skipVideo ) - { - m_videoStream->frameGoto(m_videoStream->frameCount() - 1); - break; - } - - // NOTE: This may process stale messages, so we check m_skipVideo again after if( TheMessageStream ) TheMessageStream->propagateMessages(); - if ( m_skipVideo ) - { - m_videoStream->frameGoto(m_videoStream->frameCount() - 1); - break; - } - if(!m_videoStream->isFrameReady()) { Sleep(1); @@ -656,7 +643,6 @@ void SinglePlayerLoadScreen::reset( void ) { setLoadScreen(NULL); m_progressBar = NULL; - m_skipVideo = FALSE; } void SinglePlayerLoadScreen::update( Int percent ) @@ -684,7 +670,6 @@ ChallengeLoadScreen::ChallengeLoadScreen( void ) m_progressBar = NULL; m_videoStream = NULL; m_videoBuffer = NULL; - m_skipVideo = FALSE; m_bioNameLeft = NULL; m_bioAgeLeft = NULL; @@ -779,7 +764,10 @@ Bool ChallengeLoadScreen::isVideoPlaying( void ) const void ChallengeLoadScreen::skipVideo( void ) { - m_skipVideo = TRUE; + if ( m_videoStream ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + } } // accepts the number of chars to advance, the window we're concerned with, the total text for final display, and the current position of the readout @@ -1096,8 +1084,6 @@ void ChallengeLoadScreen::init( GameInfo *game ) m_wndVideoManager = NEW WindowVideoManager; m_wndVideoManager->init(); - m_skipVideo = FALSE; - if(TheGameLODManager && TheGameLODManager->didMemPass()) { Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD; @@ -1107,12 +1093,6 @@ void ChallengeLoadScreen::init( GameInfo *game ) { TheGameEngine->serviceWindowsOS(); - if ( m_skipVideo ) - { - m_videoStream->frameGoto(m_videoStream->frameCount() - 1); - break; - } - if ( TheKeyboard ) { TheKeyboard->UPDATE(); @@ -1123,12 +1103,6 @@ void ChallengeLoadScreen::init( GameInfo *game ) TheMessageStream->propagateMessages(); } - if ( m_skipVideo ) - { - m_videoStream->frameGoto(m_videoStream->frameCount() - 1); - break; - } - if(!m_videoStream->isFrameReady()) { Sleep(1); @@ -1218,7 +1192,6 @@ void ChallengeLoadScreen::reset( void ) { setLoadScreen(NULL); m_progressBar = NULL; - m_skipVideo = FALSE; } From c7c881299cd19aa7e9c0ae1e664ca651f729fb33 Mon Sep 17 00:00:00 2001 From: bobtista Date: Mon, 24 Nov 2025 11:43:56 -0500 Subject: [PATCH 08/31] Replace dynamic_cast with virtual function calls for video skip --- .../GameClient/MessageStream/WindowXlat.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 4a0b7a7f95..e093d4f0a8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -319,27 +319,19 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage if( TheGameLogic && TheGameLogic->getLoadScreen() ) { LoadScreen *loadScreen = TheGameLogic->getLoadScreen(); - SinglePlayerLoadScreen *singlePlayerLoadScreen = dynamic_cast(loadScreen); - ChallengeLoadScreen *challengeLoadScreen = dynamic_cast(loadScreen); - - if( singlePlayerLoadScreen ) + if( loadScreen->isVideoPlaying() ) { - singlePlayerLoadScreen->skipVideo(); - returnCode = WIN_INPUT_USED; - videoSkipHandled = TRUE; - } - else if( challengeLoadScreen ) - { - challengeLoadScreen->skipVideo(); + loadScreen->skipVideo(); returnCode = WIN_INPUT_USED; videoSkipHandled = TRUE; } } } - // process event through window system (but skip if we already handled video skip) if( TheWindowManager && !videoSkipHandled ) + { returnCode = TheWindowManager->winProcessKey( key, state ); + } // If we're in a movie, we want to be able to escape out of it From 6ae09b02cdcdc06f76639f947713f79e8d3b21c4 Mon Sep 17 00:00:00 2001 From: bobtista Date: Mon, 24 Nov 2025 11:56:06 -0500 Subject: [PATCH 09/31] Match Generals order: handle load screen video skip after TheDisplay->stopMovie --- .../GameClient/MessageStream/WindowXlat.cpp | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index e093d4f0a8..4e5d8f6f48 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -312,26 +312,9 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage UnsignedByte key = msg->getArgument( 0 )->integer; UnsignedByte state = msg->getArgument( 1 )->integer; - Bool videoSkipHandled = FALSE; - if( (key == KEY_ESC) - && (BitIsSet( state, KEY_STATE_UP )) ) - { - if( TheGameLogic && TheGameLogic->getLoadScreen() ) - { - LoadScreen *loadScreen = TheGameLogic->getLoadScreen(); - if( loadScreen->isVideoPlaying() ) - { - loadScreen->skipVideo(); - returnCode = WIN_INPUT_USED; - videoSkipHandled = TRUE; - } - } - } - - if( TheWindowManager && !videoSkipHandled ) - { + // process event through window system + if( TheWindowManager ) returnCode = TheWindowManager->winProcessKey( key, state ); - } // If we're in a movie, we want to be able to escape out of it @@ -345,6 +328,21 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage returnCode = WIN_INPUT_USED; } + if(returnCode != WIN_INPUT_USED + && (key == KEY_ESC) + && (BitIsSet( state, KEY_STATE_UP )) ) + { + if( TheGameLogic && TheGameLogic->getLoadScreen() ) + { + LoadScreen *loadScreen = TheGameLogic->getLoadScreen(); + if( loadScreen->isVideoPlaying() ) + { + loadScreen->skipVideo(); + returnCode = WIN_INPUT_USED; + } + } + } + if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) From 79dac14b76758ba34e530eb4c4ef053912ad53fe Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Mon, 24 Nov 2025 12:12:55 -0500 Subject: [PATCH 10/31] Make Generals code match GeneralsMD implementation --- .../GameEngine/Include/GameClient/LoadScreen.h | 6 ++++-- .../GameClient/MessageStream/WindowXlat.cpp | 15 ++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h index bde66b8762..72a5a35db9 100644 --- a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -60,6 +60,8 @@ class LoadScreen virtual void update( Int percent ); ///< Update the state of the slider bars virtual void processProgress(Int playerId, Int percentage) = 0; virtual void setProgressRange( Int min, Int max ) = 0; + virtual Bool isVideoPlaying( void ) const { return FALSE; } + virtual void skipVideo( void ) { } protected: void setLoadScreen( GameWindow *g ) { m_loadScreen = g; } GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen @@ -91,8 +93,8 @@ class SinglePlayerLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); - Bool isVideoPlaying( void ) const; - void skipVideo( void ); + virtual Bool isVideoPlaying( void ) const; + virtual void skipVideo( void ); private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 567e2f3991..82909b00ee 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -312,15 +312,16 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) - && (BitIsSet( state, KEY_STATE_UP )) - && TheGameLogic - && TheGameLogic->getLoadScreen() ) + && (BitIsSet( state, KEY_STATE_UP )) ) { - SinglePlayerLoadScreen *singlePlayerLoadScreen = dynamic_cast(TheGameLogic->getLoadScreen()); - if( singlePlayerLoadScreen && singlePlayerLoadScreen->isVideoPlaying() ) + if( TheGameLogic && TheGameLogic->getLoadScreen() ) { - singlePlayerLoadScreen->skipVideo(); - returnCode = WIN_INPUT_USED; + LoadScreen *loadScreen = TheGameLogic->getLoadScreen(); + if( loadScreen->isVideoPlaying() ) + { + loadScreen->skipVideo(); + returnCode = WIN_INPUT_USED; + } } } From 625242e8457c4bc436e2a4b9c4e4e4d2d93b874a Mon Sep 17 00:00:00 2001 From: bobtista Date: Mon, 24 Nov 2025 13:15:07 -0500 Subject: [PATCH 11/31] Make Generals code match GeneralsMD: use pure virtual functions and remove m_skipVideo flag --- .../GameEngine/Include/GameClient/LoadScreen.h | 13 ++++++++++--- .../Source/GameClient/GUI/LoadScreen.cpp | 18 +++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h index 72a5a35db9..1619cec51b 100644 --- a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -60,8 +60,8 @@ class LoadScreen virtual void update( Int percent ); ///< Update the state of the slider bars virtual void processProgress(Int playerId, Int percentage) = 0; virtual void setProgressRange( Int min, Int max ) = 0; - virtual Bool isVideoPlaying( void ) const { return FALSE; } - virtual void skipVideo( void ) { } + virtual Bool isVideoPlaying( void ) const = 0; + virtual void skipVideo( void ) = 0; protected: void setLoadScreen( GameWindow *g ) { m_loadScreen = g; } GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen @@ -114,7 +114,6 @@ class SinglePlayerLoadScreen : public LoadScreen VideoBuffer *m_videoBuffer; VideoStreamInterface *m_videoStream; - Bool m_skipVideo; void moveWindows( Int frame ); @@ -144,6 +143,8 @@ class ShellGameLoadScreen : public LoadScreen DEBUG_CRASH(("We Got to a single player load screen throw the Network...")); } virtual void setProgressRange( Int min, Int max ) { } + virtual Bool isVideoPlaying( void ) const { return FALSE; } + virtual void skipVideo( void ) { } private: GameWindow *m_progressBar ; ///< Pointer to the Progress Bar on the window @@ -169,6 +170,8 @@ class MultiPlayerLoadScreen : public LoadScreen virtual void update(Int percent); ///< Update the state of the progress bar void processProgress(Int playerId, Int percentage); virtual void setProgressRange( Int min, Int max ) { } + virtual Bool isVideoPlaying( void ) const { return FALSE; } + virtual void skipVideo( void ) { } private: GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window @@ -197,6 +200,8 @@ class GameSpyLoadScreen : public LoadScreen virtual void update(Int percent); ///< Update the state of the progress bar void processProgress(Int playerId, Int percentage); virtual void setProgressRange( Int min, Int max ) { } + virtual Bool isVideoPlaying( void ) const { return FALSE; } + virtual void skipVideo( void ) { } private: GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window @@ -237,6 +242,8 @@ class MapTransferLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ) { } void processTimeout(Int secondsLeft); void setCurrentFilename(AsciiString filename); + virtual Bool isVideoPlaying( void ) const { return FALSE; } + virtual void skipVideo( void ) { } private: GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 2f3bb701d5..89b157bba6 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -165,7 +165,6 @@ SinglePlayerLoadScreen::SinglePlayerLoadScreen( void ) m_percent = NULL; m_videoStream = NULL; m_videoBuffer = NULL; - m_skipVideo = FALSE; m_objectiveWin = NULL; for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i) m_objectiveLines[i] = NULL; @@ -201,7 +200,10 @@ Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const void SinglePlayerLoadScreen::skipVideo( void ) { - m_skipVideo = TRUE; + if ( m_videoStream ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + } } void SinglePlayerLoadScreen::moveWindows( Int frame ) @@ -501,13 +503,16 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) Int shiftedPercent = -FRAME_FUDGE_ADD + 1; while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 ) { - if ( m_skipVideo ) + TheGameEngine->serviceWindowsOS(); + + if( TheKeyboard ) { - m_videoStream->frameGoto(m_videoStream->frameCount() - 1); - break; + TheKeyboard->UPDATE(); + TheKeyboard->createStreamMessages(); } - TheGameEngine->serviceWindowsOS(); + if( TheMessageStream ) + TheMessageStream->propagateMessages(); if(!m_videoStream->isFrameReady()) { @@ -604,7 +609,6 @@ void SinglePlayerLoadScreen::reset( void ) { setLoadScreen(NULL); m_progressBar = NULL; - m_skipVideo = FALSE; } void SinglePlayerLoadScreen::update( Int percent ) From d4f86384449b73c48e0920ead6c2c296481e01b6 Mon Sep 17 00:00:00 2001 From: bobtista Date: Mon, 24 Nov 2025 13:29:12 -0500 Subject: [PATCH 12/31] Add missing Keyboard.h include in Generals LoadScreen.cpp --- Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 89b157bba6..0c0c82c2b9 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -74,6 +74,7 @@ #include "GameClient/Display.h" #include "GameClient/WindowLayout.h" #include "GameClient/Mouse.h" +#include "GameClient/Keyboard.h" #include "GameClient/VideoPlayer.h" #include "GameClient/MapUtil.h" #include "GameLogic/FPUControl.h" From 3b824a21234e46ba0e812ee6332e9ee32fbb428a Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 25 Nov 2025 10:34:27 -0500 Subject: [PATCH 13/31] Check frameIndex to confirm video playback is active --- .../Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 4 +++- .../Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 0c0c82c2b9..48f081c8c1 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -196,7 +196,9 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const { - return m_videoStream != NULL && m_videoBuffer != NULL; + return m_videoStream != NULL + && m_videoBuffer != NULL + && m_videoStream->frameIndex() < m_videoStream->frameCount() - 1; } void SinglePlayerLoadScreen::skipVideo( void ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 8cb48d8a24..02155ef67a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -218,7 +218,9 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const { - return m_videoStream != NULL && m_videoBuffer != NULL; + return m_videoStream != NULL + && m_videoBuffer != NULL + && m_videoStream->frameIndex() < m_videoStream->frameCount() - 1; } void SinglePlayerLoadScreen::skipVideo( void ) @@ -759,7 +761,9 @@ ChallengeLoadScreen::~ChallengeLoadScreen( void ) Bool ChallengeLoadScreen::isVideoPlaying( void ) const { - return m_videoStream != NULL && m_videoBuffer != NULL; + return m_videoStream != NULL + && m_videoBuffer != NULL + && m_videoStream->frameIndex() < m_videoStream->frameCount() - 1; } void ChallengeLoadScreen::skipVideo( void ) From 9ef4b5de230dcdaa375308ac63224777f80a0241 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 25 Nov 2025 10:35:32 -0500 Subject: [PATCH 14/31] Format TheMessageStream check with braces for consistency --- Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 48f081c8c1..71a918e5ce 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -515,7 +515,9 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) } if( TheMessageStream ) + { TheMessageStream->propagateMessages(); + } if(!m_videoStream->isFrameReady()) { From e9a0780e344bd4c54da300bc0adbbc12df9d594d Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 25 Nov 2025 10:36:13 -0500 Subject: [PATCH 15/31] Store getLoadScreen result to avoid duplicate call --- .../Source/GameClient/MessageStream/WindowXlat.cpp | 7 ++++--- .../Source/GameClient/MessageStream/WindowXlat.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 82909b00ee..736ec1df29 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -296,8 +296,9 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage // process event through window system if( TheWindowManager ) + { returnCode = TheWindowManager->winProcessKey( key, state ); - + } // If we're in a movie, we want to be able to escape out of it if(returnCode != WIN_INPUT_USED @@ -314,10 +315,10 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) ) { - if( TheGameLogic && TheGameLogic->getLoadScreen() ) + if( TheGameLogic ) { LoadScreen *loadScreen = TheGameLogic->getLoadScreen(); - if( loadScreen->isVideoPlaying() ) + if( loadScreen && loadScreen->isVideoPlaying() ) { loadScreen->skipVideo(); returnCode = WIN_INPUT_USED; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 4e5d8f6f48..fd1e3a6c49 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -332,10 +332,10 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) ) { - if( TheGameLogic && TheGameLogic->getLoadScreen() ) + if( TheGameLogic ) { LoadScreen *loadScreen = TheGameLogic->getLoadScreen(); - if( loadScreen->isVideoPlaying() ) + if( loadScreen && loadScreen->isVideoPlaying() ) { loadScreen->skipVideo(); returnCode = WIN_INPUT_USED; From 7f7537b7b832c8defa07b388ca54fc449b435439 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 25 Nov 2025 10:36:41 -0500 Subject: [PATCH 16/31] Combine TheKeyboard and TheMessageStream conditions --- .../Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 71a918e5ce..7694422ddc 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -508,14 +508,10 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) { TheGameEngine->serviceWindowsOS(); - if( TheKeyboard ) + if( TheKeyboard && TheMessageStream ) { TheKeyboard->UPDATE(); TheKeyboard->createStreamMessages(); - } - - if( TheMessageStream ) - { TheMessageStream->propagateMessages(); } From de20cd7bb71807ba59436926817afba5d7bbc257 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 25 Nov 2025 10:37:51 -0500 Subject: [PATCH 17/31] Add comment that campaign videos are skippable --- .../GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp | 1 + .../GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 736ec1df29..98d7fd92e2 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -311,6 +311,7 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage returnCode = WIN_INPUT_USED; } + // TheSuperHackers @feature bobtista 25/11/2025 Campaign Bink videos are now skippable with ESC if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index fd1e3a6c49..c784e57f9d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -328,6 +328,7 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage returnCode = WIN_INPUT_USED; } + // TheSuperHackers @feature bobtista 25/11/2025 Campaign Bink videos are now skippable with ESC if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) ) From 68143c6c1457d0467cc01750736a0b34de1f5f53 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 25 Nov 2025 10:38:21 -0500 Subject: [PATCH 18/31] Remove excess blank line in ChallengeLoadScreen --- GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 02155ef67a..7b72fd6306 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -1198,7 +1198,6 @@ void ChallengeLoadScreen::reset( void ) m_progressBar = NULL; } - void ChallengeLoadScreen::update( Int percent ) { percent = (percent + FRAME_FUDGE_ADD)/1.3; From bfe0bea19b7b73a10e43bb6dd19a98d49e9210b4 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 25 Nov 2025 11:13:50 -0500 Subject: [PATCH 19/31] Add GameLogic::skipLoadScreen method to prevent direct LoadScreen access --- .../Code/GameEngine/Include/GameLogic/GameLogic.h | 1 + .../Source/GameClient/MessageStream/WindowXlat.cpp | 10 ++-------- .../Source/GameLogic/System/GameLogic.cpp | 13 +++++++++++++ .../Code/GameEngine/Include/GameLogic/GameLogic.h | 1 + .../Source/GameClient/MessageStream/WindowXlat.cpp | 10 ++-------- .../Source/GameLogic/System/GameLogic.cpp | 13 +++++++++++++ 6 files changed, 32 insertions(+), 16 deletions(-) diff --git a/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h b/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h index d163ecb155..764a56ef9d 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h +++ b/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h @@ -158,6 +158,7 @@ class GameLogic : public SubsystemInterface, public Snapshot void updateLoadProgress( Int progress ); void deleteLoadScreen( void ); LoadScreen *getLoadScreen( void ) const { return m_loadScreen; } + Bool skipLoadScreen( void ); void setGameLoading( Bool loading ); void setGameMode( GameMode mode ); diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 98d7fd92e2..e64b642ebc 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -55,7 +55,6 @@ #include "GameClient/Shell.h" #include "GameClient/Display.h" #include "GameLogic/GameLogic.h" -#include "GameClient/LoadScreen.h" // DEFINES //////////////////////////////////////////////////////////////////// @@ -316,14 +315,9 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) ) { - if( TheGameLogic ) + if( TheGameLogic && TheGameLogic->skipLoadScreen() ) { - LoadScreen *loadScreen = TheGameLogic->getLoadScreen(); - if( loadScreen && loadScreen->isVideoPlaying() ) - { - loadScreen->skipVideo(); - returnCode = WIN_INPUT_USED; - } + returnCode = WIN_INPUT_USED; } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 44f527814d..8672b39f27 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -980,6 +980,19 @@ void GameLogic::deleteLoadScreen( void ) } +// ------------------------------------------------------------------------------------------------ +/** Skip the load screen video if one is playing */ +// ------------------------------------------------------------------------------------------------ +Bool GameLogic::skipLoadScreen( void ) +{ + if( m_loadScreen && m_loadScreen->isVideoPlaying() ) + { + m_loadScreen->skipVideo(); + return TRUE; + } + return FALSE; +} + void GameLogic::setGameLoading( Bool loading ) { m_loadingScene = loading; diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h index 1959d79936..abce38ef59 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h @@ -163,6 +163,7 @@ class GameLogic : public SubsystemInterface, public Snapshot void updateLoadProgress( Int progress ); void deleteLoadScreen( void ); LoadScreen *getLoadScreen( void ) const { return m_loadScreen; } + Bool skipLoadScreen( void ); //Kris: Cut setGameLoading() and replaced with setLoadingMap() and setLoadingSave() -- reason: nomenclature //void setGameLoading( Bool loading ) { m_loadingScene = loading; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index c784e57f9d..38586ad554 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -55,7 +55,6 @@ #include "GameClient/Shell.h" #include "GameClient/Display.h" #include "GameLogic/GameLogic.h" -#include "GameClient/LoadScreen.h" // DEFINES //////////////////////////////////////////////////////////////////// @@ -333,14 +332,9 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) ) { - if( TheGameLogic ) + if( TheGameLogic && TheGameLogic->skipLoadScreen() ) { - LoadScreen *loadScreen = TheGameLogic->getLoadScreen(); - if( loadScreen && loadScreen->isVideoPlaying() ) - { - loadScreen->skipVideo(); - returnCode = WIN_INPUT_USED; - } + returnCode = WIN_INPUT_USED; } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 1275f07557..5caf72bf96 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -1122,6 +1122,19 @@ void GameLogic::deleteLoadScreen( void ) } +// ------------------------------------------------------------------------------------------------ +/** Skip the load screen video if one is playing */ +// ------------------------------------------------------------------------------------------------ +Bool GameLogic::skipLoadScreen( void ) +{ + if( m_loadScreen && m_loadScreen->isVideoPlaying() ) + { + m_loadScreen->skipVideo(); + return TRUE; + } + return FALSE; +} + // ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------ void GameLogic::updateDisplayBusyState() From 85482215ffe94fa342d3313f1f856fe77b84f810 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 25 Nov 2025 11:21:39 -0500 Subject: [PATCH 20/31] Combine TheKeyboard and TheMessageStream conditions in GeneralsMD --- Generals/Code/GameEngine/Source/GameClient/GameClient.cpp | 1 - .../Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 6 ++---- GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp index aa6b7c0bc9..339d65eb4a 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -568,7 +568,6 @@ void GameClient::update( void ) { TheKeyboard->UPDATE(); TheKeyboard->createStreamMessages(); - } // Update the Eva stuff diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 7b72fd6306..feb2ca4330 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -552,14 +552,12 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) { TheGameEngine->serviceWindowsOS(); - if( TheKeyboard ) + if( TheKeyboard && TheMessageStream ) { TheKeyboard->UPDATE(); TheKeyboard->createStreamMessages(); - } - - if( TheMessageStream ) TheMessageStream->propagateMessages(); + } if(!m_videoStream->isFrameReady()) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index a0de88a9ae..88fcfcaed8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -593,7 +593,6 @@ void GameClient::update( void ) { TheKeyboard->UPDATE(); TheKeyboard->createStreamMessages(); - } // Update the Eva stuff @@ -604,7 +603,6 @@ void GameClient::update( void ) { TheMouse->UPDATE(); TheMouse->createStreamMessages(); - } From 150a8b6b3e1e2428707637c47ce16fc406b6bd92 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 25 Nov 2025 11:37:25 -0500 Subject: [PATCH 21/31] Simplify isVideoPlaying to remove overengineered frameIndex check --- .../Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 4 +--- .../Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 7694422ddc..b2c631c12a 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -196,9 +196,7 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const { - return m_videoStream != NULL - && m_videoBuffer != NULL - && m_videoStream->frameIndex() < m_videoStream->frameCount() - 1; + return m_videoStream != NULL && m_videoBuffer != NULL; } void SinglePlayerLoadScreen::skipVideo( void ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index feb2ca4330..820057776c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -218,9 +218,7 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const { - return m_videoStream != NULL - && m_videoBuffer != NULL - && m_videoStream->frameIndex() < m_videoStream->frameCount() - 1; + return m_videoStream != NULL && m_videoBuffer != NULL; } void SinglePlayerLoadScreen::skipVideo( void ) @@ -759,9 +757,7 @@ ChallengeLoadScreen::~ChallengeLoadScreen( void ) Bool ChallengeLoadScreen::isVideoPlaying( void ) const { - return m_videoStream != NULL - && m_videoBuffer != NULL - && m_videoStream->frameIndex() < m_videoStream->frameCount() - 1; + return m_videoStream != NULL && m_videoBuffer != NULL; } void ChallengeLoadScreen::skipVideo( void ) From 0c384c99269f4371a6b87e5b19d8c7b85ba4efd3 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Fri, 28 Nov 2025 17:30:19 -0500 Subject: [PATCH 22/31] refactor(video): remove isVideoPlaying() and make skipVideo() return Bool --- .../Include/GameClient/LoadScreen.h | 18 +++++---------- .../Source/GameClient/GUI/LoadScreen.cpp | 9 +++----- .../Include/GameClient/LoadScreen.h | 9 +++----- .../Source/GameClient/GUI/LoadScreen.cpp | 23 ++++++------------- 4 files changed, 19 insertions(+), 40 deletions(-) diff --git a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h index 1619cec51b..4b9e61f923 100644 --- a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -60,8 +60,7 @@ class LoadScreen virtual void update( Int percent ); ///< Update the state of the slider bars virtual void processProgress(Int playerId, Int percentage) = 0; virtual void setProgressRange( Int min, Int max ) = 0; - virtual Bool isVideoPlaying( void ) const = 0; - virtual void skipVideo( void ) = 0; + virtual Bool skipVideo( void ) = 0; protected: void setLoadScreen( GameWindow *g ) { m_loadScreen = g; } GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen @@ -93,8 +92,7 @@ class SinglePlayerLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); - virtual Bool isVideoPlaying( void ) const; - virtual void skipVideo( void ); + virtual Bool skipVideo( void ); private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window @@ -143,8 +141,7 @@ class ShellGameLoadScreen : public LoadScreen DEBUG_CRASH(("We Got to a single player load screen throw the Network...")); } virtual void setProgressRange( Int min, Int max ) { } - virtual Bool isVideoPlaying( void ) const { return FALSE; } - virtual void skipVideo( void ) { } + virtual Bool skipVideo( void ) { return FALSE; } private: GameWindow *m_progressBar ; ///< Pointer to the Progress Bar on the window @@ -170,8 +167,7 @@ class MultiPlayerLoadScreen : public LoadScreen virtual void update(Int percent); ///< Update the state of the progress bar void processProgress(Int playerId, Int percentage); virtual void setProgressRange( Int min, Int max ) { } - virtual Bool isVideoPlaying( void ) const { return FALSE; } - virtual void skipVideo( void ) { } + virtual Bool skipVideo( void ) { return FALSE; } private: GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window @@ -200,8 +196,7 @@ class GameSpyLoadScreen : public LoadScreen virtual void update(Int percent); ///< Update the state of the progress bar void processProgress(Int playerId, Int percentage); virtual void setProgressRange( Int min, Int max ) { } - virtual Bool isVideoPlaying( void ) const { return FALSE; } - virtual void skipVideo( void ) { } + virtual Bool skipVideo( void ) { return FALSE; } private: GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window @@ -242,8 +237,7 @@ class MapTransferLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ) { } void processTimeout(Int secondsLeft); void setCurrentFilename(AsciiString filename); - virtual Bool isVideoPlaying( void ) const { return FALSE; } - virtual void skipVideo( void ) { } + virtual Bool skipVideo( void ) { return FALSE; } private: GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index b2c631c12a..d1b74e566e 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -194,17 +194,14 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) } -Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const -{ - return m_videoStream != NULL && m_videoBuffer != NULL; -} - -void SinglePlayerLoadScreen::skipVideo( void ) +Bool SinglePlayerLoadScreen::skipVideo( void ) { if ( m_videoStream ) { m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + return TRUE; } + return FALSE; } void SinglePlayerLoadScreen::moveWindows( Int frame ) diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h index 6b119b6595..dcc52e3460 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -63,8 +63,7 @@ class LoadScreen virtual void update( Int percent ); ///< Update the state of the slider bars virtual void processProgress(Int playerId, Int percentage) = 0; virtual void setProgressRange( Int min, Int max ) = 0; - virtual Bool isVideoPlaying( void ) const { return FALSE; } - virtual void skipVideo( void ) { } + virtual Bool skipVideo( void ) { return FALSE; } protected: void setLoadScreen( GameWindow *g ) { m_loadScreen = g; } GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen @@ -96,8 +95,7 @@ class SinglePlayerLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); - virtual Bool isVideoPlaying( void ) const; - virtual void skipVideo( void ); + virtual Bool skipVideo( void ); private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window @@ -149,8 +147,7 @@ class ChallengeLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); - virtual Bool isVideoPlaying( void ) const; - virtual void skipVideo( void ); + virtual Bool skipVideo( void ); private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 820057776c..e5333f4a4f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -216,17 +216,14 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) } -Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const -{ - return m_videoStream != NULL && m_videoBuffer != NULL; -} - -void SinglePlayerLoadScreen::skipVideo( void ) +Bool SinglePlayerLoadScreen::skipVideo( void ) { if ( m_videoStream ) { m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + return TRUE; } + return FALSE; } void SinglePlayerLoadScreen::moveWindows( Int frame ) @@ -755,17 +752,14 @@ ChallengeLoadScreen::~ChallengeLoadScreen( void ) m_ambientLoopHandle = NULL; } -Bool ChallengeLoadScreen::isVideoPlaying( void ) const -{ - return m_videoStream != NULL && m_videoBuffer != NULL; -} - -void ChallengeLoadScreen::skipVideo( void ) +Bool ChallengeLoadScreen::skipVideo( void ) { if ( m_videoStream ) { m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + return TRUE; } + return FALSE; } // accepts the number of chars to advance, the window we're concerned with, the total text for final display, and the current position of the readout @@ -1091,13 +1085,10 @@ void ChallengeLoadScreen::init( GameInfo *game ) { TheGameEngine->serviceWindowsOS(); - if ( TheKeyboard ) + if( TheKeyboard && TheMessageStream ) { TheKeyboard->UPDATE(); TheKeyboard->createStreamMessages(); - } - if ( TheMessageStream ) - { TheMessageStream->propagateMessages(); } From 12ab31b52f06ebcadca16aae98c8f80b334f7d6b Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Fri, 28 Nov 2025 17:30:29 -0500 Subject: [PATCH 23/31] refactor(video): simplify GameLogic::skipLoadScreen() to use skipVideo() return value --- .../Code/GameEngine/Source/GameLogic/System/GameLogic.cpp | 7 +------ .../Code/GameEngine/Source/GameLogic/System/GameLogic.cpp | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 8672b39f27..55d8e8f34a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -985,12 +985,7 @@ void GameLogic::deleteLoadScreen( void ) // ------------------------------------------------------------------------------------------------ Bool GameLogic::skipLoadScreen( void ) { - if( m_loadScreen && m_loadScreen->isVideoPlaying() ) - { - m_loadScreen->skipVideo(); - return TRUE; - } - return FALSE; + return m_loadScreen && m_loadScreen->skipVideo(); } void GameLogic::setGameLoading( Bool loading ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 5caf72bf96..8ef44fcf63 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -1127,12 +1127,7 @@ void GameLogic::deleteLoadScreen( void ) // ------------------------------------------------------------------------------------------------ Bool GameLogic::skipLoadScreen( void ) { - if( m_loadScreen && m_loadScreen->isVideoPlaying() ) - { - m_loadScreen->skipVideo(); - return TRUE; - } - return FALSE; + return m_loadScreen && m_loadScreen->skipVideo(); } // ------------------------------------------------------------------------------------------------ From 905430c07427d8bc53338d7029fad4d3e286ff9a Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Fri, 28 Nov 2025 17:32:55 -0500 Subject: [PATCH 24/31] revert: remove accidental whitespace changes from GeneralsMD GameClient.cpp --- GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index 88fcfcaed8..a0de88a9ae 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -593,6 +593,7 @@ void GameClient::update( void ) { TheKeyboard->UPDATE(); TheKeyboard->createStreamMessages(); + } // Update the Eva stuff @@ -603,6 +604,7 @@ void GameClient::update( void ) { TheMouse->UPDATE(); TheMouse->createStreamMessages(); + } From e3b8511741f4302a08abe5ebabf889d208d9eb2a Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Fri, 28 Nov 2025 17:38:31 -0500 Subject: [PATCH 25/31] fix: sync GeneralsMD LoadScreen base class and remove accidental Generals GameClient.cpp changes --- Generals/Code/GameEngine/Source/GameClient/GameClient.cpp | 1 + GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp index 339d65eb4a..aa6b7c0bc9 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -568,6 +568,7 @@ void GameClient::update( void ) { TheKeyboard->UPDATE(); TheKeyboard->createStreamMessages(); + } // Update the Eva stuff diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h index dcc52e3460..fb63ae7cd6 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -63,7 +63,7 @@ class LoadScreen virtual void update( Int percent ); ///< Update the state of the slider bars virtual void processProgress(Int playerId, Int percentage) = 0; virtual void setProgressRange( Int min, Int max ) = 0; - virtual Bool skipVideo( void ) { return FALSE; } + virtual Bool skipVideo( void ) = 0; protected: void setLoadScreen( GameWindow *g ) { m_loadScreen = g; } GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen From 5acba10d63d9bc6759cb7be2269e8bfe1a3056eb Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Fri, 28 Nov 2025 17:58:16 -0500 Subject: [PATCH 26/31] fix: add missing skipVideo() implementations to GeneralsMD load screen classes --- GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h index fb63ae7cd6..b0783523e3 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -219,6 +219,7 @@ class ShellGameLoadScreen : public LoadScreen DEBUG_CRASH(("We Got to a single player load screen throw the Network...")); } virtual void setProgressRange( Int min, Int max ) { } + virtual Bool skipVideo( void ) { return FALSE; } private: GameWindow *m_progressBar ; ///< Pointer to the Progress Bar on the window @@ -244,6 +245,7 @@ class MultiPlayerLoadScreen : public LoadScreen virtual void update(Int percent); ///< Update the state of the progress bar void processProgress(Int playerId, Int percentage); virtual void setProgressRange( Int min, Int max ) { } + virtual Bool skipVideo( void ) { return FALSE; } private: GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window @@ -275,6 +277,7 @@ class GameSpyLoadScreen : public LoadScreen virtual void update(Int percent); ///< Update the state of the progress bar void processProgress(Int playerId, Int percentage); virtual void setProgressRange( Int min, Int max ) { } + virtual Bool skipVideo( void ) { return FALSE; } private: GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window @@ -319,6 +322,7 @@ class MapTransferLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ) { } void processTimeout(Int secondsLeft); void setCurrentFilename(AsciiString filename); + virtual Bool skipVideo( void ) { return FALSE; } private: GameWindow *m_progressBars[MAX_SLOTS]; ///< pointer array to all the progress bars on the window GameWindow *m_playerNames[MAX_SLOTS]; ///< pointer array to all the static text player names on the window From 884fc9ecebce5bf8fd569097bb6a88c8a9089cb2 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sat, 29 Nov 2025 08:50:13 -0500 Subject: [PATCH 27/31] Make Generals WindowXlat formatting match GeneralsMD --- .../GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index e64b642ebc..40c53d36f6 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -295,9 +295,8 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage // process event through window system if( TheWindowManager ) - { returnCode = TheWindowManager->winProcessKey( key, state ); - } + // If we're in a movie, we want to be able to escape out of it if(returnCode != WIN_INPUT_USED From ac0181672e1463b68f371277ea1b20342457cffc Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sat, 29 Nov 2025 08:53:34 -0500 Subject: [PATCH 28/31] Add braces to TheWindowManager conditional in both games --- .../GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp | 2 ++ .../GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 40c53d36f6..f1eea29492 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -295,7 +295,9 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage // process event through window system if( TheWindowManager ) + { returnCode = TheWindowManager->winProcessKey( key, state ); + } // If we're in a movie, we want to be able to escape out of it diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 38586ad554..4d888a3b69 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -313,7 +313,9 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage // process event through window system if( TheWindowManager ) + { returnCode = TheWindowManager->winProcessKey( key, state ); + } // If we're in a movie, we want to be able to escape out of it From 4f24f74139a2fec607c75bf9c04dbc978f5293d2 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sat, 29 Nov 2025 09:00:50 -0500 Subject: [PATCH 29/31] Add MessageStream.h include to Generals LoadScreen for consistency --- Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index d1b74e566e..776043394e 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -84,6 +84,7 @@ #include "GameNetwork/GameSpy/PersistentStorageThread.h" #include "GameClient/CampaignManager.h" #include "GameNetwork/RankPointValue.h" +#include "Common/MessageStream.h" #include "GameClient/GameWindowTransitions.h" //----------------------------------------------------------------------------- From f4540cf295c04bce5a15b735a77b07d4af944b67 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sat, 29 Nov 2025 14:15:22 -0500 Subject: [PATCH 30/31] Replicate GeneralsMD changes to Generals using patch method --- Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 776043394e..60bc16f3ea 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -500,6 +500,7 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) { Int progressUpdateCount = m_videoStream->frameCount() / FRAME_FUDGE_ADD; Int shiftedPercent = -FRAME_FUDGE_ADD + 1; + while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 ) { TheGameEngine->serviceWindowsOS(); From 45edf94c38a32735b1fe36879c58e3a6dc7ad0a6 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sat, 29 Nov 2025 15:44:23 -0500 Subject: [PATCH 31/31] Remove unused getLoadScreen() const method --- Generals/Code/GameEngine/Include/GameLogic/GameLogic.h | 1 - GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h | 1 - 2 files changed, 2 deletions(-) diff --git a/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h b/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h index 764a56ef9d..d44f56201f 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h +++ b/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h @@ -157,7 +157,6 @@ class GameLogic : public SubsystemInterface, public Snapshot void updateLoadProgress( Int progress ); void deleteLoadScreen( void ); - LoadScreen *getLoadScreen( void ) const { return m_loadScreen; } Bool skipLoadScreen( void ); void setGameLoading( Bool loading ); diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h index abce38ef59..242956d294 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h @@ -162,7 +162,6 @@ class GameLogic : public SubsystemInterface, public Snapshot void updateLoadProgress( Int progress ); void deleteLoadScreen( void ); - LoadScreen *getLoadScreen( void ) const { return m_loadScreen; } Bool skipLoadScreen( void ); //Kris: Cut setGameLoading() and replaced with setLoadingMap() and setLoadingSave() -- reason: nomenclature