1
0
forked from 0ad/0ad
Commit Graph

1161 Commits

Author SHA1 Message Date
51419d7092 Correct uncaught MapReader and MapGenerator throw statements following 2b138f47db and 2180862d40.
Differential Revision: https://code.wildfiregames.com/D2089
Reviewed By: historic_bruno
This was SVN commit r22521.
2019-07-21 01:35:39 +00:00
e8f4ae36a7 MapGenerator to delete its ScriptInterface directly after last use, refs 64efbfeae3, D2085.
Differential Revision: https://code.wildfiregames.com/D2084
Reviewed By: historic_bruno
This was SVN commit r22489.
2019-07-17 00:07:10 +00:00
a6f30c14d5 Provide microsecond precision in the RandomMapLogger too, refs 7a91d330d3.
This was SVN commit r22481.
2019-07-15 14:44:53 +00:00
7300dd186e Cleanup MapGenerator.cpp, use VfsPath, create RegisterScriptFunctions, add header comments, register TERRAIN_TILE_SIZE directly.
Refs 7a17a3152c, #4034, #4964.
Differential Revision: https://code.wildfiregames.com/D2068
VfsPath change accepted by historic_bruno.

This was SVN commit r22466.
2019-07-13 21:41:09 +00:00
d5a3437882 Unify the magic number indicating the number of impassable tiles at the map edge redundant in the Pathfinder, RangeManager and MapGenerator.
Refs #4034, #4636.
Differential Revision: https://code.wildfiregames.com/D2061
Reviewed By: wraitii
This was SVN commit r22459.
2019-07-12 16:38:51 +00:00
8a32b0b3d4 Fix some gcc 8 and gcc 9 compiler warnings that were thrown 4500 times.
Refs #5294
Differential Revision: https://code.wildfiregames.com/D2055
Reviewed By: Vladislav
This was SVN commit r22443.
2019-07-09 00:18:48 +00:00
8babfe2330 Refactors camera projections - makes projection functions of camera more clear.
Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2012
This was SVN commit r22404.
2019-06-26 22:54:05 +00:00
ec4d84c72f Removes unused and obsolete LightingModel.
It was introduced in d295dacb9b as a way to control behavior of shaders.
Its usage in shaders was completely removed in 05008d190e (before that
in b7888aea52).

Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2011
This was SVN commit r22403.
2019-06-26 22:30:23 +00:00
ba736916fc Clean up ThreadUtil, use standard C++11 constructs instead of custom ones.
ThreadUtil shipped a scope lock and a mutex implementation, which can be
removed since we now have these in the standard library.
This lets us clean up this header which get included everywhere (through
profiler includes).

Tested By: Angen and Stan
Differential Revision: https://code.wildfiregames.com/D1915
This was SVN commit r22344.
2019-06-06 19:30:48 +00:00
70ccc3e5cb Adds Camera test for ortho projection.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1948
This was SVN commit r22340.
2019-06-05 19:55:37 +00:00
2cf1f85d7e Fixes tests compilation after ebfec91057. Found by Angen.
Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D1937
This was SVN commit r22321.
2019-05-30 17:27:55 +00:00
ebfec91057 Adds Camera test for frustum.
Reviewed By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1927
This was SVN commit r22319.
2019-05-29 20:12:41 +00:00
3a031128f7 Refactor and cleanup of CGameView.
Commented By: asterix, elexis, Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D1571
This was SVN commit r22214.
2019-04-22 22:12:08 +00:00
fd719833ab Replace includes uniform_foo with uniform_foo_distribution as it's deprecated in newer versions of boost. It was added in the 1.47 version.
Reviewed by: @Angen, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1823
This was SVN commit r22211.
2019-04-22 21:45:23 +00:00
651cf8b364 Split CColor from Shapes.
Reviewed By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1515
This was SVN commit r22051.
2019-01-13 15:38:41 +00:00
43758bcb92 Fix warnings in vs2015 when building tests.
Reviewed by: @Angen, @Itms
Differential Revision: https://code.wildfiregames.com/D1678
This was SVN commit r22048.
2019-01-12 16:23:47 +00:00
276050bcad Cleanup Camera code for projections.
Reviewd By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1514
This was SVN commit r22033.
2019-01-05 22:40:56 +00:00
962815c898 Fix build without PCH for some targets.
Patch By: Angen
Reviewed By: vladislavbelov
Tested By: Stan, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1361
This was SVN commit r21964.
2018-12-28 14:58:35 +00:00
f7783fb4bb Fix biome-specific mappreviews in 7f602037ba for zipped mods, refs #4962.
Add TextureExists to avoid needless redundant hardcoding of the
filenames.
Remove mapBiome.Preview from gamedescription.js, obsolete following
8cde469501.

Differential Revision: https://code.wildfiregames.com/D1583
Accepted By: Vladislav
This was SVN commit r21859.
2018-08-05 21:50:00 +00:00
a5d1e0068b Fix OSX not starting matches following 8fbc095a88.
That commit illegaly polled SDL events from a different thread which for
an unknown reason did not error on Windows and GNU/linux.

Refs #4822 / D1304, similarly 8fec942e8a.

Differential Revision: https://code.wildfiregames.com/D1484
Previous iteration tested on OSX and some comments with regards to
letter case by Vladislav (refs 27da92e55f, 4c73614955).

This was SVN commit r21818.
2018-05-08 10:03:46 +00:00
16fbe90342 Fix 204b04f2d4 compatibility with zipped mods, refs #5018.
Differential Revision: https://code.wildfiregames.com/D1480
Reviewed By: Itms
This was SVN commit r21814.
2018-05-01 21:15:55 +00:00
13e1702777 Add missing ScriptInterface includes to
JSInterface_L10n.cpp from d6db5a466d,
JSInterface_Renderer.cpp and JSInterface_GUITypes.cpp from 4b1297b328,
JSInterface_VisualReplay.cpp from b830233498,
JSInterface_Game.cpp from 5f8be8e0c6,
JSInterface_Simulation.cpp from 921c5515a6,
JSInterface_Debug.cpp from d6cb9c845b,
JSInterface_Main.cpp from 486aec18d4, refs #4772,
JSInterface_Mod.cpp where it was incorrectly removed in af03c72f76.

Refs D1470.
Sort includes alphabetically, add recent Coding Convention macro
comments.

This was SVN commit r21789.
2018-04-27 16:48:44 +00:00
6d93be0f58 Fix the display of light broken by cc67d54aeb
Reviewed by: Elexis, vladislav
Differential Revisions : https://code.wildfiregames.com/D1389
Refs: https://code.wildfiregames.com/D1262
https://code.wildfiregames.com/D1372

This was SVN commit r21557.
2018-03-15 18:19:12 +00:00
cc67d54aeb Fix compiler warnings on VS 2015, refs #3439, refs #5069.
Patch By: Stan
Reviewed By: Itms, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1262
This was SVN commit r21480.
2018-03-10 09:58:53 +00:00
2be4293dff Complain if an RMS tries to revert the loading progress.
Also increase estimated mapgen time, refs 942a45372c, 0e0ed94926.

Differential Revision: https://code.wildfiregames.com/D1341
Proposed By: Vladislav in D1340
This was SVN commit r21400.
2018-03-01 12:06:55 +00:00
bb
c0349931c0 Update the animation immediately after a varaint is changed, so we don't have sliding issues when we do so.
Differential Revision: https://code.wildfiregames.com/D1322
Reviewed By: temple
This was SVN commit r21335.
2018-02-23 20:11:16 +00:00
e497672a9c Bump copyright header year numbers.
This was SVN commit r21305.
2018-02-21 18:44:52 +00:00
8fbc095a88 Stop the random map generation upon quit request (Alt+F4), refs #4822.
Differential Revision: https://code.wildfiregames.com/D1304
Discussed with: Yves

This was SVN commit r21264.
2018-02-19 15:46:25 +00:00
470d3eb129 Replace a territory texture hack
Differential Revision: https://code.wildfiregames.com/D1293
This was SVN commit r21233.
2018-02-17 01:37:52 +00:00
2180862d40 Implement random map script backend to read terrain PMP files created with Atlas, fixes #4816.
Allows developers to set elevation and terrain textures in the map
editor and use that for a random map.

This was SVN commit r21131.
2018-02-06 23:05:58 +00:00
204b04f2d4 Allow random map scripts to load heightmap image files, fixes #5018.
Move the atlas heightmap import code to MapIO.cpp and reuse it.
Implements what 33e3e6c2ab and 69b7f39bf1 wanted to be.

This was SVN commit r21113.
2018-02-05 16:02:00 +00:00
7819ea434e Diplomacy Colors
Add a button to toggle between normal and "diplomacy" colors.
Reviewed by: elexis
Comments by: leper, ffffffff, Stan
Fixes: #4747

This was SVN commit r21107.
2018-02-03 14:17:31 +00:00
c90d72deb5 Replace DataTemplateManager simulation component with a globalscript, refs #4868.
Removes the serialization of JSON files, shrinking savegame files and
rejoin states sent across the network, refs #3834, #4239, #3909,
f24523dc8f.
Removes the AI C++ code to read JSON files from e33d4a52e9 since the AI
can now use the globalscript.
Allows the AI to read Aura templates and removal of GUIInterface code to
improve performance.
Serialization of the JSON objects in other simulation components was
removed in 9c0e37f2c0 / D1109, a6f14f5631 / D1130.

Serialization removal planned by sanderd17
AI part proofread by mimo
Simulation part proofread by bb
Discussed with Itms on irc

Differential Revision: https://code.wildfiregames.com/D1108
This was SVN commit r20737.
2017-12-31 01:02:21 +00:00
d18374bffe Fix ugly font rendering using GL linear interpolation if the UI scale was changed.
Patch By: Dariost
Refs D332

This was SVN commit r20735.
2017-12-30 17:56:07 +00:00
89e339dd16 Remove VFS cache, because it is less effective and less efficient than the OS cache (and partially redundant with higher level application caches).
Patch By: Sandarac
Discussed with: Philip, echotangoecho, Bezerra
Fixes #4072.
Differential Revision: https://code.wildfiregames.com/D587
This was SVN commit r20639.
2017-12-10 17:33:03 +00:00
f7aa7ac79e Optimise HierarchicalPathfinder::Update by speeding up the chunk dirtiness check.
By adding a custom function in Grid, the code gets vectorised on both
gcc and clang, resulting in much faster code and faster update times,
sometimes substantially (on giant maps or when few chunks must be
updated).

Reviewed By: mimo
Differential Revision: https://code.wildfiregames.com/D73
This was SVN commit r20630.
2017-12-10 08:59:43 +00:00
13ad114dd6 Move selection ring OverlayTexture code from CCmpSelectable::UpdateTexturedLineOverlay to the SOverlayTexturedLine struct in graphics/Overlay.cpp and SimRender in simulation2/helpers/Render.cpp.
This abstraction allows calling that code again from other simulation
components, like the RangeOverlayRenderer in D555.

Differential Revision: https://code.wildfiregames.com/D1139
Refs #3915, D555
Comments By: Vladislav, echotangoecho
This was SVN commit r20621.
2017-12-10 00:19:51 +00:00
53c9e89591 Move EOverlayType and SOverlayDescriptor from the Selectable component to Overlay.h.
Refs #3915, D568
Patch By: Sandarac
Taken from D555
Reviewed By: Vladislav
This was SVN commit r20618.
2017-12-09 19:49:56 +00:00
0cfe9ab153 Expose the same ReadJSONFile function to simulation, GUI and rmgen.
This way globalscripts/ can use the same code in all contexts, all paths
are absolute and only one function name is needed.
Remove ReadCivJSONFile which is redundant with this function as well.
Restrict read access of rmgen/ to rmgen/ and simulation/, refs
4275a8a33c, 89055ef858.

Refs #4868
Differential Revision: https://code.wildfiregames.com/D1085
Reviewed By: wraitii
Partial agreement with leper

This was SVN commit r20576.
2017-12-03 23:02:27 +00:00
9f0484e5ce Delete unused SpiderMonkey GarbageCollection ScriptFunctions ForceGC in the AI and GUI context (e9e05f4efc) and MaybeGC in the random mapgen context (942a45372c).
Optimizing the memory footprint requires likely different functions
following the new SM versions and a lot of testing,
so having these doesn't lower the effort to achieve optimization while
confusing the reader.

Differential Revision: https://code.wildfiregames.com/D1073
Reviewed By: Yves
This was SVN commit r20572.
2017-12-03 12:48:21 +00:00
89055ef858 Delete GetCivData from MapGeneratorWorker.cpp which is redundant with the ReadJSONFile from 871ed04521.
Unify civ file loading from gui/common/functions_civinfo.js and
rmgen/library.js in globalscripts/Templates.js.
Delete the two forgotton headers in 4275a8a33c.

Refs #4868, #4804, D900.
Differential Revision: https://code.wildfiregames.com/D1062
Discussed with: leper

This was SVN commit r20528.
2017-11-26 13:30:57 +00:00
69b7f39bf1 Rename RMS to Engine.
This was SVN commit r20525.
2017-11-25 22:17:01 +00:00
4275a8a33c Unify two rmgen and GUI JSON file loading script functions, refs #4868.
Revert the introduction of the exact copies of FileExists ReadJSONFile
functions in MapGenerator.cpp introduced by 871ed04521.
Include JSInterface_VFS.cpp from MapGenerator.cpp to remove that code
while gaining the other missing VFS file loading functions in rmgen/.
Split RegisterScriptFunctions of JSInterface_VFS.cpp from eb4e66aab3
into RegisterReadOnlyScriptFunctions and RegisterWriteScriptFunctions to
prevent unintentional write access.

This was SVN commit r20507.
2017-11-24 17:19:16 +00:00
7a17a3152c Pass the size in meters of a terrain grid tile from Terrain.h to the rmgen JS code to avoid hardcoding thereof.
Refs #4034, D900
Differential Revision: https://code.wildfiregames.com/D1059
Reviewed By: s0600204
This was SVN commit r20504.
2017-11-23 20:54:48 +00:00
63e77de94e Use only one coordinate system for locations in the rmgen system.
Thereby fix the distance check of the SimpleObject, refs #4338, D189 and
remove the CELL_SIZE engine constant magic number, refs #4034.

Differential Revision: https://code.wildfiregames.com/D996
Thanks a lot to rapidelectron and temple who independently discovered
this!

This was SVN commit r20396.
2017-11-01 22:59:27 +00:00
7e239f38a3 Adds a wireframe mode to the water rendering.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D769
This was SVN commit r20378.
2017-10-30 00:02:29 +00:00
38d09ce35c Adds a perspective matrix, refracts a matrix projection setup to prepare for an isometric view.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D971
This was SVN commit r20377.
2017-10-29 23:41:59 +00:00
7b93690c76 Fix few typos found with the Debian lintian tool.
Differential Revision: https://code.wildfiregames.com/D973
Differential Revision: https://code.wildfiregames.com/D974
Differential Revision: https://code.wildfiregames.com/D975
Patch By: LudovicRousseau
Reviewed By: Dunedan, bb
This was SVN commit r20369.
2017-10-28 22:34:57 +00:00
1fcdc3d7f4 Deepfreeze the map settings object (created from g_GameAttributes.settings by the gamesetup extending the map JSON data) to prevent random map scripts from unintentionally modifying that, refs #4257.
This was SVN commit r20265.
2017-10-06 18:53:24 +00:00
f1cc54cc18 Move GameView ScriptFunctions to its JS Interface, refs #4772.
Use early returns as initialization checks.

This was SVN commit r20165.
2017-09-11 23:03:27 +00:00
871ed04521 Move biome definitions to JSON and JS files, so that mods can easily remove or add new biomes, refs cc0d4f25da.
Move environment biome constants from JS to JSON.

This was SVN commit r20129.
2017-09-08 02:15:54 +00:00
1b44946078 Replace deprecated jsval with JS::Value.
Remove unused SGUIBaseSettings and GUI comment.
Fix indentation of a macro, refs D794.

Differential Revision: https://code.wildfiregames.com/D838
Review by: leper.
Itms came up with the same patch for the SpiderMonkey 45 update
independently.

This was SVN commit r20062.
2017-08-28 10:27:36 +00:00
ce580f0de0 Always delete CMapReader. Patch by Sandarac. Fixes #4154.
This fixes an assertion failure in ScriptEngine that can occur when
closing
the game while in the loading screen.

Reviewed By: vladislavbelov, leper
Differential Revision: https://code.wildfiregames.com/D684
This was SVN commit r20035.
2017-08-25 00:37:48 +00:00
9defd11440 Pass ScriptInterface as a const ref where possible.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D739
This was SVN commit r20028.
2017-08-24 00:32:42 +00:00
cb18830a81 Remove CinemaManager input handler to allow user interaction on other GUI pages like message boxes and possibly few selected hotkeys.
Disable gameview/camera hotkeys while cinematic paths are playing.

Differential Revision: https://code.wildfiregames.com/D697
Refs #3301, #3814, 89aef0b6eb
Reviewed By: Vladislav
This was SVN commit r19980.
2017-08-12 10:32:07 +00:00
00fafda955 Stop copying the territory grid when recomputing the texture.
Before inlining territories it was changed to be a const reference, thus
avoiding the copy.

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D741
This was SVN commit r19936.
2017-07-30 23:37:05 +00:00
98d7763765 Remove code that doesn't do anything.
Reviewed By: Imarok
Differential Revision: https://code.wildfiregames.com/D743
This was SVN commit r19933.
2017-07-29 23:27:28 +00:00
5ab426d621 Remove commented out code.
Reviewed By: Sandarac
Differential Revision: https://code.wildfiregames.com/D742
This was SVN commit r19932.
2017-07-29 23:27:14 +00:00
d49bf8b1bf Ensure the camera position being above the water level (without smoothing the water level with the terrain).
Differential Revision: https://code.wildfiregames.com/D700
Fixes #3892, D229, D638

This was SVN commit r19896.
2017-07-10 02:16:57 +00:00
cfd08bbf28 Cinema Path GUI hiding and silhouettes fixes.
Let the JS GUI take care of hiding the GUI and silhouettes and remove
the according hardcoding in the engine following 89aef0b6eb.
Thereby fix some bugs (like not having hid the GUI if there was a
message box or different page shown while playing a path) and
fix these two hotkeys broken by 5d49e6c456.

Differential Revision: https://code.wildfiregames.com/D631
Fixes #4633
Reviewed By: Vladislav
This was SVN commit r19797.
2017-06-17 14:17:30 +00:00
b94a54b18a Use direct gui.scale instead of reciprocal gui.scale
Patch by Dariost.

Differential Revision: https://code.wildfiregames.com/D328
This was SVN commit r19774.
2017-06-14 17:13:44 +00:00
51f62818f7 Fix all broken checks for the absent (random-mapgen+simulation) Seed property in the engine, refs #3965.
Hence display the originally intended useful warnings (instead of the
characterless JS "Script value conversion check failed" warning and
skipping the intended warnings).

This was SVN commit r19718.
2017-06-02 15:07:58 +00:00
25b1837603 Pass CVector3D as const reference in a few places.
Reviewed By: Sandarac
Differential Revision: https://code.wildfiregames.com/D424
This was SVN commit r19534.
2017-05-08 04:04:45 +00:00
bdfe500f98 Draw paths only when cinematics isn't playing. Patch by Vladislav.
Also show the GUI after the cinematics stopped playing in Atlas.

Differential Revision: https://code.wildfiregames.com/D411
This was SVN commit r19533.
2017-05-08 04:02:33 +00:00
09e974e1cb Bump year number of files changed this year in the license headers.
This was SVN commit r19503.
2017-05-01 14:28:22 +00:00
ecaa8434b1 Cinematic path node moving tool for Atlas. Patch by Vladislav.
Differential Revision: https://code.wildfiregames.com/D369
This was SVN commit r19483.
2017-04-30 23:47:16 +00:00
5a4cbc9261 Move CinemaManager includes forgotton in 5d49e6c456 to the right place, thus fixing the build without precompiled headers.
Refs https://code.wildfiregames.com/D385
Reported by: leper
Fix proposed by: Vladislav
This was SVN commit r19473.
2017-04-29 18:08:06 +00:00
5462f26aba Move CinemaPath class to the simulation helper directory, because it contains predominantly simulation data that is already serialized.
The remaining graphics code should be moved or removed.

Differential Revision: https://code.wildfiregames.com/D324
Patch By: Vladislav
This was SVN commit r19414.
2017-04-14 23:20:49 +00:00
2e37e6a8d9 Remove redundant path name argument from the CinemaManager AddPath function.
Differential Revision: https://code.wildfiregames.com/D310
Patch By: Vladislav
This was SVN commit r19406.
2017-04-11 01:37:00 +00:00
ee987d3b0d Add some consts to ShaderProgram functions
Reviewed by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D315
This was SVN commit r19403.
2017-04-10 15:44:33 +00:00
2f02fb4535 Move OpenGL CinemaPath rendering code to the CinemaManager, so that the remaining simulation data can be moved to the simulation directory.
Add height indicator so that we can actually estimate the location of
the paths in atlas.

Differential Revision: https://code.wildfiregames.com/D306
Patch By: Vladislav
This was SVN commit r19394.
2017-04-09 17:21:01 +00:00
5d49e6c456 Move most cinematic path simulation data and control from the graphics class to the simulation component and solve the hash mimatch in non-visual replay.
Move graphics code to smaller helper functions UpdateSessionVisibility,
UpdateSilhouettesVisibility and DrawPaths.
Remove the hotkey TODO code which should be implemented differently.
Mark voids as const.

Differential Revision: https://code.wildfiregames.com/D271
Patch By: Vladislav
This was SVN commit r19375.
2017-04-05 03:59:20 +00:00
9e6571c461 Some cinema path cleanup.
Could possibly fix a compilation failure with some compilers in
36330732fa.

Patch By: Vladislav
Differential Revision: https://code.wildfiregames.com/D250
This was SVN commit r19341.
2017-03-24 22:49:06 +00:00
36330732fa Allow Cinematic Path nodes that only specify a camera position or direction and group them by deltatime.
Remove the support of saving the rotation of camera position nodes,
because that should be rewritten to use a custom spline.

Patch By: Vladislav
Differential Revision: https://code.wildfiregames.com/D124
Refs #3814

This was SVN commit r19317.
2017-03-20 15:26:34 +00:00
e7eeb6927d Remove deprecated water parameters. Patch by paulobezerr. Partial review by FeXoR. Fixes #4292.
This was SVN commit r19040.
2016-12-12 23:46:46 +00:00
06333708f8 Fix animation syncronisation between actor props. Fixes #2324 one more time. Refs [18568] and [18265]. Reported by
wowgetoffyourcellphone

This was SVN commit r19031.
2016-12-08 23:16:54 +00:00
808dd347b6 Play cinematic paths on arbitrary cameras to prepare previews of the camera frustum in atlas. Patch by Vladislav, refs #3814.
This was SVN commit r18992.
2016-11-23 14:50:47 +00:00
417c84870c Actually remove trailing tabs from source/.
This was SVN commit r18991.
2016-11-23 14:09:58 +00:00
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
0cc23c1964 SpiderMonkey 38 upgrade: 33/35
Remove a workaround. Note that this removal is incomplete. Based on
patch by leper.

This was SVN commit r18687.
2016-09-02 16:53:22 +00:00
4ed7d6c202 Fix compilation failure.
This was SVN commit r18621.
2016-08-21 20:35:10 +00:00
4e87fef3da The old debug API has been removed in SpiderMonkey 38, so remove profiler1 script profiling.
Patch by leper, refs #3708

See also https://bugzilla.mozilla.org/show_bug.cgi?id=1069694

This was SVN commit r18580.
2016-08-02 16:58:30 +00:00
51eb4b255c Don't let the props inherit the 'idle' animation if the parent doesn't have the needed animation. Fixes #4071
This was SVN commit r18568.
2016-07-29 11:57:27 +00:00
7c21a0cf8e Header cleanup: profile.h is no longer unnecessarily included in scriptinterface.h but rather in the required .cpp files
This was SVN commit r18417.
2016-06-21 10:33:11 +00:00
450973a624 Clean up some code-style issues reported by leper
This was SVN commit r18390.
2016-06-16 14:51:12 +00:00
ff886b1773 Try to fix issue with probably uninitialised animation frequency, improve error message and clean up code a bit
This was SVN commit r18278.
2016-06-01 07:21:50 +00:00
b18c4ac217 Code style improvements to df971c3885
This was SVN commit r18267.
2016-05-30 17:05:39 +00:00
83af69286d Allow simulation to set the actor variant selection, and use it for the garrison flag. Fixes #3952 Refs #2679, #3983
This was SVN commit r18266.
2016-05-30 14:07:48 +00:00
df971c3885 Allow to give a frequency to animations, and allow to sync randomly selected animations on base model and prop. Fixes #2324
This was SVN commit r18265.
2016-05-30 11:53:19 +00:00
9cc98aaf47 Take new observermode into account in some missing places, refs #3850, #3168.
This was SVN commit r18223.
2016-05-23 15:26:47 +00:00
8311472a5c Change include into forward declaration
This was SVN commit r18063.
2016-04-19 17:48:06 +00:00
1e6c12de7b Allow variants to be defined in external files. Fixes #3286
This was SVN commit r18054.
2016-04-19 07:51:59 +00:00
df3c3c35b2 Cleanup cinema code. Fix some issues with resetting of times. Patch by Vladislav. Refs #3814
This was SVN commit r18041.
2016-04-17 15:43:29 +00:00
22bbe450e4 Move some methods out of the headers. Patch by Vladislav. Refs #3814
This was SVN commit r18000.
2016-04-07 17:47:30 +00:00
2a11d3ca7b Interpolate cinematic camera rotation + allow more points in cinematic path + add comments. Patch by Vladislav. Refs #3814
This was SVN commit r17975.
2016-04-04 20:31:18 +00:00
c3ac6cf7fc Save target-nodes (lookAt-coordinates) for cinematic-camera paths. Patch by Vladislav, refs #3301.
This was SVN commit r17763.
2016-02-15 17:18:59 +00:00
a2f7d4d82a Show fog of war in observermode, fixes #3168.
This was SVN commit r17735.
2016-02-06 12:56:41 +00:00
1a66f510d0 Use const T& for parameters of some types in script-exposed native functions
Using references matches the C++ coding style better and should improve
performance a bit in theory. It avoids 2 copies of T in case of the
functions registered with RegisterFunction (mainy used in the GUI). It
should also avoid one or two copies in case of
DEFINE_INTERFACE_METHOD_X, which is used in the simulation, but I
haven't bothered to count it there exactly.
It is now predefined which types have to be passed by const reference
and which are passed by value. Note that references can't be used as
out-parameters (to return multiple values to JS). This hasn't worked
before either and probably never will.

This was SVN commit r17696.
2016-01-23 15:17:56 +00:00
327c0d0d00 Remove trailing whitespace. Refs #118.
This was SVN commit r17650.
2016-01-14 00:04:32 +00:00
fb92761c92 Use explicit types instead of auto.
This was SVN commit r17642.
2016-01-13 00:42:55 +00:00
89aef0b6eb Cinematic camera core functionality. Patch by Vladislav Belov.
Based on existing code that was still around from an old(not working)
implementation.
Supports basic control from trigger scirpts (queue, start and stop
camera paths) and works in multiplayer.

This was SVN commit r17594.
2016-01-03 12:41:04 +00:00
d313a1934a Code style cleanups for CinemaPath in preparation for the cinematic camera patch.
Refs #3301

This was SVN commit r17593.
2016-01-02 20:14:14 +00:00
a144ec7e08 Indentation corrections and other code style fixes in preparation for the cinematic camera patch.
Refs #3301

This was SVN commit r17578.
2015-12-31 13:40:56 +00:00
8d9cfd66b8 Reorganize code in different files in prepartion for the cinematic camera patch (by Vladislav Belov).
Refs #3301

This was SVN commit r17575.
2015-12-30 21:16:35 +00:00
543472b77b Optimization of isBoxVisible + cleanup, fixes #3712
This was SVN commit r17561.
2015-12-28 16:27:31 +00:00
6f09803e8c TerrainTextureManager file loading rewrite. Fixes #3358.
Add directory callback to vfs::ForEachFile.
Each terrain directory should now have a terrains.xml file,
as using the previous terrains.xml file is unlikely to be what was
intended.

This was SVN commit r17341.
2015-11-30 20:12:12 +00:00
4043c56518 Fixes global init order bug that caused OOS between OS X and other platforms, fixes #3499. May improve pathfinding behavior in some cases, please test!
This was SVN commit r17132.
2015-10-15 02:51:12 +00:00
558d43bac5 Replace some functor structs with lambdas, closures or range-based fors.
This was SVN commit r16923.
2015-08-19 03:33:04 +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
a4e606c575 TerrainTextureManager cleanup.
This was SVN commit r16901.
2015-07-30 21:51:01 +00:00
8bfe16cac8 Use in-place construction.
This was SVN commit r16894.
2015-07-29 23:44:17 +00:00
c5eb9b7bb7 Range-based for for VfsPath loops.
This was SVN commit r16893.
2015-07-29 23:44:12 +00:00
a07add11c6 Some range-based for loops and some style cleanup.
This was SVN commit r16888.
2015-07-29 01:07:23 +00:00
851e863892 Remove animation name compatibility mapping.
10 years should have given everyone enough time to move to the new
naming scheme.

This was SVN commit r16884.
2015-07-27 01:08:29 +00:00
495aa7bec5 Expose TemplateExists() to RM scripts.
This was SVN commit r16804.
2015-06-21 20:22:34 +00:00
ae4dfe294d Actually state the file instead of the directory in some error messages.
This was SVN commit r16802.
2015-06-21 18:46:33 +00:00
8380b67f94 Move GUI schemas to the mod mod. Fix some validation related errors in the mod mod.
Check if the used directory exists before trying to add a validator.
Refs #245.

This was SVN commit r16773.
2015-06-15 16:00:26 +00:00
68ea5f37f4 Remove unused ctors. Fixes compilation with GCC 4.6.
This was SVN commit r16771.
2015-06-14 23:50:38 +00:00
25a7d79d1e FIXE ERROR: CCmpPosition::GetPosition called on entity when IsInWorld is false, when you save a map with garrisoned units, thx to daniel for report
This was SVN commit r16769.
2015-06-14 22:17:39 +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
a18fbd12ec XML validation. Based on patch by historic_bruno. Refs #245.
This was SVN commit r16733.
2015-06-07 21:56:52 +00:00
14bfbbf9d4 Allow sprites to have color multiplication, which allows player-colored bars. Patch by Vladislav. Fixes #3233
This was SVN commit r16715.
2015-06-04 12:16:52 +00:00
f71be3c764 Use iterators for XMBAttributeList and XMBElementList. Fixes #3269.
This was SVN commit r16704.
2015-06-01 00:29:35 +00:00
d3da00dc99 Fix some issues found by static analysis.
Actually abort in case of recursive includes again. Refs #2622.

This was SVN commit r16703.
2015-06-01 00:29:23 +00:00
e68ef21334 Don't decay when connected to connected allied territory, and also allow the decay script to determine which parts of the territory should blink
This was SVN commit r16692.
2015-05-29 07:02:16 +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
8b4b8431e3 Small cleanup, based on a change from one of Philip's old patches
This was SVN commit r16653.
2015-05-16 09:39:27 +00:00
b6bcfdbb2e Fixes missing newlines in debug_printf, patch by elexis, fixes #3056
This was SVN commit r16534.
2015-04-12 19:38:31 +00:00
4e763ef26e Move civ JSON files to simulation/data. Patch by MattDoerksen. Fixes #2562.
This was SVN commit r16485.
2015-04-01 23:48:33 +00:00
ebb57aa516 Fix tests by enlarging the precision bumped in 7ed45213a9
This was SVN commit r16479.
2015-03-31 16:56:09 +00:00
7ed45213a9 Allow heightmaps to be 8 times as high by lessening precisions. Includes conversion script and modified standard maps. Bump the map version number. Fixes #3112
This was SVN commit r16478.
2015-03-31 16:48:31 +00:00
89107d1406 Fixes grayscale PNG handling, there is no need to convert them all to RGB and 4741e896c4 broke special font texture handling. Instead, only grayscale with alpha PNGs will be converted to RGBA (they fail to load otherwise).
Removes warning about converting grayscale textures, refs #1640.

This was SVN commit r16449.
2015-03-19 03:04:01 +00:00
b1c4e29ac8 Fixes inconsistencies in spelling of colour/color by preferring "color" (only wxWidgets remains with some API that requires "colour"), fixes #1029.
NOTE: requires update-workspaces and may require correction of some
modded actors/scenarios

This was SVN commit r16438.
2015-03-15 23:59:48 +00:00
caf89fa04e Rename ps/Overlay(.h|.cpp) to ps/Shapes(.h|.cpp), fixes a TODO located in graphics/Overlay.h.
The file name did not match the content.

Also little cleanup of some unnecessary includes.

This was SVN commit r16431.
2015-03-15 18:06:32 +00:00
618fe81814 Check when loading an actor that it defines all the texture samplers required by its material. Print out a readable error otherwise. Fixes #1613 (note that this does not check for unnecessary samplers as that is non-trivial and does not lead to graphical glitches).
Also add a shortcut for some defines to clean-up material files slightly
and make the link between sampler and shader more explicit.

This was SVN commit r16427.
2015-03-15 11:37:26 +00:00
607bbcc2f1 Fixes invisible particles (clouds, dust storms) due to incorrect bounds calculations on the emitters, fixes #2643.
Makes the emitters a little more efficient by only setting
position/rotation when their transform changes.

This was SVN commit r16397.
2015-03-01 23:58:53 +00:00
21f3be7df5 Always select a texture unit before calling glEnable(GL_TEXTURE_2D).
Without this, some code will enable (and set other parameters for)
whatever random texture unit the previous stage had selected. This can
break any fixed-function rendering, since either it will not have
enabled the correct texture unit, or its correct setup will be
interfered with by another texture unit that shouldn't be enabled. (This
doesn't affect ARB/GLSL shader rendering, since they don't care about
the enabled state, but the GUI (and some debug things) are still FFP in
the default ARB mode.)

Fixes #2833 (in which the fancy water shader selected texture units 5/6,
which then got enabled, and remained enabled forever).

This was SVN commit r16372.
2015-02-21 21:40:10 +00:00
e06a7b37d8 Convert debug_printf to take UTF-8 strings instead of wchar_t.
This fixes the problem where passing a non-ASCII string to
debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it
doesn't know what encoding the char* is meant to have). Now debug
messages will remain as UTF-8 until they reach the OS.

Fixes #3021.

This was SVN commit r16332.
2015-02-14 01:45:13 +00:00
846fdc1ed8 Provide explicit spezializations of hash_value for CTexturePtr and CTextureProperties. Fixes #3036.
This was SVN commit r16271.
2015-02-06 02:03:20 +00:00
1564a10120 Move back the computation of most of the visibilities from JS to engine, to improve performance.
Also fix the remaining TODO left by #958, as a use case of the scripted
Visibility component.

Refs #2913, #958.

This was SVN commit r16248.
2015-01-30 15:28:06 +00:00
0ef6c7555e Optimise VBO updates.
Some drivers (at least the Intel drivers on Windows) are slow at
incrementally updating a VBO with hundreds of calls to glBufferSubData
every frame. Performance is significantly better if you use
glBufferData(NULL) to tell it to discard all the previous contents, and
then re-upload all the data at once.

Update CVertexBuffer so that GL_DYNAMIC_DRAW/GL_STREAM_DRAW buffers are
handled with the new mechanism. This requires the caller to hold onto
the backing store so it can be re-uploaded when necessary, and needs a
bit more signalling to indicate exactly what needs uploading.

I see an improvement from roughly 60 to 75 fps on Intel HD Graphics
3000, Windows, 1024x768, Siwa Oasis.

This was SVN commit r16241.
2015-01-28 00:48:00 +00:00
4c1903500b Switch to std::shared_ptr and std::weak_ptr.
This was SVN commit r16227.
2015-01-25 03:10:58 +00:00
59503b9ae9 Add basic support for GUI scaling factor, to help with high-res displays (e.g. 4K monitors and 1080p tablets).
Use the config setting "gui.scale = 0.5" to make the GUI bigger.

This was SVN commit r16223.
2015-01-24 20:06:37 +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
2e01b157d6 Fix build error in GLES configurations
This was SVN commit r16207.
2015-01-23 20:54:14 +00:00
f350a24c73 Disable "assignment operator could not be generated" warning globally on Windows, since it's never useful.
This was SVN commit r16192.
2015-01-22 21:09:33 +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
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
e9a33b71ae Manually fix the less trivial CLogger format strings.
This was SVN commit r16184.
2015-01-22 20:32:06 +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
dcf5a2667f CLogger: Use cppformat instead of sys_vswprintf.
sys_vswprintf relies on platform-specific printf implementations, which
vary widely between platforms (in handling of truncation, return values,
use of %s/%S/%hs/%ls for mixing char and wchar_t strings, etc) and are
therefore a pain.

Use cppformat's fmt::sprintf instead, which has very similar syntax to
sprintf but is more C++ish and is portable.

Also, wchar_t is stupid, so use char* strings (which are expected to be
UTF-8) in CLogger. This creates a bit of a pain with changing all
callers to convert to char* strings, but that's their fault for not
using UTF-8 already.

Refs #3011.

This was SVN commit r16182.
2015-01-22 20:30:05 +00:00
4c12440868 Give access to the templates to the GUI. This will be useful for eventually displaying factions specificities in main menus.
This was SVN commit r16075.
2014-12-28 16:21:07 +00:00
9407dbe45e Remove useless parameter from CFG_GET_VALUE.
This was SVN commit r15984.
2014-11-17 23:29:49 +00:00
d58189d510 Parse terrain properties without CParser. Refs #2589.
This was SVN commit r15967.
2014-11-16 02:09:02 +00:00
6e788fb15e Clean up JSON parsing code. Refs #1374.
Fix Engine.ReadJSONFile() which did throw a JS exception that was not
caught. Discovered by s0600204.
Expose Engine.ReadJSONFile() to the gui scripts.

This was SVN commit r15959.
2014-11-13 01:26:22 +00:00
b4997dc7c6 Fixes minimap GLES compatibility by making point size a uniform and passing into the shaders
This was SVN commit r15901.
2014-10-26 04:37:26 +00:00
46fd718ac1 Initialize some variables. Patch by Echelon9. Fixes #2862.
This was SVN commit r15851.
2014-10-12 19:27:49 +00:00
5d9d9a67bf Allow enabling the post processing filters during a game.
Includes numerous code updates, also updated the copyright for
cd5de73f3a.

Patch by dan@sstrev.com, fixes #2672.

This was SVN commit r15843.
2014-10-05 20:50:10 +00:00
cd5de73f3a Allow setting the "Smoothing LoS" option during a game.
Patch by dan@sstrev.com, fixes #2513

This was SVN commit r15841.
2014-10-05 20:02:04 +00:00
c5c394fd17 Fix some disabled tests.
This was SVN commit r15673.
2014-08-24 15:29: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
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
608c27fe10 Exact stack rooting for structured cloning functions.
Refs #2415
Refs #2462

This was SVN commit r15597.
2014-08-01 20:55:16 +00:00
07653c9a70 Fixes crash when generating random maps.
We must not be in a request when calling the ScriptInterface destructor.

This was SVN commit r15572.
2014-07-27 18:17:16 +00:00
64efbfeae3 Fixes small memory leak introduced in 28bdd8540f.
Thanks to leper for pointing it out.

This was SVN commit r15569.
2014-07-26 23:09:24 +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
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
8b45f453e5 Fix non-PCH build.
This was SVN commit r15498.
2014-07-06 16:35:41 +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
eb7955599a Optimise silhouette rendering.
Do some intersection tests on the CPU so that the silhouette render
passes only have to draw models/patches that might actually contribute
to silhouettes, saving the CPU and GPU cost of rendering more objects
than necessary.

This was SVN commit r15483.
2014-07-03 01:00:25 +00:00
30e851ab90 Forward-declare CShaderProgramPtr, to avoid pulling in more headers than necessary and to hypothetically reduce build times by a minuscule amount.
This was SVN commit r15481.
2014-07-02 22:36:45 +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
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
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
e6b8339103 Minor optimisation for non-animated units.
This was SVN commit r15266.
2014-06-01 18:25:20 +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
ceb3c3d366 MapReader: Load terrain before entities.
This allows component Init functions to make use of the terrain
immediately, instead of delaying some computations until the first
frame.

This was SVN commit r15262.
2014-06-01 18:08:11 +00:00
fe3315376c Add BoundingSphere, SOverlaySphere.
BoundingSphere is similar to a bounding box, but more spherical.

SOverlaySphere is useful for visualising BoundingSphere (it's quite
inefficient and should only be used for debug functionality).

Normalise the camera frustum clipping planes, so that IsSphereVisible
gives the correct result.

This was SVN commit r15261.
2014-06-01 18:05:46 +00:00
e79adae921 Attempt to work around LOS texture alignment bug.
For unknown reasons, sometimes glTexSubImage2D acts as if
GL_UNPACK_ALIGNMENT = 2 or 4, instead of 1. This causes the odd-sized
array uploaded for the LOS texture to be interpreted incorrectly, and
the LOS texture gets rendered very incorrectly.

Pad the array to a multiple of 4 in all cases, so that
GL_UNPACK_ALIGNMENT shouldn't affect it.

Hopefully fixes #2594.

This was SVN commit r15216.
2014-05-25 13:30:39 +00:00
3014df2280 Disable wireframe mode in ranked games. Fixes #2401.
This was SVN commit r15050.
2014-04-28 05:02:20 +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
833c2bac7a save/restore camera position and orientation in saved games, fixes #2354
This was SVN commit r14905.
2014-04-06 16:27:57 +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
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
937ee8f77c Fixes clang "hidden overloaded virtual function" warning, patch by Echelon9, fixes #2388
This was SVN commit r14674.
2014-01-26 01:20:34 +00:00
d0e57cb0ff Change a few things to avoid warnings with gcc. Should fix #2359
This was SVN commit r14529.
2014-01-06 22:14:27 +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
d4b2c1285c add the ability to exclude props from the selection size + add aura visualisation rings again
This was SVN commit r14497.
2014-01-04 10:41:32 +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
5f8b6be833 Some additions to the particle system:
This was SVN commit r14286.
2013-12-04 17:21:59 +00:00
acf1c420c1 Moves management of GL viewports to CRenderer, letting it store the current viewport; calling code can retrieve and restore it later (instead of using deprecated glPush/PopAttrib, previously removed for GLES compatibility by 7dec618898)
This was SVN commit r14235.
2013-11-28 00:57:39 +00:00
0170db4a53 Adding advanced graphical features into random maps. Fixes #2262.
This was SVN commit r14170.
2013-11-14 14:33:55 +00:00
e58fa107cc Fix skeleton caching.
This was SVN commit r14163.
2013-11-13 20:05:57 +00:00
7dec618898 Some attempts to fix GLES build in smooth LOS and post proc manager.
Replaces glBegin/End with glDrawArrays, GL_QUADS with GL_TRIANGLES, and
replaces glPush/PopAttrib by resetting the viewport manually.
Adjusts GLSL shaders for these changes.

This was SVN commit r14152.
2013-11-12 01:30:17 +00:00
5771bee032 First pass at fixing GLES build - more to come
This was SVN commit r14149.
2013-11-12 01:17:16 +00:00