Commit Graph

7275 Commits

Author SHA1 Message Date
9f4e398585 Fix rooting mistake in CGame::ReallyStartGame, detected by Bellaz89, fixes #5776.
Differential Revision: https://code.wildfiregames.com/D2869
Accepted By: Bellaz89
This was SVN commit r23815.
2020-07-11 14:24:09 +00:00
365dbd91fc Fixes terrain index type (causing a warning) introduced in 1e1ce27eba.
This was SVN commit r23807.
2020-07-07 16:51:20 +00:00
56d3aa40fe Fix conversion of UTF8 strings between the scripts and the engine.
SpiderMonkey uses UTF16 internally, and only provides APIs for that
encoding, so stop hacking UTF8 strings: properly convert them to and
from UTF16 when passing them through SM.

Patch By: wraitii
Differential Revision: https://code.wildfiregames.com/D2838
This was SVN commit r23795.
2020-06-30 10:46:06 +00:00
dc65912043 Fix building on GCC 10, fixes #5709, #5756.
Patch By: pcpa and wraitii
Tested By: Nescio, andy5995 and others
Differential Revision: https://code.wildfiregames.com/D2745
This was SVN commit r23794.
2020-06-30 10:24:00 +00:00
853e8c0f1e CVector2D: Fix members may not be initialized warnings
Differential Revision: https://code.wildfiregames.com/D2825
This was SVN commit r23784.
2020-06-21 18:21:31 +00:00
ec4f51d928 Fix --without-pch build following ffd2219200
Differential Revision: https://code.wildfiregames.com/D2819
This was SVN commit r23775.
2020-06-14 20:51:21 +00:00
6b2b071ad5 Move LOS to a los helper header and cleanup Grid.h includes.
Changing Grid.h should recompile faster, as it is now included in fewer
TUs.

Differential Revision: https://code.wildfiregames.com/D2784
This was SVN commit r23774.
2020-06-14 20:39:03 +00:00
ffd2219200 Don't overwrite JS error reporting by calling JS_ReportError.
Upstream spidermonkey supports JSNative error reporting by returning an
explicit failure code. This provides a full stacktrace. Calling
JS_ReportError, removed upstream, removes that stacktrace.

Instead, we should simply LOGERROR.

Based on a patch by: elexis
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2627
This was SVN commit r23773.
2020-06-14 10:34:49 +00:00
4b1a4ef4cf Rework ScriptInterface EnumeratePropertyNames to support non-enumerable properties.
This lets it support the JSClass syntax, introduced for components in
5fb88172a2/D2492, which required a workaround before.
As cleanup, remove the prefix logic which was too specific to be in
ScriptInterface, and use an upstream-compatible API that also does more
of what we want.

Based on a patch by: elexis
Differential Revision: https://code.wildfiregames.com/D2644
This was SVN commit r23771.
2020-06-14 09:49:32 +00:00
939002f0dc RangeManager: Grid for 2D array, enum cleanups.
Range manager has several `std::vector` for fixed-size arrays and 2D
grids. By using proper data structures, the code readability is
improved.
This also moves around the LosVisibility enum.

Comments by: Stan`, nani
Differential Revision: https://code.wildfiregames.com/D2770
This was SVN commit r23769.
2020-06-13 09:05:40 +00:00
6f70a901f8 Remove duplicated call in tile rendering for TerrainOverlay.
Patch By: vinhig
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2811
This was SVN commit r23767.
2020-06-12 20:52:18 +00:00
fd8a47f5d9 Moves calculations of bounds for fixed shadows to a separate function.
Reduces complexity of the SetupFrame function. Fixed shadows were added
in 8e48e1b17e.

This was SVN commit r23766.
2020-06-12 20:09:08 +00:00
06bf3a8739 Adds GLSL shaders of overlay lines.
We were using ARB shaders in GLSL mode for overlay lines (unit
selection, ranges and so on).

Tested By: Freagarach, OptimusShepard, Stan
Differential Revision: https://code.wildfiregames.com/D2621
This was SVN commit r23765.
2020-06-12 15:39:44 +00:00
5176f848b8 Fixes missing deletion of files in 409c436ae2.
Patch By: linkmauve
Differential Revision: https://code.wildfiregames.com/D2476
This was SVN commit r23755.
2020-06-08 22:36:19 +00:00
409c436ae2 Remove obsolete GetVideoMode platform-specifics, replaces by platform-agnostic SDL2`s APIs.
Before and after the commit we don't support multiple displays and HiDPI
properly.

Patch By: linkmauve
Tested By: Angen, elexis, Stan
Differential Revision: https://code.wildfiregames.com/D2476
This was SVN commit r23754.
2020-06-08 17:49:26 +00:00
b62308a301 Fix error in e9361705ae.
The HWDetect changes were not working properly.

Reported by: Nescio
Tested by: Nescio
Differential Revision: https://code.wildfiregames.com/D2799
This was SVN commit r23748.
2020-06-07 20:11:37 +00:00
e9361705ae Refactor HWDetect and rendering options setup.
Remove duplication when setting graphic options by reading the configDB
directly.
Properly protect the ModIO config keys.

Approved By: linkmauve
Refs #5538

Differential Revision: https://code.wildfiregames.com/D1931
This was SVN commit r23747.
2020-06-07 13:16:57 +00:00
7440523ade Enable garrisoning on gates / fix movement of units with visible garrison points (2nd commit)
This is the same commit as 2abd9cead2 / D1418, fixing noted issues.

This addresses two related issues:
- Units visibly garrisoned on gates keep the gate open.
- Units visibly garrisoned on entities keep their pathfinding blocker
flags.

De-activate the obstruction of visibly-garrisoned entities, fixing the
2nd issue.
Keep a list of entities that cannot move and thus should not count
towards gate-opening logic.

Packing logic is kept separate: it is more related to entities having
'alternate forms' with different capabilities than being currently
incapable of moving.

Based on work by temple

Fixes #2679.
Fixes #5151.

Differential Revision: https://code.wildfiregames.com/D2775
This was SVN commit r23731.
2020-06-02 11:40:29 +00:00
c4625b14df Improve the warning message for FromJSValue<CColor> when trying to convert a non-object to CColor.
Reviewed by: wraitii
Differential Revision: https://code.wildfiregames.com/D2778
This was SVN commit r23727.
2020-06-01 16:09:28 +00:00
945ac4fc3b Do not change the gamma of the display on startup.
Added in df6fceba62 to (most likely) have some control over brightness,
this conflicted with dimming utilities and would not play nice with
starting 0 A.D. in windowed mode.

If gamma handling were to be reintroduced later, it should only affect
the 0 A.D. window.

Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1976
This was SVN commit r23722.
2020-06-01 05:12:51 +00:00
531dcf40c3 Revert 0363202a20, 2abd9cead2 and b4144dc2c3
Player-testing has revealed QA issues, so reverting these for now.

Differential Revision: https://code.wildfiregames.com/D2773
This was SVN commit r23714.
2020-05-31 10:06:39 +00:00
2abd9cead2 Enable garrisoning on gates / fix movement of units with visible garrison points
This addresses two related issues:
- Units visibly garrisoned on gates keep the gate open.
- Units visibly garrisoned on entities keep their pathfinding blocker
flags.

Remove the block-movement flag from visibly garrisoned entities.
Keep a list of entities that cannot move and thus should not count
towards gate-opening logic.

Packing logic is kept separate: it is more related to entities having
'alternate forms' with different capabilities than being currently
incapable of moving.

Based on work by temple

Comments by: Freagarach
Tested by: Nescio
Fixes #2679
Fixes #5151

Differential Revision: https://code.wildfiregames.com/D1418
This was SVN commit r23710.
2020-05-30 09:18:33 +00:00
ebd9786268 Add missing cpp files in last commit refs D2503
This was SVN commit r23704.
2020-05-28 18:18:00 +00:00
bb
5cfce692e7 Implement keyDown event
Change HotkeyPress event to be non-repeating (HotkeyDown to replace the
repeating case)
Fix shiftlag
Make toggle hotkeys only respond to the first SDL event.

Many iterations of review by: elexis
Test done by: Imarok
Comments By: vladislav, Stan
Reviewed By: wraitii
Fixes: #5055
Differential Revision: https://code.wildfiregames.com/D1398
This was SVN commit r23701.
2020-05-26 21:47:03 +00:00
892f97743b Fix some cases of units getting stuck.
This fixes an off-by-one error that led to entities sometimes getting
stuck against obstructions.
It also increases the max-range of the short pathfinder to help entities
find their way around corridors and house blocks.

Fixes 2ff8614ce2 (off-by-one error) and reverts the range changes from
32e8ed51aa

Reported By: Freagarach
Fixes #5586 . Refs #5624

Differential Revision: https://code.wildfiregames.com/D2754
This was SVN commit r23699.
2020-05-25 20:13:35 +00:00
Angen
c8e6c05334 Fix gcc warning reported by Imarok after 204e17206b
Introduced in 204e17206b.
Gcc gives warning about missing parenthesis so this patch is adding
them, not changing result of expression.
Fix proposed by Imarok in P206 after report on irc
http://irclogs.wildfiregames.com/2020-05/2020-05-22-QuakeNet-%230ad-dev.log.

Differential Revision: https://code.wildfiregames.com/D2762
Reviewed by: elexis
This was SVN commit r23692.
2020-05-23 12:21:49 +00:00
Angen
204e17206b Update plural_forms.cpp by tinygettext to reflect needs of translators
Some languages like sk in [[SVN:21907]] have changed crucial line with
information about how many plurals language uses and how to calculate
correct one. However in plural_forms this line could not be matched with
implemented functions so as result object with default settings have
been returned what resulted in using only singular for translatePlural
calls.

Affected languages (12):
sk, lt, uk, cs, pl, ro, mk, he, ga, cy, be, br

I am leaving old variants as they can be useful for another languages.

Differential Revision: https://code.wildfiregames.com/D2751
Comments by: wraitii
This was SVN commit r23690.
2020-05-22 20:06:40 +00:00
57636140b5 Fix typo (certifiacte -> certificate) imported from gloox in 0e2adda813, reported by pilino1234 on transifex, relayed via Angen on Phabricator.
This was SVN commit r23685.
2020-05-21 10:15:26 +00:00
c1ddc0c4b9 Internationalise Damage Types and Status Effects using (optional) JSON files.
.json files in simulation/data/template/helpers/damage_types and
status_effects will be used to internationalise damage types and status
effects, as well as share common text.
Fixes the order of damage types being inconsistent.

Add the possibility for i10n xml extractor to set a custom context.

Fixes #4801
Related to D2296.

Featuring work from: Freagarach

Differential Revision: https://code.wildfiregames.com/D2337
This was SVN commit r23681.
2020-05-20 17:26:37 +00:00
c9d9b7be83 macOS build fixes and Jenkins pipelines.
This includes:
- some build fixes
- Jenkins pipelines, in use since January
- a revamped DMG build script, including dmgbuild configuration by Tobbi
and a tweak by norsnor (D2650)

Differential Revision: https://code.wildfiregames.com/D2523
This was SVN commit r23676.
2020-05-17 14:12:53 +00:00
20ea4b1329 Enable preSelectedi actions on the minimap
Quickly tested by: Stan
Differential Revision: https://code.wildfiregames.com/D2728
This was SVN commit r23653.
2020-05-10 14:22:39 +00:00
1ed64439ea IGUIObject ScriptEventi: optional return value for signalling if the event has been handled
Comments by: badosu, elexis
Differential Revision: https://code.wildfiregames.com/D2727
This was SVN commit r23652.
2020-05-10 14:01:00 +00:00
1e1ce27eba Adds offsets to the terrain resize function and adds comments how the resizing works.
Original Patch By: Clockwork-Muse
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2724
This was SVN commit r23639.
2020-05-07 21:46:17 +00:00
Angen
990e3163d8 Do not store empty Garrison tag in map xml files after 8bfb449375
Differential Revision: https://code.wildfiregames.com/D2690
Patch by: Freagarach
Reported on forum:
https://wildfiregames.com/forum/index.php?/topic/27867-tag-in-the-map-xml-file/

8bfb449375 introduced Garrison tag to the xml map files.
In case GarrisonHolder was present, but held no entities, empty tag was
written. This is adding check for emptyness so that behaviour is
prevented.

This was SVN commit r23634.
2020-05-07 16:57:45 +00:00
a4341acaa6 Fixes macOS builds after 76909984b2 because of removed header.
This was SVN commit r23625.
2020-05-05 11:31:19 +00:00
76909984b2 Removes obsolete clipboard, replaces by platform-agnostic SDL2`s APIs. Refs D2476.
Patch By: linkmauve
Tested By: bb, elexis, Stan
This was SVN commit r23624.
2020-05-05 11:18:00 +00:00
2e6aecb210 Fixes FXAA for maps with default effects, FXAA was introduced in 113b1c49b9.
Tested By: OptimusShepard, Stan
Differential Revision: https://code.wildfiregames.com/D2712
This was SVN commit r23617.
2020-05-02 22:34:29 +00:00
2489e57d58 Uses EPS to compare Camera quads after 50f70b7be3.
We don't need exact precision in that kind of calculations. Since we use
not fixed floating point numbers and use them only for visual stuff.

Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2713
This was SVN commit r23608.
2020-04-29 18:41:53 +00:00
ebf0591a8f Skip and warn about globalscripts and random map tests following 077c4f2576 and 0a6db43c83 when testing without public mod present or if the respective folders don't exist.
Differential Revision: https://code.wildfiregames.com/D2645
Reported By: ricotz
Reviewed By: Angen
Comments By: Stan, Freagarach
This was SVN commit r23598.
2020-04-23 12:06:56 +00:00
0ad79096bd Add a C++ interface for CCmpAttack.
This allows Atlas not to rely on eval() to get access to the attack
component.
Add a quick test for the added method.
This fixes the animation speed matching that of the actor instead of the
template.
Remove some dead code after af2abb8cbf
Fixes: #5129
Reviewed by: @Angen
Comments by: @elexis
Differential Revision: https://code.wildfiregames.com/D2464
This was SVN commit r23592.
2020-04-21 21:44:05 +00:00
ff7ab2fa8f Revert 0916ffbbb1
Summary: Having a mouse event and a hotkey for the same hardware key
turned out to be bad. If the mouse is above a gui element that handles
the middle mouse event and the middle mouse is released, this event will
be consumed by the gui handler of this gui element. Therefore the hotkey
handler does not know that the key was released. If we change that
behaviour typing in input fields would trigger hotkeys. So this seems
unsolvable without adding special handling for the middle mouse case,
which would be ugly.


Fixes: #5695

Differential Revision: https://code.wildfiregames.com/D2700
This was SVN commit r23589.
2020-04-19 12:29:40 +00:00
accf7ade37 Add thread names on Linux (implements debug_SetThreadName), also add the thread name of the UPnP thread.
Patch By: linkmauve
Differential Revision: https://code.wildfiregames.com/D2479
This was SVN commit r23568.
2020-04-06 20:20:27 +00:00
32a105d6f8 Update cppformat from v0.11.0 to v1.1.0, fixes #5646, refs #3190.
Use the opportunity to rename the lib from cppformat to fmt, refs #4148.

Patch By: adrian
Rebased By: s0600204
Differential Revision: https://code.wildfiregames.com/D2613
This was SVN commit r23562.
2020-04-01 07:29:33 +00:00
c2afb5cdb6 Fix warnings with VS2015 introduced in 800bf0da24
Reviewed by: @Angen
Differential Revision: https://code.wildfiregames.com/D2394
This was SVN commit r23531.
2020-03-15 16:13:51 +00:00
Angen
8bfb449375 Support garrisoned enitites defined in map files.
This is adding support to handle garrisoned entities defined in map
files by game engine and atlas allowing future extension for atlas ui
and solving recreation of entites on init in D1958. Also solving
deepfreeze described in D2562.

Differential Revision; https://code.wildfiregames.com/D2597
Ticket: #3008
Patch by: Freagarach
Comments by: elexis
This was SVN commit r23529.
2020-03-15 13:54:50 +00:00
8be20790b5 Check for missing selection textures and missing range overlay textures
Refs: D2618

This was SVN commit r23520.
2020-03-07 11:06:51 +00:00
Angen
0b8aa7eb5a Fix GetTerritoryPercentage when changing number of players
Check for player being out of bounds after m_TerritoryCellCounts may be
recomputed.

Differential Revision: https://code.wildfiregames.com/D2046
Reviewed by: @Stan
This was SVN commit r23510.
2020-02-23 18:24:31 +00:00
b4da3388ec Should have waited for the bears
refs D1752
refs 0916ffbbb1

This was SVN commit r23507.
2020-02-17 19:23:42 +00:00
0916ffbbb1 Add GUI events for middle mouse click
Summary: Add gui events for middle mouse click

Differential Revision: https://code.wildfiregames.com/D1752
This was SVN commit r23505.
2020-02-17 18:16:58 +00:00
Angen
0535eb9b92 Fix formationmember not leaving walking state if offset cannot be reached
Fail movement for formationmember when cannot find path to destination
and formationcontroller is not moving so formationmember will enter idle
state or follow next command relying on member stopping movement first.

Introduced in a1dc9cadd8.

Differentail Revision: https://code.wildfiregames.com/D2438

This was SVN commit r23496.
2020-02-13 19:44:03 +00:00