1
0
forked from 0ad/0ad
Commit Graph

16 Commits

Author SHA1 Message Date
ab5616b4c4 Mass rename CxPrivate to CmptPrivate.
As part of the SM45->52 migration, a ScriptInterface becomes a wrapper
around a JSCompartment, not a JSContext, thus we ought to store private
data for the compartment and not the context.
This is a mass rename of CxPrivate to CmptPrivate to match that before
the actual changes.

Part of the SM52 migration, stage: SM45 compatible

Patch by: Itms
Tested By: Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3089
This was SVN commit r24177.
2020-11-13 16:44:15 +00:00
27da92e55f Main.cpp cleanup.
Use an enum to indicate the type of engine shutdown instead of three
bools.
State in the comments that the program is restarted within the same
process.

In preparation of introducing an IsQuitRequested function (which shall
not be named is_quit_requested as stressed by Vladislav):
Rename kill_mainloop to QuitEngine, restart_mainloop to RestartEngine,
restart_mainloop_in_atlas to StartAtlas to not break consistency.
Don't rename RestartInAtlas in JS just now.
Group declarations at the top of main.cpp.

This was SVN commit r21817.
2018-05-08 09:45:54 +00:00
13e1702777 Add missing ScriptInterface includes to
JSInterface_L10n.cpp from d6db5a466d,
JSInterface_Renderer.cpp and JSInterface_GUITypes.cpp from 4b1297b328,
JSInterface_VisualReplay.cpp from b830233498,
JSInterface_Game.cpp from 5f8be8e0c6,
JSInterface_Simulation.cpp from 921c5515a6,
JSInterface_Debug.cpp from d6cb9c845b,
JSInterface_Main.cpp from 486aec18d4, refs #4772,
JSInterface_Mod.cpp where it was incorrectly removed in af03c72f76.

Refs D1470.
Sort includes alphabetically, add recent Coding Convention macro
comments.

This was SVN commit r21789.
2018-04-27 16:48:44 +00:00
86fcf0de8c Move ModIo JS interface functions to a separate namespace, refs 833c9f108c.
Differential Revision: https://code.wildfiregames.com/D1466
Reviewed By: Itms
This was SVN commit r21778.
2018-04-24 13:12:08 +00:00
833c9f108c mod.io support.
mod.io is a new platform for sharing mods, that 0 A.D. can make use of
in order to download mods and install them.

Based on patch by leper, numerous changes from s0600204, vladislavbelov,
Imarok, elexis, temple and myself.
Differential Revision: https://code.wildfiregames.com/D1029
This was SVN commit r21759.
2018-04-22 18:14:45 +00:00
02ed411e6f Fix comments and year in d5807cd59f and 01f581e813
Reviewed by: elexis
Differential Revision: https://code.wildfiregames.com/D1314
This was SVN commit r21313.
2018-02-21 22:53:01 +00:00
01f581e813 Move GetEngineInfo to Mod.[h|cpp]
Suggested by: elexis
refs d5807cd59f

This was SVN commit r21242.
2018-02-17 17:36:43 +00:00
af03c72f76 Move GetAvailableMods
Reviewed by: elexis
Differential Revision: https://code.wildfiregames.com/D1106
This was SVN commit r20591.
2017-12-05 17:17:21 +00:00
9defd11440 Pass ScriptInterface as a const ref where possible.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D739
This was SVN commit r20028.
2017-08-24 00:32:42 +00:00
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
20b4e039be Fix fileendings of files with mixed fileendings in the public mod (except art, l10n) and in source/ (except for source/third_party/).
Thus fix lineendings in files that were missed in bcbf25bfbd, as
reported by Imarok.

(SVN throws an error when trying to set the native filending property on
a file with mixed fileendings. However when recursing it hides this
error).

This was SVN commit r18561.
2016-07-25 12:58:47 +00:00
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
1a66f510d0 Use const T& for parameters of some types in script-exposed native functions
Using references matches the C++ coding style better and should improve
performance a bit in theory. It avoids 2 copies of T in case of the
functions registered with RegisterFunction (mainy used in the GUI). It
should also avoid one or two copies in case of
DEFINE_INTERFACE_METHOD_X, which is used in the simulation, but I
haven't bothered to count it there exactly.
It is now predefined which types have to be passed by const reference
and which are passed by value. Note that references can't be used as
out-parameters (to return multiple values to JS). This hasn't worked
before either and probably never will.

This was SVN commit r17696.
2016-01-23 15:17:56 +00:00
c02a7e1a7b SpiderMonkey 31 upgrade
This upgrade also introduces exact stack rooting (see to the wiki:
JSRootingGuide) and fixes problems with moving GC. This allows us to
enable generational garbage collection (GGC).
Measurements a few months ago have shown a performance improvement of a
non-visual replay of around 13.5%. This probably varies quite a bit, but
it should be somewhere between 5-20%. Memory usage has also been
improved. Check the forum thread for details.

Thanks to everyone from the team who helped with this directly or
indirectly (review, finding and fixing issues, the required C++11
upgrade, the new autobuilder etc.)! Also thanks to the SpiderMonkey
developers who helped on the #jsapi channel or elsewhere!

Fixes #2462, #2415, #2428, #2684, #1374
Refs #2973, #2669

This was SVN commit r16214.
2015-01-24 14:46:52 +00:00
6e788fb15e Clean up JSON parsing code. Refs #1374.
Fix Engine.ReadJSONFile() which did throw a JS exception that was not
caught. Discovered by s0600204.
Expose Engine.ReadJSONFile() to the gui scripts.

This was SVN commit r15959.
2014-11-13 01:26:22 +00:00
64bfa089af Add mod selection mod.
Includes some contributions by rada and sanderd17.

This was SVN commit r15677.
2014-08-25 16:02:54 +00:00