1
1
forked from 0ad/0ad
Commit Graph

21058 Commits

Author SHA1 Message Date
4928508dcd Properly set and get GUI objects' style attribute in JS
This fixes tab buttons not playing sounds when pressed.

Original patch by: Stan
Amended patch reviewed by: Stan

Differential Revision: https://code.wildfiregames.com/D3109
This was SVN commit r24270.
2020-11-27 02:30:42 +00:00
8b720117ee Follow up of D3126. Refactor L10.cpp following wraitii's advice.
This was SVN commit r24269.
2020-11-26 22:29:36 +00:00
9ae084519f Fix most of the new vs2017 induced warnings.
Refs: https://code.wildfiregames.com/D3096
https://code.wildfiregames.com/D3103 #5862
Reviewed by: @wraitii
Comments by: @Angen
Differential Revision: https://code.wildfiregames.com/D3126
This was SVN commit r24268.
2020-11-26 22:28:50 +00:00
d7d0f142d8 Update (and debundle) fmt dependancy
We now support the most recent released version of `fmt` available (at
the time
of committing).

As we no longer patch `fmt` to get it to work within `pyrogenesis`, this
commit
also mostly removes its source from our code-tree (some headers are
retained for
Windows builds).


If you are a user of...

Linux/BSD: You will now need to have `fmt` installed from your
distribution's
           package repository. The minimum supported version of `fmt` is
`4.0`.

      OSX: The source is acquired and compiled (in `build-osx-libs.sh`),
           then included and linked automatically.

  Windows: The relevant header files are retained and, along with a
pre-built
           library, are the only things still bundled.


Accepted by: wraitii
Tested by:
* Freagarach (Lubuntu 18.04, `fmt 4.0.0`)
* Krinkle (MacOS 10.14, `fmt 6.1.2`)
* nephele (Alpine Linux)
* wraitii (MacOS 10.14)
* Nescio (Fedora 33, `fmt 7.0.3`)

Windows library files built by: Stan
Fixes: #3190
Differential Revision: https://code.wildfiregames.com/D2689
This was SVN commit r24267.
2020-11-26 21:01:32 +00:00
fb3a0b7add Use new JS Map/Set APIs in the serializer
Patch by: Itms (for the most part)
Refs #5860

Differential Revision: https://code.wildfiregames.com/D3146
This was SVN commit r24266.
2020-11-26 18:15:47 +00:00
Angen
64243cf5f3 Revert b1a78ce285
Fix in b1a78ce285 actually worked by accident, and introduced more
serious issue with minimal range.

Differential revision: D3148
Fixes: #5864
Reviewed by: wraitii
This was SVN commit r24264.
2020-11-26 15:51:46 +00:00
97e254c295 Fix MacOS GNUTLS linking against the 10.12 SDK
This also speed up compilation in general.

This was SVN commit r24263.
2020-11-26 14:47:36 +00:00
eb7940b418 Silence warnings about unused result.
Introduce a DISCARD macro to ignore the warn_unused_result attribute
used by Spidermonkey, and reuse it elsewhere.

Differential Revision: https://code.wildfiregames.com/D3147
This was SVN commit r24261.
2020-11-26 13:58:59 +00:00
22d1742311 Fix MacOS libpng compilation against the 10.12 SDK
This was SVN commit r24260.
2020-11-26 09:15:36 +00:00
a33b3883e1 Fix forgotten patch file in 9a1c7cb8d2
This was SVN commit r24258.
2020-11-26 08:00:43 +00:00
9a1c7cb8d2 Upgrade Mac OS libraries
All are updated except:
- WxWidgets (not sure about compatibility)
- libogg (doesn't compile)
- zlib/libsodimum which have no update.

This drops supports for 10.11 and earlier, meaning we can now assume
SSE4.1 is present.
Updates the build system to account for this.

Closes #5777 (by virtue of upgrading to SDL 2.12)

Refs #4362

Differential Revision: https://code.wildfiregames.com/D3111
This was SVN commit r24257.
2020-11-26 07:20:10 +00:00
646ff183ae Fix horse breed animations. Fix naming conventions while at it.
Patch by: @Alexandermb
This was SVN commit r24255.
2020-11-25 22:08:46 +00:00
c4c7d3c760 Fix recent macOS builds.
Fix aarch64 build for NVTT.
Fix warning about GLVND when building on Linux (Patch by @Stan)
Native EOLs.

Patch by: @Itms
Differential Revision: https://code.wildfiregames.com/D2563
This was SVN commit r24245.
2020-11-24 19:36:19 +00:00
d07f271d60 [SM60 2/2] Update to Spidermonkey 60 APIs
Two noteworthy changes:
- Proxies are update to the SM60 API, having an explicit reserved slot
and a private slot, in which the 'proxy data' and the C++ object are
stored. This fixes a debug assertion failure of SM52 (See bugs 1237504
and 1339411)
- The GC callback behaviour has changed slightly, and we should now only
look for GC_SLICE_BEGIN and GC_SLICE_END calls (Bug 1364547)

Other updates are minor:
- Bug 1339036: JSTYPE_VOID beomes JSTYPE_UNDEFINED
- Bug 1308236 - avoid ambiguous comparison by changing NULL to nullptr
- Bug 1421358, GC::reason::REFRESH_FRAME was removed. API is indicated
in jsapi.h so use that.
- Compartment behaviours update
- ClassOps changes (Bug 1389510 removed the getter/setter - 7c04ea0211 -
and bug 1370608 added one more before that so net minus one)
- Minor tests touchups again.

Tested by: SubitaNeo, Stan
Thanks to bellaz89 for the Shared Array fix

Closes #5859

Differential Revision: https://code.wildfiregames.com/D3116
This was SVN commit r24243.
2020-11-24 15:47:03 +00:00
f2cf2c97ad [SM60 1/2] Upgrade Spidermonkey build system and binaries to 60.9.1
This changes VS to use the same library name as other platforms, since
the toolsets are binary-compatible going forward. This makes the build
script slightly more streamlined on windows.
Also enable building NSPR on windows as part of the spidermonkey build,
instead of compiling it separately.

Tested by: SubitaNeo, Stan
Refs #5859

Differential Revision: https://code.wildfiregames.com/D3115
This was SVN commit r24242.
2020-11-24 15:41:52 +00:00
a226c4804e Fix segfault in FCollada with Visual Studio > 2013. Bump the version of fcollada for macOS; Linux has no check. add native eol to the file.
Reviewed by: @wraitii
Comments by: @smiley
Differential Revision: https://code.wildfiregames.com/D2474
This was SVN commit r24241.
2020-11-24 11:07:05 +00:00
5ef6ff054d Prepare for VS2017 upgrade - workspace updates
This:
- Generates a VS solution for VS17
- Explicits the boost toolset chosen, leveraging ABI compatibility to
avoid recompiling the library (for now).
- Likewise, reuses the Spidermonkey libraries. The SM60 upgrades does
away with putting the toolset in the library name entirely.

Refs #5862

Differential Revision: https://code.wildfiregames.com/D3130
This was SVN commit r24240.
2020-11-24 08:29:21 +00:00
1fbf51ccf1 Fix OS detection on Windows 10.
Compatibility mode will be handled in a later diff.

Comments by: @Itms, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D2420
This was SVN commit r24238.
2020-11-23 10:11:37 +00:00
15001ec798 Enable C++14
Spidermonkey 60 can only be compiled with C++14. This conflicts with
building 0 A.D. with C++11, so upgrade to C++14 first.
This in itself should not drop compiler support on any platform.

Tested on Windows by: Stan
Tested on Linux by: Freagarach
Refs #5859
Refs #5862

Differential Revision: https://code.wildfiregames.com/D3124
This was SVN commit r24235.
2020-11-22 14:34:31 +00:00
2288de4aa6 Remove UniqueRange custom code in favour of unique_ptr
UniqueRange was a unique_ptr replacement with a few tweaks (such as a
compulsory custom deleter). Its features are not really used, it
contains outdated atomic calls, and it blocks D1511, thus it is removed.

Refs #5165

Differential Revision: https://code.wildfiregames.com/D613
This was SVN commit r24234.
2020-11-22 13:43:19 +00:00
3391542fec Fix rendering options failures following 8a1b3d6769
Two issues are fixed:
- Atlas on non-Mac crashed when started from within the game.
- MSAA options crashed if enabled on startup.

The underlying issues where improper shutdown, and assuming the renderer
was initialised than it might not be (in particular, the post-processor
wasn't).

Tested by: Stan
Differential Revision: https://code.wildfiregames.com/D3131
This was SVN commit r24233.
2020-11-22 11:09:13 +00:00
b3c5347e26 Real fix for d0fc8ff67d,
Follows from d0fc8ff67d, 95dbb8be25.
The original diff asserted that only "real" entities would make range
queries. This proved inaccurate as building previews can too. However,
simply removing the assertion doesn't fix the issue, given that they
still aren't found and we still need to account for their size.

This fixes that properly by special-casing local entities.

Thanks s0600204 for giving this a look.

Reported by: Mr.lie
Differential Revision: https://code.wildfiregames.com/D3132
This was SVN commit r24231.
2020-11-22 09:29:45 +00:00
7c04ea0211 Make JS GUI Objects Proxy objects.
The JS-side counterparts of C++ objects are now Proxy objects, in
anticipation of SM60 changes that remove the get/set hooks entirely.
This makes semantic sense too as they are essentially phantom wrappers
around the C++ objects, with no proper JS representation.

By using different proxy handlers for different GUI object types, we can
further fix issues encountered in D2136 by defining the relevant
functions only on objects that should have them.

The main complexity with proxy handlers is that Spidermonkey assumes in
several places that they are static and data-less, so they cannot be
used directly to hold data. This diff works around that issue by storing
per-script-interface data in the CGui directly.

Further API changes in SM60 make this slightly cleaner.

Comments by: Itms
Refs #5859

Differential Revision: https://code.wildfiregames.com/D2768
This was SVN commit r24229.
2020-11-21 17:49:06 +00:00
8a1b3d6769 Allow registering hooks that trigger on config changes.
Rendering options use this capability to simplify their implementation.
This makes it easier to add new options.

Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D2293
This was SVN commit r24228.
2020-11-21 11:57:14 +00:00
f6348b9617 Clean up header includes, add new forward declarations.
This cleans up many un-necessary header includes, either simply
providing nothing or forward declarations in their place.

No major compilation time change here, though this does reduce depencies
in some headers.

Also fix up old MacOS STL-include fixes that are no longer relevant.

Differential Revision: https://code.wildfiregames.com/D3128
This was SVN commit r24227.
2020-11-21 11:20:29 +00:00
8726a2abbf [gameplay] tweak human training times to make them feel less "spammy"
Patch by: @Nescio
Reviewed by: @borg-
Like by: @Lionkanzen
Differential Revision: https://code.wildfiregames.com/D2866
This was SVN commit r24226.
2020-11-21 11:13:15 +00:00
560127a5c8 [gameplay] Remove structure <Loot/xp> as most builings are destroyed by siege.
Patch by: @Nescio
Reviewed by: @ValihrAnt
Comments by: @borg-
Differential Revision: https://code.wildfiregames.com/D2992
This was SVN commit r24225.
2020-11-21 11:08:37 +00:00
95dbb8be25 Fix broken assertion in d0fc8ff67d
I incorrectly assumed no local entities would be making range queries,
but some building previews do. The assert is thus incorrect.

Reported by: SubitaNeo
Fixes #5870

Differential Revision: https://code.wildfiregames.com/D3125
This was SVN commit r24223.
2020-11-20 15:30:55 +00:00
ff924aaffc Fix no-PCH builds and checkrefs following a4852c4c01
Fixes D2814 / a4852c4c01.


Differential Revision: https://code.wildfiregames.com/D3123
This was SVN commit r24222.
2020-11-20 11:41:56 +00:00
eef9e9517b Fix .dae files with Windows paths inside.
FCollada asserts, but only on windows for whatever reason, when loading
a file that contains a Windows path.
There are many others, but the game explicitly fixes those, so I haven't
changed them for now.

Reviewed By: Stan
Differential Revision: https://code.wildfiregames.com/D3120
This was SVN commit r24220.
2020-11-20 08:26:46 +00:00
640efa557e Add a hashing function for CStr8 & CStrW
Reviewed by: @wraitii
Differential Revision: https://code.wildfiregames.com/D3106
This was SVN commit r24218.
2020-11-19 15:25:27 +00:00
d0fc8ff67d Update range queries to account for entity size.
CCmpRangeManager queries do not take obstruction size into account,
meaning they return fewer entities than they should. This particularly
affects buildings with ranged attacks, gates, and a few other templates.

This is, unfortunately, a slight performance decrease.

Discovered following Angen's comment [[
https://code.wildfiregames.com/D2738#116269 | here ]].

Comments by: Angen
Reviewed By: bb
Refs #3381 (not marking it down as 'fixes' and I'm not entirely sure it
was the only moving part here).

Differential Revision: https://code.wildfiregames.com/D2759
This was SVN commit r24217.
2020-11-19 14:07:24 +00:00
b57abe806c Move civ-specific templates to subfolders.
See also
https://wildfiregames.com/forum/index.php?/topic/28614-template-folder-structure/.

Differential Revision: D2952
Reviewed By: @Nescio
This was SVN commit r24216.
2020-11-19 10:20:25 +00:00
a4852c4c01 Let players remap hotkeys in-game, fix default hotkeys being qwerty-specific.
- Provide a "Hotkey" screen to let players remap hotkeys in-game using a
convenient setup.
- Make all .cfg hotkeys refer to scancodes (i.e. position on the
keyboard), so that default hotkeys now translate correctly for AZERTY,
QWERTZ and other layouts.
- 'BackSpace' is now an alias for 'Delete', and works for killing units.
This fixes #1917, as macs don't have a proper delete key and would need
to use Fn+Del otherwise. This shifts "timewarp" to Shift+BackSpace.

Functionally, this switches hotkeys to scancodes, as that makes more
sense (they are combinations of key positions, not actual text output).
SDL includes are cleaned and key names are reused.

Fixes #2850, Fixes #2604, Refs #1810, Fixes #1917.

Follows work in 3d7784d2af.

Various diffs tested by: Angen, Stan, Freagarach
Comments by: Nescio
Differential Revision: https://code.wildfiregames.com/D2814
This was SVN commit r24215.
2020-11-19 09:27:26 +00:00
e6adfd01bf Deactivate RTTI (except in AtlasUI) on all platforms.
D2768 inherits from a Spidermonkey class, and SM is built without rtti.
This won't compile unless we also compile without RTTI, and that diff is
required for SM60.
Further, windows was already compiling without RTTI and our coding
conventions say to not use it, so this is more of a regularization.

AtlasUI is left unaffected as WXWidgets uses it (and it's a dynamic
library so separate enough to do that).

Differential Revision: https://code.wildfiregames.com/D3104
This was SVN commit r24214.
2020-11-19 08:36:25 +00:00
f1881a0ccd Missed a rebase when committing 0cdd69e8e5.
Adds the attack name.
Diff: D2595.

This was SVN commit r24213.
2020-11-19 07:05:57 +00:00
0cdd69e8e5 Separate elephant archer from cavalry templates.
Making it easier to change just one of the two.
Also makes some stats more similar to that of a champion elephant, most
notably the vision was increased from 92 to 100 and deleted wedge
formation.

Patch by: @Nescio
Differential Revision: D2595
Comments by: @Angen, @bb.
This was SVN commit r24212.
2020-11-19 06:42:29 +00:00
5faf62d9ee Allow affecting garrison list via tech and auras
Reviewed by: @Freagarach
Differential Revision: https://code.wildfiregames.com/D3070
This was SVN commit r24210.
2020-11-18 21:39:22 +00:00
bb
85c9a48db0 Generalize to arbitrary translatable attacknames in the GUI
Reviewed By: Nescio, Freagarach
Comments By: wraitii, elexis
Differential Revision: D2995
refs: #252

This was SVN commit r24209.
2020-11-18 21:34:33 +00:00
2dd223af29 Rename nuba -> noba.
Also renames clubman to maceman.

Patch by: @Nescio
Differential Revision: D3018
This was SVN commit r24207.
2020-11-18 20:13:30 +00:00
0cbd07b455 [SM52 3/2] Revert static linking change on linux - other fixes.
This reverts static linking on linux from 6bb08fb424, it appears to fail
to link and/or crash, depending.

- Commit the tarball.
- Update update-workspaces.sh

Refs #4893

Differential Revision: https://code.wildfiregames.com/D3114
This was SVN commit r24205.
2020-11-18 19:08:15 +00:00
fd8f5abd2e [SM52 2/2] Update to Spidermonkey 52 APIs.
No particularly noteworthy changes, as most complex API changes were
already supported in SM45 and done.
The addition of JSStructuredCloneData allows to remove our custom class.

Changes:
- InformalValueTypeName is back in the API, so remove our
implementation.
- Stop using JSRuntime entirely in favour of JSContext*
- JSPropertyDescriptor is renamed.
- CompartmentOptions are tweaked slightly (no functional changes)
- JS::Construct - API update.
- JSClass split - API update.
- A js.msg error message was removed, so we had to use a different one.
- Tests fix: fix comparison of union instances
- Disable warning in spidermonkey Vector.h
- Update error reporting to SM52 (minor API updates)
- Ignore warnings about unused return values (would come from OOM, which
isn't recoverable)

Most of the patching was done by Itms.

Tested by: Stan, Freagarach
Fixes #4893

Differential Revision: https://code.wildfiregames.com/D3095
This was SVN commit r24203.
2020-11-18 14:39:04 +00:00
6bb08fb424 [SM52 1/2] Upgrade Spidermonkey build system and binaries to 52.9.1
Of note is the change to static linking on *nix (MacOS already used it).
The logic is that we can only use one single version of SM, so that
advantage of dynamic linking is lost regardless. We might also see
performance gains in the future with LTO enabled. It is also slightly
easier to distribute the program as a result. Expect a negligible size
increase in the binary size (offset somewhat by no longer needing to
distribute .so files). Finally, it streamlines the build script.

Also noteworthy in this commit:
- The MacOS build script is folded back into the general build script.
- the perl/sed command is replaced by patching the configuration file,
which at least warns if it starts failing in the future.

Binaries for windows provided by @Itms
The bulk of the patching was also done by @Itms.

Tested by: Stan, Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3094
This was SVN commit r24202.
2020-11-18 14:34:17 +00:00
935af751b9 Fix building without precompiled headers.
Broken in several recent diffs.
This also fixes (very) old missing standard headers.

Differential Revision: https://code.wildfiregames.com/D3110
This was SVN commit r24200.
2020-11-18 11:35:36 +00:00
0f2b00326f Notify players with a sound when a player is defeated
Includes alarm_defeated_ally.ogg by @Samulis

Reviewed by: @bb
Comments by: @Angen Freagarach
Differential Revision: https://code.wildfiregames.com/D2860
This was SVN commit r24199.
2020-11-18 09:14:08 +00:00
bb
28c11ab6f2 Lets not break tests in 029751c135
This was SVN commit r24198.
2020-11-18 08:31:03 +00:00
bb
029751c135 Don't uselessly traffic constant statuseffect translatable strings and icons through the guiinterface.
Reviewed By: wraitii
Differential Revision: D3112
Fixes: 876b035336

This was SVN commit r24197.
2020-11-18 08:25:43 +00:00
841b381607 Correct a few weapon prop names.
Patch by: @Nescio
Differential Revision: https://code.wildfiregames.com/D3015
This was SVN commit r24196.
2020-11-17 10:06:09 +00:00
4f897d7151 Napatan voices for the Kushites. Audio fixes (reverb, background noises) and equalization by @Samulis
This was SVN commit r24195.
2020-11-16 22:36:39 +00:00
d0c1d119dc Using same value for unit and terrain ambient colors for random maps.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3079
This was SVN commit r24194.
2020-11-16 20:40:31 +00:00