From: Mikko Rasa Date: Wed, 22 May 2019 11:47:49 +0000 (+0300) Subject: Load any collection files from the data directory X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6a05e385ed55b1b38825b07166698590df4d3634;p=libs%2Fdemoscene.git Load any collection files from the data directory --- diff --git a/source/resources.cpp b/source/resources.cpp index cba8054..e5e893d 100644 --- a/source/resources.cpp +++ b/source/resources.cpp @@ -1,3 +1,4 @@ +#include #include #include "resources.h" @@ -11,10 +12,13 @@ Resources::Resources(const string &pack_name): set_default_texture_anisotropy(8); set_srgb_conversion(true); - if(FS::exists("data")) + FS::Path data_dir = "data"; + if(FS::exists(data_dir)) { - dir_source.add_directory("data"); + dir_source.add_directory(data_dir); add_source(dir_source); + for(const auto &c: FS::list_filtered(data_dir, "\\.mdc$")) + load(*this, (data_dir/c).str()); } else {