Fixes the issue that they noticably stick out horizontally when placed on slopes.
(thanks to the previous commit these values will be adopted by the "special/actor" template when loading it in)
Reviewed-By: Itms
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/7542
Optionally let actor templates define their own anchor types.
These override the default value defined in the template.
Useful for actors without their own entity template.
Reviewed-By: Itms
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/7542
During the eslint 8 cycle the formatting rules were split out [1],
deprecating the corresponding rules in core.
This replaces all rules that where moved to @stylistic/eslint-plugin [2]
and accounts for the difference in the indenting rule behaviour.
To allow the pre-commit import hack to continue to work with the
stylisitc plugin for a recent nodejs version to be used.
[1] https://eslint.org/blog/2023/10/deprecating-formatting-rules/
[2] https://eslint.style/packages/default
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Not all modules should be able to load all other modules. A predicate
function can to be passed to the `ScriptInterface`. That function
returns whether the module is allowed to loat the module. If no
predicate is passed in no modules can be loaded through that
`ScriptInterface`.
- With modules JavaScript code can be split up into multiple files. We
already implemented such a mechanism (`Engine.LoadLibrary`) in
multiple parts of the engine. The advantage of using modules is
that it's standart (JS-devs are familiar with it) and it doesn't
has to be implemented multiple times.
Note that `Engine.LoadLibrary` loads all files in a directory
while the new `import` only loads one file.
- With modules seemingly global variables are local to that
script/module. We already implemented such a mechanism
(`ScriptInterface::LoadScript`).
Requires HEAD to point to --to <commitish> for the files to be in the
state for copyright.py to produce expected results. Which isn't the case
in the gitea workflow.
Also use plumbing commands to on one hand make it more robust and on the
other hand to avoid bad files only in --from <commitish> to leak into
the check.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit primarily corrects an inaccurate comment and resolves a
hidden bug in the VisualActor shadow logic, while preserving the current
behavior.
Previously, the DisableShadows option removed both casting and receiving
shadows. However, the internal logic ignored this setting in some cases,
causing shadows to appear even when explicitly disabled in XML
templates.
This change introduces the ability to control CastShadows and
ReceiveShadows independently via template settings, defaulting both to
true unless explicitly specified.
In addition, previews are updated to receive shadows but not cast them,
improving visual volume effects without affecting lighting behavior.
All documentation pages are made subpages of a page Documentation, this
helps browse documentation not directly tied to source code.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The FreeType font loader was directly passing filesystem-style paths
(e.g., mod.zip/...) to FT_New_Face, which does not support paths inside
ZIP archives. As a result, FreeType failed to open the font, triggering
a crash when the engine attempted to use an invalid face object.
This patch changes the font loading logic to:
Use the VFS to read the .ttf font file into memory (shared_ptr<u8> and
size).
Load the font using FT_New_Memory_Face with the in-memory buffer,
ensuring compatibility with zipped mods.
Previously, opening a map that referenced a deleted or missing terrain
caused a severe crash with multiple error dialogs, forcing users to kill
the process. This change restores the previous behavior where missing
terrains are gracefully handled: a warning is logged and the terrain is
substituted with a fallback placeholder (ErrorTexture from
TextureManager).
This significantly improves UX for developers and modders working with
outdated or broken maps, aligning behavior with expectations from
earlier versions of the editor.
Extends the current Windows pipeline to also build for AMD64. While at
it use a matrix build.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The BIT macro is compile time only anyway. Takes care of the warning
"C4334 - <<': result of 32-bit shift implicitly converted to 64 bits".
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make what could be considered a legendary hack less brittle.
C4312: 'reinterpret_cast': conversion from 'long' to 'void *' of greater size
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In premake we check for wxWidgets on Windows to see if we can build
Atlas, this check wasn't adopted when adding support for Win64.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Those warnings aren't enabled for gcc and clang currently either, so
just disable them for msvc as well.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Mongoose is on the way out, and it's not like the same issue isn't
present for other 64bit platforms, we just don't have those warnings
enable there.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The target file is checked in into vcs so this tool isn't used during
build and as such better lives in source/tools.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
All linting was ported to pre-commit or gitea workflows, the only thing
left is an adapter to output to Phabricator which is no longer in use.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This option allows to build the spidermonky archive hosted by WFG from
the upstream firefox tarball.
First this serves as documentation as to how the taball is created and
by integrating it into the regular build process allows to easely bump
spidermonky version for local testing.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In f3ac9e9669 the fail condition was broken causing it to allow building on restricted areas.
Add a test to ensure correct behavior for this case.
Reported by: @wowgetoffyourcellphone
Pull Request: #8021
Atlas has no notion of player removal. Each entity would trigger an error in Player.js
Reported by: @trompetin17
Reviewed by: @trompetin17
Pull Request: #8006
This replaces the old arclint eslint setup 1:1 rule wise, only porting
the configuration to a format recent eslint can read.
Further remove the arclint setup as it is no longer of use.
Thanks to Stan for reviewing all needed fixes to Javascript code to
allow for adding this without compromises.
Fixes: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This fixes 'no-trailing-spaces', 'semi', 'prefer-const' that made it in
since and 'no-shadow', 'no-multi-assign', 'no-invalid-this' as well as
'no-undef-init' in profiler.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Variables declared with `var` are also accible after accessing the
scope. This lead to shadowing because variables with the same name are
declared in a later scope.
Ref: #7812
Since variables declared with `var` don't respect all scopes, when used
in a loop it doesn't create a new variable each iteration. The
initializer value is always assigned to the same variable. That makes
problems when the variable is used in a callback. To work around that
the variable is copied in to a IIFE.
When not using `var` the iife isn't required.
Ref: #7812
This commit introduces optional debugging visuals for font glyph
rendering. When enabled, each glyph is drawn with a surrounding debug
box to aid in visual inspection of glyph layout, spacing, and atlas
behavior.
Usage examples (via console):
// Enable debug box rendering
Engine.ConfigDB_CreateValue("user","fonts.debugBox", true);
// Set debug box color (R G B)
Engine.ConfigDB_CreateValue("user","fonts.debugBoxColor", "35 0 35");
This feature is intended for developers working on font layout or atlas
generation logic, and has no effect on normal gameplay or UI rendering
when disabled.
This removes all global code and fixes eslint warnings 'no-shadow' and
'no-undef-init'. Leave other possible improvement style wise for an
other time.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Eslint doesn't like the global return and fails to parse the trigger
script file. Rewrite the script to avoid this and any globals while at
it. Also use OnInitGame as the execution with an IIFE in global scope
wouldn't guarantee when it will be executed or whether the timer
component is already registered.
Further don't concat the warning string as the extraction script for
translation expects a literal.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>