diff --git a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h index f0f2ac53fe..4b9e61f923 100644 --- a/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/Generals/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -60,6 +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 skipVideo( void ) = 0; protected: void setLoadScreen( GameWindow *g ) { m_loadScreen = g; } GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen @@ -91,6 +92,8 @@ class SinglePlayerLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); + virtual Bool skipVideo( void ); + private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window GameWindow *m_percent; @@ -138,6 +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 skipVideo( void ) { return FALSE; } private: GameWindow *m_progressBar ; ///< Pointer to the Progress Bar on the window @@ -163,6 +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 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 @@ -191,6 +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 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 @@ -231,6 +237,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 diff --git a/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h b/Generals/Code/GameEngine/Include/GameLogic/GameLogic.h index abfc552b96..d44f56201f 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 ); + Bool skipLoadScreen( void ); void setGameLoading( Bool loading ); void setGameMode( GameMode mode ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 0c453dce3e..60bc16f3ea 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" @@ -83,6 +84,7 @@ #include "GameNetwork/GameSpy/PersistentStorageThread.h" #include "GameClient/CampaignManager.h" #include "GameNetwork/RankPointValue.h" +#include "Common/MessageStream.h" #include "GameClient/GameWindowTransitions.h" //----------------------------------------------------------------------------- @@ -193,6 +195,16 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) } +Bool SinglePlayerLoadScreen::skipVideo( void ) +{ + if ( m_videoStream ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + return TRUE; + } + return FALSE; +} + void SinglePlayerLoadScreen::moveWindows( Int frame ) { enum{ @@ -488,10 +500,18 @@ 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(); + if( TheKeyboard && TheMessageStream ) + { + TheKeyboard->UPDATE(); + TheKeyboard->createStreamMessages(); + TheMessageStream->propagateMessages(); + } + if(!m_videoStream->isFrameReady()) { Sleep(1); diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index cd30ff3c2c..f1eea29492 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -54,6 +54,7 @@ #include "GameClient/WindowXlat.h" #include "GameClient/Shell.h" #include "GameClient/Display.h" +#include "GameLogic/GameLogic.h" // DEFINES //////////////////////////////////////////////////////////////////// @@ -294,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 @@ -308,6 +311,17 @@ 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 )) ) + { + if( TheGameLogic && TheGameLogic->skipLoadScreen() ) + { + returnCode = WIN_INPUT_USED; + } + } + if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 44f527814d..55d8e8f34a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -980,6 +980,14 @@ void GameLogic::deleteLoadScreen( void ) } +// ------------------------------------------------------------------------------------------------ +/** Skip the load screen video if one is playing */ +// ------------------------------------------------------------------------------------------------ +Bool GameLogic::skipLoadScreen( void ) +{ + return m_loadScreen && m_loadScreen->skipVideo(); +} + void GameLogic::setGameLoading( Bool loading ) { m_loadingScene = loading; diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h index a70892d2f5..b0783523e3 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h @@ -63,6 +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 ) = 0; protected: void setLoadScreen( GameWindow *g ) { m_loadScreen = g; } GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen @@ -94,6 +95,8 @@ class SinglePlayerLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); + virtual Bool skipVideo( void ); + private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window GameWindow *m_percent; @@ -144,6 +147,8 @@ class ChallengeLoadScreen : public LoadScreen virtual void setProgressRange( Int min, Int max ); + virtual Bool skipVideo( void ); + private: GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window @@ -214,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 @@ -239,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 @@ -270,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 @@ -314,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 diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h index 49bbfffc9a..242956d294 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 ); + 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/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 2613bcf697..e5333f4a4f 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 //////////////////////////////////////////////////////////////////// @@ -214,6 +216,16 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void ) } +Bool SinglePlayerLoadScreen::skipVideo( void ) +{ + if ( m_videoStream ) + { + m_videoStream->frameGoto(m_videoStream->frameCount() - 1); + return TRUE; + } + return FALSE; +} + void SinglePlayerLoadScreen::moveWindows( Int frame ) { enum{ @@ -526,15 +538,22 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) } // else leave the default background screen - 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 && TheMessageStream ) + { + TheKeyboard->UPDATE(); + TheKeyboard->createStreamMessages(); + TheMessageStream->propagateMessages(); + } + if(!m_videoStream->isFrameReady()) { Sleep(1); @@ -733,6 +752,16 @@ ChallengeLoadScreen::~ChallengeLoadScreen( void ) m_ambientLoopHandle = NULL; } +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 // returns the updated position of the readout Int updateTeletypeText( Int num_chars, GameWindow* window, UnicodeString full_text, Int current_text_pos ) @@ -1051,10 +1080,18 @@ void ChallengeLoadScreen::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(); + if( TheKeyboard && TheMessageStream ) + { + TheKeyboard->UPDATE(); + TheKeyboard->createStreamMessages(); + TheMessageStream->propagateMessages(); + } + if(!m_videoStream->isFrameReady()) { Sleep(1); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 29d30e2873..4d888a3b69 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -54,6 +54,7 @@ #include "GameClient/WindowXlat.h" #include "GameClient/Shell.h" #include "GameClient/Display.h" +#include "GameLogic/GameLogic.h" // DEFINES //////////////////////////////////////////////////////////////////// @@ -312,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 @@ -326,6 +329,17 @@ 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 )) ) + { + if( TheGameLogic && TheGameLogic->skipLoadScreen() ) + { + returnCode = WIN_INPUT_USED; + } + } + if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) && (BitIsSet( state, KEY_STATE_UP )) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 1275f07557..8ef44fcf63 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -1122,6 +1122,14 @@ void GameLogic::deleteLoadScreen( void ) } +// ------------------------------------------------------------------------------------------------ +/** Skip the load screen video if one is playing */ +// ------------------------------------------------------------------------------------------------ +Bool GameLogic::skipLoadScreen( void ) +{ + return m_loadScreen && m_loadScreen->skipVideo(); +} + // ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------ void GameLogic::updateDisplayBusyState()