1
0
forked from 0ad/0ad
0ad/source/graphics
wraitii 87a2c3347f Make real directory paths on the VFS predictable (retry)
This is the same commit as 4bb31f084e, reverted in 5d1899785a. Noted
issues were fixed.

Partial revert/fix of 2f19cf86d3 and 2567fee329.

Before this diff, it was possible for a mod containing a cache/ or a
config/ folder to get written to incorrectly.
The issue is VFS can map multiple directories to one 'virtual' path, for
reading mods. However, writing data is problematic: which path to
choose?
The only viable solution is to use a path relative to the highest
priority directory encountered in the VFS path, or write paths could be
'hijacked' by lower-priority mods.

This fixes these issues by:
- Adding a new lookup mode ('Real-path') that explicitly picks the real
path relative to the highest-priority subdirectory in the VFS Path.
- Preventing overwriting a real directory with a lower priority one in
general.
- Revert c0c8132dd4's GetRealPath change, re-introducing the function as
GetOriginalPath.

This also cleans up some duplication that led to empty mod folders in
the user mod path, and cleans up loading the 'user' mod.
It also makes it explicit that a directory must be passed to Mount().

Note that the new 'realpath' lookup can still be somewhat complex with
many mount points at various hierarchy levels, but it is at least
predictable/deterministic without having to be careful about populating
order.

Fixes #2553

Differential Revision: https://code.wildfiregames.com/D3728
This was SVN commit r25107.
2021-03-23 12:46:59 +00:00
..
scripting Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
tests Make real directory paths on the VFS predictable (retry) 2021-03-23 12:46:59 +00:00
Camera.cpp Adds basic tests for BuildCameraRay and uses viewport instead of renderer for width and height. 2021-03-19 17:39:34 +00:00
Camera.h Adds basic tests for BuildCameraRay and uses viewport instead of renderer for width and height. 2021-03-19 17:39:34 +00:00
CameraController.cpp Removes joystick from camera controller. 2021-03-17 16:28:48 +00:00
CameraController.h Removes joystick from camera controller. 2021-03-17 16:28:48 +00:00
CinemaManager.cpp Add missing files in 4942cabab5 2020-12-31 14:27:02 +00:00
CinemaManager.h Split CColor from Shapes. 2019-01-13 15:38:41 +00:00
ColladaManager.cpp Fix few typos found with the Debian lintian tool. 2017-10-28 22:34:57 +00:00
ColladaManager.h Split skeleton definitions into multiple files, adds hotloading support for skeleton files. Fixes #190. 2013-07-08 20:25:06 +00:00
Color.cpp Move SSE.h to a better place. Rename it to simd.h after discussion with @OptimusShepard and @vladislavbelov 2021-02-05 12:40:59 +00:00
Color.h Remove SSE detection duplication in Colors and ModelRenderer 2020-12-31 15:37:28 +00:00
Decal.cpp Removes usages of duplication of Clamp function in graphics. Refs D1763. 2019-09-18 08:34:36 +00:00
Decal.h MapReader: Load terrain before entities. 2014-06-01 18:08:11 +00:00
Entity.h Small cleanup, based on a change from one of Philip's old patches 2015-05-16 09:39:27 +00:00
Font.cpp Optimise glyph lookup in text renderer 2013-10-18 15:56:12 +00:00
Font.h Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
FontManager.cpp Fix ugly font rendering using GL linear interpolation if the UI scale was changed. 2017-12-30 17:56:07 +00:00
FontManager.h Replace boost::unordered_map, boost::unordered_set with std::unordered_map, std::unordered_set to establish consistency. 2019-11-25 14:30:25 +00:00
FontMetrics.cpp Use CStrIntern for font names to reduce lookup cost 2013-10-18 16:15:42 +00:00
FontMetrics.h Use CStrIntern for font names to reduce lookup cost 2013-10-18 16:15:42 +00:00
Frustum.cpp Actually remove trailing tabs from source/. 2016-11-23 14:09:58 +00:00
Frustum.h Optimization of isBoxVisible + cleanup, fixes #3712 2015-12-28 16:27:31 +00:00
GameView.cpp Removes joystick from camera controller. 2021-03-17 16:28:48 +00:00
GameView.h Cleanup Camera related code and uses constant references where possible. 2019-10-03 12:58:47 +00:00
HeightMipmap.cpp Replace DISCARD macro with ignore_result template. 2020-12-15 09:03:44 +00:00
HeightMipmap.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
HFTracer.cpp Removes usages of duplication of Clamp function in graphics. Refs D1763. 2019-09-18 08:34:36 +00:00
HFTracer.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
ICameraController.cpp Splits CameraController and adds ICameraController interface 2019-12-21 00:44:18 +00:00
ICameraController.h Splits CameraController and adds ICameraController interface 2019-12-21 00:44:18 +00:00
LightEnv.cpp Combines terrain and units ambient colors into the single color. 2021-01-17 13:10:00 +00:00
LightEnv.h Combines terrain and units ambient colors into the single color. 2021-01-17 13:10:00 +00:00
LOSTexture.cpp Decouple LOS resolution from terrain resolution 2021-03-02 16:44:40 +00:00
LOSTexture.h Decouple LOS resolution from terrain resolution 2021-03-02 16:44:40 +00:00
MapGenerator.cpp Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
MapGenerator.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
MapIO.cpp Fixes UB in shared_ptr usage of an array. Refs #5288 2021-02-13 23:25:41 +00:00
MapIO.h Increases the maps version to 7 for XML and PMP files. 2021-01-17 02:12:04 +00:00
MapReader.cpp Combines terrain and units ambient colors into the single color. 2021-01-17 13:10:00 +00:00
MapReader.h Clean up header includes, add new forward declarations. 2020-11-21 11:20:29 +00:00
MapWriter.cpp Combines terrain and units ambient colors into the single color. 2021-01-17 13:10:00 +00:00
MapWriter.h Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
Material.cpp Check when loading an actor that it defines all the texture samplers required by its material. Print out a readable error otherwise. Fixes #1613 (note that this does not check for unnecessary samplers as that is non-trivial and does not lead to graphical glitches). 2015-03-15 11:37:26 +00:00
Material.h Adds const to Material and CShaderProgram::Binding methods, removes a redundant variable from ModelRenderer 2020-01-26 21:32:12 +00:00
MaterialManager.cpp Move Ogre3D GLSL Preprocessor to a third_party folder and restore its original name. Also restore the Wrapper name to reflect what it's wrapping and move it to renderer. 2019-12-07 11:48:03 +00:00
MaterialManager.h ao/parallax/normal/specular/emissive mapping; windy trees; time manager; render queries; conditional defines 2012-08-06 19:10:47 +00:00
MeshManager.cpp Automatically replace %hs/%ls with %s in CLogger format strings. 2015-01-22 20:36:24 +00:00
MeshManager.h Replace boost::unordered_map, boost::unordered_set with std::unordered_map, std::unordered_set to establish consistency. 2019-11-25 14:30:25 +00:00
MiniPatch.cpp # Handle terrain passability and movement costs in pathfinder. 2010-05-27 23:31:03 +00:00
MiniPatch.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
Model.cpp Fix incorrect prop height for floating objects. 2020-12-31 16:17:58 +00:00
Model.h Fix incorrect prop height for floating objects. 2020-12-31 16:17:58 +00:00
ModelAbstract.cpp Actually remove trailing tabs from source/. 2016-11-23 14:09:58 +00:00
ModelAbstract.h Split CColor from Shapes. 2019-01-13 15:38:41 +00:00
ModelDef.cpp Refactors smart pointers creation, reduces code duplication and improves exception safety. 2021-02-13 23:53:40 +00:00
ModelDef.h Remove SSE detection duplication in Colors and ModelRenderer 2020-12-31 15:37:28 +00:00
ObjectBase.cpp Fix variant loading order 2021-02-16 10:51:23 +00:00
ObjectBase.h Replace boost::unordered_map, boost::unordered_set with std::unordered_map, std::unordered_set to establish consistency. 2019-11-25 14:30:25 +00:00
ObjectEntry.cpp Fix incorrect prop height for floating objects. 2020-12-31 16:17:58 +00:00
ObjectEntry.h Split CColor from Shapes. 2019-01-13 15:38:41 +00:00
ObjectManager.cpp Add missing files in 4942cabab5 2020-12-31 14:27:02 +00:00
ObjectManager.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
Overlay.cpp Optimise out of frustum rendering of texture overlays. 2019-12-10 23:13:37 +00:00
Overlay.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
ParticleEmitter.cpp Fix most of the new vs2017 induced warnings. 2020-11-26 22:28:50 +00:00
ParticleEmitter.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
ParticleEmitterType.cpp Removes usages of duplication of Clamp function in graphics. Refs D1763. 2019-09-18 08:34:36 +00:00
ParticleEmitterType.h Fix most of the new vs2017 induced warnings. 2020-11-26 22:28:50 +00:00
ParticleManager.cpp Replace boost::unordered_map, boost::unordered_set with std::unordered_map, std::unordered_set to establish consistency. 2019-11-25 14:30:25 +00:00
ParticleManager.h Fix No-PCH build. 2021-02-21 10:04:39 +00:00
Patch.cpp Actually remove trailing tabs from source/. 2016-11-23 14:09:58 +00:00
Patch.h Fix culling for shadows and reflections. 2014-06-25 01:11:10 +00:00
PreprocessorWrapper.cpp Early return in PreprocessorWrapper in case of failed include resolve. 2021-02-27 17:21:02 +00:00
PreprocessorWrapper.h Optimization for include resolving in PreprocessorWrapper. 2021-01-20 23:05:15 +00:00
RenderableObject.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
SColor.h Add GPL header 2009-04-18 17:00:33 +00:00
ShaderDefines.cpp Refactors smart pointers creation, reduces code duplication and improves exception safety. 2021-02-13 23:53:40 +00:00
ShaderDefines.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
ShaderManager.cpp Adds #include directive support to shaders 2021-01-11 23:23:30 +00:00
ShaderManager.h Adds #include directive support to shaders 2021-01-11 23:23:30 +00:00
ShaderProgram.cpp Removes redundant normalizations for float types. 2021-02-04 20:03:03 +00:00
ShaderProgram.h Implements binding a float array as a uniform input. 2021-01-19 19:57:31 +00:00
ShaderProgramFFP.cpp Implements binding a float array as a uniform input. 2021-01-19 19:57:31 +00:00
ShaderProgramPtr.h Switch to std::shared_ptr and std::weak_ptr. 2015-01-25 03:10:58 +00:00
ShaderTechnique.cpp Forward-declare CShaderProgramPtr, to avoid pulling in more headers than necessary and to hypothetically reduce build times by a minuscule amount. 2014-07-02 22:36:45 +00:00
ShaderTechnique.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
ShaderTechniquePtr.h Clean up header includes, add new forward declarations. 2020-11-21 11:20:29 +00:00
SkeletonAnim.h Fix animation syncronisation between actor props. Fixes #2324 one more time. Refs [18568] and [18265]. Reported by 2016-12-08 23:16:54 +00:00
SkeletonAnimDef.cpp Update (and debundle) fmt dependancy 2020-11-26 21:01:32 +00:00
SkeletonAnimDef.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
SkeletonAnimManager.cpp Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
SkeletonAnimManager.h Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
SmoothedValue.cpp Moves CSmoothedValue to separate file. 2019-10-01 22:42:54 +00:00
SmoothedValue.h Moves CSmoothedValue to separate file. 2019-10-01 22:42:54 +00:00
Terrain.cpp Fixes terrain index type (causing a warning) introduced in 1e1ce27eba. 2020-07-07 16:51:20 +00:00
Terrain.h Adds offsets to the terrain resize function and adds comments how the resizing works. 2020-05-07 21:46:17 +00:00
TerrainProperties.cpp Split CColor from Shapes. 2019-01-13 15:38:41 +00:00
TerrainProperties.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
TerrainTextureEntry.cpp Replace DISCARD macro with ignore_result template. 2020-12-15 09:03:44 +00:00
TerrainTextureEntry.h Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
TerrainTextureManager.cpp Add missing files in 4942cabab5 2020-12-31 14:27:02 +00:00
TerrainTextureManager.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
TerritoryBoundary.cpp Move LOS to a los helper header and cleanup Grid.h includes. 2020-06-14 20:39:03 +00:00
TerritoryBoundary.h Optimise HierarchicalPathfinder::Update by speeding up the chunk dirtiness check. 2017-12-10 08:59:43 +00:00
TerritoryTexture.cpp Move LOS to a los helper header and cleanup Grid.h includes. 2020-06-14 20:39:03 +00:00
TerritoryTexture.h Optimise HierarchicalPathfinder::Update by speeding up the chunk dirtiness check. 2017-12-10 08:59:43 +00:00
TextRenderer.cpp Reduces the number of GL state changes in GUI. 2021-02-11 19:15:35 +00:00
TextRenderer.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
Texture.h Switch to std::shared_ptr and std::weak_ptr. 2015-01-25 03:10:58 +00:00
TextureConverter.cpp Refactors smart pointers creation, reduces code duplication and improves exception safety. 2021-02-13 23:53:40 +00:00
TextureConverter.h Fix building without precompiled headers. 2020-11-18 11:35:36 +00:00
TextureManager.cpp Fixes revealed missed includes after e104b41be2. 2021-03-03 22:38:59 +00:00
TextureManager.h Replace boost::unordered_map, boost::unordered_set with std::unordered_map, std::unordered_set to establish consistency. 2019-11-25 14:30:25 +00:00
Unit.cpp Add missing files in 4942cabab5 2020-12-31 14:27:02 +00:00
Unit.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
UnitAnimation.cpp Prevent the game from playing sounds too often (8 times for a cavalry slaughter animation) and allow for subprops with a different event time to still play the sound at the same as their parent. 2021-01-15 14:34:45 +00:00
UnitAnimation.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
UnitManager.cpp Adds multiple entity selection to Atlas (including move/delete). Fixes #678. 2012-02-27 05:32:35 +00:00
UnitManager.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00