Page MenuHomeWildfire Games

Move all path drawing functions to the CinemaManager + Height Indicator
ClosedPublic

Authored by vladislavbelov on Apr 9 2017, 11:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Aug 28, 2:31 AM
Unknown Object (File)
Tue, Aug 27, 6:06 AM
Unknown Object (File)
Sun, Aug 25, 6:47 PM
Unknown Object (File)
May 4 2017, 6:34 PM
Unknown Object (File)
May 3 2017, 3:11 PM
Unknown Object (File)
Apr 27 2017, 1:43 PM
Unknown Object (File)
Apr 26 2017, 7:23 PM
Unknown Object (File)
Apr 22 2017, 10:04 AM
Subscribers

Details

Summary

CCinemaPath should contain only simulation and additional math data, so it shouldn't draw itself. CCinemaManager already handles most of drawing operations.

Also added lines between a spline and a terrain.

Test Plan
  1. Open a map with cinema paths
  2. Toggle checkbox about the path drawing
  3. Check that all is drawn the same

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/721/ for more details.

summary could have mentioned the distptr removal and that the intention is to move the openGL code to the other graphics file so that the remaining code can more easily be moved to the simulation.

Thanks for the patch!

source/graphics/CinemaManager.cpp
116 ↗(On Diff #1167)

Would be great to make those colors more modifyable, moving them to a member variable would improve.

An XML file might be nice, but didn't see a good place where to add them. source/ doesn't have any XML files, public/art/ has no place for color settings.

Also there are other hardcoded CColors which could be placed into the same file.
wraitii made a good suggestion to make it a default.cfg option. We could write a simple ticket for that if we have some time to waste on this or if someone actually wants to modify it. The line width and other hardcoded numbers could go there too.

120 ↗(On Diff #1167)

Continue not return

127 ↗(On Diff #1167)

color argument indeed useful because selected / active paths could be rendered in a different color

138 ↗(On Diff #1167)

"something" is a bit vague. "Implement GLES support" would be better

141 ↗(On Diff #1167)

glEnable(GL_BLEND); was added to enable transparency, good change.

151 ↗(On Diff #1167)

2 spaces IMO

156 ↗(On Diff #1167)

// Render height indicaor lines

197 ↗(On Diff #1167)

Ok, was entirely moved besides the change of the current color. nodesColor -> nodeColor

207 ↗(On Diff #1167)

range based loop

source/graphics/CinemaPath.cpp
101 ↗(On Diff #1167)

(18:33:00) elexis: Vladislav: why no more DistModePtr?
(18:34:04) Vladislav: elexis: because it's only for speed when moving, so if we'll render all path we'd not notice it
(18:37:29) elexis: so it was a bug before (using distptr?)?
(18:40:42) Vladislav: No, it's not the bug, just different aproximation points, you couldn't notice it with big number of smoothenes (>10, I think)

This revision is now accepted and ready to land.Apr 9 2017, 7:05 PM
elexis retitled this revision from Move all paths drawing functions to the CinemaManager to Move all path drawing functions to the CinemaManager + Height Indicator.Apr 9 2017, 7:06 PM
This revision was automatically updated to reflect the committed changes.
source/graphics/CinemaManager.cpp
203 ↗(On Diff #1167)

Perhaps the points could become larger and darker.