DS2Revival/mods/modloader/gltf_mods.h

23 lines
1.4 KiB
C++

// glTF files in mods (DS2ModLoader): every .glb / .gltf in a mod folder is converted in process (gltf.h) into a cache
// folder that the mod loader mounts just above that mod's loose files. Rules: docs/architecture/gltf-loading.md.
#pragma once
#include <string>
#include <vector>
namespace gltfmods {
struct ModInfo {
std::wstring name; // folder name
std::wstring dir; // absolute folder, no trailing backslash
bool modsFolder = false; // the entry for files straight in Mods\ (dir = the Mods folder; only its top level counts)
};
// Brings the cache of every mod up to date (converting only new or changed glTF files, removing what is stale) and
// returns, per mod, the cache folder to mount (ANSI, as the engine's PathFileMgr takes it; "" = nothing to mount).
// resourceDirs: the game's Resources folders, read for the naming key (art/namingkey*.nnk) that places textures and
// animations. keepCaches: names of mods left out of this start on purpose (their Games= is for the other game); their
// caches in the same Mods folders are not touched. Never throws; problems are logged and the affected glTF file is skipped.
std::vector<std::string> Prepare(const std::vector<ModInfo>& mods, const std::vector<std::wstring>& resourceDirs,
const std::vector<std::wstring>& keepCaches = {});
} // namespace gltfmods