Skip to content

Commit 79dac14

Browse files
committed
Make Generals code match GeneralsMD implementation
1 parent 6ae09b0 commit 79dac14

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Generals/Code/GameEngine/Include/GameClient/LoadScreen.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class LoadScreen
6060
virtual void update( Int percent ); ///< Update the state of the slider bars
6161
virtual void processProgress(Int playerId, Int percentage) = 0;
6262
virtual void setProgressRange( Int min, Int max ) = 0;
63+
virtual Bool isVideoPlaying( void ) const { return FALSE; }
64+
virtual void skipVideo( void ) { }
6365
protected:
6466
void setLoadScreen( GameWindow *g ) { m_loadScreen = g; }
6567
GameWindow *m_loadScreen; ///< The GameWindow that is our loadscreen
@@ -91,8 +93,8 @@ class SinglePlayerLoadScreen : public LoadScreen
9193

9294
virtual void setProgressRange( Int min, Int max );
9395

94-
Bool isVideoPlaying( void ) const;
95-
void skipVideo( void );
96+
virtual Bool isVideoPlaying( void ) const;
97+
virtual void skipVideo( void );
9698

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

Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,16 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage
312312

313313
if(returnCode != WIN_INPUT_USED
314314
&& (key == KEY_ESC)
315-
&& (BitIsSet( state, KEY_STATE_UP ))
316-
&& TheGameLogic
317-
&& TheGameLogic->getLoadScreen() )
315+
&& (BitIsSet( state, KEY_STATE_UP )) )
318316
{
319-
SinglePlayerLoadScreen *singlePlayerLoadScreen = dynamic_cast<SinglePlayerLoadScreen*>(TheGameLogic->getLoadScreen());
320-
if( singlePlayerLoadScreen && singlePlayerLoadScreen->isVideoPlaying() )
317+
if( TheGameLogic && TheGameLogic->getLoadScreen() )
321318
{
322-
singlePlayerLoadScreen->skipVideo();
323-
returnCode = WIN_INPUT_USED;
319+
LoadScreen *loadScreen = TheGameLogic->getLoadScreen();
320+
if( loadScreen->isVideoPlaying() )
321+
{
322+
loadScreen->skipVideo();
323+
returnCode = WIN_INPUT_USED;
324+
}
324325
}
325326
}
326327

0 commit comments

Comments
 (0)