1
1
forked from 0ad/0ad
Commit Graph

133 Commits

Author SHA1 Message Date
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
5cf2086a33 Fix the initial exploration of territories, which shouldn't be performed in Atlas.
Also clean up the code a bit.

Fixes #2969

This was SVN commit r16129.
2015-01-08 22:36:13 +00:00
9329506e0d add support for civ specific player template, see #2877
This was SVN commit r16092.
2014-12-31 09:31:41 +00:00
d21cf8f3aa Clarify some comments.
This was SVN commit r16060.
2014-12-23 00:46:00 +00:00
ce0c1e4302 Report names of components or interfaces in case of error when registering those.
This was SVN commit r16059.
2014-12-23 00:29:14 +00:00
8e2d514228 Exact stack rooting for CParamNode
Refs #2415
Refs #2462

This was SVN commit r15944.
2014-11-09 11:08:53 +00:00
7dad37c78f Some cleanup. Fix a comment.
This was SVN commit r15928.
2014-11-05 00:22:14 +00:00
acd86047dc Only split strings if they are non-empty. Fixes previous commit.
This was SVN commit r15737.
2014-09-12 23:11:03 +00:00
134e3c84b0 Clean up some code.
Fixes linker error on OSX.

This was SVN commit r15735.
2014-09-12 21:45:30 +00:00
12771edb0e Delete dynamic message subscriptions on simulation reset.
This was SVN commit r15646.
2014-08-16 01:23:50 +00:00
83aa817f71 Exact stack rooting for simulation message type conversions.
Also replaces some deprecated API (jsval typedef and OBJECT_TO_JSVAL) in
that part of the code.

Refs #2415

This was SVN commit r15624.
2014-08-09 20:02:49 +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
c818b8e475 Exact rooting for CallConstructor.
Refs #2415
Refs #2462

This was SVN commit r15601.
2014-08-02 16:30:15 +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
e818b08344 Better support for SpiderMonkey rooted types in the ScriptInterface.
* Adds additional overloads/specializations which are required when
passing JS::Handle<T>/JS::MutableHandle<T> types to different functions.
* Replaces GetPropertyJS with a GetProperty specialization.
* Allows us to avoid the implementation of ToJSVal specializations for
JS::Value and JS::HandleValue. Such conversions should only happen if
there's no way around it and if you are aware of it.
* Adds test to make sure that all potentially required specializations
with custom implementations are instantiated. This should help prevent
introducing bugs in temporarily unused code.

Refs #2415

This was SVN commit r15567.
2014-07-26 20:31:29 +00:00
a5ebd8dafd Load trigger scripts in serialization test mode.
This was SVN commit r15549.
2014-07-22 23:30:27 +00:00
a82d32bd3c Fixes MSVC warning C4189: 'componentManager' : local variable is initialized but not referenced (Script_RegisterComponentType_Common is a static member function, so an instance of CComponentManager isn't needed)
This was SVN commit r15526.
2014-07-13 20:38:34 +00:00
1b5ab8142e Makes custom JS objects compatible with SpiderMonkey ESR31.
In v24 you called JS_InitClass and passed in a definition of JSNative
functions. Later you could call JS_NewObject with this class and the
object would get a prototype with the specified JSNative functions.
In ESR31 you now have to explicitly store the prototype object returned
by JS_InitClass and pass it as prototype argument to JS_NewObject to
achieve the same.
This change modifies our existing ScriptInterface implementation for
custom object types a bit and uses it at places where the JSAPI was used
directly before.

Refs #2462

This was SVN commit r15524.
2014-07-13 15:31:48 +00:00
754e76e4a1 Fix non-PCH build
This was SVN commit r15401.
2014-06-19 23:36:09 +00:00
d936bde74a Dynamic message subscriptions.
Allow components to individually subscribe/unsubscribe to messages,
instead of statically subscribing the entire component type. Use this
for most Interpolate/RenderSubmit messages, to avoid the performance
cost of passing those messages to a large number of components that will
just ignore them anyway.

On Azure Coast this reduces total time per frame by about 30% on a
CPU-bound system.

This was SVN commit r15400.
2014-06-19 23:20:12 +00:00
b4f3b503f2 code style cleanup
This was SVN commit r15273.
2014-06-02 15:48:37 +00:00
a500826ae4 Since the VFS logs the missing files now, there's no reason to crash on it.
This was SVN commit r15272.
2014-06-02 15:41:41 +00:00
1882f28504 New unit renderer.
Instead of each CCmpVisualActor rendering itself individually, collect
all the units in a single CCmpUnitRenderer. This avoids the overhead of
doing Interpolate/RenderSubmit calls every frame for every object in the
world. It also allows more efficient culling.

CCmpUnitRenderer knows the positions of each object at the start and end
of each turn, and computes the bounding sphere of the object along that
path. That allows quick culling without recomputing the precise
interpolated transform every frame. (In the future it could be improved
much more.)

Clarify and clean up the sending of PositionChanged messages, and add
new InterpolatedPositionChanged.

Remove the forceFloating parameter from GetInterpolatedTransform, since
it doesn't fit the new design. Replace it with a (non-synchronised) flag
in CCmpPosition.

Move construction progress from CCmpVisualActor to CCmpPosition, so that
it consistently affects all position/transform computation.

Refs #2337.

This was SVN commit r15265.
2014-06-01 18:24:50 +00:00
d117d96d22 Simplify component deserialization.
Deserialize SYSTEM_ENTITY before any other entities. This makes it safe
for Deserialize() methods to access system components (mirroring how
Init() can already access system components).

Add a Deserialized message, sent after all entities have been
deserialized, to help with some other sequencing problems.

This was SVN commit r15264.
2014-06-01 18:14:09 +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
b7f6c00c2b Mark all components as global variables and allow to re-register existing components to update their schema and/or message receiving methods.
This allows for components to be extended in other files, so mods don't
have to overwrite entire components.
Fixes #2517. Thanks to Rada for helping on this
(also fix some tests broken in the previous commit)

This was SVN commit r15150.
2014-05-18 08:20:02 +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
02860690eb fix unused parameter warning.
This was SVN commit r14789.
2014-02-26 19:16:44 +00:00
3f78042f45 Fix tests and C++11 build.
This was SVN commit r14788.
2014-02-26 19:08:03 +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
b1c081e36d Set svn:eol-style=native, fix some inconsistent line endings
This was SVN commit r14299.
2013-12-06 00:42:50 +00:00
5d9b2b95b0 Ticket #2127 - Performance and style improvements in scriptinterface.
No real behavior changes, only code maintenance.

Fixed signed/unsigned mismatch in EntityMap.h

This was SVN commit r13865.
2013-09-16 19:10:06 +00:00
1b6a5fa802 This was SVN commit r13861. 2013-09-15 21:37:05 +00:00
9694eec8b8 As per ticket #1707. Some minor improvements to spatial subdivision. Makes way for future changes in RangeManager.
Right now merely improves memory usage.

This was SVN commit r13854.
2013-09-15 14:03:53 +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
b1bd61938e add file notification to Mac ticket 514, also change name of class FileInfo to CFileInfo to ease Mac development
This was SVN commit r13821.
2013-09-10 14:17:04 +00:00
d037d97d55 disable querying of local entities with a component. Avoids OOS problems. Patch thanks to historicbruno. Fixes #2119
This was SVN commit r13820.
2013-09-10 12:27:59 +00:00
53a5781c66 Increase simulation script runtime size again. Refs #1436, #1966 and #2035.
This was SVN commit r13794.
2013-09-01 23:29:21 +00:00
7ff167e7de Removes more unused variables, based on patch by Markus, refs #1852.
Adds TODOs to use POT textures in fancy water rendering.

This was SVN commit r13663.
2013-08-15 18:25:32 +00:00
1712b0f42d Increases simulation script runtime to 32 MB to reduce OOM errors, refs #1436, #1966, #2035
This was SVN commit r13659.
2013-08-15 05:15:54 +00:00
8c74df2acd Give an elevation advantage to ranged units. Patch by sanderd17. Fix #1960.
This was SVN commit r13626.
2013-08-03 19:20:20 +00:00
39c0498811 Changes terrain anchoring to use faster CalcExactNormal instead of CalcNormalFixed, refs #1988, #2039
This was SVN commit r13571.
2013-07-17 05:42:16 +00:00
d2b0d25457 Fixes macro redefinition of FACILITY_VISUALCPP in VC2012 (it's defined in winerror.h).
Removes obsolete hack for old Boost and VC2005 (broke VC2005 build with
modern Boost).

This was SVN commit r13433.
2013-05-28 01:14:41 +00:00
31be9cd0de Adds building previews that rise during construction, fixes #1174, refs #21.
Adds scaffold support for foundations, includes two examples for 3x3 and
4x4, fixes #1581.
Extends CmpVisualActor and CUnit to support random variant seeds.
Fixes bug in actor hotloading.
Fixes serialization failure caused by destroying entities in OnDestroy
handlers.

This was SVN commit r13143.
2013-02-03 02:08:20 +00:00
3653fe5d3a Added support for putting technologies in folders. Fixes #1462.
This was SVN commit r12440.
2012-08-15 22:25:25 +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
vts
490182ddd0 Wall placement. Closes #786.
This was SVN commit r11760.
2012-05-05 19:22:22 +00:00
32d2927449 Adds UTF-8 support for JavaScript files.
This was SVN commit r11750.
2012-05-04 21:48:46 +00:00