1
0
forked from 0ad/0ad
Commit Graph

6967 Commits

Author SHA1 Message Date
5fef05d780 UnitMotion - make ComputeTargetPosition return a position for point goals
This makes it possible to merge the TryGoingStraightTo family of
function.
This means it is now called even for point goals and decreases the
likelihood of stuck units (as we take over from the long-range
pathfinder which brings units to navcell centers, which may not be in
the goal).

Differential Revision: https://code.wildfiregames.com/D1982
This was SVN commit r22426.
2019-07-02 07:29:31 +00:00
44aef27b78 Adapt unitMotion to edge-edge distance checks.
D981/c219ee54b2 changed IsInXChecks to use edge-to-edge distance instead
of centre-to-edge, which broke UnitMotion's min-range movement, which
assumed distance to the center.

Since units are represented as squares, the diagonal point may be closer
to the target than the "real" clearance by a factor √2, so the delta
between minimum range and maximum range should be at least `(√2 - 1) *
clearance` to be safe in all situations (this is generally not a problem
for regular units which have a clearance of 0.8, but could be one for
catapults or elephants).

Differential Revision: https://code.wildfiregames.com/D1969
This was SVN commit r22422.
2019-07-01 19:50:06 +00:00
69d3e76fd2 Unit Motion - Stop when targets have an invalid position.
Previously, unitMotion had no code that checked particularly if the
target was still in the world.
When the target moved out of the world, unitMotion would follow the path
to its last known position, then send a "MoveSucceeded" message once
there.

Following 98f609df1d, this message was no longer sent. Thus unit would
follow their path to its last waypoint and stay there, unable to carry
on or finish the order. UnitMotion now explcitly sends a "MoveFailed"
message.

This still changes behaviour from A23, requiring further revisions to
UnitAI (see D1992 for one such case).

Minohaka tested an earlier version of this change (which incorporated
D1992) and accepted it.

Differential Revision: https://code.wildfiregames.com/D1979
This was SVN commit r22415.
2019-06-30 19:00:27 +00:00
f42d97c6f3 Fix some animals "roaming" state not working correctly (units seem stuck in place)
Due to an issue in 4a15cc3b9f, animals incorrectly tried going towards
the roaming point instead of away from it.

With that fixed, MovementUpdate still did not trigger as the min and max
range were the same.
Use -1 as max range (= infinite) instead since we want to move
arbitrarily away.

Having an infinite max range was broken in c219ee54b2, this
re-implements that.

Further, other calls with equal min and max range have been changed
likewise.

This does not entirely fix whales, which run in other problems because
of their large roaming range.

Differential Revision: https://code.wildfiregames.com/D1980
This was SVN commit r22413.
2019-06-30 18:53:25 +00:00
6cde90104a Update precompiled win32 libogg to 1.3.3 and libvorbis to 1.3.6, building them with VS2015, refs #5379.
Use the default naming for both libraries (libvorbis instead of vorbis),
and use our default suffix for debug versions of the libs.

This was SVN commit r22406.
2019-06-27 22:36:04 +00:00
8babfe2330 Refactors camera projections - makes projection functions of camera more clear.
Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2012
This was SVN commit r22404.
2019-06-26 22:54:05 +00:00
ec4d84c72f Removes unused and obsolete LightingModel.
It was introduced in d295dacb9b as a way to control behavior of shaders.
Its usage in shaders was completely removed in 05008d190e (before that
in b7888aea52).

Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2011
This was SVN commit r22403.
2019-06-26 22:30:23 +00:00
3b77a0fba1 Update the minimap, range overlay renderer, and status bars when a player's color is changed in Atlas.
These were missing from 343ec21e75.

Patch By: temple
Differential Revision: https://code.wildfiregames.com/D1261
This was SVN commit r22402.
2019-06-26 19:16:57 +00:00
844462b0c0 #5445
This was SVN commit r22397.
2019-06-25 05:05:06 +00:00
61db02790c Fix cppformat failures on MacOS tests.
cppformat tests failed on MacOS - the global locale was not set and
defaulted to something unexcpeted.
It is now fixed to US notation.

Patch By: Krinkle
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1978
This was SVN commit r22378.
2019-06-16 15:25:17 +00:00
d1fb66d2a7 Cleanups BoundingBoxAxisAligned and fixes coding styles a bit.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1951
This was SVN commit r22372.
2019-06-12 20:23:14 +00:00
3e53d05298 Fixes includes and forward declarations in CPatchRData.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1952
This was SVN commit r22371.
2019-06-12 20:03:22 +00:00
98f609df1d UnitMotion - Change "Possibly At Destination" logic.
UnitMotion will now send hints that a move may be completed if:
- it is a formation member and the formation member has stopped moving.
- it isn't and it is in range from its target.

Differential Revision: https://code.wildfiregames.com/D1899
This was SVN commit r22366.
2019-06-11 19:52:40 +00:00
8ac104b07a Fix 'gliding' behaviour at the end of movement by moving the PossiblyAtDestination check earlier.
Units in 0 A.D. exhibited a "gliding" behaviour at the end of a
movement, e.g. they switched to the Idle animation and still moved a
little bit.

The reason for this behaviour is that entities check if they reached
their destination after moving. Other components (unitAI mostly) will
then possibly change animations and such, resulting in a movement over
the turn while the entity is possibly now in another animation state
than "move".
Instead, what should be done is checking if the entity has arrived
before moving, so if UnitAI calls StopMoving, then entity won't move at
all on the same turn, and the gliding effect vanishes.

The STATE_STOPPING state is made un-necessary by this change, since this
off-by-one mistake was the reason for its existence. It can be removed
(see downstream).

Differential Revision: https://code.wildfiregames.com/D1898
This was SVN commit r22365.
2019-06-11 18:51:55 +00:00
f04bdd84ae UnitMotion - Split Move() into several functions
Move() is generally 4 parts:
- Moving
- Updating our state
- Handling obstructed moves
- Checking if we are at destination.

These can all be put in their own functions, clarifying logic and making
it harder to make mistakes.

Differential Revision: https://code.wildfiregames.com/D1897
This was SVN commit r22364.
2019-06-11 17:25:59 +00:00
ad4594e55d UnitMotion - move TryGoingStraight before the core of the 'Move' logic
In preparation for D1897, this logic isn't related to the "movement"
part of Move(), and can be called earlier.

Differential Revision: https://code.wildfiregames.com/D1896
This was SVN commit r22363.
2019-06-10 19:35:02 +00:00
36341b5d6c UnitMotion - Handle obstruction moving flag similarly to m_CurSpeed
The obstruction manager keeps a flag of moving units. This should be
updated in the same location as the entity's current speed, since they
have similar properties.

Differential Revision: https://code.wildfiregames.com/D1895
This was SVN commit r22362.
2019-06-10 19:33:24 +00:00
1adf9560b8 Unit Motion - update our current speed even when we have not moved.
VisualActor refers to unit motion's `m_CurSpeed` to know what animation
to display in the special walk mode. However that variable was
inconsistently updated. By making sure we reach that codepath in one
place, we remove opportunities for issues.

This should fix most existing instances of moonwalking, another upstream
diff will fix the rest.

Differential Revision: https://code.wildfiregames.com/D1894
This was SVN commit r22361.
2019-06-10 18:27:27 +00:00
017cb504ee Drop an indentation level in UnitMotion.
This will simplify later changes.

Differential Revision: https://code.wildfiregames.com/D1893
This was SVN commit r22360.
2019-06-10 17:15:27 +00:00
70e22e2923 Unit Motion - Face point when calling StopMoving()
FacePointAfterMoving intends for the unit to face the destination once a
move is done. Since 4fda917f46, stopping is the responsibility of UnitAI
(through a call to StopMoving()). Thus we should move that code in that
function, as this ensures we don't forget to do it and removes
duplications.

Differential Revision: https://code.wildfiregames.com/D1889
This was SVN commit r22355.
2019-06-09 17:06:24 +00:00
f2db913a7d Unit Motion - remove the m_Moving variable
The variable is not necessary since having a target is equivalent,
removing it thus reduces redundant state.

Differential Revision: https://code.wildfiregames.com/D1888
This was SVN commit r22354.
2019-06-09 17:04:18 +00:00
4a15cc3b9f Unit Motion - wrap target state into a struct
These variables together held the state for the target of UnitMotion, as
set by the MoveTo[X] family of functions.
Wrapping them in a struct reduces the chances that one will accidentally
forget to reset part of the state and makes it explicit in-code that
these are grouped together.

Calling StopMoving() resets this target, which wasn't before and left
the component in an incoherent state.

Differential Revision: https://code.wildfiregames.com/D1887
This was SVN commit r22352.
2019-06-09 11:18:06 +00:00
4fda917f46 Prevent UnitMotion from stopping on its own, and rename "MoveCompleted" to "MovementUpdate"
UnitAI is now solely in charge of moving and stopping, making UnitMotion
behaviour easier to predict, which will ultimately help with unitAI
development. It might temporarily make units more resilient than before
however.

UnitMotion also tells UnitAI that it's arrived with "MoveCompleted"
messages, but these actually could be wrong - unitAI could decide that
we didn't want to stop after all - so change the name for something less
misleading.

Differential Revision: https://code.wildfiregames.com/D1886
This was SVN commit r22351.
2019-06-09 11:16:40 +00:00
27b686215a Remove "MoveStarted" messages
"MoveStarted" messages were sent by UnitMotion when the unit started
moving (sort of) or failed to do so. This was used by formations and
guarding but was not really necessary as this can be done in "enter" or
in a timer.

Differential Revision: https://code.wildfiregames.com/D1885
This was SVN commit r22350.
2019-06-08 12:53:28 +00:00
c219ee54b2 Move "IsInRange" family of functions to the Obstruction Manager and make the commutative.
These functions were placed in UnitMotion, which had nothing to do with
range checks and made them available only to moving entities for no
particular reason.

This patch also adds support for square-square range checks and
shape-shape distance checks.

Modified from a patch by bb on top of work from wraitii.

Differential Revision: https://code.wildfiregames.com/D981
This was SVN commit r22345.
2019-06-06 19:37:23 +00:00
ba736916fc Clean up ThreadUtil, use standard C++11 constructs instead of custom ones.
ThreadUtil shipped a scope lock and a mutex implementation, which can be
removed since we now have these in the standard library.
This lets us clean up this header which get included everywhere (through
profiler includes).

Tested By: Angen and Stan
Differential Revision: https://code.wildfiregames.com/D1915
This was SVN commit r22344.
2019-06-06 19:30:48 +00:00
70ccc3e5cb Adds Camera test for ortho projection.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1948
This was SVN commit r22340.
2019-06-05 19:55:37 +00:00
dd67d0769e Resolve issues with 0c20afdfda - unitAI order cleanup and unitMotion MoveTo change
0c20afdfda had two issues:
- some of the unitAI code did not return true when switching states in
the "enter" phase
- missed a return false in unitMotion.cpp

This fixes the issue noticed by @bb.

Differential Revision: https://code.wildfiregames.com/D1947
This was SVN commit r22339.
2019-06-05 17:27:12 +00:00
37e5097ea9 Fix a m_JumpPointCache assertion failure in debug mode, refs fa726867f1.
Patch By: Stan
Comments By: wraitii
Differential Revision: https://code.wildfiregames.com/D1942
This was SVN commit r22336.
2019-06-04 08:29:47 +00:00
800bf0da24 Improve UTF-8 character handling in Atlas
(Also prevents the compile-time warnings reported in the abandoned
D1432)

Accepted by: Itms
Patch linting by: Stan, Vladislav, wraitii
Also tested by: Imarok
Fixes: #4936
Differential Revision: https://code.wildfiregames.com/D1395
This was SVN commit r22335.
2019-06-03 20:19:53 +00:00
4b65cc0317 Fixes a typo introduced in cb048b4738 in shore calculations, found by Angen and fixes style notes by elexis.
Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D1949
This was SVN commit r22334.
2019-06-03 20:19:18 +00:00
f4194df416 Removes unused variable from ModelRenderer introduced in 6bc33fe8bd. Found by Angen.
Patch By: Angen
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1812
This was SVN commit r22333.
2019-06-03 20:06:01 +00:00
ddcdc643ba Further cleanup of MikkTSpace
- Move the * and & to the correct side,
- Add .0 and  0.f to clearly mark the types
- Pass pointers instead of arrays
- Add a newline after forward declaration
- Add spaces between operators
- Use c++ cast

Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1934
This was SVN commit r22323.
2019-05-30 23:03:01 +00:00
2cf1f85d7e Fixes tests compilation after ebfec91057. Found by Angen.
Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D1937
This was SVN commit r22321.
2019-05-30 17:27:55 +00:00
ebfec91057 Adds Camera test for frustum.
Reviewed By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1927
This was SVN commit r22319.
2019-05-29 20:12:41 +00:00
39720041f7 Cleanup MikktspaceWrapper.
Reviewed by: @Angen
Differential Revision: https://code.wildfiregames.com/D1872
This was SVN commit r22316.
2019-05-28 22:06:29 +00:00
ca9109be75 Fix a crash on some system when Alt-tabbing during game setup.
Move checks for rendering a frame in Render() to avoid missing calls to
this functions, which can crash on certain systems.

Move the sound manager's idle task out of Render().
Move the buffer swapping in Render() since we do not need to swap
buffers unless we are rendering.

Patch By: Angen
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1495
This was SVN commit r22314.
2019-05-28 13:18:32 +00:00
0c20afdfda Unit Motion: MoveTo family of function no longer returns false if the move is un-necessary, instead unitAI checks explicitly.
This also moves the actual "moving" code to states instead of orders,
making states more self-contained and removing the change of errors when
cleaning up a state.

Differential Revision: https://code.wildfiregames.com/D1865
This was SVN commit r22313.
2019-05-28 11:38:18 +00:00
e2233a4a90 Don't clear pathnames in vfs::GetPathnames so it can be called several times.
Differential Revision: https://code.wildfiregames.com/D1914
This was SVN commit r22312.
2019-05-28 10:18:04 +00:00
12f893b1e3 Remove 'Async' from short/long path requests names
Having Async in the name was not really informative and made it awkward
to reuse for non-async code.

Reviewed By: Kuba386
Differential Revision: https://code.wildfiregames.com/D1854
This was SVN commit r22305.
2019-05-26 13:47:41 +00:00
65fcd66556 Update precompiled headers to improve build times.
Expect a 10-25% build time improvement.

Original Patch By: Angen
Reviewed By: Angen
References #5038

Differential Revision: https://code.wildfiregames.com/D1333
This was SVN commit r22303.
2019-05-26 07:21:12 +00:00
9ea68317ad Use pkg-config where possible instead of hard-coding or library-specific programs
Accepted by: Itms, wraitii
Previously tested by: andy5995
Fixes: #5157
Refs: D1582
Differential Revision: https://code.wildfiregames.com/D1611
This was SVN commit r22302.
2019-05-25 18:00:40 +00:00
220449ea9a JPS - make the JPC cache usable again (98f4ed6cb8 fix)
Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D1875
This was SVN commit r22301.
2019-05-25 16:01:44 +00:00
537a141867 Early-exit when destroying invalid entities (INVALID_ENTITY, already destroyed…)
Destroying INVALID_ENTITY is valid and should do nothing.

The current code will send MT_Destroy messages when doing this, which is
un-necessary work and feels kind of broken to me.
Early-exit instead.

Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D1736
This was SVN commit r22300.
2019-05-25 15:59:43 +00:00
94e0856485 ShouldConsiderOurselvesAtDestination renamed to CloseEnoughFromDestinationToStop and stateful effects moved at the caller.
It improves readability of the code when a function that seems like it
does a simple check actually only does a simple check and the caller is
the one changing state.

Differential Revision: https://code.wildfiregames.com/D1884
This was SVN commit r22299.
2019-05-25 13:23:44 +00:00
01a8138780 Water GLSL shader improvements around reflections and whitespace fixes.
This improves refractions around entities close to the surface, such as
fishes, by handling depth better and by clipping the water plane a
little lower.

This uses the skybox for reflections when refractions are enabled but
reflections are disabled, making it possible to play with reflections
disabled without having super-ugly water (arguably a performance
improvement).

Differential Revision: https://code.wildfiregames.com/D359
This was SVN commit r22297.
2019-05-25 11:08:57 +00:00
dc34d9c5d0 Fix possibly using uninitialized global in 80635665f7 and rename GetDirectoryName
Reviewed by: weberkai
Fixes: #4789
Differential Revision: https://code.wildfiregames.com/D1852
This was SVN commit r22284.
2019-05-14 10:13:02 +00:00
621bb1367a [CChart] Add a percentage format and round displayed integers
Reviewed by: bb
Approved by: Vladislav
Differential Revision: https://code.wildfiregames.com/D1878
This was SVN commit r22282.
2019-05-13 21:23:26 +00:00
795e414663 Hierarchical pathfinder: Speed up edge update
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.
2019-05-13 17:02:16 +00:00
32b2c01c7c Decouple long and hierarchical pathfinders to an extent.
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.
2019-05-13 16:58:00 +00:00
859d96fba5 UnitMotion - improve variable names and reuse a duplicated function (cleanup def47cb7ae)
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.
2019-05-13 16:47:51 +00:00
809f297707 Move the Vertex Pathfinder to its own helper class
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.
2019-05-08 11:53:02 +00:00
b0f41952b8 Fix UnitMotion calculation of time left to avoid units going back and forth between walking and running animations.
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.
2019-05-04 15:53:46 +00:00
75d0c56070 Don't crash when calling the profiler from a 'non-main' thread
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.
2019-05-04 15:03:10 +00:00
ef098db7c8 Seed unit sounds so that their pitch and their gain are always the same for the same unit.
Fixes #3578
Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1584
This was SVN commit r22231.
2019-04-25 22:37:15 +00:00
9f5494cb87 Fixes a misprint that was introduced in cb83d494e0.
This was SVN commit r22228.
2019-04-25 18:59:41 +00:00
98f4ed6cb8 Fix D1491 which introduced an ENSURE that should not have been there.
Reported by wowgetoffyourcellphone.

This was SVN commit r22225.
2019-04-25 07:08:19 +00:00
fa726867f1 Const-Correct the long range pathfinder
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.
2019-04-24 19:07:32 +00:00
d3de36527d Hierarchical pathfinder: fix an issue with regions and some touch-ups
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.
2019-04-24 19:02:09 +00:00
71125baf74 Fix tests on Visual Studio 2013, which doesn't deduce types when using std::map initializer lists.
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.
2019-04-23 20:54:32 +00:00
3a031128f7 Refactor and cleanup of CGameView.
Commented By: asterix, elexis, Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D1571
This was SVN commit r22214.
2019-04-22 22:12:08 +00:00
285db48813 Simple cleanup of Shapes, removes old style format.
Reviewed By: wraitii
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D1809
This was SVN commit r22213.
2019-04-22 21:53:11 +00:00
fd719833ab Replace includes uniform_foo with uniform_foo_distribution as it's deprecated in newer versions of boost. It was added in the 1.47 version.
Reviewed by: @Angen, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1823
This was SVN commit r22211.
2019-04-22 21:45:23 +00:00
bc3fd69bf0 Const-correct the hierarchical pathfinder.
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.
2019-04-22 16:07:25 +00:00
ccfae46042 Accidentally committed an upstream version of the hierarchical pathfinder tests in 60cfd2d16c.
This fixes that.

This was SVN commit r22208.
2019-04-22 14:31:19 +00:00
60cfd2d16c Actually add the test file for ab5f63e087.
This was SVN commit r22207.
2019-04-22 12:44:28 +00:00
4c7f14b7f3 Add a few assertions to pathfinder tests, fix the disabled tests.
Differential Revision: https://code.wildfiregames.com/D1831
This was SVN commit r22206.
2019-04-22 12:13:54 +00:00
ab5f63e087 Add tests for the hierarchical pathfinder.
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.
2019-04-22 12:07:30 +00:00
f9b529f2fb Remove workaround in GetGUIObjectByName
f0d9806b3f added a problem: Engine.GetGuiObjectByName is unaware of the
caller GUI page.
So GUI pages in the background that still run the onTick and other event
code tried to look on the topmost GUI page, rather than their own GUI
page.
9674c3c0fe added a workaround that has to be copied to any place that
can call JS code.
If developers don't know about the reason for this workaround and add a
new place that can call JS code (#5369), they won't be able to implement
anything.

This removes this workaround by passing the pointer to the correct GUI
page as callback data.

Patch By: elexis
Reviewed By: wraitii
Refs #5369

Trac Tickets: #5369

Differential Revision: https://code.wildfiregames.com/D1701
This was SVN commit r22200.
2019-04-20 15:49:42 +00:00
def47cb7ae Change Run Speed into a Run multiplier.
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.
2019-04-19 10:04:50 +00:00
02a429bc7f Fix 4edcf21b98. Refs #5428
Differential Revision: https://code.wildfiregames.com/D1821
This was SVN commit r22178.
2019-04-10 06:05:34 +00:00
4edcf21b98 Remove useless class, test class and use boost instead of it in test_RangeManager.h. Use boost::random::uniform_real_distribution<double> instead of deprecated boost::uniform_real<> in that class as well.
Refs #5428
Reviewed by: @Angen, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1584
This was SVN commit r22175.
2019-04-09 21:50:10 +00:00
3a7335d723 Removes unused iterator in Xeromyces. Its usage was removed in a07add11c6.
Patch By: Angen
Differential Revision: https://code.wildfiregames.com/D1814
This was SVN commit r22170.
2019-04-07 18:23:04 +00:00
bb
0b1593e268 recieve -> receive
Reported by Stan in 13288df4f4

This was SVN commit r22169.
2019-04-07 16:06:10 +00:00
bb
94716b9987 Remove an unused variable
The variable was introduced in 492e49da38 without being used, neither
did it become used in a later commit. To me it seems that it is a
left-over from a copy paste, as the ".left" functions do use the
variable.
Notice 74c420f658 did cleanup around these lines, but did not remove
this variable

Patch By: Angen
Differential Revision: https://code.wildfiregames.com/D1813
This was SVN commit r22166.
2019-04-06 22:04:13 +00:00
359df88f1a [CSlider] On click move the slider-button to the mouse position
Reviewed By: vladislavbelov
Refs: #2593
Differential Revision: https://code.wildfiregames.com/D1622
This was SVN commit r22164.
2019-04-06 18:47:22 +00:00
2288943f91 Fixes
C4458 in AtlasObjectImpl.cpp line 292 and in AtlasUI/Object.cpp:547
C4456 in MapDialog.cpp:173 and in ScenarioEditor.cpp:742

Reviewed by: @Angen
Accepted by: @Itms
Comments by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1741
This was SVN commit r22161.
2019-04-05 12:37:37 +00:00
734ea4fd6b Improve the error window on Windows by adding a link to https://trac.wildfiregames.com/wiki/GameDataPaths.
Patch By: Angen
Reviewed By: Itms, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1799
This was SVN commit r22157.
2019-04-04 20:30:52 +00:00
7182de3b20 Removes unused variable. It was introduced in f0615df318, an interface to control
the variable was removed in 12e2428495. A usage was removed in
9376609ee8.
And since then the usage is useless because we use infinity sky model.

This was SVN commit r22154.
2019-04-02 18:49:12 +00:00
cb83d494e0 Refactor CBoundingSphere and add tests
Reviewed By: wraitii
Comments By: smiley, Stan
Differential Revision: https://code.wildfiregames.com/D1576
This was SVN commit r22143.
2019-03-25 21:17:43 +00:00
9c5062147a Add a GetTextSize() method to GUI objects
Usage:
  let size = Engine.GetGUIObjectByName({gui_object_name}).GetTextSize()

Returns a JS object containing the height and width of the primary text
field within
the object, taking into account new lines, text wrapping, and font
changes.

Unless the object doesn't contain text, in which case the method will
return undefined.

Commented on by: vladislavbelov
Additional code by: elexis
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D844
This was SVN commit r22134.
2019-03-18 22:15:40 +00:00
993ddcfe3e Rotate entities during placement in Atlas with the keyboard only when the window has focus. Reported by Andrettin.
Patch By: Angen
Reviewed By: Itms, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1509
This was SVN commit r22125.
2019-03-17 16:04:06 +00:00
7e2b318a1e Add particle support to the Actor Editor, fixes #1590.
Patch By: shh
Differential Revision: https://code.wildfiregames.com/D1783
This was SVN commit r22117.
2019-03-16 21:16:04 +00:00
bb
702127b8df Add autostart conquest default description to readme.txt and add endless support for autostart in both readme.txt and GameSetup.cpp
Reported By: elexis
Fixes: 6d54ab4c1f, 22903b09a6

This was SVN commit r22112.
2019-03-16 14:20:28 +00:00
0cc034fa6f Improve and fix checkrefs.pl, add a readme for usage, add mod support, add command line arguments.
Reviewed by: @Itms
Comments by: @elexis
Differential Revision: https://code.wildfiregames.com/D1381
This was SVN commit r22096.
2019-02-24 21:19:20 +00:00
111f850927 Don't let the duplicateplayernames setting break lobbied games (0fd8aa2a77)
Looked at by: elexis
Differential Revision: https://code.wildfiregames.com/D1748
This was SVN commit r22072.
2019-01-28 12:09:42 +00:00
ac1a56e0cc Fix cell text wrapping inside COList.
Patch By: gentz
Tested By: vladislavbelov
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D1717
This was SVN commit r22066.
2019-01-24 20:00:31 +00:00
db5d4bb5f1 SpiderMonkey-related changes in preparation for the upgrade to SpiderMonkey 45, refs #4893.
- Remove JSVAL_ZERO and JSVAL_NULL
https://bugzilla.mozilla.org/show_bug.cgi?id=1177825
- Remove *_TO_JSVAL https://bugzilla.mozilla.org/show_bug.cgi?id=1177892
- Drop support for parent object in the deserializer
https://bugzilla.mozilla.org/show_bug.cgi?id=1136345,
https://bugzilla.mozilla.org/show_bug.cgi?id=805052
- Correctly use boolean values in JS::RuntimeOptionsRef
- Use JS_FN instead of JS_FS: in future versions, JS_FS is not public
because it isn't supposed to be used in JSAPI code
- Allow to select flags for global objects, and correctly mark progress
bars in the loading screen as not readonly+permanent
- Remove empty JSI_props in IGUIObject

Reviewed By: wraitii, elexis
Differential Revision: https://code.wildfiregames.com/D1716
This was SVN commit r22052.
2019-01-13 16:37:41 +00:00
651cf8b364 Split CColor from Shapes.
Reviewed By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1515
This was SVN commit r22051.
2019-01-13 15:38:41 +00:00
43a291a071 Simple refactoring of Singleton. Make it non-copyable.
Reviewed By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1564
This was SVN commit r22050.
2019-01-13 15:11:40 +00:00
43758bcb92 Fix warnings in vs2015 when building tests.
Reviewed by: @Angen, @Itms
Differential Revision: https://code.wildfiregames.com/D1678
This was SVN commit r22048.
2019-01-12 16:23:47 +00:00
74a26820f2 Add a confirmation message when packaging ends.
Reviewed by: elexis
Differential Revision: https://code.wildfiregames.com/D1585
This was SVN commit r22042.
2019-01-07 23:57:18 +00:00
9376609ee8 Remove hardcoded SkyBox sizes and use the infinity sky. No we render
the skybox at the current camera location, so that the skybox appears
indefinitely far away. Refs #3458.

Reviewed By: wraitii
Tested By: elexis, Stan
Differential Revision: https://code.wildfiregames.com/D1683
This was SVN commit r22039.
2019-01-06 21:55:30 +00:00
14a7147540 Removes active values from UserReport, they are not hardware statistics.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D1621
This was SVN commit r22038.
2019-01-06 21:18:55 +00:00
d5668cfb99 Add an error message for crashes without required UV sets.
Reviewed By: Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D433
This was SVN commit r22037.
2019-01-06 21:04:01 +00:00
c1027f478c Test we can destroy INVALID_ENTITY
This is part of the spec and wasn't unit-tested for.

Differential Revision: https://code.wildfiregames.com/D1735
This was SVN commit r22036.
2019-01-06 16:32:50 +00:00
2d56e62e11 Refactor build information getters and remove the useless code.
Reviewed By: elexis, Stan
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1348
This was SVN commit r22035.
2019-01-06 14:32:54 +00:00
276050bcad Cleanup Camera code for projections.
Reviewd By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1514
This was SVN commit r22033.
2019-01-05 22:40:56 +00:00
24812b06d7 Revert b56f7f39d4 as it triggers an assertion failure.
This was SVN commit r22032.
2019-01-05 22:38:00 +00:00
b56f7f39d4 Change internals of EntityMap to use an std::vector
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.
2019-01-05 18:19:59 +00:00