Speed up edge update by being clever, only updating dirty tiles instead
of everything (effectively doing to "TODO be clever" here).
This is a substantial speed improvement when an update is necessary.
Differential Revision: https://code.wildfiregames.com/D1834
This was SVN commit r22279.
Following 809f297707, this decouples the hierarchical pathfinder and the
long pathfinder. The long pathfinder was the class owning the
hierarchical pathfinder, which didn't particularly make sense and
resulted in some interface awkwardness.
At the moment, the long pathfinder still needs to hierarchical
pathfinder to compute paths (to make sure they are reachable).
Differential Revision: https://code.wildfiregames.com/D1867
This was SVN commit r22278.
This:
- cleans up a code duplication and clarifies the intent.
- reorders things around for clarity
- improves variable names.
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D1840
This was SVN commit r22277.
The vertex pathfinder was implemented directly in CCmpPathfinder,
instead of being a separate helper like the hierarchical pathfinder or
the long pathfinder.
This moves it to its own helper VertexPathfinder, which gets us ready
for D14 and pathfinder threading. Some struct definitions need to be
moved around.
Differential Revision: https://code.wildfiregames.com/D1855
This was SVN commit r22253.
Because of the limited precision of our fixed-point numbers, the
timeLeft calculation could sometimes return results above the actual
time left, resulting in units moving a few fixed::epsilons farther than
they should be, which makes them switch to the running animation. This
was rather unstable however, so there was a constant 'flickering'
between walking and running.
If we divide last instead of first in the operation, the errors get
gobbled up by the division and we no longer have this issue.
Reported by: wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D1856
This was SVN commit r22249.
Motive behind the change: calls to Profile() currently crash unless they
are triggered from the main thread, but it's somewhat difficult to know
that from the code. It makes more sense to silently ignore those
particularly so we can easily have the same code be threaded or not.
This also removes a few profiling calls that don't make much sense.
Differential Revision: https://code.wildfiregames.com/D1853
This was SVN commit r22248.
Debug variables are kept mutable as one otherwise has to use a complex
system and this is really not worth it.
Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1491
This was SVN commit r22219.
FindPassableRegions intends to return all passable regions in a chunk,
but did not as it used the number of regions in that chunk. In fact,
regions can have individual IDs higher than the number of regions (as
shown by the test), therefore FindPassableRegions might miss some.
This only affected the JPS pathfinder, when starting on an impassable
cell, which called FindNearestPassableNavcell with then possibly
returned a sub-optimal navcell. This is a limited impact but upcoming
patches will rely on that function more.
Fixed using a vector to store IDs, which also makes for-range loops
usable.
Differential Revision: https://code.wildfiregames.com/D1832
This was SVN commit r22218.
Includes some style normalization.
Refs 60cfd2d16c.
Patch By: Stan
Reviewed By: vladislavbelov, Itms
Differential Revision: https://code.wildfiregames.com/D1845
This was SVN commit r22216.
Use at() over find() as it makes the code neater and the performance
impact is negligible.
This forces an algorithm change in FindReachableRegions as the key
accessed is not guaranteed to exist.
Differential Revision: https://code.wildfiregames.com/D1830
This was SVN commit r22210.
These variously test some simple MakeGoalReachable and
FindNearestNavcell calls, as well as checking edges and regions when
updating the map.
Differential Revision: https://code.wildfiregames.com/D1833
This was SVN commit r22205.
This changes running speed into a running multiplier (of walk speed).
The advantage is that it simplifies code since you can setup a default
run multiplier at the template level and it'll work for all subsequent
templates, and technologies cannot forget to change it. It makes
specialised unit templates easier to maintain, too.
Formations have a 100 run multiplier which effectively sets their
maximal walking speed at 100
Reviewed By: bb, O2 JS Simulation
Differential Revision: https://code.wildfiregames.com/D438
This was SVN commit r22197.
This generally makes this code cleaner and easier to maintain, while
also being more modern and fully tested.
Looked at by: leper
Differential Revision: https://code.wildfiregames.com/D8
This was SVN commit r22029.
This allows using arbitrary 'mul' values with Integer types, instead of
having to switch them to Decimal types.
The ParamNode is not aware of validation (thus types) so a better
solution is incredibly non-trivial.
Differential Revision: https://code.wildfiregames.com/D268
This was SVN commit r22003.
Use an enum to indicate the type of engine shutdown instead of three
bools.
State in the comments that the program is restarted within the same
process.
In preparation of introducing an IsQuitRequested function (which shall
not be named is_quit_requested as stressed by Vladislav):
Rename kill_mainloop to QuitEngine, restart_mainloop to RestartEngine,
restart_mainloop_in_atlas to StartAtlas to not break consistency.
Don't rename RestartInAtlas in JS just now.
Group declarations at the top of main.cpp.
This was SVN commit r21817.
JSInterface_L10n.cpp from d6db5a466d,
JSInterface_Renderer.cpp and JSInterface_GUITypes.cpp from 4b1297b328,
JSInterface_VisualReplay.cpp from b830233498,
JSInterface_Game.cpp from 5f8be8e0c6,
JSInterface_Simulation.cpp from 921c5515a6,
JSInterface_Debug.cpp from d6cb9c845b,
JSInterface_Main.cpp from 486aec18d4, refs #4772,
JSInterface_Mod.cpp where it was incorrectly removed in af03c72f76.
Refs D1470.
Sort includes alphabetically, add recent Coding Convention macro
comments.
This was SVN commit r21789.
Clean the code by removing the animal hardcoding in the Foundation
component and adding a flag DeleteUponConstruction to the Obstruction
component.
Have locked gates and upgraded entities equally delete entities when
transforming.
Add a workaround for trees inside walls on random maps.
Reviewed by: temple
Differential Revision: https://code.wildfiregames.com/D1415
Refs #4268
This was SVN commit r21624.
so that units don't try to gather forever while not being able to reach
it and
so that the sheep corpse can't be selected and seen anymore.
Differential Revision: https://code.wildfiregames.com/D21Fixes#4268
Based On Patch By: wraitii
Reviewed By: temple
Previously Reviewed By: Itms
This was SVN commit r21597.
This currently disabled by variants, and will be reenabled when sounds
have been chosen.
Reviewed by: Vladislav,
Comments by: Itms, elexis
Differential Revision: https://code.wildfiregames.com/1257
This was SVN commit r21359.
Add a button to toggle between normal and "diplomacy" colors.
Reviewed by: elexis
Comments by: leper, ffffffff, Stan
Fixes: #4747
This was SVN commit r21107.
Since the component initialization order is the alphabetic filename
order and
since the RangeOverlayRenderer < Player < Selectable, the new file in
that commit introduced the issue.
Similar to 36b315ca32, refs #4632.
UpdateColor function taken from temple's D754
This was SVN commit r20963.