refactor(view): Simplify code to set location for Replay Camera#2353
Merged
xezon merged 2 commits intoFeb 26, 2026
Merged
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Include/GameClient/View.h | Moves setPosition from protected to public, removes virtual from getPosition(Coord3D*), cleans up whitespace, and initializes ViewLocation members with 0.0f instead of 0.0. |
| Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp | Replaces ViewLocation intermediate object with direct calls to setPosition, setAngle, setPitch, setZoom on the tactical view. Adds const qualifiers to local variables. |
| GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp | Same simplification as the Generals variant — replaces ViewLocation with direct camera property setters. Identical change pattern. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[MSG_SET_REPLAY_CAMERA received] --> B{isPlaybackMode &\nuseCameraInReplay &\nobserverMatch?}
B -- No --> Z[Skip]
B -- Yes --> C{isCameraMovementFinished?}
C -- No --> Z
C -- Yes --> D[Extract pos, angle, pitch, zoom from message]
subgraph Before[Before - Using ViewLocation]
D1[Create ViewLocation] --> D2["loc.init(pos, angle, pitch, zoom)"]
D2 --> D3["setLocation(&loc)"]
D3 --> D4["Internally calls setPosition, setAngle, setPitch, setZoom, forceRedraw"]
end
subgraph After[After - Direct Calls]
E1["setPosition(&pos)"] --> E2["setAngle(angle)"]
E2 --> E3["setPitch(pitch)"]
E3 --> E4["setZoom(zoom)"]
end
D --> After
E4 --> F["lockViewUntilFrame(frame + 1)"]
Last reviewed commit: 64f8d56
Author
|
Replicated in Generals without conflicts. |
CookieLandProjects
pushed a commit
to CookieLandProjects/CLP_AI
that referenced
this pull request
Feb 28, 2026
Okladnoj
pushed a commit
to Okladnoj/GeneralsGameCode
that referenced
this pull request
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change simplifies the code to set the location for the Replay Camera.
Note that the Replay Camera currently does not work, which will be fixed soon.
To test the Replay Camera, the following line needs to be commented:
TheTacticalView->lockViewUntilFrame( getFrame() + 1 );TODO