Page MenuHomeWildfire Games

Move LOS to a los helper header and cleanup Grid.h includes
ClosedPublic

Authored by wraitii on Jun 4 2020, 9:37 AM.

Details

Summary

Mostly cosmetic, but should help with incremental compile times:

  • Moves LOS to a los.h helper header.
  • Don't include Grid in Pathfinding.h (which is included everywhere), which means changing Grid.h is faster.

(On top of D2770)

Test Plan

Should be straightforward but I fully expect this to fail in some weird build case :p

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

wraitii created this revision.Jun 4 2020, 9:37 AM
Owners added a subscriber: Restricted Owners Package.Jun 4 2020, 9:37 AM
Vulcan added a comment.Jun 4 2020, 9:39 AM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1779/display/redirect

Vulcan added a comment.Jun 4 2020, 9:47 AM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2310/display/redirect

Stan added a subscriber: Stan.Jun 4 2020, 9:52 AM

Los.h could be CLosQuerier no?
Also headers everywhere ?
Could some headers be forward declared ?

Looks like patch fails to apply on windows for some reason.

source/simulation2/helpers/Pathfinding.cpp
25 ↗(On Diff #12126)

I don't know about the cc, but I remember we usually use prefixes everywhere...

In D2784#118314, @Stan wrote:

Los.h could be CLosQuerier no?

It also includes the LosState enums, and could include more in the future.

Could some headers be forward declared ?

Unlikely, they're included in .cpp files for the most part.

Looks like patch fails to apply on windows for some reason.

Probably because it's in top of D2770

wraitii updated this revision to Diff 12305.Jun 14 2020, 12:46 PM
wraitii edited the test plan for this revision. (Show Details)

Rebased, should run clean this time.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/graphics/TerritoryTexture.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/simulation2/helpers/LongPathfinder.h
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2017"

source/simulation2/helpers/LongPathfinder.h
|  32| ·*·objects·for·equality·comparisons·and·the·VC2010·optimizer·doesn't·seem·to·automatically
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classPathGoal{' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/tests/test_HierPathfinder.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/simulation2/components/tests/test_HierPathfinder.h
|  26| class·TestHierarchicalPathfinder·:·public·CxxTest::TestSuite
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classTestHierarchicalPathfinder:' is invalid C code. Use --std or --language to configure the language.

source/simulation2/helpers/Pathfinding.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/simulation2/helpers/Pathfinding.h
|  32| 
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classPathGoal{' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/ICmpObstructionManager.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/simulation2/components/ICmpObstructionManager.h
|  28| template<typename·T>
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.

source/simulation2/helpers/Los.h
|  33| /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/CCmpProjectileManager.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/simulation2/components/tests/test_Pathfinder.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/simulation2/components/tests/test_Pathfinder.h
|  33| class·TestCmpPathfinder·:·public·CxxTest::TestSuite
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classTestCmpPathfinder:' is invalid C code. Use --std or --language to configure the language.

source/graphics/tests/test_LOSTexture.h
|  26| class·TestLOSTexture·:·public·CxxTest::TestSuite
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classTestLOSTexture:' is invalid C code. Use --std or --language to configure the language.

source/graphics/LOSTexture.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/graphics/LOSTexture.h
|  32| class·CLOSTexture
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCLOSTexture{' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/CCmpRallyPointRenderer.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/simulation2/components/ICmpRangeManager.h
|  90| class·ICmpRangeManager·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpRangeManager:' is invalid C code. Use --std or --language to configure the language.

source/simulation2/helpers/HierarchicalPathfinder.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/graphics/TerritoryBoundary.cpp
|   1| /*·Copyright·(C)·2012·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2012"

source/simulation2/components/CCmpRallyPointRenderer.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/simulation2/components/CCmpRallyPointRenderer.h
|  29| #include·"simulation2/components/ICmpPlayer.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpRallyPointRenderer:' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/CCmpPathfinder_Common.h
|  34| #include·"graphics/Overlay.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.

source/simulation2/helpers/VertexPathfinder.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/simulation2/components/CCmpObstructionManager.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2430/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Jun 14 2020, 10:39 PM
This revision was automatically updated to reflect the committed changes.