Commit graph

679 commits

Author SHA1 Message Date
mimo
f3e4e619bc RangeManager returns Gaia entities in GetNonGaiaEntities
refs #4495
Reviewed By: leper, elexis
Differential Revision: https://code.wildfiregames.com/D164
This was SVN commit r19245.
2017-02-26 10:26:35 +00:00
mimo
360ba27865 Cleanup of CCmprangeManager
Summary: Following discussions in https://code.wildfiregames.com/D60 the
use of u8 to store each boolean has been cleanup up. Now only one u8 is
used, thus reducing the size of the struct.

Reviewed By: leper
Differential Revision: https://code.wildfiregames.com/D101
refs #3834

This was SVN commit r19242.
2017-02-24 19:15:54 +00:00
leper
a0a0895a12 Pass some strings and a vector as const refs.
Reviewed By: Imarok
Differential Revision: https://code.wildfiregames.com/D160
This was SVN commit r19240.
2017-02-24 17:02:10 +00:00
leper
6ae2db53db Employ some variadic macros to make some of the C++ -> JS function calling code nicer.
Template-ize CallFunctionVoid.
Changes CallFunction parameter order to make template parameter
deduction with
variadic parameters work nicely.

Reviewed By: Itms, wraitii, Yves
Differential Revision: https://code.wildfiregames.com/D77
This was SVN commit r19183.
2017-01-28 23:37:15 +00:00
mimo
c2d0327af9 Implement shared vision at the entity level
Summary:
To fix tickets like #3335, having a shared vision at the entity level is
needed. This patch implements that in CCmpRangeManager, interfaced with
a new JS component VisionSharing to manage the shared entities visions.
As an example of use case (in addition to garrisoning in allied
structure without the sharedLos tech), we can think of bribing enemy
units: there is a part about it in the patch, but this one is very wip
and not intended to be committed but rather for test purposes of the
feature.
So when garrisoning a unit in another player's building, the vision of
the garrisonHolder is shared (part intended for review). In addition,
for tests of the feature, when clicking on the new bribe icon in the
diplomacy window, a random unit of the chosen player is bribed and share
its vision during 15 s.

Test Plan: Garrison a unit in an allied structure without the sharedLos
tech, or test the wip bribe feature from the diplomacy window.

Reviewers: Itms

Reviewed By: Itms
Subscribers: Stan, leper, O11 Templates, wraitii, elexis, fatherbushido,
Itms, Vulcan, O1 C++ Simulation

Differential Revision: https://code.wildfiregames.com/D60
This was SVN commit r19175.
2017-01-26 21:10:46 +00:00
elexis
4f01db4831 Split TurnManager classes into individual files per class. Patch by echotangoecho, fixes #4095.
Remove the "Net" prefix from the non-networked classes.
Use variadic macros and mark the client turnmanager as NONCOPYABLE.

Differential Revision: D16
Reviewed By: leper
This was SVN commit r19165.
2017-01-24 02:04:50 +00:00
leper
be1a205f91 Add support for const methods in components and make those that can be const const.
Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D75
This was SVN commit r19156.
2017-01-20 02:25:19 +00:00
elexis
678e082230 Remove the "quit" simulation command and restrict the "set-shading-color" simulation command to AIs,
since they are only useful for AI debugging and counterproductive in
multiplayer mode, refs #3551.

Instead, enable AI developers to exit the game from a new AI API
command,
allowing to batch simulate matches. Refs #2755.

Differential Revision: D65
Reviewed By: leper
Consulted: mimo

This was SVN commit r19155.
2017-01-19 14:45:32 +00:00
wraitii
b3b47c1718 Avoid recreating the dirtiness grid every turn by swapping. Significantly reduces the number of allocations, and slight speedup (particularly on larger maps). Reviewed by Leper.
Differential Revision: https://code.wildfiregames.com/D70
This was SVN commit r19149.
2017-01-17 07:24:41 +00:00
wraitii
0a6a42321d Improve cache efficiency of CcmpPathfinder::UpdateGrid substantially. On very large maps, this can be a very substantial improvement (I have measured up to 30ms)
This was SVN commit r19146.
2017-01-16 10:41:35 +00:00
wraitii
ad76352cef Prevent the AI manager from copying the pathfindinder dirtiness grid every turn.
Review by Itms

Differential Revision: https://code.wildfiregames.com/D25
This was SVN commit r19145.
2017-01-16 08:38:31 +00:00
leper
3a85d0b3fa Remove unused parameter from template loading code
Templates should be the same for all players, techs can be used to
provide
different lists of templates if that is needed.

Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D25
This was SVN commit r19142.
2017-01-15 18:41:53 +00:00
Itms
490a3a27f6 Fix the cache directory appearing during tests.
Summary: Refs #4419.

Test Plan: When running tests, make sure nothing is created.

Reviewers: leper

Reviewed By: leper
Subscribers: leper, Vulcan

Differential Revision: https://code.wildfiregames.com/D1
This was SVN commit r19062.
2016-12-25 22:03:30 +00:00
wraitii
40fd373c83 Revert [19043]
This was SVN commit r19054.
2016-12-21 12:36:41 +00:00
wraitii
8e8da9aee4 Fix a bug introduced by a fix of a bug introduced by a fix of a bug (x100) in the vertex pathfinder. Revealed by automated tests on another branch of mine. Revert back to pre-new pathfinder behavior of not returning paths in some cases, since that is most likely less broken than now - but probably still a little broken.
This was SVN commit r19043.
2016-12-18 10:02:36 +00:00
wraitii
9288837472 Fix misleading indentation warning on gcc, introduced by [19024]. Reported by elexis. Fixes #3785
This was SVN commit r19041.
2016-12-13 13:34:31 +00:00
wraitii
e7e5631135 Better fix to #3785. Fixes #3785
This was SVN commit r19024.
2016-12-06 23:25:26 +00:00
Itms
6ae374dbee Fix the update of shared dirty visibility masks when changing diplomacy.
The previous code worked in case new mutual allies were added, but, when
some were removed, it was suboptimal in terms of performance and it made
some units visible in the FoW.

Fixes #4266

This was SVN commit r18994.
2016-11-24 14:57:09 +00:00
elexis
417c84870c Actually remove trailing tabs from source/.
This was SVN commit r18991.
2016-11-23 14:09:58 +00:00
elexis
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
elexis
944ba16eb4 End source files with a newline.
This was SVN commit r18988.
2016-11-23 11:27:54 +00:00
elexis
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
elexis
2ec3f3ebaa Add parenthesis suggested by gcc 5.4 following 3e59ac76ee, refs #4278.
This was SVN commit r18924.
2016-11-12 16:07:23 +00:00
mimo
3e59ac76ee fix UnitMotion when inside the obstruction, refs #4278
This was SVN commit r18921.
2016-11-11 13:14:30 +00:00
elexis
4898e94c81 Remove unneeded braces and whitespace in empty lines.
This was SVN commit r18882.
2016-10-28 16:11:59 +00:00
elexis
5a384f4eaf Fix an OOS on rejoin when a ptolemian lighthouse revealing the shoreline was built prior. Patch by Itms and wraitii, fixes #4277.
Serialize the mapsize in the pathfinder and the reveal shoreline flag in
the range manager.
Reload the rangemanager data after other components have been
deserialized.
Use the SerializeCommon pattern in the pathfinder to avoid code
duplication.
Move the shoreline logic from the Vision component to the range manager.
Remove unused interface mocks from the rangemanager test following
b05879e151.

This was SVN commit r18879.
2016-10-28 15:34:24 +00:00
wraitii
7f8f820e35 Fix an oversight in d8c11434a8/18823, fixes #4270 .
This was SVN commit r18835.
2016-10-16 20:17:31 +00:00
elexis
0991c22026 Take vision range techs into account on ownership change (capturing or defeat). Solves an OOS, reviewed by wraitii, fixes #4279, refs #3989.
This was SVN commit r18833.
2016-10-15 18:22:10 +00:00
Itms
9c2404e40e Some tweaks in order to fix the non-graphical test modes (serialization test, etc.), and possible future non-visual players like headless game servers.
The internal data of the component, which is serialized, should not
depend on the presence of a visual Unit.

Also remove a misleading comment about a simple initialization code.

Refs #4270

This was SVN commit r18824.
2016-10-10 10:56:13 +00:00
Itms
ef7486c5d3 Fix a number of things in cmpVisualActor:
* Rewrite the Update function, add more details and information in
comments, and properly serialize everything that function needs.
* Fix the broken deserialization code by using a sane helper function.
* Fix the `SelectMovementAnimation` function.

Fixes #4270.

This was SVN commit r18823.
2016-10-10 10:49:49 +00:00
Itms
d8c11434a8 Save the animation sync offset, for consistency's sake.
Refs #4270

This was SVN commit r18822.
2016-10-10 10:41:36 +00:00
Itms
79b37bd4dc Improve style and whitespace in CCmpVisualActor.
Refs #4270

This was SVN commit r18821.
2016-10-10 10:37:58 +00:00
Itms
0030f6ad2b In CCmpVisualActor, m_Unit is not initialized when running without graphics, so we must check that pointer everytime. Also make one call consistent with the rest of the file.
Fixes #4238, refs #3952

This was SVN commit r18812.
2016-10-08 08:49:35 +00:00
Itms
636da605bb Following e757fb84d5: also regenerate the JS values for AI maps upon deserialization.
Fixes #4247, refs #4191

This was SVN commit r18797.
2016-10-01 12:29:44 +00:00
Itms
58704fa140 Remove a function relying on systems that are not optimized at all. This function is not actually used by Petra.
If it is needed at some point, this map should be handled and updated
the same way as the passability map and territory map are.

Refs #4191

This was SVN commit r18760.
2016-09-24 15:21:20 +00:00
Itms
e757fb84d5 More clever map updates for the AI.
This patch fixes frequent memory issues by removing several dummy
allocations and a lot of memory footwork.

Fixes #4191

This was SVN commit r18759.
2016-09-24 15:16:55 +00:00
Itms
caef42084d Add missing JSAutoRequest calls. (hopefully all of them have been spotted now)
Patch by echotangoecho, refs #4053

This was SVN commit r18730.
2016-09-18 09:34:45 +00:00
Itms
8d15411abf SpiderMonkey 38 upgrade: 13/35
Update JS_NewObject to JS_NewPlainObject, with new parameters. Patch by
leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1136906 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1125356

This was SVN commit r18667.
2016-09-02 16:28:17 +00:00
Itms
b01300c222 SpiderMonkey 38 upgrade: 11/35
Renamed JS_CallHeapFooTracer to JS_CallFooTracer. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1052388

This was SVN commit r18665.
2016-09-02 16:25:42 +00:00
Itms
761abd587e SpiderMonkey 38 upgrade: 10/35
Use operator= instead of .set(). Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1128110

This was SVN commit r18664.
2016-09-02 16:24:46 +00:00
leper
014a6d621b Keep mounting the cache directory in tests. Fixes oversight in 493990f472.
This was SVN commit r18623.
2016-08-22 01:00:23 +00:00
leper
9998592542 Remove unused variable.
This was SVN commit r18620.
2016-08-21 20:35:08 +00:00
elexis
416049e4b4 Remove charge attack from the templates which isn't implemented nor designed yet. Patch by fatherbushido, fixes #4139.
Remove the unused "recharge" attack timer which was introduced in
b21e798243 but should have been removed with 4e5c5e2d8f.

This was SVN commit r18599.
2016-08-11 14:35:50 +00:00
Itms
e3cdb2253d Fix calls to CXeromyces::Terminate in the main loop to fix several possible memory leaks.
Make init/shutdown order consistent in some places.

This was SVN commit r18589.
2016-08-08 08:32:57 +00:00
Itms
4e87fef3da The old debug API has been removed in SpiderMonkey 38, so remove profiler1 script profiling.
Patch by leper, refs #3708

See also https://bugzilla.mozilla.org/show_bug.cgi?id=1069694

This was SVN commit r18580.
2016-08-02 16:58:30 +00:00
Itms
493990f472 Fix engine tests when no mods are present, by making the pathfinder tests consistent with the rest of the tests.
This was SVN commit r18577.
2016-08-02 15:38:39 +00:00
Itms
ec2e2a84a4 Fix and improve 001c411cc2.
This was SVN commit r18489.
2016-07-05 20:23:12 +00:00
wraitii
898ab5229b Change profiling calls to get a better view of what is actually slow and what is not.
This was SVN commit r18438.
2016-06-25 13:12:35 +00:00
wraitii
9e526614be Accidentally left a change from #4056 in in 7c21a0cf8e.
This was SVN commit r18418.
2016-06-21 11:13:00 +00:00
wraitii
7c21a0cf8e Header cleanup: profile.h is no longer unnecessarily included in scriptinterface.h but rather in the required .cpp files
This was SVN commit r18417.
2016-06-21 10:33:11 +00:00