1
0
forked from 0ad/0ad
Commit Graph

21250 Commits

Author SHA1 Message Date
de1a42d937 Fix test macro introduced in b6114adc8d
This was SVN commit r24409.
2020-12-17 21:17:16 +00:00
bb
686686f2a4 Make buildingAI's arrowcount more transparent
Reviewed By: Freagarach
Comments By: wraitii, Stan
Differential Revision: D3198
This was SVN commit r24408.
2020-12-17 19:55:22 +00:00
82d079d06c Add a Dev Overlay checkbox to activate RejoinTest from the session.
This makes this feature, very useful for checking for OOS, more easily
accessible.

Differential Revision: https://code.wildfiregames.com/D3199
This was SVN commit r24407.
2020-12-17 17:53:13 +00:00
e22a915351 Add a function to query a global object, including JS classes, from C++
The latter are not properties of the global object but stored within the
global lexical environment.
This is not currently needed, but will be useful for future diffs.
Update Vector2D/3D querying.

Taken from D2746

This was SVN commit r24406.
2020-12-17 17:51:18 +00:00
25b8cfc6b8 Only create construction previews when committed.
Missed in bdbd0b9dbf, meaning after serialization uncommited foundations
preview were incorrectly created. This was generally invisible, except
when a decal was present (e.g. with ptolemies).

This was SVN commit r24405.
2020-12-17 17:40:35 +00:00
2e0b9d7a9b Do not let UnitAI listen to HealthChanged messages anymore.
In earlier revisions units fled more slowly with fewer hitpoints.
Since def47cb7ae this is not the case anymore.

Differential revision: D3229
Reviewed by: @wraitii
This was SVN commit r24404.
2020-12-17 13:09:49 +00:00
bc4e75c75c Reverts 2603703d66
Either the default handlers _are_ needed or we don't care much. But
removing (at least the motion one) may give errors.

This was SVN commit r24403.
2020-12-17 12:56:21 +00:00
2603703d66 Remove some unnecessary default handlers.
`ConstructionFinished` is obselete since 88dc6d8e1e.
These messages are only sent when the entity is in a specific state (or
states).

Differential revision: D3044
Discussed with @wraitii

This was SVN commit r24402.
2020-12-17 11:56:18 +00:00
88bc450b79 Correct some strings in the GUI.
Patch by: @Nescio
Differential Revision: D3007
This was SVN commit r24401.
2020-12-17 11:47:04 +00:00
bb
3726db16b1 Treat code between [] and {} as one blob for translations.
Agreed By: wraitii
Comments By: elexis
Differential Revision: D3032
Obsoletes: D2451

This was SVN commit r24400.
2020-12-16 21:12:54 +00:00
d257122bb4 Fix typo from 2dd223af29.
This was SVN commit r24399.
2020-12-16 19:40:45 +00:00
dd0b56c8aa Replace DISCARD macro with ignore_result template.
Fixes eb7940b418.
As reported by Vladislav, there is possibly confusion on what exactly is
being ignored when there are multiple statements after DISCARD. Explicit
wrapping avoids that.

Differential Revision: https://code.wildfiregames.com/D3206
This was SVN commit r24397.
2020-12-15 09:03:44 +00:00
38c3827d3b Fix UnitMotion updating the visual Actor with the target speed, not the real speed.
Fixes D1901 / a1dc9cadd8

Noted by bb also in D3021

Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3221
This was SVN commit r24396.
2020-12-15 07:44:05 +00:00
7f77cf2f3e Move PopulationBonus from cmpCost to new cmpPopulation.
Since PopBonus is not a cost.

Patch by: @lonehawk
Differential Revision: D2948
Comments by: @Angen, @Nescio, @wraitii
Closes #4081

This was SVN commit r24394.
2020-12-14 18:17:59 +00:00
014c2922f2 Give Fortress a territory root.
And consequently reduce the territory radius by 20%.

Patch by: @Nescio
Differential Revision: D1762
Reviewed by: @borg-, @ValihrAnt
Comments by: @elexis
This was SVN commit r24393.
2020-12-14 18:05:41 +00:00
b0c3037abc Fix JS incremental GC issue (destroyed realms are not collected).
Further work would be nice to be able to only collect zones that
probably have garbage to collect, but that likely requires splitting our
contexts in more zones.

0 A.D. had been running in incremental GC since 1.8.5. With the SM78
upgrade, I changed this to the new default "ZONE_INCREMENTAL", which GCs
specific zones.
However, I failed to realise that deleted scriptInterfaces and their
corresponding zones would no longer be collected.
This corrects for that.

Fixes d92a2118b0.

Refs #5861

Differential Revision: https://code.wildfiregames.com/D3220
This was SVN commit r24392.
2020-12-14 08:51:29 +00:00
21fa835cff Move a few unit actors and icons.
- move infantry_crossbowman_c.xml from athenians/ to macedonians/
- renames kushites/camelry_* to kushites/camel_*
- renames kushites/infantry_clubman_* to kushites/infantry_maceman_*
- renames persians/cavalry_swordsman_* to persians/cavalry_axeman_*
- renames ptolemies/camelry_* to ptolemies/camel_*

Patch by: @Nescio
Differential Revision: D2688
This was SVN commit r24391.
2020-12-14 08:07:44 +00:00
2e27ece0a0 (2/2) Update premake5 to Alpha 15 - shell scripts
Update build shell scripts to use premake5 `gmake2.*` directories.
(The old `gmake.*` directories have been removed from premake5.)


Differential Revision: https://code.wildfiregames.com/D3219
This was SVN commit r24388.
2020-12-14 02:22:58 +00:00
a0d2112195 (1/2) Update premake5 to Alpha 15 - premake5 files
See `CHANGES.txt` below for the upstream-composed list of changes.


`premake5.exe` built by Stan

Accepted By: Stan (for Windows)
Trac Tickets: #5869
Differential Revision: https://code.wildfiregames.com/D3219
This was SVN commit r24387.
2020-12-14 02:17:47 +00:00
5190bd4c56 Remove old premake5 vs20XX make files
These files contain instructions to build premake and its bundled
dependancies
on versions of Visual Studio we no longer support.


Refs: D3219

This was SVN commit r24386.
2020-12-14 01:41:50 +00:00
df9f0bef20 Run a short-pathfinder call occasionally to get unstuck in some situations.
Units can get stuck on passable navcells surrounded by impassable
navcells because the short-pathfinder got them there, and then ordering
them to move far way uses the long-pathfinder.
We can safely run a short-pathfinder call, using the same logic as in
D1424, to get unstuck in at least some of those situations.

Reported by: Angen
Differential Revision: https://code.wildfiregames.com/D3215
This was SVN commit r24385.
2020-12-13 15:25:16 +00:00
1b67a079fb Reduce duplication in JSI GUI objects implementation.
- Store the functions in an unordered_map. A no-container implementation
is doable but likely not worth the added code complexity, maybe with
C++20
- Move more things into the _impl.h
- Clear out the un-necessary friends declaration in the specific types
by moving the functions to the public interface, which makes sense.
- Fix a memory leak (JS::PersistentRootedObject weren't deleted).

This doesn't change what one needs to do to add a new type, but it does
reduce the actual code that's necessary, and makes it less error prone.

Differential Revision: https://code.wildfiregames.com/D3214
This was SVN commit r24384.
2020-12-13 15:06:18 +00:00
876f6d5e50 Improve sound attenuation so that zooming out actually reduce the sound level.
Patch by: @Samulis
Differential Revision: https://code.wildfiregames.com/D3108
This was SVN commit r24382.
2020-12-13 00:04:17 +00:00
aa3bd08513 Fix non-visual replay on Windows. Use the actual detected resolution.
Differential Revision: https://code.wildfiregames.com/D3208
This was SVN commit r24381.
2020-12-12 08:18:24 +00:00
00aeebea6d Add getTextSize() for CButton
Summary: 9c5062147a introduced the `getTextSize()` to all GUIObjects for
getting the rendered size of a text. 8190293f8b made it only available
to CText. `getTextSize()` can also be useful for CButtons so this diff
adds the function back to CButtons. There seem to be no other GUIObjects
besiders CText and CButton where `getTextSize()` makes sense.

Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3195
This was SVN commit r24378.
2020-12-11 16:12:46 +00:00
5e754a86a9 Associate .zip and .pyromod files with 0 A.D. on MacOS
- Change the .Plist to associate 0 A.D. with .pyromod files (as owner,
so the default choice), and .zip (as alternate, so not the default, but
will appaer in the 'open with' dropdown).
- Make 0 A.D. actually load mods opened like that on MacOS. The files
aren't actually opened with command line arguments, but via Cocoa stuff,
which SDL2 handles via the 'DropEvent' event. This ought also work on
windows and linux.

Closes #5357

Differential Revision: https://code.wildfiregames.com/D3190
This was SVN commit r24377.
2020-12-11 15:43:25 +00:00
bf85e4ac38 Allow boolean and u16 modifications for C++
Allow boolean modifications JavaScript
Allow territory influence weight, and root, to be changed via tech.


Differential Revision: https://code.wildfiregames.com/D3069
This was SVN commit r24373.
2020-12-11 14:07:48 +00:00
c013ee3778 Fix usage of remove_if in CHotkeyPicker
I was not aware of the erase-remove idiom and failed to notice that
remove_if simply reorders the elements.
Noted by Stan thanks to VS17 warnings.

Fixes a4852c4c01 / D2814

This was SVN commit r24371.
2020-12-11 10:02:05 +00:00
14cc771b6d Fix zip with comments triggering assertion on game startup
Fixes #5165

Patch by: @Teiresias
Differential Revision: https://code.wildfiregames.com/D1511
This was SVN commit r24368.
2020-12-10 19:09:10 +00:00
ea38089853 Fix userreport detection of sound cards
Differential Revision: https://code.wildfiregames.com/D3025
This was SVN commit r24367.
2020-12-10 18:36:05 +00:00
cc65e0e8a2 Add support for HAIKU detection by the SDL.
This was SVN commit r24366.
2020-12-10 18:15:50 +00:00
d09c5bf8bc Small cleanup of test_wdbg_sym.h
This was SVN commit r24364.
2020-12-10 16:13:29 +00:00
b6114adc8d Fix tests on Windows in no pch mode.
This was SVN commit r24363.
2020-12-10 15:58:17 +00:00
c9695dd669 Really remove domestic class from violent arctic wolves.
Failed to be done in 28cb8a4c06, noticed by @Angen.

This was SVN commit r24362.
2020-12-10 10:45:57 +00:00
764440e017 Remove the Engine threading when using Atlas
MacOS requires some UI-related API calls to happen on the main thread.
There are several SDL functions that call UI-things, and those were,
since #500 / 08b4d96cf2, in a separate thread.
This crashes on Catalina, instead of simply warning (see #5470).

It is not the first time we had such issues, as originally the Engine
was on the main thread and AtlasUI on a separate thread.
That didn't work on MacOS, so the threading was inverted in #500 /
08b4d96cf2, with AtlasUI on the main thread and the Engine in another
thread.
Unfortunately, this still wasn't enough.

This formally unthreads the engine, running it on a wxTimer, to avoid
these issues.

Future work should focus on:
- Further decoupling the simulation from the engine itself, as what
Atlas really needs is a threaded simulation, not a threaded engine.
- Making the simulation itself more threaded
- Making it possible to do tasks asynchronously under Atlas.

Refs #500
Fixes #5470

Differential Revision: https://code.wildfiregames.com/D2752
This was SVN commit r24361.
2020-12-10 09:42:58 +00:00
6778fc4ea6 Make units wait a few seconds at waypoints during Patrol.
This makes 'dancing' impossible with patrol, for both single units and
formations.
It further makes the formation and regular patrol code more similar.

The diff harcodes an integer wait time as it relies on timer calls
instead of range queries, as that was much simpler to implement.
Animations for the waypoint-waiting is also unimplemented.

Reviewed By: Freagarach
Refs #5106

Differential Revision: https://code.wildfiregames.com/D2913
This was SVN commit r24360.
2020-12-10 09:18:13 +00:00
28cb8a4c06 Remove domestic attribute from wolves on polar sea.
This made entites use slaughter against the wolves instead of normal
attacks.
After b97d251322 the class is not needed anymore to be able to move the
wolves.

The fix of the wolves stacking in one place is deferred.

Patch by: @Dunedan
Differential Revision: D2771
Reviewed by: @wraitii
Comments by: @elexis
This was SVN commit r24359.
2020-12-10 08:34:04 +00:00
aa305cc14b Properly clean up _testcache folder.
Introduced in 61e3f1ec0d / D1839.

This was SVN commit r24358.
2020-12-10 08:18:18 +00:00
1e0a6f66f0 Show gatherers next to resource icons.
And total gatherers next to the population icon.

Closes #643
Patch by: @mammadori
Differential Revision: D3155
Earlier revisions reviewed by: @Angen, @wraitii
Comments by: @Nescio, @s0600204, @Stan
This was SVN commit r24357.
2020-12-10 08:13:46 +00:00
8accbce1d7 Fix nomad maps after moving templates to civ folders.
Broken in b57abe806c as noticed by @mammadori.

Differential Revision: D3188
Tested by: @mammadori
This was SVN commit r24356.
2020-12-10 07:55:32 +00:00
605386a278 Fix OOS in bdbd0b9dbf
Preview entity IDs vary from user to user.

Reported by: Freagarach
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3196
This was SVN commit r24354.
2020-12-09 16:45:14 +00:00
69f31a67a4 More improvements to the release scripts.
- Add a 'dev' option to the mac bundle that's much faster, intended to
quickly test bundle-like behaviour.
- Add an option to only archive the 'mod' folder, intended to speed up
the CI weekly builds and avoid taking too much disk
space.
- Tweak the windows installer, add an option to create a shortcut to the
desktop (Fixes #1637). This uses the readme 'hack'
 which appears to be a relatively standard way of doing that.
- Make the scripts executable.
- Update jenkinsfile.

Follows d95550248b

Differential Revision: https://code.wildfiregames.com/D3191
This was SVN commit r24353.
2020-12-09 15:22:24 +00:00
369c2e8801 Further header & precompiled cleanup, fix no-PCH builds.
GUIObjectBase is made a IGUIObject* to avoid including those headers
un-necessarily. Subsequent diffs ought to clean up the various of
pointers for that with a similar type with reference semantics.

Also:
- Add standard C and C++ headers (mostly cstring for memcpy, string and
vector) where needed.
- Swap out some includes for forward declarations
- Clean up un-necessary boost includes in precompiled and other headers.
- Clean up precompiled headers, including fewer things.
- Move ACPI to the windows-specific folder as it's included there only
and mostly specific to that platform.

Thanks Stan for the testing.

Differential Revision: https://code.wildfiregames.com/D3129
This was SVN commit r24352.
2020-12-09 14:39:14 +00:00
bb
715f441fbb Add context for mustang attack
Reviewed By: Nescio, wraitii
Differential Revision: D3197
This was SVN commit r24350.
2020-12-08 22:33:56 +00:00
050c5401b1 Adjust range visualisation and aura ranges following d0fc8ff67d
d0fc8ff67d / D2759 made ranges account for entity size, making auras
larger than they needed to be. This accounts for that.

Units haven't been changed, the delta is not worth modifying imo.

As discussed with Nescio, this means that, for a given aura, larger
buildings will now have a larger "aura area". This particularly affects
oblong buildings.
A proper solution for this would be to not approximate some structures
as a circle, but remains to be implemented.

Note that for current 0 A.D., this effect is unlikely to be a
significant gameplay advantage to one civilisation over another.

Reviewed By: Nescio
Differential Revision: https://code.wildfiregames.com/D3169
This was SVN commit r24349.
2020-12-08 12:53:07 +00:00
4bfc7048f0 Fix tests in bdbd0b9dbf
Forgetting about the tests is a categorical imperative.

This was SVN commit r24348.
2020-12-08 09:29:04 +00:00
bdbd0b9dbf Make construction previews local entities (fix 7bf933d5f6)
Identity classes where added to construction previews in D576 /
7bf933d5f6. This meant they counted towarde entity limits, as they were
not local entities.

This diff fixes that by making them local entities.

Thanks for s0600204 for raising the issue

Reported by: wowgetoffyourcellphone
Refs #2907

Differential Revision: https://code.wildfiregames.com/D3187
This was SVN commit r24347.
2020-12-08 08:32:15 +00:00
d4773df0c1 Version the documentation pipeline used on Jenkins
This was SVN commit r24344.
2020-12-07 15:49:47 +00:00
d95550248b Rework bundle creation scripts.
This reworks the OSX bundle script, to run it easily on CI and to
further also build the unix tarballs and the windows installer.

Clean up the MacOS bundle detection, by not forcing a compilation-time
switch.
Clean up shared library compilation: changing the installation name
isn't necessary for 0 A.D.

Differential Revision: https://code.wildfiregames.com/D3161
This was SVN commit r24343.
2020-12-07 13:44:42 +00:00
a2f3b25923 Update tinygettext to match upstream.
We're now ISO on the plural forms
(https://github.com/tinygettext/tinygettext/pull/30), so remove the
modified warning.
We use boost filesystem as <filesystem> and <experimental/filesystem>
are not available on the macOS CI yet.
(https://github.com/tinygettext/tinygettext/issues/31)

Differential Revision: https://code.wildfiregames.com/D3185
This was SVN commit r24342.
2020-12-07 13:15:31 +00:00