Commit Graph

72 Commits

Author SHA1 Message Date
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
0c16980408 Fix tests.
This was SVN commit r13709.
2013-08-19 10:55:35 +00:00
b3653cfe16 Updates bundled Valgrind headers to 3.8.1 and fixes test build, patch by Markus, fixes #1971
This was SVN commit r13473.
2013-06-12 03:38:37 +00:00
29549561e1 Add flag to VisualActor for entities that should only be visible in Atlas. Patch by KareemErgawy. Fixes #1411.
This was SVN commit r13465.
2013-06-09 23:18:21 +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
1fb7889539 Postproc manager
This was SVN commit r12755.
2012-10-15 10:34:23 +00:00
99d04e93bb Implements global tech modification function. Fixes #1358, refs #1520.
Applies tech modifications to template data returned by GuiInterface.
Extends engine to load arbitrary global scripts, separates this from RNG
replacement. Refs #1193.
Loads global scripts for most script contexts for consistency.
Adds simulation tests for global scripts.

This was SVN commit r12056.
2012-07-03 02:16:45 +00:00
ebe5b66ba3 Fix test failure caused by f660f834bf.
This was SVN commit r12014.
2012-06-24 21:03:46 +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
vts
34fc883317 Pretty unit selection overlay rings. Fixes #824.
This was SVN commit r11623.
2012-04-22 04:04:02 +00:00
vts
d7128572ae Removed logger output for XML token node tests
This was SVN commit r11360.
2012-03-17 23:03:02 +00:00
vts
31da0a746b Fixes crash when removing non-existent tokens from XML 'token' nodes
This was SVN commit r11342.
2012-03-15 22:57:08 +00:00
vts
b8e8602e39 Fixed test failure in test_CmpTemplateManager.h after atlas selection improvement
This was SVN commit r11182.
2012-02-27 19:10:49 +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
0ec4242962 Detect and fix printf signedness errors. Fixes #1086, #1087.
This was SVN commit r10846.
2012-01-01 16:43:10 +00:00
301854702c add support for removing individual files from VFS and a mechanism for automatically doing so (add filename.extension.DELETED to the same directory/archive), as discussed in meeting.
refactor: split up Invalidate into RemoveFile+RepopulateDirectory
GameSetup: fix: ensure the first mod always overrides game files,
irrespective of timestamp.

This was SVN commit r10610.
2011-11-26 18:37:53 +00:00
d57bb00ece Fix sparse array serialization
This was SVN commit r10442.
2011-10-27 20:56:32 +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
b6d04004b6 Avoid errors when using planes in formations, by not allowing them to join formations
This was SVN commit r9776.
2011-07-07 17:05:22 +00:00
2c58b07223 # Add experimental fighter planes.
This was SVN commit r9605.
2011-06-09 19:44:40 +00:00
f608b44d1d fix self-test and map load on Windows (avoid mixing dir separators).
add more specific error codes (used at work)

This was SVN commit r9462.
2011-05-06 18:45:30 +00:00
a122f55bde Avoid hardcoding the actor entity template details.
This was SVN commit r9183.
2011-04-06 21:01:00 +00:00
dcd192cb60 refactor path interface:
- use wrapper class instead of std::wstring (reduces mixing of
strings/paths; allows safe+easy join via operator/ and convenient
case-insensitive comparison via operator==, avoids NativePathFromString,
similar to boost::filesystem)
- NativePath -> OsPath
- add hash and To/FromJSVal for Path
- add TS_ASSERT_PATH_EQUALS
- replace _wfopen_s with sys_OpenFile
- remove obsolete SortFiles/Directories

This was SVN commit r9107.
2011-03-23 13:36:20 +00:00
c3405e6f50 path improvements/fixes:
- replace more std::wstring with Native or VfsPath; wstring_from_utf8 ->
NativePathFromString
- replace sequences of Join(Path(), Basename+extension) with
ChangeExtension in wsdl, CacheLoader
- add Path::IsDirectory to replace .empty() / path_is_dir_sep(.back()).
also changed behavior to reflect the fact that "" is the VFS root
_directory_
- Path::Join now allows 2 identical path types (e.g. VfsPath) or one
char* literal (prevents inadvertently introducing non-safe characters).
to convert from wstring or wchar_t, use an explicit ctor (e.g.
VfsPath(wchar_t_string))

This was SVN commit r9091.
2011-03-21 19:54:08 +00:00
6d25329412 # towards locale-independent pathnames on Linux
c.f.
http://www.wildfiregames.com/forum/index.php?showtopic=14541&st=0&p=217250&#entry217250
and 2011-03-19 meeting

This was SVN commit r9090.
2011-03-21 17:53:13 +00:00
25524dc99f Fix tests
This was SVN commit r9080.
2011-03-18 19:35:31 +00:00
6f9da85d9f Improve performance of full state hash computation, by skipping script components that are known to have no data.
Switch to much quicker (and less comprehensive) per-turn hashing in
multiplayer games.

This was SVN commit r9036.
2011-03-05 22:30:32 +00:00
f4f36af852 Block new buildings being placed on top of existing not-yet-started foundations. Fixes #740.
This was SVN commit r8980.
2011-02-24 21:49:24 +00:00
f6c1d98c9a Fix #739 (test failures).
Use JSON in debug serializer output unless it fails due to e.g. cyclic
values, in which case use toSource.
Disable file stats code by default, since its output isn't used.

This was SVN commit r8975.
2011-02-24 00:32:38 +00:00
b8925fbbc9 # Support AI construction of buildings.
Pass terrain passability data to AI scripts.
Expand pathfinder passability data to 16 bits per tile, to allow more
classes.
Support 16-bit ints in serializer.
Partially support JS typed arrays.
Allow foundations to be placed on top of units (fixes #499).
Stop farms and fishes blocking movement (fixes #534).
Add obstruction flags to allow finer control over what they block.
Associate entity IDs with obstruction shapes, to allow finding colliding
entities.
Support moving to the edge of a target entity with inactive obstruction.
Support foundation entities in AI.
Support playing as non-hele civs.

This was SVN commit r8899.
2011-02-10 16:06:28 +00:00
f39f279132 Add AI script code to provide a cleaner API around the engine interface.
Handle AIProxy entirely through scripts.
Support structured clones of script values.
Improve performance.
Support multiple script contexts sharing a runtime.
Use a separate context per AI player.

This was SVN commit r8866.
2011-01-15 23:35:20 +00:00
dd501b2a5a # Add initial basic player AI framework.
Support direct access to serializer streams, so serializers can be
nested.
Make component script "this.template" read-only.
Stop globally-subscribed component scripts receiving messages posted to
local components, to reduce out-of-sync risks.
Move pathfinder data out of entity template directory.
Fix GuiInterface deserialization.

This was SVN commit r8865.
2011-01-12 12:29:00 +00:00
d8cd31d4b6 Add probably-unnecessary script serialization test.
This was SVN commit r8862.
2011-01-12 12:13:11 +00:00
bd3bd084c0 Support new SpiderMonkey API.
wposix: Define int8_t compatibly with SpiderMonkey.
Remove unused camera, lightenv JS interfaces.
Remove most of vector JS interface.
Remove some of the redundant JS string conversion functions.
Remove unneeded vmem, _lodBias functions.
Clean up some formatting.

This was SVN commit r8629.
2010-11-16 23:00:52 +00:00
ab77ec40e4 Fix highlighting of obstructed building placement previews.
Prevent building in non-visible areas.
Fixes #594.

This was SVN commit r8272.
2010-10-04 17:34:33 +00:00
924d1219a7 # Add fog-of-war.
Move Vision component to C++, for more efficient FoW processing.
Disable FoW on demo maps.

This was SVN commit r8160.
2010-09-23 12:13:13 +00:00
8a98102195 Fix serialize/deserialize API asymmetry.
Add serialization support to more components.

This was SVN commit r8122.
2010-09-17 17:53:26 +00:00
4471d37ca5 Fix script caching of inherited templates.
This was SVN commit r7773.
2010-07-21 16:04:17 +00:00
f6081101e7 Use more precision in debug serialization, to help debugging of OOS errors
This was SVN commit r7689.
2010-07-04 17:03:45 +00:00
df86f4d27b Fix tokenisation to ignore multiple spaces
This was SVN commit r7676.
2010-07-03 15:21:50 +00:00
c57575df3e Set each player's default camera location to their civ center.
This was SVN commit r7672.
2010-07-03 13:15:57 +00:00
5bc3c4b751 Fix inheritance of construction/training lists.
This was SVN commit r7667.
2010-07-03 01:23:23 +00:00
1edb23e7a4 Fix script serializer to cope with spliced array enumeration quirk
This was SVN commit r7637.
2010-06-27 11:57:00 +00:00
47a03c3397 Replace JS_Enumerate with manual enumeration, to avoid its memory allocations.
Use LookupProperty to avoid having to check for getters.
Add a quicker method of rooting many script values.

This was SVN commit r7579.
2010-05-25 18:24:12 +00:00
6fdb947ff0 Convert CCmpTemplateManager to use ASCII strings internally, to save memory and serialisation cost.
This was SVN commit r7577.
2010-05-25 18:17:12 +00:00
a9963dee56 Serialize JS strings as UTF-16(ish), to avoid the cost of UTF-8 conversion.
This was SVN commit r7576.
2010-05-25 18:07:41 +00:00
fd1f864cde Avoid unreliable float conversions when loading old maps.
Use debug_printf in performance test, to work better on Windows.

This was SVN commit r7575.
2010-05-25 17:55:41 +00:00
64a610baab Add some code for rough testing of state hashing performance.
Simplify the code needed for tests based on real maps.

This was SVN commit r7574.
2010-05-25 17:28:26 +00:00
5c3a59234c Fix OOS errors when placing buildings.
Allow script components to supply custom serialization objects.

This was SVN commit r7571.
2010-05-22 23:02:07 +00:00
4e661a205d Serialize RNG state
This was SVN commit r7564.
2010-05-22 01:32:11 +00:00