Commit Graph
26087 Commits
Author SHA1 Message Date
Vladislav Belov 8c7dd6f85b Removes APIC functionality 2026-10-17 15:53:16 +02:00
Vladislav Belov dcc66fdc57 Removes CPU frequency calculating functionality 2026-10-17 15:53:14 +02:00
Vladislav Belov 7fcecda91b Removes NUMA functionality 2026-10-17 15:53:12 +02:00
Vladislav Belov a8d31f4353 Increases HW report version 2026-10-17 15:53:09 +02:00
Vladislav Belov 24d9658f44 Replaces x86-64 only cpu features by SDL calls 2026-10-17 15:53:07 +02:00
Vladislav Belov 3f557c7833 Removes os_cpu_NumProcessors from HW reports
The number of possible threads is already reported by SDL and STL.
2026-10-17 15:53:05 +02:00
Vladislav Belov a5b5a57b9c Removes CPU frequency from HW reports
It wasn't represeting maximumum or average CPU frequency. Just a
frequency calculated at the time of HW report. Also it was
working only for Windows and x86-64.
2026-10-17 15:53:03 +02:00
Vladislav Belov f9d4333e4c Removes custom memory counters from HW report
We already count memory reported by SDL.
2026-10-17 15:53:01 +02:00
Vladislav Belov 3d93cf7b4c Removes NUMA from HW reports
NUMA is needed for multiprocessors systems like server ones. We don't
target such platform. OS shouldn't handle that for us.
Also we had NUMA support only for Windows.
2026-10-17 15:52:59 +02:00
phosit a0b92764df Leave g_Game uninitialized when CNetClient throws
When it failed to connect to a host `g_Game` was still initialized.
Retrying that crashed the program.
2026-10-17 09:24:00 +02:00
Vladislav Belov 8bda1d8642 Removes dynamic loading on Windows
All required functions are available on all supported Windows versions.
2026-10-17 01:50:46 +02:00
Fabio Pedretti 862bdd5349 UnitMotion: Compute pushing-grid index once in Move()
pos.X/pos.Y divided by PUSHING_GRID_SIZE twice each (ENSURE, then
m_MovingUnits.get()) instead of once.
2026-10-15 16:56:34 +02:00
Fabio Pedretti 43d8446854 UnitMotion: Fix ShouldAlternatePathfinder() using wrong constant
Used MAX_FAILED_MOVEMENTS (a fixed constant) instead of
m_FailedMovements, making the "every N failures" clause always
false at compile time. Alternation only ever fired once per
failure streak instead of periodically as intended.

Introduced in 70ec781.
2026-10-15 16:56:34 +02:00
Fabio Pedretti f10fe18d7a Create the water constraint once
Deduplicate the stayClasses(tileClassWater, 0) constraint by creating
it once before the placement loop, instead of constructing a new
identical one for every placed dock.
2026-10-15 16:55:16 +02:00
Fabio Pedretti f08832b60d Search the closest water point among boundary points only
Area.getClosestPointTo scans every point of the water search area, and
it was called up to count * retryFactor times in placeDocks.

The nearest point of a set to a point outside of it is always a
boundary point, so compute the boundary once and scan only that. The
logic lives in two small helpers, getBoundaryPoints (Uint8Array mask
based) and getClosestPointInList, so it can be reused and read apart
from placeDocks. getBoundaryPoints returns the original point objects,
while getClosestPointInList returns a clone of the point it finds, so
callers cannot mutate the points stored in the list.
2026-10-15 16:55:16 +02:00
Fabio Pedretti a8ba4945e9 Bail out early and guard against an empty start area
Create the water search area first and return before computing the land
search area if there is no water at all, so that work is not wasted.

Also return if the land search area is empty. Previously pickRandom
would have been called on an empty array and returned undefined, making
getClosestPointTo fail on an undefined position.

Cache the start points instead of calling getPoints() on every try.
2026-10-15 16:55:16 +02:00
Fabio Pedretti 79c0a48ce3 Remove unused areaLand and areaWater areas
areaLand and areaWater were created with a MapBoundsPlacer, which
evaluates the tileclass constraint on every tile of the map. However,
createArea only has an effect if either a painter is specified or the
returned Area is used. Here no painter was passed and the returned
values were never read, so these calls did nothing except waste time.
2026-10-15 16:55:16 +02:00
Ralph Sennhauser f5bcb3fcaa Bump premake to 5.0.0
The first non prerelease of premake5 was released. Update to a stable
version.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-10-12 18:48:10 +02:00
Fabio Pedretti 78ca04310e Precalculate abn in VertexPathfinder
Avoid calculating it in each of the 5 CheckVisibility functions.
2026-10-12 18:22:20 +02:00
Fabio Pedretti 36eb25de3a Return early on an exact match in getClosestPointTo()
If a point at squared distance 0 is found, no closer point can exist, so
return it immediately instead of scanning the rest of the points. The
returned point is the same as before, since the first point with the
smallest distance was already the one kept.
2026-10-12 16:24:13 +02:00
Fabio Pedretti dda1e6c1a3 Use an indexed loop in getClosestPointTo()
Iterate with an indexed loop over a local reference to the points array
instead of for...of over this.points, which avoids iterator and property
lookup overhead in a loop that can run over thousands of points.
2026-10-12 16:24:13 +02:00
Dunedan 40b8794eec Fix link to AGENTS.md in issue templates 2026-10-11 09:42:15 +02:00
Dunedan 691e9273b3 Add checkbox for authorship to the issue templates 2026-10-11 07:38:02 +02:00
Dunedan d06647fc97 Add an AGENTS.md 2026-10-11 07:38:01 +02:00
Fabio Pedretti 25592e9f5d Avoid Vector2D allocations in the inner loops
Every neighbor sample created a new Vector2D and went through
validHeight() and getHeight(). Use plain integer coordinates, an inline
bounds check and direct access to the height array instead, which also
removes the per-vertex allocation and the setHeight() call.
2026-10-10 16:42:53 +02:00
Fabio Pedretti 2ebb6d5a12 Precompute the neighbor offsets and distances
The distance of each brush point and the check for the center vertex
were recomputed for every vertex. Compute them once per paint() call
into typed arrays instead.
2026-10-10 16:42:53 +02:00
Fabio Pedretti d6d83c00e8 Use a single flat array for the visited vertices
Replace the array of Uint8Arrays, which was rebuilt with fill().map()
on every iteration, by one flat Uint8Array that is allocated once and
cleared at the start of each iteration.
2026-10-10 16:42:53 +02:00
Fabio Pedretti c8cf658d46 Remove unused heightmap clone
The clone of g_Map.height was only used to read its length, while all
neighbor heights are read from g_Map itself. Cloning the whole heightmap
on every iteration was therefore pure overhead.
2026-10-10 16:42:53 +02:00
obelix 6d77c4809d Change the term Ticket to Issue
Our new bugtracker no more uses the term Ticket but Issue for bug reports.

Fixes #9292
2026-10-09 22:18:51 +02:00
phosit 581503fb82 Fix generating Mediterranean
Removing this `printDuration` was forgotten in a80446eb59.
2026-10-07 16:53:06 +02:00
Ralph Sennhauser 67fdc35ee6 Fix building with --without-lobby
Ifdef what is needed to let the game compile and link without gloox.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-10-07 13:16:50 +02:00
phosit ccd7481e5c Use const char* to print OpenGL messages
GCC warns about a stringop-overread. There is no need to convert it to
an `std::string` and back.
2026-10-05 20:29:26 +02:00
phosit 369a7e7e5d Use fmt::format for LOGERROR
The format string can be checked at compile time. It will be easier to
transition to `std::format`.
2026-10-05 20:29:26 +02:00
phosit ba158aa3ff Use fmt::format for LOGWARNING
The format string can be checked at compile time. It will be easier to
transition to `std::format`.
2026-10-05 20:29:25 +02:00
phosit d686708c92 Use fmt::format for LOGMESSAGERENDER
The format string can be checked at compile time. It will be easier to
transition to `std::format`.
2026-10-05 20:29:25 +02:00
phosit 43cb3100b6 Use fmt::format for LOGMESSAGE
The format string can be checked at compile time. It will be easier to
transition to `std::format`.
2026-10-05 20:29:25 +02:00
phosit b2496aa9ca Improve translated strings
Remove too much white space; fix "a" vs "an" mistakes...
2026-10-05 17:45:32 +02:00
Stanislas Daniel Claude Dolcini 282cd1eb60 Scan JS for literal audio paths
Audio files referenced directly in GUI/simulation JS strings
(e.g. g_FlareSound, soundfile entries, Ambient tracks) were not
tracked. Add a js_audio_regex scan alongside the existing sprite
scan for both gui/ and simulation/ JS files.
2026-10-03 23:13:47 +02:00
Stanislas Daniel Claude Dolcini 6856ca3349 Fix checkrefs ruff lint/format issues 2026-10-03 23:13:35 +02:00
Stanislas Daniel Claude Dolcini 4bc1938ddc Track many more dynamically-constructed UI texture paths
Several categories of session UI textures were falsely reported as
unused because checkrefs only parsed XML/JSON data files and missed
texture references buried in JavaScript runtime logic.

Entity templates:
- Parse <Identity><Rank> to track session/icons/ranks/{rank}.png
- Parse <Minimap><Icon> to track session/icons/minimap/{icon}.png

Data-driven JSON files:
- Add add_resources(): scan simulation/data/resources/*.json for
  resource 'code' fields -> session/icons/resources/{code}.png
- Add add_status_effects(): scan simulation/data/status_effects/*.json
  for 'icon' fields -> session/icons/status_effects/{icon}.png

Technology files:
- In add_techs(): detect phase_*.json base techs (e.g. phase_city.json)
  and add session/panel_phase_emblems_{phase}.png as a dep

JS scanning (extended):
- Extend the GUI JS literal-path regex to also recognise:
  - 'texture:' sprite modifier prefix
  - full 'art/textures/ui/...' literal paths
  - bare 'session/...' paths used as runtime sprite components
- Also scan simulation/components, simulation/helpers and globalscripts
  JS files (registered as roots) with the same regex so textures
  referenced from simulation code are tracked
- Add _add_unit_action_icon_deps(): parse unit_actions.js for
  'icon': 'X.png' properties -> session/icons/X
- Add _add_status_bar_icon_deps(): parse StatusBars.js AddBar() calls
  for bar type strings -> session/icons/{type}_bg/fg.png
- Add _add_stance_icon_deps(): parse g_Stances in UnitAI.js for
  selectable stance keys -> session/icons/stances/{stance}.png
2026-10-03 22:55:40 +02:00
Stanislas Daniel Claude Dolcini 0a8369c0b8 Scan JS for literal sprite paths, track civ background circles
Two sources of false-positive unused-file warnings:

1. Literal stretched:/cropped: sprite paths in GUI JS files (e.g.
   bell_level0.png, cancel.png, minimap flare textures) were never
   tracked because JS is not parsed for texture deps. Add a regex scan
   of gui/*.js for complete literal sprite paths ending in a known
   texture extension, filtering out dynamic string concatenations
   (+ / ${...}).

2. Per-civ background circle textures (bkg/background_circle_<code>.png)
   are constructed at runtime in MiniMapPanel.js via a template literal
   using the player civ code. Add a dep from each civ JSON to its
   corresponding background circle texture.
2026-10-03 22:55:22 +02:00
Stanislas Daniel Claude Dolcini d8e040f84b Handle <icon> elements in GUI setup XML
Icons defined in setup XML files (e.g. lobby/icons/public.xml) have
sprite attributes that reference UI textures, but the setup parser only
handled <scrollbar>, <tooltip> and <color> tags. This caused textures
like lobby/public.png to be falsely reported as unused by -u.
2026-10-03 22:54:55 +02:00
Stanislas Daniel Claude Dolcini 9419eb55e6 Add JSON registry for C++-hardcoded asset paths
Some engine assets are loaded directly by C++ renderer code with no
corresponding reference in any XML template, actor, or data file that
checkrefs.py can statically trace. Files in mod layers that override
these paths were incorrectly reported as unused.

Introduce source/tools/entity/cpp_hardcoded_assets.json to maintain
the list of such VFS paths alongside their C++ source location and a
description. checkrefs.py reads this JSON via add_cpp_hardcoded_assets()
and marks every matching file in all loaded mod layers as a known-used
root, so mod overrides are no longer flagged.

Initial entries:
  art/textures/terrain/types/water/coastalWave.png
  art/textures/terrain/types/water/foam.png
Both are loaded unconditionally by WaterManager::LoadWaterTextures().

Fixes 2 false-positive unused-file warnings for mod/ water textures.
2026-10-03 22:54:48 +02:00
Stanislas Daniel Claude Dolcini 49aeda6767 Track terrain alphamap PNG files loaded by C++
TerrainTextureManager::LoadAlphaMap() hardcodes 14 PNG filenames and
loads them from art/textures/terrain/alphamaps/<type>/ where <type>
comes from the terrain XML <alphamap> element (defaulting to
"standard"). checkrefs add_terrains() parsed <textures> and
<material> but never read <alphamap> and had no knowledge of the
filenames loaded by C++.

Changes:
- Read <alphamap> from each terrain XML (default "standard") and
  add all 14 hardcoded PNG filenames as deps of the terrain file.
- Always register the "standard" set as roots since C++ loads it
  unconditionally as a fallback, even when no terrain specifies it.

The filenames are kept in sync with the fnames[] array in
source/graphics/TerrainTextureManager.cpp.

Fixes 14 false-positive unused-file warnings for the standard/
alphamap set.
2026-10-03 22:54:42 +02:00
Stanislas Daniel Claude Dolcini d65e51c38b Track LineTexture from Selectable/Overlay/Outline
The entity parser handled LineTexture/LineTextureMask under
Heal/RangeOverlay and MainTexture/MainTextureMask under
Selectable/Overlay/Texture, but had no handling for the
Selectable/Overlay/Outline/{LineTexture,LineTextureMask} path
used by the outline selection ring renderer.

These textures are referenced in e.g. mixins/trading_post.xml and
any other template that sets a custom outline selection style.

Fixes 2 false-positive unused-file warnings:
  art/textures/selection/outline_border_02.png
  art/textures/selection/outline_border_02_mask.png
2026-10-03 22:54:37 +02:00
Stanislas Daniel Claude Dolcini e5c1b68481 Fix <sprites> parser to read <image> child elements
The sprites XML parser iterated sprite.attrib.items() — the attributes
of the <sprite> tag itself — and checked if el == "image". Since
<image texture="..."> elements are children of <sprite>, not its
attributes, this check could never be true. No texture dependency was
ever extracted from any sprites definition file.

Fix by iterating sprite.findall("image") and sprite.findall("effect")
to correctly traverse child elements, and read attributes from those
elements directly.

Fixes 99 false-positive unused-file warnings across global/border/,
global/button/, global/modern/, global/watermark/, loading/,
pregame/, session/, and tipdisplay/ UI texture directories.
2026-10-03 22:54:30 +02:00
Stanislas Daniel Claude Dolcini 806225a5d4 Track default music tracks from music.js and cheats
checkrefs.py only traced music files referenced in civ JSON Music[]
arrays. Two additional sources were missed:

- gui/common/music.js DEFAULT_*_TRACKS prototype arrays define fallback
  playlists used when a civ has no music entries. All .ogg filenames
  found in that file are now added as deps of the music.js root.
- simulation/data/cheats/*.json files can reference audio files via
  Data.DefaultParameter (e.g. retroMe.json -> 0_8Bit_Bonus_Track.ogg).
  These are now tracked as deps of each cheat root.

Fixes 10 false-positive unused-file warnings.
2026-10-03 22:54:15 +02:00
phosit abf9d5ce00 Fix typos and word doubling in translation strings
Fix strings affecting translations: actually translated strings and
translation context.
2026-10-03 09:39:07 +02:00
Fabio Pedretti 5877ed59bf rms: remove misleading "Placing docks" log calls inside maps
The same "Placing docks" log call is already used inside placeDocks
function, which is called just after these log calls.
Remove as it is useless and confusing.
2026-10-02 21:55:04 +02:00
phosit a0b7b249ee Add back the space between playername and index
The space has been mistakenly removed in ae936e8177.
2026-10-02 21:32:45 +02:00