Commit Graph

84 Commits

Author SHA1 Message Date
72ca6c5f80 Style cleanup by leper, preparing the SpiderMonkey update. Refs #3708
This was SVN commit r18579.
2016-08-02 16:12:11 +00:00
4ea49f374a Disable serialization of the AI when no AI players are present. Disable serialization of cached AI templates overall. Improve serialization of repetitive vectors and templatenames. Refs #3834
This was SVN commit r18121.
2016-05-02 09:26:07 +00:00
fb92761c92 Use explicit types instead of auto.
This was SVN commit r17642.
2016-01-13 00:42:55 +00:00
f4898c18d8 SpiderMonkey 38 removes the JS_LookupProperty{,ById} API. Refs #3708.
Use JS_GetProperty{,ById} instead.
Ensure that we break if someone tries to serialize a getter by using
something similar to what we used pre 47a03c3397.
https://bugzilla.mozilla.org/show_bug.cgi?id=1094176

This was SVN commit r17633.
2016-01-11 20:03:33 +00:00
775f856421 Use .assign instead of operator=.
This was SVN commit r17631.
2016-01-11 20:03:28 +00:00
332096e4ed SpiderMonkey 38 removes JS_AllocateArrayBufferContents.
Users required the returned buffer to be passable to free(), so replace
it by malloc().
https://bugzilla.mozilla.org/show_bug.cgi?id=1037358

This was SVN commit r17511.
2015-12-19 02:49:46 +00:00
2239fe338c The jschar typedef is removed in SpiderMonkey 38.
Since it already is char16_t in 31 replace it by that.
https://bugzilla.mozilla.org/show_bug.cgi?id=1063962

This was SVN commit r17506.
2015-12-19 01:29:55 +00:00
69ab2bae5b Some ctors were made explicit in SpiderMonkey 38, so call them where needed.
https://bugzilla.mozilla.org/show_bug.cgi?id=1013663

This was SVN commit r17505.
2015-12-19 01:13:56 +00:00
2f6f0bd477 Serialize everything that is needed by UpdateVisibilityData instead of assuming everything as dirty.
Fixes #3271.

This was SVN commit r17223.
2015-11-11 12:15:57 +00:00
c0b4e78801 Fixes stream serialization bug on OS X 10.8 and older, which caused instant OOS in multiplayer games, fixes #3108.
Fixes test failures on OS X 10.7 and older, refs #3109

This was SVN commit r17133.
2015-10-15 03:31:30 +00:00
dcf8e66aca Update the goal serialization for 03d2c5e40b. Fixes #3425.
This was SVN commit r17068.
2015-09-24 17:13:39 +00:00
2aef62d65f Handle backrefs properly for maps and sets. Fixes #3374.
Allocate the tag for the backreference before deserializing the content,
to match the order of serializing.

This was SVN commit r16959.
2015-08-30 04:51:16 +00:00
36c6b50944 Revert emplace for associative containers. Fixes #3366.
GCC < 4.8.0 does not support emplace for those.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44436.

This was SVN commit r16922.
2015-08-19 03:32:47 +00:00
8bfe16cac8 Use in-place construction.
This was SVN commit r16894.
2015-07-29 23:44:17 +00:00
e1a34eb4ea Handle (de)serialization of the AI pathfinder.
This was SVN commit r16815.
2015-06-24 20:24:58 +00:00
6581796103 New long-range pathfinder.
Based on Philip's work located at
http://git.wildfiregames.com/gitweb/?p=0ad.git;a=shortlog;h=refs/heads/projects/philip/pathfinder
Includes code by wraitii, sanderd17 and kanetaka.

An updated version of docs/pathfinder.pdf describing the changes in
detail will be committed ASAP.

Running update-workspaces is needed after this change.

Fixes #1756.
Fixes #930, #1259, #2908, #2960, #3097
Refs #1200, #1914, #1942, #2568, #2132, #2563

This was SVN commit r16751.
2015-06-12 18:58:24 +00:00
f6f4f83784 Fixes instant multiplayer crash on OS X Lion (10.7). libc++ had a bug where it set eofbit on reading the last character in a stringstream, we compare gcount with the expected length as a workaround to detect real eofs. Fixes #3109.
This was SVN commit r16714.
2015-06-04 05:11:47 +00:00
c93c1c92eb Replace std::auto_ptr uses by std::unique_ptr since the former is deprecated.
This was SVN commit r16674.
2015-05-25 01:23:27 +00:00
b8a20c958c Do not serialize properties for Sets. Serialization tests for Map and Set.
This was SVN commit r16620.
2015-05-04 01:41:09 +00:00
a9afa61a7b Serialization support for ES6 Sets.
This was SVN commit r16608.
2015-05-01 23:04:28 +00:00
bb9de80dd4 Convert CConsole to take UTF-8 strings.
This avoids vswprintf failures when printing non-ASCII char* strings
from CLogger into the console.

Also convert ScriptInterface::ToString to return UTF-8, to avoid some
utf8_from_wstring calls.

Also remove some unused and redundant CConsole functions.

This was SVN commit r16333.
2015-02-14 01:49:34 +00:00
bd7b07cc80 Make the visibility cache a bit more clever, by making LoS tiles as dirty separately for each player.
It is necessary to rely on shared los masks, else some visibility
updates will be missing.

Refs #2913, see this ticket for a performance graph.

This was SVN commit r16328.
2015-02-12 23:22:29 +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
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
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
f5336c42b8 Adds Serialization support for ES6 Maps.
Also includes the patch from Sanderd17 to use Maps and Sets for the
Timer components. Sets can't be serialized yet, but in this case they
don't require serialization.
Refs #2475

This was SVN commit r15770.
2014-09-20 17:14:53 +00:00
efb889b79a Exact stack rooting for WriteStructuredClone and functions that use it.
Refs #2415

This was SVN commit r15607.
2014-08-03 19:32:39 +00:00
169174824f Exact stack rooting for ScriptInterface::ToString.
I had to change a few other functions to take JS::MutableHandleValue
because JS::Stringify takes a JS::MutableHandleValue as input parameter.
That seems a bit strange because it should not change that value.
I assume it has historical reasons.

Refs #2415
Refs #2462

This was SVN commit r15605.
2014-08-03 17:29:49 +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
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
f3714a7075 Fix invalid count for entityMaps
Improve error reporting on failed deserializations
Fixes #2328

This was SVN commit r14806.
2014-03-05 14:58:17 +00:00
e24ce51029 Adds DynamicArena allocator that grows by fixed chunk size, fixes #2142.
Changes fixed size arenas to new dynamic arenas with reasonable chunk
sizes (may require tuning), refs #1842

This was SVN commit r13916.
2013-09-30 01:22:44 +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
88c4e5bdd0 Extends binary serializer to support some standard JS classes: Number, String, Boolean. Fixes #406.
Extends binary serializer to support typed arrays.
Extends binary serializer to support custom JS prototype objects in AIs,
fixes #407.
Allows full serialization of AIs (not yet implemented). Refs #1089,
#1886
Increases binary serializer script backref arena from 8 MB to 16 MB,
refs #1842

This was SVN commit r13429.
2013-05-26 21:57:24 +00:00
ba94247744 Added unordered map serialization
This was SVN commit r13039.
2013-01-03 22:33:04 +00:00
a01e1cd46a Fixes incorrect use of jschar (broke Linux builds)
This was SVN commit r11207.
2012-02-29 23:41:23 +00:00
366cd7f15a Fixes broken selections in saved games (CmpSelectable needed to call Init on deserialization).
Adds function name to log output when serializer fails on functions, to
aid in debugging.

This was SVN commit r11199.
2012-02-28 22:12:30 +00:00
0ec4242962 Detect and fix printf signedness errors. Fixes #1086, #1087.
This was SVN commit r10846.
2012-01-01 16:43:10 +00:00
1f38526444 Fix test failures on Windows
This was SVN commit r10802.
2011-12-23 13:37:11 +00:00
4f6f0b7baf Fix tests, and warnings, and non-PCH build
This was SVN commit r10801.
2011-12-23 13:01:29 +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
f31a8f7181 Fix warning
This was SVN commit r10448.
2011-10-28 13:16:53 +00:00
d57bb00ece Fix sparse array serialization
This was SVN commit r10442.
2011-10-27 20:56:32 +00:00
4c561dc3f9 Improve debugging of binary serialization
This was SVN commit r10440.
2011-10-27 20:10:53 +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
8af8326563 replace old pool_allocator/RawPoolAllocator with ProxyAllocator that draws upon the new-style Arena (more efficient, avoids slow VirtualAlloc)
This was SVN commit r10410.
2011-10-16 10:37:21 +00:00
609f1643d5 Fix -Wconversion warnings in simulation code.
Cast to smaller integer types explicitly.
Generally avoid platform-dependent types (size_t) in simulation code.
Use float versions of math.h functions, not double.

This was SVN commit r10017.
2011-08-16 11:18:32 +00:00
2f0bd8d8b0 Upgrade to SpiderMonkey 1.8.5 (fixes #734)
This was SVN commit r9852.
2011-07-16 23:24:14 +00:00
996a32125c Add per-player LOS-reveal flag.
Reveal LOS for Gaia and AI players (fixes #879).
Use player_id_t slightly more consistently in interfaces.

This was SVN commit r9720.
2011-06-28 23:24:42 +00:00