1
1
forked from 0ad/0ad
Commit Graph

19693 Commits

Author SHA1 Message Date
5c4d124d2a Refactor renderer options.
This moves the renderer options into their own class to:@
  - allow one to only include the rendering options, not the whole
renderer header, when one wants access to rendering options.
  - centralise rendering changes and their side-effects.
  - clean up code.

Tested by: historic_bruno, Freagarach
Commented by: historic_bruno
Differential Revision: https://code.wildfiregames.com/D1929
This was SVN commit r22610.
2019-08-04 08:28:30 +00:00
2ff8614ce2 Unit Motion - Improve behaviour around obstructions and unreachable goals
Use the "pretend correct path" behaviour for short goals too. This is a
fix for #5545, since the position check now works correctly without
needing to add a tricky check for path-vs-path distance.

Simplify HandleObstructedMove to use ComputePathToGoal more. This means
we occasionally compute a long path when stuck, which fixes two cases of
stuck units reported in #5547.

Move some common calls into functions for convenience.

Make sure the short-path-waypoint-range-relaxing introduced in
32e8ed51aa doesn't happen for the last waypoint, which caused units to
occasionally never get in range of the last waypoint.

Clear short path waypoints when computing a long path.

This won't fix all instances of unit dancing, but it should improve most
of them.

Fixes #5545, Fixes #5547

Differential Revision: https://code.wildfiregames.com/D2135
This was SVN commit r22609.
2019-08-04 08:16:09 +00:00
9ece3e7088 Pthread -> std::thread (2/7) - Remove pthread in Profilers
Use std::thread and thread_local instead of pthread specific calls.

Differential Revision: https://code.wildfiregames.com/D1916
This was SVN commit r22608.
2019-08-04 08:11:58 +00:00
accd72b3c1 Prevent tree leaves from being too bright in water reflections.
Since ead8436b3d, the sides of tree leaves are extremely bright. The
reason is that they overwrite the value of the depth buffer, and thus
they show the skybox in the water calculation.

The simplest fix for this is to show the skybox only at lower
transparency values. A better fix would require handling alpha blending
completely differently.

Refs #5125.

Differential Revision: https://code.wildfiregames.com/D2143
This was SVN commit r22607.
2019-08-04 07:54:13 +00:00
c4789fdcc7 Fix missing ShadowMap headers in previous, da4e601d8f.
Tested on: gcc, clang

This was SVN commit r22606.
2019-08-04 05:58:55 +00:00
da4e601d8f Move GetDefaultGuiMatrix to a separate file.
The function was located in the wrong file, because it is not logically
related to IGUIObject settings.
The separate file allows the various users to include it without
including the GUIRenderer.

This was SVN commit r22605.
2019-08-04 03:52:00 +00:00
85a622b13a Implement IGUIObject settings as a template class and IGUIObject::AddSetting as a template function.
This means the type information is available for all methods operating
with the setting type, which is easier for the authors, allows for
compile-time checks and optimizations.
Remove the enum that was used to indirectly obtain the setting type at
runtime.
Revises SGUISetting and enum from e326ebae46 (5122b0f906),
std::function from 82f1d2718b.

Differential Revision: https://code.wildfiregames.com/D2145
Tested on: gcc, clang, VS2015, Jenkins

This was SVN commit r22604.
2019-08-04 02:20:08 +00:00
5a1da77ce4 Use IGUIObject::GetSettingPointer and SetSetting instead of accessing the member m_pSetting directly following fd91563f42.
Revise 53b335f5ae in CInput::UpdateBufferPositionSetting to use the
SkipMessage argument from 4113aa0a36 to prevent the infinite loop
instead of hijacking the pointer.

This was SVN commit r22603.
2019-08-04 00:02:56 +00:00
cd82b62e25 Fix JSInterface_IGUITextOwner build on VS2015 following 3d07327837 (which works on gcc, clang and Jenkins), reported by minohaka.
Retract IGUIObject override keyword from that commit, because clang
recommends to use it for either every or no overriding class member
(which then should be done consistently for all classes inheriting
IGUIObject, refs D2144).

This was SVN commit r22602.
2019-08-03 17:52:56 +00:00
wackyserious
11dc5e3901 Texture Update: Judean Slinger
Thread:
https://wildfiregames.com/forum/index.php?/topic/22287-task-judean-slinger

Reviewed by: Stan, Lordgood (wowgetoffyourcellphone and Lion.Kanzen)
This was SVN commit r22601.
2019-08-03 06:18:37 +00:00
Alexandermb
f64a39c123 Better texture for shield_props (bosses and spinas)
Better texture for brit_battersea shield

Fix celtic shield bosses using 3rd texture variant instead of 1st

Added brass and golden variant for shields props 02 and 03

replaced gold texture with 03 texture variant for have less texture
files.

This was SVN commit r22600.
2019-08-03 02:52:40 +00:00
wackyserious
674d60e830 Texture Update: Gallic Naked Fanatic
Thread:
https://wildfiregames.com/forum/index.php?/topic/25403-task-gallic-naked-warrior-re-design/

Reviewed by: Stan (Genava55 and Sundiata)
This was SVN commit r22599.
2019-08-02 23:19:39 +00:00
wackyserious
1a388ff401 Texture Update: Scythian Archer
Thread:
https://wildfiregames.com/forum/index.php?/topic/26592-task-scythian-archer-athens-rework/

Review by: Several active community members (Check thread)
This was SVN commit r22598.
2019-08-02 23:07:19 +00:00
wackyserious
8f314fb653 Texture Update: Thracian Peltast
Thread:
https://wildfiregames.com/forum/index.php?/topic/26673-task-thracian-peltast-retexture/

Reviewed by: wowgetoffyourcellphone
This was SVN commit r22597.
2019-08-02 21:38:31 +00:00
3d07327837 Introduce a JSInterface_IGUITextOwner to encapsulate JSI_IGUIObject::getTextSize from 9c5062147a / D844.
JSI_IGUIObject should not contain functions that work only for some GUI
Object types, refs #5442.

Deduplicate the shuffled copy of CText::SetupText.

Avoid the 80 times slower dynamic_cast mandated by the virtual class
inheritance by adding an ugly overridable pointer to the base class
pointing at this derived classes, as bargained with Vladislav and
proposed by wraitii in D1781 id=8426.
This may be improved by refactoring the IGUIObject and JSInterface
classes to use templates and / or eliminating its virtual inheritance.

Implement and use FromJSVal / ToJSVal CSize specialization.
Remove the JS::CallArgsFromVp call.

Differential Revision: https://code.wildfiregames.com/D2136
Comments By: wraitii, Vladislav
This was SVN commit r22596.
2019-08-02 16:55:15 +00:00
Alexandermb
a1963b8ec2 Separate texture variants in bryastovets helmet as requested by @wackyserious.
Thread:
https://wildfiregames.com/forum/index.php?/topic/25179-committed-hellenic-helmets/page/10/&tab=comments#comment-381256

Following 0257f1ca79

This was SVN commit r22595.
2019-08-02 14:21:56 +00:00
Alexandermb
007f271a67 Remove unused horse sele_crest and straps_kush_base.xml from wrong folder.
Concern raised by @elexis in checkref

Following 2115bf2e5d

This was SVN commit r22594.
2019-08-02 14:20:12 +00:00
df489f2500 Add virtual CreateJSObject to IGUIObject, split from GetJSObject, so that inheriting classes can extend the JS object upon construction, refs #5442, D2136.
Remove the comment from 53bcba3368 that allures the reader to believe
there is a memory leak which is not and has not been the case, refs
D1700.
Remove the useless JSAutoRequest from GetJSObject if the object was
constructed already (performance improvement), following cx assignment
in 4b1297b328, following JSAutoRequest addition in e9e05f4efc (that also
had removed other useles JSAutoRequest calls but not this one).
Don't change JS::PersistentRooted to JS::Heap until SpiderMonkey is
updated, refs D1700.
Provide access to GUI, ScriptHandlers and JSObject for inheriting
classes.

This was SVN commit r22593.
2019-08-02 12:18:30 +00:00
Alexandermb
2510e1b82e Fix concern raised by checkref mentioned by @elexis
Add silver chalcidean variant for
macedonians/hero_infantry_swordsman_craterus.xml

Following 0257f1ca79

This was SVN commit r22590.
2019-08-02 02:36:01 +00:00
52f2bfae2b Add virtual base initialization missing in 2c47fbd66a.
Reported by Jenkins, but not gcc, clang, VS2015.
Take the opportunity following 2c47fbd66a to make the CGUI pointer held
by IGUIObject constant (the address, not the value).

Differential Revision: https://code.wildfiregames.com/D2139
This was SVN commit r22589.
2019-08-01 23:55:10 +00:00
69ac0b9656 Move CGUIManager::LoadPage to CGUIManager::SGUIPage::LoadPage, because it only operates only on that struct.
Refs D1684 (patch also made an appearance in D2108)

This was SVN commit r22588.
2019-08-01 20:48:05 +00:00
2c47fbd66a Pass the GUI page pointer CGUI* to the IGUIObject and derived classes upon construction, instead of on stray cases.
Call JS_AddExtraGCRootsTracer and JS_RemoveExtraGCRootsTracer depending
on JS::Heap use instead of on CGUI page link setup.
GUIObjects should be able to access the GUI page independent of the
scripting (for example to obtain PredefinedColors, refs D2108).

Refs: D2108, c02a7e1a7b
Comments By: wraitii
This was SVN commit r22587.
2019-08-01 20:20:24 +00:00
eab4f9fdde Replace {gender} by {phenotype} and support this tag in VisualActor.
A random phenotype can be chosen by giving multiple tokens to the
template.
This allows giving different looks to the same template.

Comments By: stan, vladislav, elexis
Patch By: Freagarach
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1955
This was SVN commit r22586.
2019-08-01 19:14:40 +00:00
Alexandermb
d7a93c3b35 Update some actors outdated helmets
(following 0257f1ca79 And 2fcccb6669)

This was SVN commit r22585.
2019-08-01 17:54:15 +00:00
Alexandermb
29b72212fe Update some hero helmets
(following 0257f1ca79)

This was SVN commit r22584.
2019-08-01 17:39:26 +00:00
Alexandermb
d51adb2674 Fix for broken catafalque_two_wheel.dae following 6d332c0822
Mentioned by @elexis

Also fix traders two_wheel carts from staying static while dead.
(temporary fix until i place an animation for death in the
two/four_wheel_cart.

This was SVN commit r22583.
2019-08-01 12:59:24 +00:00
Alexandermb
9e1c53c2ff Update athen/cavalry_javelinist_e_r.xml helmet.
This actor was using old boeotian helmet

mentioned by @wackyserious Thread:
https://wildfiregames.com/forum/index.php?/topic/25179-committed-hellenic-helmets/page/10/&tab=comments#comment-381154

(following 0257f1ca79)

This was SVN commit r22582.
2019-08-01 12:34:49 +00:00
Alexandermb
12797e14d7 Remove now unused corinthians actors due to new meshes.
Remove mask from boeotian helmets B3/B4

Remove hele_su3 from macedonians/infantry_javelinist_e.xml.

Add missing checkguard from hele_phrygian_bronze.png

(following 0257f1ca79)

This was SVN commit r22581.
2019-07-31 23:00:22 +00:00
Alexandermb
8f979756fd Add two missing corinthians after update.
This was SVN commit r22580.
2019-07-31 19:15:16 +00:00
Alexandermb
0257f1ca79 Big hellenic helmets update
Including:

*Thracian*
*Phrygian*
*Boeotian*
*Chalcidean*
*Attic*
*Bryastovets*
*Corinthian*
*Pilos*

Thread:
https://wildfiregames.com/forum/index.php?/topic/25179-committed-hellenic-helmets/page/10/&tab=comments#comment-381132

Reviewed by the community of 0.A.D.

This was SVN commit r22579.
2019-07-31 18:40:21 +00:00
8d4d70add9 entity template for the juniper tree
This was SVN commit r22577.
2019-07-29 19:14:08 +00:00
a21a21c443 Junipers, grasses, and some flora material edits for broken parallax. Black pines lightened a bit
This was SVN commit r22576.
2019-07-29 19:04:39 +00:00
fee7dba38f Fix Capture oversight in GetBestAttackAgainst in 9fcfdb0324
This fixes units always using capture attack on a building, since
rp22569 forgot to eliminate Capture from the attack types when not
allowed.

Reported by: minohaka
Patch by: Freagarach
Reviewed by: wraitii
Fixes #5544

Differential Revision: https://code.wildfiregames.com/D2134
This was SVN commit r22575.
2019-07-29 18:51:50 +00:00
82f1d2718b Remove both copies of the 15-fold copies of the JSI_IGUIObject::getProperty and setProperty setting case handlers following the FromJSVal / ToJSVal template specializations implemented in
* JSI_GUIColor in 9be8a560a9
* bool in eec179a9a8
* CGUISeries and CGUIList in 26ae9d430a
* primitives in 636c719110
* EAlign and EVAlign in 0834d07462
* ClientArea in b9f3c8557b
* CColor in 415939b59b
* CGUISpriteInstance 0a7d0ecdde
* CPos in d6b93b3be6

The removed JS_ReportError calls were redundant.

This was SVN commit r22574.
2019-07-29 14:46:29 +00:00
d6b93b3be6 Add missing CPos FromJSVal, ToJSVal following 659a9ea57a.
This was SVN commit r22573.
2019-07-29 11:56:11 +00:00
0a7d0ecdde CGUISpriteInstance non-copyable and FromJSVal / ToJSVal.
Make CGUISpriteInstance non-copyable to further harden Philips
protection from 8f4f8e240f against unintentional copies of its DrawCall
cache such as in c19f3608a5.
Remove its copy constructor from 849f50a500, make it movable, and until
it becomes otherwise necessary, force move assignment when sprites are
assigned.
Improves the fixes of the compiler warnings about deprecated implicit
copy constructors in 8a32b0b3d4 by avoiding the copies instead of
copying explicitly.
Add ToJSVal, FromJSVal for CGUISprinteInstance to make
JSI_IGUIObject::getProperty and setProperty more consistent.
Rename Sprite operator= to SetName to reduce ambiguity.
Pass CRect by reference in CGUISpriteInstance::Draw.

Differential Revision: https://code.wildfiregames.com/D2133
Comments By: wraitii
This was SVN commit r22570.
2019-07-28 22:40:58 +00:00
9fcfdb0324 Improve Attack's GetBestAttackAgainst by only considering attack types that actually can attack the target.
Patch By: freagarach
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2112
This was SVN commit r22569.
2019-07-28 14:58:24 +00:00
c03abd1e92 UnitMotion cleanup - remove dead code, add a common path for MoveTo functions, rename BeginPathing, move functions around for better readability.
BeginPathing renamed to ComputePathToGoal, as that is what this function
does.
IsMoving renamed to IsMoveRequested, as the function returns true when
the unit has a move request going on, not when it is actually moving
across the map, which was misleading.

UpdateMovementState's implementation moved closer to where it is used.

PathIsShort and WAYPOINT_ADVANCE_MAX are currently unused, thus deleted.

Differential Revision: https://code.wildfiregames.com/D2067
This was SVN commit r22568.
2019-07-28 10:51:12 +00:00
d9c6879450 Fix units ignoring range when attacking in one case, and fix targeting formations
Fixes for 5568bd4c16:
- units could occasionally ignore range checks when attacking.
- attacking a formation wouldn't pick new targets correctly.

While testing, I also think the walk then walk and fight behaviour
should be changed to just walk and fight or units might just run towards
enemies and not attack them, which looks rather odd.

Reported By: Angen
Fixes #5530

Differential Revision: https://code.wildfiregames.com/D2119
This was SVN commit r22567.
2019-07-28 10:39:27 +00:00
1e2f511a09 UnitMotion - reject paths that would not take the unit closer to the goal than it is now.
This helps with #3144 and units not going idle when ordered to clump
together.

By rejecting paths that would not take the unit closer to the goal than
it is, we can avoid the case where a unit at A finds a short path to B,
goes there, gets stuck, finds a new short path to A, etc. ad infinitum.

It doesn't completely fix the problem since two units moving might still
occasionally become stuck against one another, but it makes it rarer
(unit pushing would probably finish solving this).

This assumes that being as close as possible to the goal is the best
behaviour when trying to move somewhere, even when it is unreachable.

Refs #3144

Differential Revision: https://code.wildfiregames.com/D2075
This was SVN commit r22566.
2019-07-28 10:29:28 +00:00
103d89f026 GatherNearPositiion when the target remains invisible on our second try, instead of going idle.
This improves hunting behaviour, as targets may still be in FOW on the
second try, and the unit would go idle - instead it'll now gather near
position, which is more likely to find a proper resource.

Differential Revision: https://code.wildfiregames.com/D2071
This was SVN commit r22565.
2019-07-28 09:48:23 +00:00
ad4de3d3be Delete CInternalCGUIAccessorBase class from c2a71e41bf.
Delete GetSetting/SetSetting variants that operate on a GUI page other
than the one that the setting is defined in; introduced in c2a71e41bf,
obsolete since f0d9806b3f.

Delete CInternalCGUIAccessorBase::GetObjectPointer as these variants
were the only caller for that.
Delete CInternalCGUIAccessorBase::HandleMessage from a08cbd2f74 as it's
an unnecessary proxy.
Delete CInternalCGUIAccessorBase::QueryResetting from 953f72a91c by
making ResetStates public, equal to UpdateCachedSize from 90bbd48a14
(public required for VS2015 but not gcc 9).
Move ResetStates to implementation file.

Tested on: gcc 9, VS2015

This was SVN commit r22563.
2019-07-28 02:39:52 +00:00
3e4d339b51 Add a missing undefined to booelan conversion for the diplomacy dialog in eec179a9a8, fixes #5542.
Remove diplomacyMenuButton unused since introduction in a21e01150a.

This was SVN commit r22562.
2019-07-27 21:18:16 +00:00
6b052bab08 Fix 415939b59b - clang-specific error at compilation time
JS_ReportError was passed a CStr, which it doesn't support.

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2131
This was SVN commit r22561.
2019-07-27 15:12:59 +00:00
b7d1ea671f Update Errors definition file following:
I18n Script SetupFailed removal in 818ea52c3b,
Renderer VBOFailed removal in 2f28b07356,
CVFSFile InvalidBufferAccess removal in b253cbbee6.

Differential Revision: https://code.wildfiregames.com/D2124
This was SVN commit r22559.
2019-07-26 19:27:10 +00:00
415939b59b Introduce CGUIColor type inheriting Color type and switch the GUI to exclusively use that.
The type differs from the Color type, because contrary to Color, it can
be created from a color predefined in the GUI page (such as "yellow").
Move this predefined color check to the new class instead of hardcoding
it in FromJSVal / ToJSVal, GUIUtil, JSInterface_IGUIObject and to
straighten the latter.

Delete fov_wedge_color from Minimap, unused since introduction in
5275dc862b.

This was SVN commit r22558.
2019-07-26 18:57:28 +00:00
b9f3c8557b Move CClientArea ToJSVal / FromJSVal conversion from JSI_IGUIObject (since that should be agnostic of the conversion) to CClientArea (since that defines the properties).
This was SVN commit r22557.
2019-07-26 14:47:27 +00:00
0834d07462 Make JS changed horizontal / vertical actually take effect, finishing 156ff7cf56, refs f4b410ff82.
Move EAlign and EVAlign JS<->C++ conversions to FromJSVal and ToJSVal
for consistency.

Remove alternative / british spelling "centre".
Use i32 instead of int since at least and at most 32 bits are intended
there, refs 1e07787e76.

This was SVN commit r22556.
2019-07-26 13:45:14 +00:00
52d58d9845 Wipe MaybeGC/ForceGC declaration leftover from 9f0484e5ce / D1073.
This was SVN commit r22555.
2019-07-26 12:41:22 +00:00
wackyserious
b9544a2eaa New Ptolemy IV (Hero) Texture
Thread:
​https://wildfiregames.com/forum/index.php?/topic/26591-task-ptolemy-iv-rework/

Reviewed by: Stan, Nescio and wowgetoffyourcellphone
This was SVN commit r22554.
2019-07-26 11:10:43 +00:00