mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-11-08 14:10:59 +00:00
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.
29 lines
1.1 KiB
JSON
29 lines
1.1 KiB
JSON
{
|
|
"_comment": [
|
|
"This file lists VFS asset paths that are loaded directly by C++ engine code",
|
|
"with no corresponding reference in XML templates, actor files, or other data",
|
|
"that checkrefs.py can statically analyse.",
|
|
"",
|
|
"Each entry is a VFS path (relative to the mod root, without the mod/ prefix).",
|
|
"checkrefs.py treats every listed path as a known-used file so that files",
|
|
"providing these paths in any mod layer (including mod overrides) are not",
|
|
"reported as unused.",
|
|
"",
|
|
"Keep this list in sync with the C++ source files noted in each entry's comment.",
|
|
"Pattern-based paths (e.g. animated water frames with printf format strings)",
|
|
"are handled separately inside checkrefs.py itself."
|
|
],
|
|
"files": [
|
|
{
|
|
"path": "art/textures/terrain/types/water/coastalWave.png",
|
|
"source": "source/renderer/WaterManager.cpp",
|
|
"note": "Coastal wave geometry texture, loaded unconditionally by WaterManager::LoadWaterTextures()"
|
|
},
|
|
{
|
|
"path": "art/textures/terrain/types/water/foam.png",
|
|
"source": "source/renderer/WaterManager.cpp",
|
|
"note": "Water foam texture, loaded unconditionally by WaterManager::LoadWaterTextures()"
|
|
}
|
|
]
|
|
}
|