-
Notifications
You must be signed in to change notification settings - Fork 121
feat(video): add ESC key support to skip campaign Bink videos #1900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
315e3f8
1cc48f2
8ddcebc
d81a844
881a208
40f1e0f
c926884
c7c8812
6ae09b0
79dac14
625242e
d4f8638
3b824a2
9ef4b5d
e9a0780
7f7537b
de20cd7
68143c6
bfe0bea
8548221
150a8b6
0c384c9
12ab31b
905430c
e3b8511
5acba10
884fc9e
ac01816
4f24f74
f4540cf
45edf94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
||
xezon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 ) | ||
| { | ||
| TheGameEngine->serviceWindowsOS(); | ||
|
|
||
| if( TheKeyboard && TheMessageStream ) | ||
| { | ||
| TheKeyboard->UPDATE(); | ||
| TheKeyboard->createStreamMessages(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After taking a look at this function, I think this logic can be greatly simplified by cutting the Message middle man and do the key press detection right in this update loop, which then eliminates touching a whole bunch of files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can take over this change because it takes too many revisions to review. |
||
| 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(); | ||
xezon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| TheKeyboard->createStreamMessages(); | ||
| TheMessageStream->propagateMessages(); | ||
| } | ||
|
|
||
| if(!m_videoStream->isFrameReady()) | ||
| { | ||
| Sleep(1); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.