Page MenuHomeWildfire Games

Properly apply the texture to the last quad of an overlay textured line
ClosedPublic

Authored by fatherbushido on Jun 20 2017, 5:15 PM.

Details

Summary

Some units (Mauryan healer hero, healer with range techs) have their heal range circle with missing textures.
In fact when the numbers of subdivision is odd, the last one won't have the texture.
Indeed as the first vertices have (0,0) and (1,0) UVs, when we will close the line, the two last vertices will have (0,1) (1,0) in the even case (and the texture will properly apply to the quad) and (0,0) (1,0) in the odd case (and the texture won't properly apply to the quad).

Test Plan

An ingame test could consist to check the health range of a mauryan healer hero and of healer (before and after techs). You can also play to change the thickness or replace the texture with another (currently the defaults are in Heal component).

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

fatherbushido created this revision.Jun 20 2017, 5:15 PM
elexis rescinded a token.
Vulcan added a subscriber: Vulcan.Jun 20 2017, 6:02 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

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

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/214/ for more details.

vladislavbelov accepted this revision.EditedJun 21 2017, 10:35 PM

I've tested it, it works for me. The patch looks good for me.

P.S. It'd be good to have wire-frame mode for paths in future too. It'd help to debug these cases.

This revision is now accepted and ready to land.Jun 21 2017, 10:35 PM

Thanks for the review.
(We had also the option to enforce having an even number of dots but I don't know if it's a wanted restricition.
In that case we would have to do job in other part of the code and it would add some limitations :/)

source/renderer/TexturedLineRData.cpp
241 ↗(On Diff #2628)

One can also directly use
SVertex vertex1(vertices[0].m_Position, 0, 1);
SVertex vertex2(vertices[1].m_Position, 1, 1);

This revision was automatically updated to reflect the committed changes.