1
1
forked from 0ad/0ad
Commit Graph

104 Commits

Author SHA1 Message Date
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
568c415d0a Convert wchar_t*/wstring arguments to UTF-8 strings in CLogger messages.
This was SVN commit r16188.
2015-01-22 20:37:38 +00:00
e02d7ad949 Automatically replace %hs/%ls with %s in CLogger format strings.
Everything is char* now, so we don't need to mess around with different
string types.

Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs perl
-pi -e'1 while
s/(LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR).*)%[hl]s/$1%s/g'

This was SVN commit r16187.
2015-01-22 20:36:24 +00:00
38a8e2e0d6 Automatically convert most path.string().c_str() to path.string8()
Done with:

  ag -l 'LOG.*string\(\).c_str\(\)' source | xargs perl -pi -e'1 while
s/(LOG.*string)\(\)\.c_str\(\)/${1}8()/g'

This was SVN commit r16186.
2015-01-22 20:35:17 +00:00
49e2ecea63 Automatically convert all CLogger format strings from wchar_t* to char*.
Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs sed
-i 's/LOG\(MESSAGE\|MESSAGERENDER\|WARNING\|ERROR\)(L/LOG\1(/g'

This was SVN commit r16183.
2015-01-22 20:31:30 +00:00
8f387e0044 Remove code duplication and some cleanup.
This was SVN commit r16088.
2014-12-30 18:21:02 +00:00
1430efa9d6 Properly handle auto-research promotion techs at game start.
This was SVN commit r16009.
2014-11-25 22:47:02 +00:00
9407dbe45e Remove useless parameter from CFG_GET_VALUE.
This was SVN commit r15984.
2014-11-17 23:29:49 +00:00
c813a11427 Split ScriptRuntime and ScriptInterface code to separate files.
The runtime is becoming more and more important in the JSAPI. As a
result, we also have more functionality on the runtime level and having
the whole ScriptRuntime class hidden in ScriptInterface.cpp doesn't make
sense anymore. ScriptInterface.cpp also has become quite a large file
and pulling out the runtime part makes it a bit smaller.

Refs #2462

This was SVN commit r15961.
2014-11-13 11:19:28 +00:00
119aad9da9 fix a debug message
This was SVN commit r15811.
2014-09-26 17:07:17 +00:00
3b49576fa6 Tunes GC scheduling a bit to reduce memory usage.
The main problem was that GC was only called from the simulation before
this patch. This means when you were waiting in the multiplayer lobby or
just had the GUI open, it only called GC when getting close to the JS
runtime size limit (I assume). Another problem was the Net Server
runtime which didn't GC either. Here the runtime size limit is 16 MB
though, so it's not too terrible. These issues have both been addressed
and GC has been given a bit more time per incremental slice to make sure
it gets done in time. It's still far from perfect, but there are too
many changes in SpiderMonkey related to GC, so I don't want to spend too
much time on this yet.

Refs #2808

This was SVN commit r15787.
2014-09-22 20:13:04 +00:00
a2bd44b23a Exact stack rooting for JSON related ScriptInterface functions.
Refs #2415
Refs #2462

This was SVN commit r15603.
2014-08-02 22:21:50 +00:00
608c27fe10 Exact stack rooting for structured cloning functions.
Refs #2415
Refs #2462

This was SVN commit r15597.
2014-08-01 20:55:16 +00:00
5c07a25ddc More exact stack rooting (CallFunction object).
Changes CallFunction and CallFunctionVoid to use a HandleValue as object
parameter. Also changes some JS serialization/deserialization functions
to only support the JSAPI rooted types (drop support for CScriptVal and
CScriptValRooted there). Some other functions got changed too because
they were closely related.

Refs #2415
Refs #2462

This was SVN commit r15592.
2014-07-31 19:18:40 +00:00
28bdd8540f Quite a lot of stack rooting related changes.
Changes GetProperty, SetProperty and HasProperty and a few other
functions to take handles. The conversions to CScriptVal or
CScriptValRooted at some places should be removed in the future. I've
done that to avoid an even larger patch.

Refs #2415
Refs #2462

This was SVN commit r15568.
2014-07-26 22:33:16 +00:00
f41d4fa48e Fixes compartment mismatch introduced in a5ebd8dafd.
Also modifies some related functions to use SpiderMonkey stack rooting
types instead of CScriptValRooted.

Refs #2415

This was SVN commit r15561.
2014-07-26 10:58:24 +00:00
a5ebd8dafd Load trigger scripts in serialization test mode.
This was SVN commit r15549.
2014-07-22 23:30:27 +00:00
9f47ed536d Add engine support to triggers + a component to provide an easy interface and to be extended by triggers. Thanks to SpahBod for the biggest part of the code, and Yves for the review.
This was SVN commit r15421.
2014-06-23 13:42:59 +00:00
7ff5fbda2b Allow system components to be registered on the scripting side (so mods can make their own system components).
This was SVN commit r15157.
2014-05-18 13:44:08 +00:00
e9e05f4efc Second (main) commit for the SpiderMonkey upgrade.
This commit contains all the required changes to our source files and
build scripts (hopefully).
A next commit will remove the old stuff of SpiderMonkey 1.8.5.

Spcial thanks to:
 - H4writer who helped a lot mainly with the performance issues we
had/have, but also with other problems or questions.
 - Leper for the review.
 - Historic_bruno for implementing the build scripts on Mac OS X and
testing on the Mac.
 - The people from the #jsapi channel and from
mozilla.dev.tech.js-engine who answered a lot of questions and helped
solving problems.
 - All the other people who helped

Refs #1886
Fixes #2442
Fixes #2416

This was SVN commit r14877.
2014-03-28 20:26:32 +00:00
4b1297b328 Removes g_ScriptingHost and implements global to compartment 1 to 1 relation.
Each GUI Page gets its own compartment and all ScriptInterfaces in the
same thread should now use the same JS Runtime.
This is required for the SpiderMonkey upgrade.
Check the ticket for details.

Closes #2241
Refs #1886
Refs #1966

This was SVN commit r14496.
2014-01-04 10:14:53 +00:00
189ef85538 Fix AI errors on skirmish maps.
This was SVN commit r14285.
2013-12-04 16:52:44 +00:00
e6d9094c98 Remove InitSavedGame, but keep the rallypoint problem it solved. Fixes #1762, Patch by mimo.
This was SVN commit r14010.
2013-10-16 17:58:12 +00:00
5f5eedc513 Rename technology related files, methods and messages so their names represent the shared data flow between technologies and auras (and maybe future components). Implement the C++ part of auras through these generalised files. Fixes #2154
This was SVN commit r14001.
2013-10-15 10:05:08 +00:00
379a7b208f Implement the js side of auras. Refs #2048. Patch with the help of Alpha123. Only the temple aura is added as example, all other aura components are removed from the templates to be created from scratch again.
This was SVN commit r13998.
2013-10-14 15:51:21 +00:00
7901ed51d4 Implements skirmish maps, based on patch by sanderd17, fixes #1198. Skirmish maps are like scenarios, except the player can choose their civ during match setup. To create a skirmish map: place some skirmish entities for each player in Atlas (see templates/skirmish/* for examples), uncheck the player's civ in Atlas' player panel if desired, and save in the maps/skirmishes directory. The map will appear in match setup under the "Skirmish" match type.
Implements custom, VFS-based map load/save dialogs for Atlas (replaces
broken native file dialogs), fixes #631, #889.
Fixes map loading/saving to handle arbitrary subdirectories for better
organization.
Adds default settings to Atlas player panel, fixes #1872. Each setting
now has a checkbox to choose whether it should be saved with the map
(avoids writing lots of useless default data for each map).
Adds map preview setting to Atlas, refs #1745.
Cleans up and simplifies some duplicate code.
Fixes optional serialization performance test.

This was SVN commit r13938.
2013-10-04 02:29:16 +00:00
e370af8d4e Fix rally point rendering on saved games. Fixes #1762. Patch by mimo
This was SVN commit r13897.
2013-09-24 20:27:18 +00:00
05422ad545 Avoid slightly-expensive QueryInterface() calls
Add CEntityHandle which wraps an entity_id_t and also has a pointer to a
per-entity array of IComponents. QueryInterface/CmpPtr on a handle just
involve a couple of pointer dereferences instead of a map lookup.

This requires sizeof(void*) per registered interface type per entity,
which is currently ~0.5KB per entity, which shouldn't be a problem.

This was SVN commit r13825.
2013-09-11 20:41:53 +00:00
6cffdacb40 Small cleanup.
This was SVN commit r13547.
2013-07-10 00:08:05 +00:00
e33d4a52e9 AI API V3 along with a new version of Aegis. Support for a JS shared component that can be used or not for each AI.
This was SVN commit r13225.
2013-03-05 22:52:48 +00:00
92fdbb49b6 Moves particle interpolation to its own simulation component.
Fixes inconsistency between Atlas and in-game particle rendering during
pauses.
Fixes some issues related to Atlas simulation test and map loading.

This was SVN commit r13184.
2013-02-22 23:20:59 +00:00
276f0a41a0 New Year's clean-up.
Throw a warning if a invalid (not present) AI is specified in a map.
Replace the last occurences of jubot with qbot.
Exclude the common siege templates from the Units Demo map.
Fix an error with flying units.
Replace CFG_GET_SYS_VAL with CFG_GET_USER_VAL and rename it to
CFG_GET_VAL to reflect its behaviour better.
Fix linker error with clang 3.2. Refs 1588.
Remove some useless includes.

This was SVN commit r13031.
2013-01-01 18:33:53 +00:00
186224612c Fixes tests by checking CConfigDB is initialized before using CFG_GET_USER_VAL
This was SVN commit r12946.
2012-12-05 18:27:42 +00:00
eb4805d73d Adds command-line and config options for OOS log and serialization test modes: -ooslog and -serializationtest
This was SVN commit r12930.
2012-12-03 20:06:58 +00:00
1fb7889539 Postproc manager
This was SVN commit r12755.
2012-10-15 10:34:23 +00:00
vts
6b50a660b9 Added elapsed real time (as opposed to elapsed simulation time) to MT_Interpolate messages. Fixes leftover TODO from #824. Refs #824.
This was SVN commit r11944.
2012-06-06 19:37:03 +00:00
32d2927449 Adds UTF-8 support for JavaScript files.
This was SVN commit r11750.
2012-05-04 21:48:46 +00:00
da4c1c8f2b Fixes handling of UTF-8 encoded JSON files (stripping BOM if necessary). Fixes #1375.
This was SVN commit r11739.
2012-05-04 03:46:05 +00:00
755e407aeb Technologies. Refs #3. Full unlocking technology implementation. Only unit gathering rates can be modified currently because the patch was big enough already.
This was SVN commit r11584.
2012-04-20 17:21:04 +00:00
08bd07ddd6 Adds safe bool operator to ICmpPtr, replacing the null() method, based on patch by leper. Also changes bool operator in AtSmartPtr to safe bool. Fixes #1077.
Changes some CmpPtr variable names for consistency.

This was SVN commit r11036.
2012-02-08 02:46:15 +00:00
6399ec0cd2 # Partial support for saved games with AI.
Support cancelling loads while inside a loader callback.
Fix use of ArchiveReader/Writer since their API changed.
Improve error-detection in deserializer to avoid crashes.
Report deserializer errors to users.
Expand load-error message box to fit message about invalid saved games.

This was SVN commit r10787.
2011-12-22 14:04:32 +00:00
8cbab40137 Barter. Closes #23.
This was SVN commit r10588.
2011-11-24 15:43:32 +00:00
09a02c96d5 Add initial code annotations for the new profiling tool
This was SVN commit r10466.
2011-11-04 01:35:50 +00:00
23ae535a1e Minor enhancements to serialization test mode
This was SVN commit r10449.
2011-10-28 13:18:16 +00:00
18e595a5a6 Fix OOS-log paths to work on Windows
This was SVN commit r10434.
2011-10-27 14:17:39 +00:00
29e4f633f1 Add initial serialization test mode.
Reduce some dependencies on CSimulation2 to provide more flexibility.

This was SVN commit r10426.
2011-10-24 14:31:05 +00:00
27e5581d27 Fixes Atlas player panel getting out of sync with simulation. Fixes #927.
Fixes object panel not being notified of map loading.
Fixes bug where opening a new map before using the player panel
prevented default player data being displayed for new players.
Fixes wxGTK 2.8 bug: wxChoicebook control doesn't update the choice
control when adding/removing pages.
Notifies player that deleting player in Atlas will delete all their
objects (and gives them the option).
Changes DeleteObject to DeleteObjects to support multiple selections.
Implements undo for map resize (experimental).
Removes annoying debug message from attempted undo of map settings.
Tweaks a few Atlas UI controls.

This was SVN commit r10064.
2011-08-22 21:45:39 +00:00
f9d7c1246d # Initial support for territories
This was SVN commit r9889.
2011-07-20 19:48:06 +00:00
2aedf48304 #788 Eliminate delay in path finding (and therefore moving)
This was SVN commit r9665.
2011-06-26 07:03:08 +00:00
3e4d74480d Adds AI control to Atlas player panel
Adds camera control to Atlas player panel
Changes map reader to handle per-player starting camera position. See
#55
Adds entity name filter to Atlas object panel
Fixes bug in Atlas map settings (caused crash when object panel was not
loaded)

This was SVN commit r9617.
2011-06-13 23:32:41 +00:00