Commit Graph

548 Commits

Author SHA1 Message Date
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
b30a9a6384 Remove m_NeedInitialXZRotation - not needed after changes to map loading order.
This was SVN commit r15263.
2014-06-01 18:10:00 +00:00
59c9ae670f Stop VFS from causing a crash when the AI player isn't found. Patch by Itms. Fixes #2558
This was SVN commit r15254.
2014-05-31 14:55:09 +00:00
e2aa24fc9a Clean up the turret interface a bit + fix serialisation for turrets
This was SVN commit r15250.
2014-05-31 11:35:07 +00:00
cfec28e553 Add the Engine code for turrets + use them to get units on walls. The scripted TurretHolder isn't included due to lack of usability for now. Refs #2577
This was SVN commit r15246.
2014-05-30 14:46:06 +00:00
a0913cbc75 Fix the interpolation changes from the previous commit, as they weren't smooth
This was SVN commit r15232.
2014-05-26 17:12:05 +00:00
5ae9f678b0 Clean up position height methods + add new. Now we have the ability to losslessly read and write positions to entities from the scripts.
This was SVN commit r15230.
2014-05-26 16:23:46 +00:00
c3a0ac43bf Broadcast TerrainChanged message, so CCmpSelectable can actually see it.
This was SVN commit r15229.
2014-05-26 15:44:35 +00:00
4ca40116ed Fix building selection rings not being recomputed when the terrain or water under them is changed.
This was SVN commit r15228.
2014-05-26 13:45:49 +00:00
1871daab0d Fix pathfinding and territories not being recomputed when water height changes.
This was SVN commit r15227.
2014-05-26 13:45:10 +00:00
41f62cd3ff Add WaterChanged message, for things that need to be recomputed when the water height changes.
This was SVN commit r15226.
2014-05-26 13:44:24 +00:00
ae29becb37 Removes pointless minimap state change during attack notification, it broke synchronized simulation state and caused some OOS errors. Fixes #2525. Refs #1719, #2526.
This was SVN commit r15163.
2014-05-19 01:35:14 +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
86196212e2 Improve navigation for ship formations by setting the formation controller to the right passability class
This was SVN commit r15149.
2014-05-18 07:59:43 +00:00
7acdde5c86 Changes tests to use global g_ScriptRuntime instead of creating a new JSRuntime for each test.
The tests crashed on my Debian systems but not on my Ubuntu system.
The crash happened in line 142 of SpiderMonkey's ThreadLocal.h.

I know that I had to use a workarounnd for contexts to avoid destroying
the context that was created first. I also had in mind that in newer
versions a JS_Init function got introduced which presumably solves this
kind of issues.
Based on this experience I assumed runtimes could have a similar problem
and this patch indeed fixes the issues.
Unfortunately the correct usage of JSRuntimes in that regard is not
documented.
There's only a rater misterious comment in JSAPI.h which hasn't been
cleared up so far and is most likely completely outdated
(https://bugzilla.mozilla.org/show_bug.cgi?id=992641).

This was SVN commit r14995.
2014-04-25 21:19:51 +00:00
e1488fee56 Add an 'explore map' option to the game setup.
This was SVN commit r14931.
2014-04-14 19:52:49 +00:00
bb71823aee Make the actor tech-modifiable. Fixes #2243
This was SVN commit r14928.
2014-04-14 15:00:49 +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
883f307b40 Implement a basic observer mode. Any player which joins a multiplayer game but is not assigned a player slot automatically becomes an observer. Refs #69
This was SVN commit r14849.
2014-03-16 23:29:27 +00:00
ef888367aa Cleanup tex_codec, fixes #2456, patch by IronNerd.
This was SVN commit r14836.
2014-03-13 04:16:20 +00:00
a5639631ee Texture system refactoring and cleanup, fixes #2455, patch by IronNerd.
This was SVN commit r14835.
2014-03-13 02:37:05 +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
e2f4379e9a Fix an issue with corruption of water data when the actor editor opened in Atlas.
Potential marginal optimizations to the water data creation code.

This was SVN commit r14784.
2014-02-25 06:27:15 +00:00
c44b48bd59 Fix Atlas lag due to Position component that listens to the territoriesChanged message
This was SVN commit r14768.
2014-02-21 13:42:46 +00:00
19965ce37a Fix missing territory decay when moving out of territory without changing the actual territory. Add possibility to check movement over territory boders in the JS simulation part. Based on patch by niektb
This was SVN commit r14754.
2014-02-16 15:22:11 +00:00
9780d7177d Adds some missing vars.
This was SVN commit r14742.
2014-02-09 16:04:30 +00:00
bab3a08643 Fixes a crash introduced in fd187f466f by ensuring that the CScriptValRooted values are destroyed before calling JS_DestroyContext.
I've tested the performance on Combat Demo (Huge) again with the code
from #2394.
It's very close but probably a little bit lower (hard to tell because
it's so close).

Closes #2408
Refs #2394

This was SVN commit r14705.
2014-01-30 13:21:36 +00:00
fd187f466f Add vector prototype to vector-like return values from C++ to JS. Fixes #2394.
This was SVN commit r14645.
2014-01-23 11:32:08 +00:00
c1e86161b5 AIs now properly receive aura and technology updates. Fixes #2377, Refs #1520 . Consequently reimplement repairing for AIs.
Fix a few style issues and a bug with the gatherer count.
Still need to fix the entity.js file to handle properly some things as
this uses raw templates values.
Cache the AIinterface in AIProxy.js, please report if this works
properly.

This was SVN commit r14588.
2014-01-16 20:32:44 +00:00
bd22432fe8 Rename common-api-v3 to common-api.
Fix warnings with the new AI.
Fix an error with the per-player gatherer counts.

This was SVN commit r14559.
2014-01-10 17:46:48 +00:00
ec36222b20 add more flexibility to eject units when garrisonHolder is destroyed, fixes #2242
This was SVN commit r14550.
2014-01-08 18:27:58 +00:00
83c5d40cfb fix compiling problem caused by 8226d75715
This was SVN commit r14535.
2014-01-07 14:37:02 +00:00
8226d75715 Make PickEntitiesAtPoint faster yielding 1-3% overall performance improvement. Fixes #2358. Also removes some trailing whitespace.
This was SVN commit r14532.
2014-01-07 04:05:10 +00:00
729a795a44 of course, 7a3b1fe47e can be simplified
This was SVN commit r14531.
2014-01-06 23:23:18 +00:00
7a3b1fe47e Improve speed of territory computation, fixes #2360
This was SVN commit r14530.
2014-01-06 22:49:57 +00:00
15ec863aec Substantial speed-up of the foam generation code.
Remove waves for now as they were unsatisfactory.
Removes "shininess" as a water parameter as it was basically useless.
Add a button in Atlas to recompute water parameters so you can now see
fog in Atlas.

Fixes #1743, #1803 (invalid)
Refs #1875, #2114, #48.

This was SVN commit r14514.
2014-01-05 16:15:20 +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
9d9361ae44 Why you should test your code before committing, exhibit A.
This was SVN commit r14466.
2013-12-31 21:45:11 +00:00
a7cafe75aa "Reveal all player" id back to -1, add some "ensure" to catch invalid player ids and be safer.
This was SVN commit r14465.
2013-12-31 21:30:48 +00:00
fe2a97b0c9 Change some useless std::map into std::vector for LOS. Player "0" now reveals the LOS for all.
This was SVN commit r14463.
2013-12-31 16:38:11 +00:00
dddc9bab7f Fix tests.
This was SVN commit r14452.
2013-12-30 18:55:37 +00:00
298115f4c5 Fix units chasing each other. Fixes #1537
This was SVN commit r14449.
2013-12-30 16:07:19 +00:00
08b44fe647 Fix water rendering (transparent objects now appear correctly when underwater/in reflections)
Add a new config option (renderactors) that, if set to false, will
prevent actors from rendering in-game (grass…)

This was SVN commit r14447.
2013-12-30 15:52:42 +00:00
3362c591f5 Moves AI players to one global using the module pattern.
This avoids wrapping overhead that would otherwise be required because
multiple globals per compartment aren't supported anymore in newer
versions of SpiderMonkey.

Check the ticket for a detailed explanation.

Closes #2322
Refs #2241
Refs #1886

This was SVN commit r14441.
2013-12-30 10:04:59 +00:00
1efd47c1ad Fix errors when loading a saved game with Aegis by making sure the AI re-inits properly. Still no real saved game support.
This was SVN commit r14329.
2013-12-11 17:10:14 +00:00
f9bee5d3ec Slight de-obfuscation of the AI code.
This was SVN commit r14317.
2013-12-09 14:20:11 +00:00
966f7c7145 Removes some duplicated code.
This was SVN commit r14311.
2013-12-08 19:23:09 +00:00