1
0
forked from 0ad/0ad
Commit Graph

19804 Commits

Author SHA1 Message Date
7876ca7acb Fix gcc 8 compiler warning in FileIo.cpp about truncating use of strncpy [-Wstringop-truncation].
Refs #5294
Differential Revision: https://code.wildfiregames.com/D2159
Tested on: gcc 9, Jenkins

This was SVN commit r22626.
2019-08-07 15:38:40 +00:00
82f765b4cc Add Profiler2 static const member definition, since the declaration itself is insufficient for const ref access, as revealed in debug builds but not release builds following f89f90d56e and 9965f43067.
Differential Revision: https://code.wildfiregames.com/D2158
This was SVN commit r22625.
2019-08-07 14:45:13 +00:00
f89f90d56e Fix Profiler2 gcc 8 compiler warning about possible out-of-bounds array access and replace auto with their type, refs #5294, 3cbe96d24c.
Tested with gcc 9, clang 8

This was SVN commit r22624.
2019-08-07 09:12:28 +00:00
eb20fe3626 Replace ScriptInterface ErrorReporter layered hack from 5e15a0279e with proper code, refs f6c1d98c9a.
Avoids preparation for the SpiderMonkey 45 update, refs #4893 / D1510 .
Add JSAutoRequest missing from 5e15a0279e too.

Differential Revision: https://code.wildfiregames.com/D2152
Reviewed By: Itms
This was SVN commit r22622.
2019-08-06 22:13:06 +00:00
d35f16e4f5 Remove unused texture test helper function obsolete since dee3cb84b5 and ef888367aa that throws a compiler warning with gcc 7 and beyond.
Refs #2456, #5294.
Differential Revision: https://code.wildfiregames.com/D2153
This was SVN commit r22621.
2019-08-06 21:00:36 +00:00
b5ff885d6a Improve Roman specific names.
Add vowel lengths, add and correct some names, expand some hero names.

Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D1999
This was SVN commit r22620.
2019-08-06 17:59:09 +00:00
df40b88c71 Fix ModIo.cpp gcc 7 compiler warning about extended alignment by using a pointer for hash_state as expected by sodium anyhow, following 833c9f108c, refs #5294.
Differential Revision: https://code.wildfiregames.com/D2102
Reviewed By: Itms
Comments By: historic_bruno
This was SVN commit r22619.
2019-08-06 13:06:15 +00:00
f236c07a56 Call CGUIColor base constructor without C++17 using declaration following 415939b59b.
This removes the trigger for an unidentified VS2015 bug revealed by the
IGUIObject::AddSetting / CGUISetting constructor in 85a622b13a
(unset GUIObject color settings didn't hold the color assigned in the
inherited default constructor, so hovered button text appeared black
instead of white on Windows).
The code in the two commits seems correct, but VS2015 doesn't seem to
implement it correctly (and claims to support C++17) while clang and gcc
behave as intended.
Fix whitespace.

Reported By: gameboy, Angen
Refs
https://wildfiregames.com/forum/index.php?/topic/26694-strange-font-color/

This was SVN commit r22617.
2019-08-05 20:45:15 +00:00
bb
7e1f959db0 redo 2d57478781, Create a ConfigDB_CreateAndWriteValueToFile function to absorb some duplication in the gui
Move two duplicated lines from 7e14a33411 in a function

fixes 2d57478781
Reviewed By: elexis
Comments By: Stan, vladislav
Differential Revision: https://code.wildfiregames.com/D1939
This was SVN commit r22615.
2019-08-05 14:12:55 +00:00
69abe717e3 Fix no-pch build following renderer options refactoring 5c4d124d2a
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2148
This was SVN commit r22612.
2019-08-04 20:08:06 +00:00
6f63f05b8a Fix eab4f9fdde - phenotype tokens were added instead of replacing.
As reported by Freagarach in D2141, when using datatype="tokens" in
children templates, the list of tokens gets expanded instead of
replaced.
This means women randomly switched to male voices.

Patch by: Freagarach
This was SVN commit r22611.
2019-08-04 09:11:46 +00:00
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