1
0
forked from 0ad/0ad
Commit Graph

21917 Commits

Author SHA1 Message Date
cdd75deafb XMB Improvements, parse JS into XMB, make strings more efficient.
XMB format is bumped to 4, invalidating all cached files. The
differences are:
 - element/attribute names are stored after the elements themselves, and
not before. This allows writing XMB data in one pass instead of two.
 - names themselves becomes offsets (instead of arbitrary integers),
making getting the string from the int name much more efficient.

XMBFile is renamed to XMBData to clarify that it does not, in fact,
refer to a file on disk.

XMBData::GetElementString is also changed to return a const char*, thus
not creating an std::string. A string_view version is added where
convenient.

The XML->XMB and JS->XMB conversion functions and the corresponding
storage are moved to `ps/XMB`, since that format doesn't particularly
relate to XML. CXeromyces becomes lighter and more focused as a result.
The XML->XMB conversion also benefits from the above streamlining.

Note that in a few cases, string_view gets printed to CLogger via
data(), which is generally not legal, but we know that the strings are
null-terminated here. Our libfmt (version 4) doesn't support
string_view, that would be v5.

Differential Revision: https://code.wildfiregames.com/D3909
This was SVN commit r25375.
2021-05-04 13:02:34 +00:00
a1010b83d3 Enable specifying the trigger action independently of the trigger name.
Trigger functions/actions were tied to the trigger 'identifier'. This is
inconvenient if several triggers should call the same function, e.g. for
range triggers.

By setting an 'action' in the trigger data, one can now specify the
function to call independently of the trigger name.

For clarity, the 'action' parameter in RegisterTrigger is changed to
'name'. By default, the action still matches the trigger name for
compatibility and convenience.

Differential Revision: https://code.wildfiregames.com/D3903
This was SVN commit r25374.
2021-05-04 12:33:45 +00:00
c0157d613d Simplify trigger event naming scheme.
Reduces confusion and string manipulation.

Refs #52.

Differential Revision: https://code.wildfiregames.com/D3913
This was SVN commit r25373.
2021-05-04 09:46:38 +00:00
79118e6716 Remove castshadow from decals.
This was SVN commit r25372.
2021-05-04 09:21:32 +00:00
6663b27fa2 Disable shadows for blood. Since they are decals it doesn't seem to make much difference.
This was SVN commit r25371.
2021-05-04 09:06:13 +00:00
2efe255bbd Fix error when hosting lobby game.
Revealed by 0406c4dfde. The fix also avoids sending a redundant
lobbyregistration message.

Reported by: langbart
Differential Revision: https://code.wildfiregames.com/D3923
This was SVN commit r25369.
2021-05-04 08:58:22 +00:00
738b200dda Let entity react on target death directly.
Don't let entities waste a repeat time when they've killed their target.
Done by storing a list of attackers in cmpResistance (since that cmp is
obligatory anyway).

Differential revision: https://code.wildfiregames.com/D2129
Comments by: @Angen, @wraitii
This was SVN commit r25368.
2021-05-04 05:18:11 +00:00
34b1920e7b Split ScriptRequest in its own header.
We often only need to include ScriptRequest.h and not the full
ScriptInterface.h

Differential Revision: https://code.wildfiregames.com/D3920
This was SVN commit r25366.
2021-05-03 16:07:26 +00:00
0406c4dfde Throw errors instead of warnings on wrong implicit conversions.
This prints out a stack trace, which is quite helpful when debugging.
Also fixes an issue with stack trace not always being reported.

Differential Revision: https://code.wildfiregames.com/D3210
This was SVN commit r25365.
2021-05-03 15:44:06 +00:00
5287dd768d Add some missing credits.
@mysticjim and @Sundiata manage the community, but were not named in
those credits yet.
@Langbart does a lot of valuable work (amongst which is writing patches)
and was not credited at their first patch (my fault).

Differential revision: https://code.wildfiregames.com/D3880
This was SVN commit r25364.
2021-05-03 14:03:43 +00:00
48cb9a2d6f Allow triggers to spawn turreted entities.
After 21e866fcf0.

Differential revision: https://code.wildfiregames.com/D3872
Comments by: @Angen
This was SVN commit r25363.
2021-05-03 08:54:54 +00:00
bb49fbe793 Further reduce usage of TERRAIN_TILE_SIZE in non-terrain components
TERRAIN_TILE_SIZE is now only used in relevant places in the simulation.
This also makes it mostly possible to use CFixed in constexpr contexts.

Refs #5566

Differential Revision: https://code.wildfiregames.com/D3078
This was SVN commit r25360.
2021-05-02 17:40:00 +00:00
6d10a35d97 Fix some warnings.
- 25332f9b86 added 'override' to a method in ShaderProgram.cpp. This
adds it to the rest.
- BinarySerializer.cpp had custom JS includes, because putting those in
ScriptExtraHeaders failed. The cause is that gloox leaves "#define
lookup" up. This has been reported upstream, and fixed here.
- VS17 complains about an uninitialised variable, though the usage is
safe.

Differential Revision: https://code.wildfiregames.com/D3916
This was SVN commit r25359.
2021-05-02 15:45:40 +00:00
3801a4dd47 Allow implicit JS boolean -> string conversions.
`false` becomes `"false"`, `true` becomes `"true"`.

Differential Revision: https://code.wildfiregames.com/D3917
This was SVN commit r25358.
2021-05-02 15:43:59 +00:00
e53628ab56 Remove debug code left in d9748173c7
Reported by: Freagarach
This was SVN commit r25357.
2021-05-02 07:08:40 +00:00
Angen
0ad3dba097 Do not transfer xp twice on Promotion
ChangeEntityTemplate used by Promotion is transfering xp from old unit
to new one, but also Promotion component itself does the same thing.
Introduced in cc1ea7cca0

Differential revision: D3915
This was SVN commit r25356.
2021-05-01 17:40:26 +00:00
2fcab79e15 Moves terrain independent code for viewport bounds calculations to camera.
This was SVN commit r25355.
2021-05-01 16:59:42 +00:00
d46a417748 Replace ScriptInterface::Call* with new ScriptFunction functions
Finishes work started in f3aedf88a6.
This removes the boost-CPP function wrappers entirely, in favour of pure
templated code in FunctionWrapper.h
The Call* functions were already heavily templated, so there is nothing
really new here. I just use tag dispatch to reduce the number of
overloads slightly.

The new functions do not need the script interface, only the script
request.

Differential Revision: https://code.wildfiregames.com/D3912
This was SVN commit r25354.
2021-05-01 14:04:53 +00:00
d9748173c7 Generalize icon-specific tooltips to a tag, streamline code.
We can currently specify a custom tooltip for an icon. This extends that
to a generic tag `[tooltip='something']...[/tooltip]` for any particular
piece of text, and removes the iconTooltip hardcoding by instead using a
virtual `GetTooltipText` call since all IGUIObject descendants have a
tooltip. This is both cleaner & more efficient.
Removes the ability to set a custom tooltip style (that doesn't seem
particularly useful), it'll reuse the style of the CText itself.

Differential Revision: https://code.wildfiregames.com/D3895
This was SVN commit r25353.
2021-05-01 12:38:05 +00:00
9107d6d8c7 Fixes unused CCamera argument in debug rendering in SilhouetteRenderer.
This was SVN commit r25352.
2021-05-01 12:13:48 +00:00
8633a28b00 TriggerPoint - default required component is '0'.
Differential Revision: https://code.wildfiregames.com/D3902
This was SVN commit r25351.
2021-05-01 09:02:30 +00:00
19b01dc710 Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers.
The main benefits are more convenient code in the component interfaces
TU and no limit on the # of arguments that can be passed.

Differential Revision: https://code.wildfiregames.com/D3910
This was SVN commit r25350.
2021-05-01 08:01:30 +00:00
c62ad8fefa Implement FromJSVal<IObject*> safely
By making all GUI proxy objects share the same class, we can easily
confirm if a given JS object is one, and from there convert to the
appropriate types.

Differential Revision: https://code.wildfiregames.com/D3907
This was SVN commit r25347.
2021-04-30 13:20:43 +00:00
3579097d95 Count resource gatherers also when returning their resources.
Followup on 1e0a6f66f0.
This gives a better image of the amount of units which are gathering.
By decision, entities are _not_ accounted from when the player tasks
them to return their resources.

Refs. #643
Differential revision: https://code.wildfiregames.com/D3226
Comments by: @wraitii
This was SVN commit r25345.
2021-04-30 06:24:13 +00:00
835c081ca4 Fix large slowdown in rendering on some configurations.
Usage of GL_VERTEX_ARRAY client state apparently prevented OpenGL from
using hardware acceleration on my computer (Macos 10.14 with an Intel
GPU).
It is unclear how many people would be affected by this issue, but on my
end it makes GLSL performance competitive with ARB again.

Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3900
This was SVN commit r25343.
2021-04-29 07:38:40 +00:00
2ce4c2e7d5 Unify pierce resistance of defensive structures.
Defensive buildings now have 25H/35P/3C resistance.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3757
This was SVN commit r25342.
2021-04-29 07:35:27 +00:00
f0b2c31533 Buff stone throwers: increased range and HP.
Patch by: borg-
Differential Revision: https://code.wildfiregames.com/D3781
This was SVN commit r25341.
2021-04-29 07:32:49 +00:00
70149803c5 Introduce a specific limit to domestic animals pop.
- Prevents lag
- Prevents abuse by using animals to break pathfinding.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3777
This was SVN commit r25340.
2021-04-29 07:29:48 +00:00
b1267f7878 Unify resistances of non-buildable structures.
Resistance is unified to 1H/10P/1C.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3756
This was SVN commit r25339.
2021-04-29 07:27:12 +00:00
04d242c456 Introduce an Hoplite tradition tech for Athens/Sparta.
Similar to the archer tradition tech.
Intended to boost usage of melee units.

Patch by: borg-
Differential Revision: https://code.wildfiregames.com/D3688
This was SVN commit r25338.
2021-04-29 07:26:00 +00:00
e3c7c4656a Increase archer spread slightly, introducing a compensating technology.
This new value was last changed in 4a2cc3273e. The new value sits
halfway.
The technology is available at the forge for all civilizations with
archers and independent of the already existing “Archery Tradition”
technology.

Patch by: Nescio
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3736
This was SVN commit r25337.
2021-04-29 07:22:20 +00:00
59168b015e Revert 2e1545ffc4, fix correctly.
This was SVN commit r25335.
2021-04-28 16:38:45 +00:00
c9a7aabbea Fix enabling / disabling shadows in the actor viewer.
Differential Revision: https://code.wildfiregames.com/D3896
This was SVN commit r25334.
2021-04-28 11:09:16 +00:00
d981536a5e Fix horses props going OOS when gathering.
- EOL native and xml mime type
- Add player_trans_norm_spec.xml
- Disable cast shadow for manes.
- Use norm instead of parallax

Reported by @Freagarach

This was SVN commit r25333.
2021-04-28 11:03:15 +00:00
cbd91ca999 Translation fixes.
- Fix in tooltip context for healing 'Health'
- Fix in tooltip for splash shape.
- Translate locale_advanced
- Translate specific name in the structure truee
- Translate player name in gamesetup.

Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3889
This was SVN commit r25332.
2021-04-28 08:04:13 +00:00
b74d5bf0d8 Removes glColor* calls from scene rendering, colors are set explicitly by uniforms.
This was SVN commit r25330.
2021-04-27 19:35:36 +00:00
5b33d3a76c Removes ShaderProgramPtr argument from DebugRenderer methods.
This was SVN commit r25329.
2021-04-27 19:23:37 +00:00
cd6a554198 Removes GL matrix stack usages from scene rendering.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3894
This was SVN commit r25328.
2021-04-27 18:43:49 +00:00
4718760754 Fix ugly water color in polynesia.xml
This was SVN commit r25327.
2021-04-27 14:09:57 +00:00
66fbc23f2c De-singletonify CConfigDB, make hooks RAII.
CConfigDB is no longer a singleton, and its members are no longer
static.
This makes it possible to have several instances of it, useful for
testing of if we ever want to have different config profiles.

Also updates hooks to delete themselves on destruction, to fit a more
natural RAII pattern. Long-lived objects must take care to destroy hooks
before ConfigDB is reset.

Differential Revision: https://code.wildfiregames.com/D3866
This was SVN commit r25326.
2021-04-27 07:45:40 +00:00
2698cf8ba2 Fixes missing DrawCameraFrustum argument after 5e12424123.
This was SVN commit r25324.
2021-04-26 21:21:13 +00:00
5e12424123 Removes glBegin from scene rendering, removes GL matrix stack dependency from scene rendering.
This was SVN commit r25323.
2021-04-26 21:11:35 +00:00
67948e4229 Fix flag position for barracks.
Refs: #6160

This was SVN commit r25322.
2021-04-26 15:33:54 +00:00
8963786a76 Improve error message for broken quality levels in Actor files.
Differential Revision: https://code.wildfiregames.com/D3887
This was SVN commit r25321.
2021-04-26 14:59:32 +00:00
ad87f1e295 More actor file validation, preventing crashes.
It's currently possible to trigger ENSUREs in the code if loading empty
groups, which is easy enough with LOD and shouldn't happen.

Recover gracefully from these errors instead.

Differential Revision: https://code.wildfiregames.com/D3888
This was SVN commit r25320.
2021-04-26 14:57:13 +00:00
9957ff1b08 Fix broken garrison flag on the athenian temple.xml
Refs: #6160

This was SVN commit r25319.
2021-04-26 14:56:50 +00:00
2e1545ffc4 Fix unused variable warning in a97f7f3917
This was SVN commit r25318.
2021-04-26 08:47:24 +00:00
2086a66340 Adds circle drawing to DebugRenderer.
This was SVN commit r25315.
2021-04-25 21:55:19 +00:00
e90aaf6348 Adds line drawing to DebugRenderer.
This was SVN commit r25314.
2021-04-25 20:48:44 +00:00
Angen
9977c73eb6 Revert 895182cbcb
This was SVN commit r25313.
2021-04-25 13:42:51 +00:00