The patch splits the camera and projections, makes the SetProjectionTile function independent from previous calls.
Details
- Reviewers
wraitii - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rP22033: Cleanup Camera code for projections.
- Apply the patch and compile the game
- Run the game with any map
- Take a big screenshot
- Make sure, that it looks the same as before the patch
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/differential/542/display/redirect
source/graphics/Camera.cpp | ||
---|---|---|
67 ↗ | (On Diff #6612) | Well functions have doxygen comments in theory. |
source/graphics/Camera.cpp | ||
---|---|---|
67 ↗ | (On Diff #6612) | But Doxygen comments usually describes an API, not an implementation behind this (but not always). |
Couldn't do big screenshots because the game wouldn't let me (OOM) but this standard screenshots are the same, without or without the patch. Both looks the same. Looks good to me.
source/graphics/Camera.cpp | ||
---|---|---|
47 ↗ | (On Diff #6718) | Didn't know that notation existed, but in this case, do you have to define a destructor at all ? |
source/maths/Matrix3D.cpp | ||
78 ↗ | (On Diff #6718) | I do not know how intensive this multiplication is but you might want to store that in a value and use it for both. |
source/graphics/Camera.cpp | ||
---|---|---|
47 ↗ | (On Diff #6718) | It's not required here, but it may save some compilation time. Because you don't need to change the header to change the destructor behaviour. |
source/maths/Matrix3D.cpp | ||
78 ↗ | (On Diff #6718) | I don't think that it makes sense here. Because it's the simple expression that can be easily optimised by a compiler. If try to optimise, then it'd be written like: const float tiles_f = 1.f / tanf(fov / 2.f) * tiles; SetPerspective(fov, aspect, near, far); _11 = tiles_f / aspect; _22 = tiles_f; _13 = -(1 - tiles + 2 * tile_x); _23 = -(1 - tiles + 2 * tile_y); |
source/maths/Matrix3D.cpp | ||
---|---|---|
78 ↗ | (On Diff #6718) | definitely optimised by the compiler. |