Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3358 closed enhancement (fixed)

[PATCH] TerrainTextureManager file loading rewrite

Reported by: leper Owned by: leper
Priority: Nice to Have Milestone: Alpha 20
Component: Core engine Keywords: patch
Cc: Patch:

Description

Currently terrain texture loading is done using a custom directory traversal logic. The attached patch enhances vfs::ForEachFile to take a directory callback which is then used to load the terrain.xml (which should be considered required now, since using the parent dir's is not really possible anymore).

Should we add a new function instead of extending vfs::ForEachFile which could eg call it (without recursing?)? I did some measurements (see the FIXME/TODO) and the new code is about as fast as the old one (I did drop all caches, but used unbundled files). The comment also seems slightly outdated since r12306 reorganized the terrain file layout organization a bit.

Attachments (1)

terraintexturemanager_file_loading.patch (6.7 KB ) - added by leper 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Itms, 9 years ago

I don't know that code much so I don't have a real opinion. The code looks nice, apart from a missing space line 75 of vfs_util.cpp.

Do you want someone to test some situation where it could lead to a bug?

in reply to:  1 comment:2 by leper, 9 years ago

Replying to Itms:

I don't know that code much so I don't have a real opinion. The code looks nice, apart from a missing space line 75 of vfs_util.cpp.

No, see the coding conventions and the exception about source/lib.

Do you want someone to test some situation where it could lead to a bug?

Someone doing another profile would be nice. I got similar results both before and after the patch. (Someone doing a test with an actual archive would be awesome.)

comment:3 by Itms, 9 years ago

Milestone: Alpha 19Alpha 20

comment:4 by leper, 8 years ago

Resolution: fixed
Status: newclosed

In 17341:

TerrainTextureManager file loading rewrite. Fixes #3358.

Add directory callback to vfs::ForEachFile.
Each terrain directory should now have a terrains.xml file,
as using the previous terrains.xml file is unlikely to be what was intended.

comment:5 by leper, 8 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.