diff --git a/lib/filesystem/AdapterLoaders.cpp b/lib/filesystem/AdapterLoaders.cpp index cb6dc0132..a97f8f384 100644 --- a/lib/filesystem/AdapterLoaders.cpp +++ b/lib/filesystem/AdapterLoaders.cpp @@ -48,6 +48,11 @@ CFilesystemList::CFilesystemList() loaders = new std::vector >; } +CFilesystemList::~CFilesystemList() +{ + delete loaders; +} + std::unique_ptr CFilesystemList::load(const ResourceID & resourceName) const { // load resource from last loader that have it (last overriden version) diff --git a/lib/filesystem/AdapterLoaders.h b/lib/filesystem/AdapterLoaders.h index dd31330c3..b4cd03137 100644 --- a/lib/filesystem/AdapterLoaders.h +++ b/lib/filesystem/AdapterLoaders.h @@ -59,6 +59,7 @@ class DLL_LINKAGE CFilesystemList : public ISimpleResourceLoader public: CFilesystemList(); + ~CFilesystemList(); /// Interface implementation /// @see ISimpleResourceLoader std::unique_ptr load(const ResourceID & resourceName) const override; diff --git a/lib/filesystem/CArchiveLoader.cpp b/lib/filesystem/CArchiveLoader.cpp index a17e0d06d..68017f256 100644 --- a/lib/filesystem/CArchiveLoader.cpp +++ b/lib/filesystem/CArchiveLoader.cpp @@ -46,6 +46,7 @@ CArchiveLoader::CArchiveLoader(const std::string &mountPoint, const std::string { throw std::runtime_error("LOD archive format unknown. Cannot deal with " + archive); } + logGlobal->traceStream() << "Archive loaded, " << entries.size() << " files found"; } void CArchiveLoader::initLODArchive(const std::string &mountPoint, CFileInputStream & fileStream) diff --git a/lib/filesystem/CFileInputStream.h b/lib/filesystem/CFileInputStream.h index 6fe25be4c..a6d1d74cf 100644 --- a/lib/filesystem/CFileInputStream.h +++ b/lib/filesystem/CFileInputStream.h @@ -46,7 +46,7 @@ public: * @param size The number of bytes to read. * @return the number of bytes read actually. */ - si64 read(ui8 * data, si64 size); + si64 read(ui8 * data, si64 size) override; /** * Seeks the internal read pointer to the specified position. @@ -54,14 +54,14 @@ public: * @param position The read position from the beginning. * @return the position actually moved to, -1 on error. */ - si64 seek(si64 position); + si64 seek(si64 position) override; /** * Gets the current read position in the stream. * * @return the read position. -1 on failure or if the read pointer isn't in the valid range. */ - si64 tell(); + si64 tell() override; /** * Skips delta numbers of bytes. @@ -69,14 +69,14 @@ public: * @param delta The count of bytes to skip. * @return the count of bytes skipped actually. */ - si64 skip(si64 delta); + si64 skip(si64 delta) override; /** * Gets the length in bytes of the stream. * * @return the length in bytes of the stream. */ - si64 getSize(); + si64 getSize() override; private: /** diff --git a/lib/filesystem/CFilesystemLoader.cpp b/lib/filesystem/CFilesystemLoader.cpp index 8457d0884..8490d0c5b 100644 --- a/lib/filesystem/CFilesystemLoader.cpp +++ b/lib/filesystem/CFilesystemLoader.cpp @@ -9,6 +9,7 @@ CFilesystemLoader::CFilesystemLoader(const std::string &mountPoint, const std::s mountPoint(mountPoint), fileList(listFiles(mountPoint, depth, initial)) { + logGlobal->traceStream() << "Filesystem loaded, " << fileList.size() << " files found"; } std::unique_ptr CFilesystemLoader::load(const ResourceID & resourceName) const @@ -97,8 +98,8 @@ std::unordered_map CFilesystemLoader::listFiles(const s { path.resize(it.level()+1); path.back() = it->path().leaf().string(); - // don't iterate into directory if depth limit reached OR into hidden directories (like .svn) - it.no_push(depth <= it.level() || it->path().leaf().string()[0] == '.'); + // don't iterate into directory if depth limit reached + it.no_push(depth <= it.level()); type = EResType::DIRECTORY; } diff --git a/lib/filesystem/CMemoryStream.h b/lib/filesystem/CMemoryStream.h index 3a9770b10..55d1447ee 100644 --- a/lib/filesystem/CMemoryStream.h +++ b/lib/filesystem/CMemoryStream.h @@ -33,7 +33,7 @@ public: * @param size The number of bytes to read. * @return the number of bytes read actually. */ - si64 read(ui8 * data, si64 size); + si64 read(ui8 * data, si64 size) override; /** * Seeks the internal read pointer to the specified position. @@ -41,14 +41,14 @@ public: * @param position The read position from the beginning. * @return the position actually moved to, -1 on error. */ - si64 seek(si64 position); + si64 seek(si64 position) override; /** * Gets the current read position in the stream. * * @return the read position. */ - si64 tell(); + si64 tell() override; /** * Skips delta numbers of bytes. @@ -56,14 +56,14 @@ public: * @param delta The count of bytes to skip. * @return the count of bytes skipped actually. */ - si64 skip(si64 delta); + si64 skip(si64 delta) override; /** * Gets the length in bytes of the stream. * * @return the length in bytes of the stream. */ - si64 getSize(); + si64 getSize() override; private: /** A pointer to the data array. */ diff --git a/lib/filesystem/Filesystem.cpp b/lib/filesystem/Filesystem.cpp index c4da02b04..240163c98 100644 --- a/lib/filesystem/Filesystem.cpp +++ b/lib/filesystem/Filesystem.cpp @@ -97,6 +97,7 @@ EResType::Type EResTypeHelper::getTypeFromExtension(std::string extension) (".AVI", EResType::VIDEO) (".MP3", EResType::MUSIC) (".OGG", EResType::MUSIC) + (".ZIP", EResType::ARCHIVE_ZIP) (".LOD", EResType::ARCHIVE_LOD) (".PAC", EResType::ARCHIVE_LOD) (".VID", EResType::ARCHIVE_VID) @@ -130,6 +131,7 @@ std::string EResTypeHelper::getEResTypeAsString(EResType::Type type) MAP_ENUM(VIDEO) MAP_ENUM(SOUND) MAP_ENUM(MUSIC) + MAP_ENUM(ARCHIVE_ZIP) MAP_ENUM(ARCHIVE_LOD) MAP_ENUM(ARCHIVE_SND) MAP_ENUM(ARCHIVE_VID) diff --git a/lib/filesystem/Filesystem.h b/lib/filesystem/Filesystem.h index 2994f8cc0..74e9ecdab 100644 --- a/lib/filesystem/Filesystem.h +++ b/lib/filesystem/Filesystem.h @@ -51,6 +51,7 @@ namespace EResType SOUND, MUSIC, ARCHIVE_VID, + ARCHIVE_ZIP, ARCHIVE_SND, ARCHIVE_LOD, PALETTE, diff --git a/lib/logging/CLogger.cpp b/lib/logging/CLogger.cpp index 5f577f6e4..1d526dd2c 100644 --- a/lib/logging/CLogger.cpp +++ b/lib/logging/CLogger.cpp @@ -72,7 +72,7 @@ CLogger * CLogger::getLogger(const CLoggerDomain & domain) logger = new CLogger(domain); if(domain.isGlobalDomain()) { - logger->setLevel(ELogLevel::INFO); + logger->setLevel(ELogLevel::TRACE); } CLogManager::get().addLogger(logger); return logger; @@ -88,7 +88,7 @@ CLogger::CLogger(const CLoggerDomain & domain) : domain(domain) { if(domain.isGlobalDomain()) { - level = ELogLevel::INFO; + level = ELogLevel::TRACE; parent = nullptr; } else