Commit Graph

429 Commits

Author SHA1 Message Date
52f4cda439 Changes ToJSVal to take JS::MutableHandleValue instead of JS::Value&.
JS::MutableHandleValue is similar to JS::HandleValue, but the whole
JS::Value it points to can be replaced.
This change is needed for support of exact stack rooting and moving GC.
Contains a few other trivial API adjustments and style improvements too.

Refs #2462
Refs #2415

This was SVN commit r15534.
2014-07-14 19:52:35 +00:00
17634d7507 Move the minimap to only use the shader pipeline. Should make it OpenGL ES compatible (untested).
This was SVN commit r15533.
2014-07-14 17:15:22 +00:00
319cf16b5a Small cleanup, including a correction in the templates documentation, and the removal of residues from the culling changes.
This was SVN commit r15514.
2014-07-12 16:03:37 +00:00
2174eaaeee Add a VisibilityChanged message sent by the range manager whenever an entity changes visibility for any player.
This will be necessary for hiding buildings/trees/etc in fog-of-war, and
may be useful for AIs and for UnitAI.

Refs #599.

This was SVN commit r15508.
2014-07-10 20:51:39 +00:00
991d5bbd63 Fix random maps for my water changes. Fix the replay mode after I had broken it. Fix an occasional crash (that might have crashed Atlas, need someone to check).
Improve debugging slightly in case of framebuffer errors. Fix a few
style issues.

This was SVN commit r15486.
2014-07-04 09:03:21 +00:00
326290463e Further WIP water improvements. Add 3 different textures for different looks. Update some oasis maps for that. Streamline water settings (some removed, some added). Update Atlas for those (needs to be tested). Fix an issue with HQ water effects.
Please report any issue and/or crash. Those will get fixed in commits to
come. Refs #48.

This was SVN commit r15484.
2014-07-03 20:07:15 +00:00
343066040f Remove inconsistent checks for pSimulation2 when saving maps and ensure that it is set.
Remove commented out code writing triggers that has nothing to do with
the actual triggers implementation.
Free memory that was allocated for error reporting when when fork()
fails.
Remove dead initialization.

This was SVN commit r15477.
2014-07-01 19:00:41 +00:00
ab30e0d4fb Change the water texture to a new, bigger one, created in Blender (thanks to Enrique). Change settings so that they are more logical, yet allow reverting back to an even lower quality setting. Add a WIP high setting (with foam) which isn't finished yet.
Change the shader itself so that the effects look nicer and are more
consistent across settings.
Rework the water mesh generation (simpler system). Fix a few issues.

May work oddly with Atlas since I haven't been able to compile yet.

Refs #1875 (maybe fix), Fixes #2077 (I'll assume it does), Fixes #2114
(assumption again), refs #48.

This was SVN commit r15473.
2014-07-01 16:05:05 +00:00
c339928c6f Disallow placing some special entities in Atlas. Fixes #1696. Patch by trompetin17
This was SVN commit r15467.
2014-06-30 10:20:20 +00:00
b1b96a89d6 Fix culling for shadows and reflections.
Previously we had a single culling frustum based on the main camera, and
any object outside the frustum would never get rendered, even if it
should actually contribute to shadows or reflections/refractions. This
caused ugly pop-in effects in the shadows and reflections while
scrolling.

Extend the renderer to support multiple cull groups, each with a
separate frustum and with separate lists of submitted objects, so that
shadows and reflections will render the correctly culled sets of
objects.

Update the shadow map generation to compute the (hopefully) correct
bounds and matrices for this new scheme.

Include terrain patches in the shadow bounds, so hills can cast shadows
correctly.

Remove the code that tried to render objects slightly outside the camera
frustum in order to reduce the pop-in effect, since that was a
workaround for the lack of a proper fix.

Remove the model/patch filtering code, which was used to cull objects
that were in the normal camera frustum but should be excluded from
reflections/refractions, since that's redundant now too.

Inline DistanceToPlane to save a few hundred usecs per frame inside
CCmpUnitRenderer::RenderSubmit.

Fixes #504, #579.

This was SVN commit r15445.
2014-06-25 01:11:10 +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
548f50b071 Give gaia back it's vision.
This was SVN commit r15332.
2014-06-11 18:20:02 +00:00
567917bf41 Give RMS access to the simulation templates. Fixes #1589. Patch by Itms.
This was SVN commit r15306.
2014-06-07 12:12:53 +00:00
d5b4dbcb71 Retain corpses in FoW. Patch by Itms. Fixes #1366.
This was SVN commit r15289.
2014-06-04 22:13:47 +00:00
b09a702c60 Recompute rally point lines when the rally point is set on a moving unit.
Does not account for setting rally points on units that can move into
the FoW/SoD.
Recalculates paths even if the rally points are not displayed.
Refactors UpdateMarkers() to remove some indentation levels.
Based on patch by Itms. Fixes #1257.

This was SVN commit r15288.
2014-06-04 22:07:58 +00:00
db39d742f0 Fix units falling off the edge of the world.
I guess changes to the map loading sequence caused the TerrainChanged
message to be sent before the map was switched from square to circular
instead of after. The pathfinder didn't notice the switch, so it
continued treating the map as if it were square, allowing units to walk
into the permanent map-corner SOD and vanish, and allowing territories
to expand into the SOD.

Tell the pathfinder explicitly when the map shape changes, so it can
discard its cached data correctly.

This was SVN commit r15277.
2014-06-03 22:35:40 +00:00
4f6afbc0bf Fix non-PCH build.
This was SVN commit r15274.
2014-06-02 20:06:27 +00:00
c17bf75cbb Fix bad merge.
This was SVN commit r15268.
2014-06-01 19:06:58 +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
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
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
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
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
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
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