Commit Graph

1277 Commits

Author SHA1 Message Date
c49d4eedd0
Lint and format Python files using ruff
To improve quality und uniformity of the included Python code this
lints and formats the included Python files with ruff.
2024-08-24 10:54:26 +02:00
eeb0f1cce6
Make checkrefs and called scripts return an error 2024-08-23 17:54:56 +02:00
2a06eea08a
Fix checkrefs.py for python 3.12
Fixes #6898
Reported by: @Itms
2024-08-23 15:59:36 +02:00
e9d1cb6cc7 Generate nightly SVN builds for end users, fixes #1819. 2024-08-20 19:15:56 +02:00
b698558102 Get rid of svnversion. 2024-08-20 19:10:54 +02:00
27757404f0 Set missing executable properties on some scripts.
Reported by: @sera
Fixes: #6944

This was SVN commit r28188.
2024-08-10 11:48:16 +00:00
32b9a27e9b Fix references in portable object templates
Up to now the references (lines starting with `#:`) in the portable
object templates generated by `updateTemplates.py` didn't comply with
the PO file format specification. They violated the specification in two
ways:

- White spaces in file names got replaced by non-breaking spaces
  (U+00A0), instead of the file names being enclosed by First Strong
  Isolate (U+2068) and Pop Directional Isolate (U+2069)
- the references didn't just include the filename and optionally the
  line number of the string, as defined in the specification, but also a
  non-standard "breadcrumb" component, which made them unnecessary
  hard to read in certain cases and difficult to use with tools
  expecting properly formatted references

This commit fixes both of these issues by properly encoding white
spaces and removing the breadcrumb component.

Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5309
This was SVN commit r28159.
2024-07-25 08:53:04 +00:00
1fa6184d17 Make language names in credits translatable
Up to now the languages and their names shown in the credits came from a
static mapping in `creditTranslators.py`. The language names noted in
there weren't consistent: some where present just in English, some in
their native language and some in both. This also required adjusting the
mapping manually, whenever a new language got added on Transifex,
otherwise its translators wouldn't be credited properly.

This commit resolves both issues, by making the language names
translatable and removing the need for the static mapping in
`creditTranslators.py`.

There is one minor nuisance with this implementation: As the languages
get listed in the credits in the same order as in `translators.json` and
they are ordered by there English name in there, the order might not be
alphabetical in other languages.

Running `creditTranslators.py` for the first time with these changes
will produce a rather large diff for `translators.json`, as not just the
language names will be changed to the English name of the language in
many cases, but the order of languages in the file as well. The first
run of `updateTemplates.py` after that will then add the languages as
new translatable strings.

Patch by: @Dunedan
Accepted by: @Itms
Differential Revision: https://code.wildfiregames.com/D5300
This was SVN commit r28158.
2024-07-24 15:37:05 +00:00
44f48427c5 Avoid empty translatable strings
Extracting translatable strings source files did also extract strings
which only consisted of spaces and line breaks. As that doesn't make
much sense, added noise in the portable object templates, for
translators and when linting the translations, this commit omits such
strings when generating the portable object templates.

Patch by: @Dunedan
Accepted by: @Stan, @Itms
Differential Revision: https://code.wildfiregames.com/D5308
This was SVN commit r28157.
2024-07-24 15:18:36 +00:00
0881583535 Remove more translator duplicates
While `creditTranslators.py` did already contain logic to remove
duplicate translator names, that logic didn't remove translator names
which only differed in their casing. As the removal was implemented
using an (unordered) `set`, the order of such duplicate names wasn't
deterministic and oscilated between the possible orders with different
invocations of `creditTranslators.py`, creating unnecessary changes to
`translators.json`.

This commit fixes that so that duplicate names are also removed when
they just differ in their casing and prefers the variant with has the
names starting with a capitalized letter.

Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5304
This was SVN commit r28152.
2024-07-16 09:32:04 +00:00
4a68486812 Preserve comments in debug translations
Up to now the "debug" and "long" translations got generated without the
comments present in the portable object files. This lead to the problem
that "dennis-ignore" directives in the comments weren't present in these
translations anymore, causing dennis to report false-positives for the
debug translations. This commit fixes that by keeping the comments in
the debug translations.

Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5303
This was SVN commit r28150.
2024-07-14 05:51:41 +00:00
70dea92859 Fix translator credit script
The changes from D5290 broke the script to credit translators, as the
lines with the translators might now include additional information,
like the years of contribution, after the usernames, that would've
been included by `creditTranslators.py` as well.

This commit also slighly hardens the removal of deleted users to from
the credited translators to reduce the likelihood to remove still
existing users.

Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5298
This was SVN commit r28142.
2024-07-07 16:26:54 +00:00
4bcbc72274 Don't use std::shared_ptr to store m_ScriptContext and m_ScriptInterface in the CGUIManager
`std::shared_ptr` is intrusive. When a function expects a
`std::shared_ptr` the caller has to use it too and can't store the
element on the stack for example.

Comments by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5221
This was SVN commit r28131.
2024-06-27 19:09:30 +00:00
75753abd2e Fix removal of email addresses from PO-files
The regex for removing the email address of the last translator from
PO-files contained two bugs causing it not to match:

1. It didn't account for text after the email address and PO-files
   from Transifex contain the year of the last translation there.
2. It expected a second `\\n"` at the end of the line, instead of `\n"`.

This commit fixes both of these issues and simplifies the regexes. It
also ensures that the text after the email address is kept as well.

Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5290
This was SVN commit r28130.
2024-06-26 04:19:43 +00:00
5a43f514dc Remove file missed by previous commit
This was SVN commit r28125.
2024-06-23 19:05:16 +00:00
53e00e1953 Remove contrib JS-lexer and use upstream one
As we depend on Babel for i18n tooling nowadays, we can also use its
maintained JavaScript-lexer, instead of the one forked from an old
version of Babel.

Doing so reduces the amount of code we have to maintain, adds new
functionality (like properly handling hexadecimal unicode notations) and
fixes some regex related incompatibilities which makes generating
portable object templates possible with recent Python versions.

The use of `tokenize(…, dotted=False)` is necessary, as we use this
lexer for C++ code as well and detection of most strings in C++ code
fails otherwise. As dotted names weren't supported by version of the
lexer we used until now, this isn't a regression.

Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5293
This was SVN commit r28124.
2024-06-23 19:04:07 +00:00
74afb17aa4 Split the Shutdown function
Comments By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5148
This was SVN commit r28056.
2024-03-24 12:45:27 +00:00
6b31999b64 Don't use std::shared_ptr<ScriptContext> in the CSimulation2
Since 1bccfef6fb the `CSimulation2` uses the `std::shared_ptr` only in
the constructor and stores a `ScriptContext&` (inside it's members).
That's a bit dangerous: A caller might think `CSimulation2` takes
ownership of the `ScriptContext`.
With this commit the caller has to pass an `ScriptContext&` to the
constructor.

Comments By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5223
This was SVN commit r28046.
2024-03-08 17:15:25 +00:00
ffc4a56b9f Revert non-ASCII characters from source and configuration files introduced in 157c6af18e.
Fixes #6846

Differential Revision: https://code.wildfiregames.com/D5185
This was SVN commit r27965.
2023-12-03 00:30:12 +00:00
949be94aab Introduce CLogger::ScopedReplacement and FileLogger
Comments By: @sera, @vladislavbelov, @Stan
Differential Revision: https://code.wildfiregames.com/D5167
This was SVN commit r27953.
2023-11-23 20:42:18 +00:00
3fff9df4a0 Return CTerrain and CUnitManager references from CWorld instead of pointers
Accepted By: @vladislavbelov
Comments By: @Stan
Differential Revision: https://code.wildfiregames.com/D4739
This was SVN commit r27861.
2023-09-26 20:10:40 +00:00
c86d3bbb56 Refactors models and materials, part 2, replaces raw pointer by unique_ptr and adds test.
Comments By: phosit
Differential Revision: https://code.wildfiregames.com/D5128
This was SVN commit r27846.
2023-09-21 19:00:28 +00:00
5214a4c073 Fixes SPIRV compile script for newer versions of spirv-reflect.
Differential Revision: https://code.wildfiregames.com/D5123
This was SVN commit r27845.
2023-09-20 17:25:14 +00:00
bb
82204a6db9 Fix the test_checkDiff translation tool tester
Differential Revision: D5091
This was SVN commit r27796.
2023-08-14 20:23:09 +00:00
bb
157c6af18e Make the space in 0 A.D. non-breaking throughout the codebase.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful

Will add linter rule in seperate commit

Happy recompiling everyone!

Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
2023-07-27 20:54:46 +00:00
4e86f99fe2 Replaces boost string general includes by more precise ones.
Differential Revision: https://code.wildfiregames.com/D5066
This was SVN commit r27746.
2023-06-30 19:10:13 +00:00
8f78ac1ef8 Decouples renderer code from VideoMode to get backend device.
Differential Revision: https://code.wildfiregames.com/D5043
This was SVN commit r27693.
2023-06-14 07:06:22 +00:00
8472240573 Fix compilation with GCC 13.
gcc-13 less often includes cstdint so one might need to include it
manually if needed.

The headers already included in Message.h are included within namespace
AtlasMessage which didn't break by chance, move them out and add
cstdint.

Patch by: @sera
Reviewed by: @phosit
Fixes: #6800
Differential Revision: https://code.wildfiregames.com/D4997
This was SVN commit r27644.
2023-05-13 12:08:23 +00:00
ede58a2065 Fix two oversights.
This was SVN commit r27639.
2023-05-10 16:02:53 +00:00
d8b1935493 Add a script to build spir-v shaders for the bundle.
Fixes: #6636
Refs: #6718
Discussed with: @vladislavbelov

Differential Revision: https://code.wildfiregames.com/D4988
This was SVN commit r27633.
2023-05-08 14:25:23 +00:00
3ceeedf169 Adds script to generate SPIR-V from GLSL shaders. Refs #6636
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4969
This was SVN commit r27627.
2023-05-02 17:31:28 +00:00
ae9f47e741 encoding="utf-8" is not supported before Python 3.10.
This was SVN commit r27622.
2023-04-28 09:24:21 +00:00
a6546cc0a4 Update infrastructure to use the new transifex API.
- Fix Jenkins warnings about leaked credentials.
- Fix one script not loading utf-8 on windows.
- Fix command line arguments not working when inlined on Linux.

This was SVN commit r27621.
2023-04-27 16:55:06 +00:00
eb29373ba7 Use the new client for the pull script.
This was SVN commit r27620.
2023-04-27 14:20:26 +00:00
929d593658 Fix build-archives.sh's shebang.
Reported by: @Itms
Refs #6701

This was SVN commit r27542.
2023-02-13 12:19:24 +00:00
0fce64ed5a Fixes Atlas previews after e4455a8e8f.
Differential Revision: https://code.wildfiregames.com/D4919
This was SVN commit r27521.
2023-02-01 21:56:35 +00:00
c422eb242a ATLAS UI be aware of GUI Scale user config
Comment by: @Phosit, @Stan, @Vladislav
Differential Revision: https://code.wildfiregames.com/D4915
Fixes: #6715

This was SVN commit r27513.
2023-01-30 22:05:17 +00:00
d0ff565aa8 Fixes DisplayVersion in NSIS on Windows.
Tested By: Itms
Differential Revision: https://code.wildfiregames.com/D4892
This was SVN commit r27512.
2023-01-30 21:29:10 +00:00
83b786dcf5 Tokens for required technologies.
Use tokens for required technologies, allowing `-tech` and easier
replacements.
Fixes requiring `replace=""` when replacing techs.
Also a minor fix in the TemplateParser.js for upgrade requirements.
Refs. 9bb9ff8b16.

Differential revision: https://code.wildfiregames.com/D4912
Comments by: @Stan
This was SVN commit r27505.
2023-01-30 08:05:34 +00:00
5d7a8b9d1b Fix: Crash atlas in relation to Terrain.cpp CalcPosition
Patch by: @trompetin17
Differential revision: https://code.wildfiregames.com/D4900
Comments by: @Langbart, @Stan, @Vladislav
Fixes #6550

This was SVN commit r27499.
2023-01-28 22:42:00 +00:00
d6121a43ea Add MoltenVK support to fix Vulkan on macOS.
Tested by: @Langbart, @real_tabasco_sauce, @wraitii
Refs #6636
Differential Revision: https://code.wildfiregames.com/D4905
This was SVN commit r27488.
2023-01-26 15:24:12 +00:00
db9af648c8 Re-add missing script
This was SVN commit r27466.
2023-01-19 00:24:04 +00:00
6727763e93 Slightly improve templatesanalyzer/unitTables.py
- Add hans
- Reduce code size
- Reuse other code
- Add poison and fire
- Fix spread

This was SVN commit r27465.
2023-01-18 23:38:44 +00:00
03da19ed10 Don't include source/test_root.cpp in bundles.
Reported by: @LudovicRousseau
Accepted by: @sera
Fixes #6300
Differential Revision: https://code.wildfiregames.com/D4895
This was SVN commit r27461.
2023-01-17 23:50:50 +00:00
3e7bdc148e Update checkrefs.py after 9bb9ff8b16.
Reported by: @Langbart
Differential revision: https://code.wildfiregames.com/D4880
Tested by: @Langbart
Fixes #6682

This was SVN commit r27436.
2023-01-13 10:29:51 +00:00
c0e888e2af Removes SetViewport from CRenderer.
Differential Revision: https://code.wildfiregames.com/D4849
This was SVN commit r27313.
2022-12-29 06:53:06 +00:00
3723cbf692 Fixes big screenshots after 29368cf776 and 3a4c8342a0.
Differential Revision: https://code.wildfiregames.com/D4835
This was SVN commit r27269.
2022-12-04 19:28:34 +00:00
29368cf776 Adds framebuffer attachment load and store operations.
Comments By: phosit, Stan
Differential Revision: https://code.wildfiregames.com/D4830
This was SVN commit r27256.
2022-11-26 21:55:17 +00:00
8e51dfa91a Moves post processing out of scene rendering to avoid framebuffer pass duplicate.
Comments By: phosit, Stan
Differential Revision: https://code.wildfiregames.com/D4827
This was SVN commit r27232.
2022-11-18 19:59:18 +00:00
3a4c8342a0 Makes AcquireNextBackbuffer returns true in case of successful backbuffer acquirement.
This was SVN commit r27184.
2022-10-30 00:38:45 +00:00