- 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.
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.
- 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.
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.
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.
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 #500Fixes#5470
Differential Revision: https://code.wildfiregames.com/D2752
This was SVN commit r24361.
- 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.
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.
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.
This ugprades 0 A.D. to the latest ESR at the moment of writing.
Mostly straighforward API changes (see meta-Bug 1633145)
- js::Class is merged with JSClass
- JSNewArrayObject becomes JS::NewArrayObject
- ArrayObject-functions are moved to a new public header Array.h
- JSMSG error messages have again been changed, requiring some tweaks.
- AutoValueArray becomes RootedBalueArray (Bug 1634435)
- 'uneval' is behind a Realm flag (Bug 1565170), but no removal is
planned in the short-term future.
- Some minor GC API changes (Bugs 1569564 and 1633405)
- Error reporting has had some tweaks, and error flags have been removed
(Bug 1620583)
- StructuredClone are now always thread-safe, simplifying an API change
introduced in SM52 (Bug 1607791)
Tested by: Stan, Freagarach, mammadori
Closes#5861
Differential Revision: https://code.wildfiregames.com/D3168
This was SVN commit r24333.
SM78 drops usage of Python 2 in favour of Python 3.
SM78 is the first ESR to actually use rust, which means a new static
library is bundled.
This means LLVM-objdump is now a dependency of Spidermonkey, and also 0
A.D.
SM78 also removes the need for NSPR on Windows (Bug 1556646).
Tested by: Stan, Freagarach, mammadori
Refs #5694
Refs #5861
Differential Revision: https://code.wildfiregames.com/D3167
This was SVN commit r24332.
Original diff D2512
Reported on forum by gameboy:
https://wildfiregames.com/forum/index.php?/topic/27384-strange-landing-on-the-island-and-unable-to-attack/
Units with goal where minrange = maxrange rarely arrive to destination,
because they miss it.
See Todo in unitmotion
Relative part:
In the meantime, one should avoid that 'Speed over a turn' > MaxRange -
MinRange, in case where min-range is not 0 and max-range is not
infinity.
For that reason avoid passing minrange = maxrange from ai.
Also warn in cpp unitmoition when getting this kind of command.
Differential revision: D3149
Reviewed by: @wraitii
This was SVN commit r24315.
- Remove the last usage of the MACRO "TRUE" as it's deprecated and
replace it by its value "1" the == operator is overloaded to return a
UBool(int8_t) refs 9b9a96382c
- Remove two unused DLLs
- Update and add EOL to headers.
Refs #3004
This was SVN commit r24314.
The `pology` library runs on Python2 and development appears stalled. It
is also not available on pip.
The `babel` library, BSD-licensed, provides, amongst many other things,
a replacement for .POT / .PO manipulation.
The `poediff` tool that we used to detect spurious i18n change is
replaced with a Python script that does a simpler but good enough job
(it is also much, much faster).
These replacements let the i18n scripts run on Python3 entirely.
Makes D506 redundant.
Comments by: Itms
Reviewed By: Gallaecio
Refs #5694
Differential Revision: https://code.wildfiregames.com/D2757
This was SVN commit r24313.
f78d3ddf71 / D1781 would fix an important source of lag... If it
actually used the code.
Also clean up some comments.
Reported by: Vladislav
Differential Revision: https://code.wildfiregames.com/D3176
This was SVN commit r24312.
Supported compilers are Clang 5, GCC 7, Visual Studio 17, Xcode 9.3
Update Atlas alongside since the replacement APIs are c++17 only.
De-activate the StyledTextCtrl module of WxWidgets on mac, since that is
a wrapper around the Scintilla Text editor and doesn't compile with
C++17 (as it uses auto_ptr). We don't use the editor, so this is also a
win on the compilation time front.
Closes#5862
Differential Revision: https://code.wildfiregames.com/D3166
This was SVN commit r24308.
CText requires re-rendering every message when adding a new one, which
quickly becomes very slow.
Use CList and a custom method to work around this.
These classes are in need of a more complete refactoring.
Based on a patch by: nani
Differential Revision: https://code.wildfiregames.com/D1781
This was SVN commit r24306.
C++14 deprecates and C++17 removes functions we use for random sounds.
This makes FastRand() fit the URG interface, and uses the appropriate
function.
Refs #5862
Differential Revision: https://code.wildfiregames.com/D3107
This was SVN commit r24302.
std::binary_function was a pre-C++11 construct, that is removed entirely
in c++17, and no longer necessary regardless.
Refs #5862
Differential Revision: https://code.wildfiregames.com/D3164
This was SVN commit r24301.
No noteworthy API changes.
Details:
- Remove UTF16 script execution since UTF8 is supported in SM68 and
going forward
- Several new headers includes are required
- Realms replace Compartments as "global holders" (see meta-Bug 1357862)
- JSRequests are removed entirely (Bug 722345), see also aae417bd29
- Trivial API updates in ProxyHandlers, ArrayBuffer, Warnings, GC
reasons, Context options, ObjectIsFunction, ValueVectors and
JSCompartment
See also the migration guide:
https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples/blob/esr78/docs/Migration%20Guide.md
Tested by: Freagarach, Stan, Subitaneo
Fixes#5860
Differential Revision: https://code.wildfiregames.com/D3144
This was SVN commit r24297.
No noteworthy build system changes, however rust is now necessary for
Spidermonkey compilation.
On windows, clang-cl is now necessary.
Tested by: Freagarach, Stan, Subitaneo
Refs #5860
Differential Revision: https://code.wildfiregames.com/D3143
This was SVN commit r24296.
Ahead of the SM68 migration, where we will need to use VS17, drop
support for compiling with VS16.
Refs #5862
Differential Revision: https://code.wildfiregames.com/D3158
This was SVN commit r24286.
Update the lib used to handle plists, as dmgbuild changed things for
Python3.
Refs #5694
Differential Revision: https://code.wildfiregames.com/D3157
This was SVN commit r24282.
Use FinishedOwnCommands, which is intented to plan commands for the N+2
turn, but can be used to run commands immediately by the replay manager,
and unlike FinishedUpdate is called before the first update.
Reported by: Freagarach
Fixes#5546
Differential Revision: https://code.wildfiregames.com/D3067
This was SVN commit r24280.
Correctly recompute the actor when something changes that could modify
it (ownership change, ...).
Make sure mirages are updated when they reappear after being hidden.
Make sure foundations have proper identity classes.
Make sure mirages don't respond to value modifications in the visual
component.
Clarify a few comments.
Earlier work by: Sandarac
Fixes#2907
Differential Revision: https://code.wildfiregames.com/D576
This was SVN commit r24279.
If modifiers (except shift) are used, hotkeys should still be triggered.
Fixes a4852c4c01 / D2814
Reported by: Stan`
Differential Revision: https://code.wildfiregames.com/D3154
This was SVN commit r24278.
clean-workspaces.sh now cleans SM libs, so it needs to be called before
building libraries.
Differential Revision: https://code.wildfiregames.com/D3153
This was SVN commit r24274.
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.
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.