Page MenuHomeWildfire Games

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

Authored by vladislavbelov on Apr 9 2017, 11:58 AM.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vladislavbelov created this revision.Apr 9 2017, 11:58 AM
Vulcan added a subscriber: Vulcan.Apr 9 2017, 11:59 AM

Build has FAILED

Link to build: http://jw:8080/job/phabricator/720/
See console output for more information: http://jw:8080/job/phabricator/720/console

vladislavbelov edited the summary of this revision. (Show Details)Apr 9 2017, 12:00 PM
vladislavbelov edited the test plan for this revision. (Show Details)Apr 9 2017, 12:12 PM

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.

elexis accepted this revision.Apr 9 2017, 7:05 PM

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.
elexis added inline comments.Apr 9 2017, 7:23 PM
source/graphics/CinemaManager.cpp
203 ↗(On Diff #1167)

Perhaps the points could become larger and darker.