-
Notifications
You must be signed in to change notification settings - Fork 162
refactor(loadscreen): Refactor the single player load screen to use TheDisplay for intro video playback #2273
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
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 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2844,6 +2844,11 @@ void W3DDisplay::drawScaledVideoBuffer( VideoBuffer *buffer, VideoStreamInterfac | |||||||||||||||||||
| drawVideoBuffer( buffer, startX, startY, endX, endY ); | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| void W3DDisplay::drawScaledVideoBuffer() | ||||||||||||||||||||
| { | ||||||||||||||||||||
| drawScaledVideoBuffer(m_videoBuffer, m_videoStream); | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
Comment on lines
+2847
to
+2850
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. Missing null check before dereferencing
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Prompt To Fix With AIThis is a comment left during a code review.
Path: GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
Line: 2847:2850
Comment:
Missing null check before dereferencing `m_videoBuffer` and `m_videoStream`. The original method at line 2813 doesn't check either, but since this is being called from `W3DGameWindow.cpp:398` which already checks `isMoviePlaying()`, it should be safe. However, defensive programming suggests adding a check here as well.
```suggestion
void W3DDisplay::drawScaledVideoBuffer()
{
if (m_videoBuffer && m_videoStream)
drawScaledVideoBuffer(m_videoBuffer, m_videoStream);
}
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||||
|
|
||||||||||||||||||||
| //============================================================================ | ||||||||||||||||||||
| // W3DDisplay::drawVideoBuffer | ||||||||||||||||||||
| //============================================================================ | ||||||||||||||||||||
|
|
@@ -2861,6 +2866,11 @@ void W3DDisplay::drawVideoBuffer( VideoBuffer *buffer, Int startX, Int startY, I | |||||||||||||||||||
|
|
||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| void W3DDisplay::drawVideoBuffer( Int startX, Int startY, Int endX, Int endY ) | ||||||||||||||||||||
| { | ||||||||||||||||||||
| drawVideoBuffer(m_videoBuffer, startX, startY, endX, endY); | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
Comment on lines
+2869
to
+2872
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. Missing null check for
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Prompt To Fix With AIThis is a comment left during a code review.
Path: GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
Line: 2869:2872
Comment:
Missing null check for `m_videoBuffer` before dereferencing. While `isMoviePlaying()` checks both pointers, adding a guard here provides an extra safety layer.
```suggestion
void W3DDisplay::drawVideoBuffer( Int startX, Int startY, Int endX, Int endY )
{
if (m_videoBuffer)
drawVideoBuffer(m_videoBuffer, startX, startY, endX, endY);
}
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||||
|
|
||||||||||||||||||||
| // W3DDisplay::setClipRegion ============================================ | ||||||||||||||||||||
| /** Set the clipping region for images. | ||||||||||||||||||||
| @todo: Make this work for all primitives, not just drawImage. */ | ||||||||||||||||||||
|
|
||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is added in addition to the original drawing functionality as some screens still use the original method, such as the challenge load screen.
The challenge load screen does something more complex with it's video handling and needs looking at seperate from this change.