Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
315e3f8
Add skip video functionality to SinglePlayerLoadScreen
bobtista Nov 23, 2025
1cc48f2
Add ESC key handler to skip campaign Bink videos
bobtista Nov 23, 2025
8ddcebc
Add skip video functionality to SinglePlayerLoadScreen
bobtista Nov 23, 2025
d81a844
Add ESC key handler to skip campaign Bink videos
bobtista Nov 23, 2025
881a208
feat: Add ESC key support to skip campaign videos
bobtista Nov 24, 2025
40f1e0f
Add virtual functions to LoadScreen base class for video skipping
bobtista Nov 24, 2025
c926884
Simplify skipVideo() to directly call frameGoto() and remove m_skipVi…
bobtista Nov 24, 2025
c7c8812
Replace dynamic_cast with virtual function calls for video skip
bobtista Nov 24, 2025
6ae09b0
Match Generals order: handle load screen video skip after TheDisplay-…
bobtista Nov 24, 2025
79dac14
Make Generals code match GeneralsMD implementation
bobtista Nov 24, 2025
625242e
Make Generals code match GeneralsMD: use pure virtual functions and r…
bobtista Nov 24, 2025
d4f8638
Add missing Keyboard.h include in Generals LoadScreen.cpp
bobtista Nov 24, 2025
3b824a2
Check frameIndex to confirm video playback is active
bobtista Nov 25, 2025
9ef4b5d
Format TheMessageStream check with braces for consistency
bobtista Nov 25, 2025
e9a0780
Store getLoadScreen result to avoid duplicate call
bobtista Nov 25, 2025
7f7537b
Combine TheKeyboard and TheMessageStream conditions
bobtista Nov 25, 2025
de20cd7
Add comment that campaign videos are skippable
bobtista Nov 25, 2025
68143c6
Remove excess blank line in ChallengeLoadScreen
bobtista Nov 25, 2025
bfe0bea
Add GameLogic::skipLoadScreen method to prevent direct LoadScreen access
bobtista Nov 25, 2025
8548221
Combine TheKeyboard and TheMessageStream conditions in GeneralsMD
bobtista Nov 25, 2025
150a8b6
Simplify isVideoPlaying to remove overengineered frameIndex check
bobtista Nov 25, 2025
0c384c9
refactor(video): remove isVideoPlaying() and make skipVideo() return …
bobtista Nov 28, 2025
12ab31b
refactor(video): simplify GameLogic::skipLoadScreen() to use skipVide…
bobtista Nov 28, 2025
905430c
revert: remove accidental whitespace changes from GeneralsMD GameClie…
bobtista Nov 28, 2025
e3b8511
fix: sync GeneralsMD LoadScreen base class and remove accidental Gene…
bobtista Nov 28, 2025
5acba10
fix: add missing skipVideo() implementations to GeneralsMD load scree…
bobtista Nov 28, 2025
884fc9e
Make Generals WindowXlat formatting match GeneralsMD
bobtista Nov 29, 2025
ac01816
Add braces to TheWindowManager conditional in both games
bobtista Nov 29, 2025
4f24f74
Add MessageStream.h include to Generals LoadScreen for consistency
bobtista Nov 29, 2025
f4540cf
Replicate GeneralsMD changes to Generals using patch method
bobtista Nov 29, 2025
45edf94
Remove unused getLoadScreen() const method
bobtista Nov 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Generals/Code/GameEngine/Include/GameClient/LoadScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0;
virtual void skipVideo( void ) = 0;
protected:
void setLoadScreen( GameWindow *g ) { m_loadScreen = g; }
GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen
Expand Down Expand Up @@ -91,6 +93,9 @@ class SinglePlayerLoadScreen : public LoadScreen

virtual void setProgressRange( Int min, Int max );

virtual Bool isVideoPlaying( void ) const;
virtual void skipVideo( void );

private:
GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window
GameWindow *m_percent;
Expand Down Expand Up @@ -138,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
Expand All @@ -163,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
Expand Down Expand Up @@ -191,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
Expand Down Expand Up @@ -231,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
Expand Down
1 change: 1 addition & 0 deletions Generals/Code/GameEngine/Include/GameLogic/GameLogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
23 changes: 23 additions & 0 deletions Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -193,6 +194,19 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void )

}

Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const
{
return m_videoStream != NULL && m_videoBuffer != NULL;
}

void SinglePlayerLoadScreen::skipVideo( void )
{
if ( m_videoStream )
{
m_videoStream->frameGoto(m_videoStream->frameCount() - 1);
}
}

void SinglePlayerLoadScreen::moveWindows( Int frame )
{
enum{
Expand Down Expand Up @@ -492,6 +506,15 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
{
TheGameEngine->serviceWindowsOS();

if( TheKeyboard )
{
TheKeyboard->UPDATE();
TheKeyboard->createStreamMessages();
}

if( TheMessageStream )
TheMessageStream->propagateMessages();

if(!m_videoStream->isFrameReady())
{
Sleep(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -308,6 +310,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 ))
Expand Down
8 changes: 8 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/GameClient/LoadScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -94,6 +96,9 @@ class SinglePlayerLoadScreen : public LoadScreen

virtual void setProgressRange( Int min, Int max );

virtual Bool isVideoPlaying( void ) const;
virtual void skipVideo( void );

private:
GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window
GameWindow *m_percent;
Expand Down Expand Up @@ -144,6 +149,9 @@ class ChallengeLoadScreen : public LoadScreen

virtual void setProgressRange( Int min, Int max );

virtual Bool isVideoPlaying( void ) const;
virtual void skipVideo( void );

private:
GameWindow *m_progressBar; ///< Pointer to the Progress Bar on the window

Expand Down
1 change: 1 addition & 0 deletions GeneralsMD/Code/GameEngine/Include/GameLogic/GameLogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
51 changes: 50 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -85,6 +86,7 @@
#include "GameNetwork/GameSpy/PersistentStorageThread.h"
#include "GameNetwork/NetworkInterface.h"
#include "GameNetwork/RankPointValue.h"
#include "Common/MessageStream.h"

//-----------------------------------------------------------------------------
// DEFINES ////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -214,6 +216,19 @@ SinglePlayerLoadScreen::~SinglePlayerLoadScreen( void )

}

Bool SinglePlayerLoadScreen::isVideoPlaying( void ) const
{
return m_videoStream != NULL && m_videoBuffer != NULL;
}

void SinglePlayerLoadScreen::skipVideo( void )
{
if ( m_videoStream )
{
m_videoStream->frameGoto(m_videoStream->frameCount() - 1);
}
}

void SinglePlayerLoadScreen::moveWindows( Int frame )
{
enum{
Expand Down Expand Up @@ -526,15 +541,24 @@ 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 )
{
TheKeyboard->UPDATE();
TheKeyboard->createStreamMessages();
}

if( TheMessageStream )
TheMessageStream->propagateMessages();

if(!m_videoStream->isFrameReady())
{
Sleep(1);
Expand Down Expand Up @@ -733,6 +757,19 @@ ChallengeLoadScreen::~ChallengeLoadScreen( void )
m_ambientLoopHandle = NULL;
}

Bool ChallengeLoadScreen::isVideoPlaying( void ) const
{
return m_videoStream != NULL && m_videoBuffer != NULL;
}

void ChallengeLoadScreen::skipVideo( void )
{
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
// returns the updated position of the readout
Int updateTeletypeText( Int num_chars, GameWindow* window, UnicodeString full_text, Int current_text_pos )
Expand Down Expand Up @@ -1051,10 +1088,21 @@ 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 )
{
TheKeyboard->UPDATE();
TheKeyboard->createStreamMessages();
}
if ( TheMessageStream )
{
TheMessageStream->propagateMessages();
}

if(!m_videoStream->isFrameReady())
{
Sleep(1);
Expand Down Expand Up @@ -1146,6 +1194,7 @@ void ChallengeLoadScreen::reset( void )
m_progressBar = NULL;
}


void ChallengeLoadScreen::update( Int percent )
{
percent = (percent + FRAME_FUDGE_ADD)/1.3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -326,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 ))
Expand Down
Loading