Add support for in-pk3 symlink to NetRadiant and Q3map2
This feature is believed to be the latest missing bit to fully support released Xonotic pk3s and get rid of the xonotic mapping support package.
NetRadiant, before:
Found image file: "dds/textures/trak5x/trim/trim_trim1a.dds"
Texture load failed: "textures/trak5x/trim/trim_trim1a"
NetRadiant, after:
Found symbolic link: "dds/textures/trak5x/trim/trim_trim1a.dds"
Resolved symbolic link: "dds/textures/trak5x/trim/trim_trim1a_gloss.dds"
Found image file: "dds/textures/trak5x/trim/trim_trim1a.dds"
Loaded Texture: "textures/trak5x/trim/trim_trim1a"
Q3map2, before:
WARNING: Invalid DDS texture
WARNING: Couldn't find image for shader textures/trak5x/trim-trim1a
Q3map2, after:
Found symbolic link: "dds/textures/trak5x/trim/trim_trim1a.dds"
Resolved symbolic link: "dds/textures/trak5x/trim/trim_trim1a_gloss.dds"
Loaded image: "dds/textures/trak5x/trim/trim_trim1a.dds"
The implementation is ported from Dæmon engine implementation by @slipher which was a complete rewrite of one I did on Dæmon by taking inspiration from Darkplaces engine.
See:
- https://github.com/DaemonEngine/Daemon/blob/master/src/common/FileSystem.cpp
- https://gitlab.com/xonotic/darkplaces/-/blob/div0-stable/fs.c
The MR also brings some commits to fix some minor issues introduced in !172 (merged) (dds/
prefix support) or some generic cleanup or enhancement in existing code (like freeing allocated variable or checking for string boundary when copying it).
Edited by Thomas Debesse