1
0
forked from mirrors/0ad
Commit Graph

20934 Commits

Author SHA1 Message Date
Freagarach a5481897eb Clean up structure vision.
By default structures now have a vision range of 4 (to allow them to
reveal themself). Effectively no values are changed (beyond those in
templates/other).

Patch by: @Nescio
Differential Revision: D3036
This was SVN commit r24163.
2020-11-11 20:27:24 +00:00
Freagarach 876b035336 Allow resistances to StatusEffects.
Differential Revision: D2908
Reviewed by: @wraitii
Comments by: @bb.
This was SVN commit r24162.
2020-11-11 20:07:30 +00:00
Freagarach b5df81af76 Store turret positions in map files.
Follow up on 8bfb449375. Allows saving turret positions in the map file,
instead of relying on the order in which the entities are added.

Differential Revision: D2614
Reviewed by: @wraitii
Comments by: @Angen, @bb, @vladislavbelov.
This was SVN commit r24161.
2020-11-11 19:40:44 +00:00
vladislavbelov 9669b5f1a9 Removes additional depth texture copying and reusing existing refraction depth.
Tested By: Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D3084
This was SVN commit r24160.
2020-11-11 18:46:52 +00:00
Stan 3392330ee9 Play a sound on invalid building placement.
Comments by: @bb, @Freagarach
Sound by @Samulis

This was SVN commit r24159.
2020-11-11 17:38:59 +00:00
Stan 38ce7c44a6 Remove useless arguments from colorFades.js, update comments, and remove useless return. Also remove redundant check.
Reviewed by: @Angen
Differential Revision: https://code.wildfiregames.com/D2334
This was SVN commit r24158.
2020-11-11 10:58:09 +00:00
wraitii f22449bf24 Remove serializablePrototype code
The script interface has code to serialize/deserialize JS objects with a
user-defined prototype. That code is usable in the AI, but currently
unused (and there are no plans to use it in the long run).

Removing it allows removing more code down the line, which helps with
the SM45-52 migration.

Collaboration with itms.

Refs #4893

Differential Revision: https://code.wildfiregames.com/D2897
This was SVN commit r24157.
2020-11-11 08:43:13 +00:00
Stan 9c46062319 Optimize arrows in quivers (reducing their polycount)
Do not use props , to reduce drastically the number of drawcalls. Those
should only be used for uneven terrain.
Do not load the kart struct for every arrow use prop_weap like all the
other weapons.
Do not use basic_trans where not necessary

Noticed by: @vladislavbelov, @OptimusShepard.
This was SVN commit r24156.
2020-11-11 01:06:19 +00:00
vladislavbelov e038f7844b Fixes terrain overlays by removing fixed pipeline dependency.
Tested By: Freagarach, wraitii
Differential Revision: https://code.wildfiregames.com/D3074
This was SVN commit r24154.
2020-11-09 18:50:40 +00:00
Stan c1eb728ffa Add a generic preview for mainland, so that it doesn't pick one randomly.
This was SVN commit r24153.
2020-11-09 18:07:01 +00:00
wraitii bb8456691b Avoid overflow in UnitMotion.
ComputeTargetPosition called Dot() with large enough vectors that it
overflowed. Avoid that by not actually doing the full dot product.

Reported by: Itms
Fixes #5852

Differential Revision: https://code.wildfiregames.com/D3061
This was SVN commit r24152.
2020-11-09 13:25:50 +00:00
wackyserious 055a659685 Observe proper naming conventions for changeset 4704ac6e03
Reviewed by: Stan`
This was SVN commit r24151.
2020-11-09 11:44:49 +00:00
wackyserious 4704ac6e03 New Texture: Thracian thureos shield
Thread:
https://wildfiregames.com/forum/topic/31815-committed-thracian-mercenary-seleucid-texture-update/?tab=comments#comment-409930

This was SVN commit r24150.
2020-11-09 10:27:39 +00:00
Freagarach b97d251322 Move the controllability of an entity to cmpIdentity.
Where controllability is defined as the ability to receive _any_ order
from the player.
Fixes the concern not raised at a1dc9cadd8#42637.

Differential Revision: D1960
Reviewed By: @wraitii
Comments by: @bb, @Stan.
This was SVN commit r24148.
2020-11-09 08:38:09 +00:00
Freagarach 41570a2dc1 Fix tower classes in maps.
e07f12bea6 Changed the class names of Defense Towers, but it forgot to
update maps, this patch fixes that.

Differential Revision: D3063
Reviewed By: @Nescio
This was SVN commit r24147.
2020-11-09 08:02:30 +00:00
vladislavbelov 61c6da91e8 Moves foam calculation into a separate function and fixes its lighting.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3071
This was SVN commit r24145.
2020-11-08 22:17:58 +00:00
vladislavbelov 8c77c4b2b6 Refactors coordinates of SOverlayTexturedLine, replaces array of floats by array of CVector2D.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3072
This was SVN commit r24144.
2020-11-08 14:47:25 +00:00
vladislavbelov 4b52e87934 Adds wireframe mode to overlays and replace the private m_TerrainRenderMode usages by related getter.
This was SVN commit r24143.
2020-11-08 11:31:32 +00:00
wraitii ad7ac8d595 Fix UpdateComponents logic for pathfinding following d592bf9cb6
Following d592bf9cb6, paths requested at turn N were set-up to be
computed between the end of turn N and the start of turn N+1 (which
would ultimately allow threading this computation), via calls to
'StartProcessingMoves' and 'FetchAsyncResultsAndSendMessages'.

However, the call to UpdateGrid() remained at the start of turn N+1,
between the 'start' and 'fetch' calls. Since all paths are currently
computed on the 'start' call, this means all paths are computed on a
(possibly) dirty pathfinder grid.
In particular, this leads to OOS on rejoin since the rejoiner will
recompute the grid before computing the outstanding paths.

This would also obviously be buggy in a threaded environment, since some
paths might be computed on the fresh and some on the dirty grid.

Finally, MT_TurnStart was sent before the paths were computed, which
might lead to further pathfinder grid changes (not a crashing problem
without threading, but still conceptually odd). The 'fetch' call is thus
moved before it.
This thus fixes d592bf9cb6/D1918, after 92ad6a61fa already fixed a first
issue.

Since the grid is now only updated at the end of a turn, we need to
ensure that it is correct on Turn 0, thus the pathfinder recomputes it
on InitGame.

Refs D14

Reported by: Itms
Fixes #5851

Differential Revision: https://code.wildfiregames.com/D3064
This was SVN commit r24142.
2020-11-08 08:58:19 +00:00
vladislavbelov 9d53bed0bd Adds a LOS mask to Minimap.
Commented By: elexis, Stan
Differential Revision: https://code.wildfiregames.com/D2216
This was SVN commit r24141.
2020-11-08 08:51:54 +00:00
vladislavbelov 212f1bdec4 Calculates LOS texture coordinates in shaders for overlay lines only if needed.
This was SVN commit r24140.
2020-11-07 21:34:35 +00:00
Angen 627ed773df Always update preview in biome and landscape
Introduced in af15d5972d.
Landscape and Biome previews are not updated correctly when reopeneing
gamesetup.
To solve that, remove lastBiome and lastLandscape and always try to
update preview if preview file exists and does not match with current
one.

Differential revision: D3041
Reviewed by: @Freagarach
Fixes: #5785

This was SVN commit r24139.
2020-11-07 15:26:37 +00:00
Stan ada16439ab Fix the random slowdowns and speedups on AMD CPUs for Windows
Remove the MAHAF code and binaries, which doesn't work on anything more
recent than Windows XP due to the usage of an unsigned driver.
Remove the custom timer (PMT, TSC...) code to use the Windows
recommended way aka, QueryPerformanceCounter (QPC)
Remove the deprecated functions in wpthread relating to this. Some
further cleanup will be needed, but this patch is already big enough.

This patch voluntarily excludes the Linux Fix for further investigation
as we haven't ruled out a kernel bug yet;

Discussed with: @wraitii, @vladislavbelov, @janwas, AMD Inc,
Tested by: Dakara, @OptimusShepard, Stan (On W10, Win7; with and without
PCH)

Threads:
https://wildfiregames.com/forum/topic/28367-amd-ryzen-threadripper-user-read-before-posting/
https://wildfiregames.com/forum/index.php?/topic/26890-problem-with-ryzen-3000er-series/page/3/

Differential Revision: https://code.wildfiregames.com/D2726
This was SVN commit r24137.
2020-11-06 23:18:16 +00:00
wraitii 429d190fd2 Fix Athenian Long Walls technology following 70c71bff0f.
70c71bff0f changed modifiers to explicitly support only string or
numeric values.
However, buildRestrictions territories worked with a list, which errored
out. This is now replaced with a string.

Reported by: Asger
Investigated by: Freagarach.
Reviewed By: Freagarach
Fixes #5849

Differential Revision: https://code.wildfiregames.com/D3062
This was SVN commit r24135.
2020-11-06 08:14:54 +00:00
vladislavbelov c3843d018f Refactors water shader and move normal and specular calculations into separate functions.
Commented By: Angen, Stan, wraitii
Tested By: Freagarach, Stan
Differential Revision: https://code.wildfiregames.com/D3040
This was SVN commit r24134.
2020-11-05 17:47:14 +00:00
s0600204 352defd399 Take civ code into account when determining base template name in the Reference Suite
Issue reported by Asger,
Brought to my attention by Freagarach.


Fixes #5848

This was SVN commit r24133.
2020-11-05 14:30:19 +00:00
vladislavbelov b7cbfecd19 Replacing losMap usages by existed and more consistent losTex.
losMap was introduces in fe21c5e023.

This was SVN commit r24130.
2020-11-04 22:55:34 +00:00
vladislavbelov ad965e167d Moves simple water from fixed pipeline to shader pipelines (ARB/GLSL).
Commented By: Stan
Reported By: Freagarach
Tested By: Freagarach, Stan
Differential Revision: https://code.wildfiregames.com/D3059
This was SVN commit r24129.
2020-11-04 22:25:08 +00:00
Freagarach e98fce58a6 Move some position-related functions to PositionHelper.
Renames helper Entity.js to Position.js and moves to there:
- `EntitiesNearPoint` (from Attacking.js).
- `InterpolatedLocation` (from Attacking.js).
- `TestCollision` (from Attacking.js).
- `PredictTimeToTarget` (from Attack.js).

Also adds a test for the helper.

Differential Revision: D2940
Reviewed By: @wraitii
Comments by: @Stan, @vladislavbelov
This was SVN commit r24128.
2020-11-04 18:56:45 +00:00
Freagarach 0addd691d1 Remove some unneeded comments in UnitAI.js.
Differential Revision: D3045
Reviewed By: @bb
This was SVN commit r24127.
2020-11-04 17:50:20 +00:00
vladislavbelov 2d54653bc3 Little cleanup of PatchRData by reordering includes and correctly formats some loops.
This was SVN commit r24126.
2020-11-04 15:53:33 +00:00
vladislavbelov c64f8824d7 Fixes wireframe mode for terrain, continuing remove fixed pipeline dependencies.
Commented By: Stan, wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3056
This was SVN commit r24125.
2020-11-04 15:52:26 +00:00
vladislavbelov d7d02a4740 Moves terrain lighting calculation to GPU.
Reviewed By: wraitii
Tested By: OptimusShepard, Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D3052
This was SVN commit r24124.
2020-11-04 12:54:17 +00:00
vladislavbelov 770280436b Removes FFP option from Atlas and adds ARB/GLSL selection.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3055
This was SVN commit r24123.
2020-11-04 12:21:55 +00:00
vladislavbelov 6e3db3d84c Removes remaining fixed program used in shader pipelines and adds check on FFP create.
Commented By: Stan
Differential Revision: https://code.wildfiregames.com/D3048
This was SVN commit r24121.
2020-11-03 18:59:27 +00:00
Freagarach 8e547cdce5 Add num pad hotkey equivalents.
Such that now e.g. control groups can be selected using those.

Patch by: @Nescio
Differential Revision: D3029
Accepted by: @wraitii
This was SVN commit r24120.
2020-11-03 18:16:19 +00:00
wraitii 478f96d0fd Fix Atlas crash in RangeManager following 939002f0dc
939002f0dc changed from vectors to grid which broke resetting when
terrain size changed.
Also use SAFE_ARRAY_DELETE for simplicity.

Reported by: vladislavbelov
Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D2961
This was SVN commit r24117.
2020-10-31 10:21:08 +00:00
wraitii 413003fe4f Fix a compartment mismatch in XmppClient, causing crashes in MP games.
Added in 9023f4bebb, which changed lobby GUI messages to JS::Values,
requiring a real context. The original code mistakenly inverted the
owning script interfaces.

Given the reproducibility discovered in SM52, the timeline of the bug,
and the nature of the issues encountered in MP, this is a rather safe
fix for #5655.

Reviewed By: Itms
Fixes #5655

Differential Revision: https://code.wildfiregames.com/D2922
This was SVN commit r24116.
2020-10-31 10:13:33 +00:00
Itms 726d59a995 Make PlayerHasMarket event-based.
This function is currently polling-based, and called by the GUI on each
turn, which results in a big performance hit.

Use the opportunity to rename the set of functions with more generic
names.

Reviewed By: Freagarach, wraitii
Differential Revision: https://code.wildfiregames.com/D2919
This was SVN commit r24114.
2020-10-29 09:22:48 +00:00
Stan 03f9522ff4 Remove useless SDL debug message introduced in 5593f573f4.
Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3050
This was SVN commit r24112.
2020-10-27 21:19:33 +00:00
vladislavbelov acc254533b Refactors water shader to move refraction in a separate function.
Commented By: Angen, asterix, linkmauve, Stan, wraitii
Reviewed By: Angen
Tested By: Angen, asterix, linkmauve, Stan
Differential Revision: https://code.wildfiregames.com/D2908
This was SVN commit r24110.
2020-10-25 21:00:52 +00:00
Angen a7b4d42032 Fix handling of fixed ai defined by map after 5ca68a38ef
Gamesetup fails to handle cases with fixed ai 5ca68a38ef.
Removing wrong 'this' and checking for 'undefined' to fix additional
warnings when switching maps.

Differential Revision: D3038
Fixes: #5844

This was SVN commit r24109.
2020-10-24 12:11:24 +00:00
wackyserious ba1bd070bc New Texture: Oscan Tunics (Carthaginian)
Thread: https://wildfiregames.com/forum/topic/31654-task-oscan-tunic/

This was SVN commit r24107.
2020-10-22 06:37:33 +00:00
wackyserious c9a61c7c4a New Texture: 1.) Thracian Mercenary (Seleucid and Macedonian) 2.) Rhodian Slinger (Macedonian)
Thread:
https://wildfiregames.com/forum/topic/31815-task-thracian-mercenary-seleucid-texture-update/

This was SVN commit r24106.
2020-10-22 06:10:11 +00:00
Freagarach 1582e80ccf Clean up structure templates.
- Purge unnecessary attack sounds and buildingAI-nodes.
- Define some sounds, health and territoryInfluence in children when
most of them override parent.
- Remove unused `<BuildRestrictions/Category>` reverts 9af7747d76, part
of cdcee291cf, references 5e3049f6b2. Categories can be added when
necessary.

Patch by: @Nescio.
Differential Revision: D3016
This was SVN commit r24104.
2020-10-15 11:07:35 +00:00
Stan 93ecc1af4c Fix texture mismatch noticed by wowgetoffyourcellphone. Ptolemies were using black Pharaohs instead of white ones.
Unify textures for kushites and ptolemies.
Add back the kush_struct_02.png file with a proper name this time
Some textures fixes from delenda est.
Delete the old textures and use correctly desaturated version of those.

Refs: 7943d82bfe & d8c7f6da62

This was SVN commit r24103.
2020-10-15 07:14:11 +00:00
Angen dcdc17b2dd Do not use GPUSkinning without glsl [Crash fix]
Disable GPUSkinning when glsl is disabled, because VertexAttribPointer
is not implemented on ARB/GLES and it is called by GPUSkinning.

Differential Revision: D2423
Reviewed by: vladislavbelov
Fixes: #5635

This was SVN commit r24101.
2020-10-13 16:48:04 +00:00
vladislavbelov 4eb13e620a Refactors water shader to move refraction in a separate function.
Tested By: Freagarach, Stan
Differential Revision: https://code.wildfiregames.com/D3028
This was SVN commit r24100.
2020-10-12 19:37:45 +00:00
Stan 11c94cd92b Use stones instead of arrows for quinqueremes. Noticed by Edwarf.
This was SVN commit r24099.
2020-10-12 16:37:52 +00:00
Stan 62a86fe15f Improved patrol icon. Much less like the recycling logo
This was SVN commit r24096.
2020-10-10 16:22:50 +00:00