18 #include "precompiled.h"
31 #pragma warning(disable:4512)
34 #include <boost/algorithm/string.hpp>
74 const bool noDeflate = !compress;
86 for (
size_t i = 0; i <
m_Files.size(); ++i)
92 ret =
m_VFS->GetRealPath(path, realPath);
96 if (boost::algorithm::starts_with(path.
string(), L
"art/textures/") &&
99 !boost::algorithm::starts_with(path.
string(), L
"art/textures/cursors/") &&
100 !boost::algorithm::starts_with(path.
string(), L
"art/textures/terrain/alphamaps/")
109 ret =
m_VFS->GetRealPath(
VfsPath(
"cache")/cachedPath, cachedRealPath);
112 writer->AddFile(cachedRealPath, cachedPath);
124 if (boost::algorithm::starts_with(path.
string(), L
"art/meshes/"))
126 else if (boost::algorithm::starts_with(path.
string(), L
"art/animation/"))
131 writer->AddFile(realPath, path);
145 ret =
m_VFS->GetRealPath(
VfsPath(
"cache")/cachedPath, cachedRealPath);
148 writer->AddFile(cachedRealPath, cachedPath);
157 writer->AddFile(realPath, path);
168 ret =
m_VFS->GetRealPath(
VfsPath(
"cache")/cachedPath, cachedRealPath);
171 writer->AddFile(cachedRealPath, cachedPath);
179 self->
m_Files.push_back(pathname);
PIArchiveWriter CreateArchiveWriter_Zip(const OsPath &archivePathname, bool noDeflate)
Packages a mod's files into a distributable archive.
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
bool GenerateCachedTexture(const VfsPath &path, VfsPath &outputPath)
Synchronously converts and compresses and saves the texture, and returns the output path (minus a "ca...
Path VfsPath
VFS path of the form "(dir/)*file?".
bool tex_is_known_extension(const VfsPath &pathname)
Is the file's extension that of a texture format supported by tex_load?
std::vector< VfsPath > m_Files
void AddBaseMod(const OsPath &mod)
Add a mod which will be loaded but not archived, to provide files like textures.xml needed for the co...
shared_ptr< IArchiveWriter > PIArchiveWriter
return ERR::VFS_DIR_NOT_FOUND if the given real path doesn't exist.
Texture manager with asynchronous loading and automatic DDS conversion/compression.
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
PIVFS CreateVfs(size_t cacheSize)
create an instance of a Virtual File System.
bool GenerateCachedFile(const VfsPath &sourcePath, FileType type, VfsPath &archiveCachePath)
Converts DAE to archive cached .pmd/psa and outputs the resulting path (used by archive builder) ...
keep the files named "*.DELETED" visible in the VFS directories.
const String & string() const
void Build(const OsPath &archive, bool compress)
Do all the processing and packing of files into the archive.
bool GenerateCachedXMB(const PIVFS &vfs, const VfsPath &sourcePath, VfsPath &archiveCachePath)
Convert the given XML file into an XMB in the archive cache.
i64 Status
Error handling system.
Status ForEachFile(const PIVFS &fs, const VfsPath &startPath, FileCallback cb, uintptr_t cbData, const wchar_t *pattern, size_t flags)
call back for each file in a directory tree
static Status CollectFileCB(const VfsPath &pathname, const CFileInfo &fileInfo, const uintptr_t cbData)
CArchiveBuilder(const OsPath &mod, const OsPath &tempdir)
Initialise the archive builder for processing the given mod.
void tex_codec_register_all()
Manually register codecs.
Status DeleteDirectory(const OsPath &path)
void tex_codec_unregister_all()
remove all codecs that have been registered.
void debug_printf(const wchar_t *fmt,...)
write a formatted string to the debug channel, subject to filtering (see below).