mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:04:06 +00:00
Add command-line option to enable archivebuilder compression
This was SVN commit r11373.
This commit is contained in:
@@ -61,5 +61,7 @@ Windows-specific:
|
||||
Archive builder:
|
||||
-archivebuild=PATH system PATH of the base directory containing mod data to be archived/precached
|
||||
-archivebuild-output=PATH system PATH to output of the resulting .zip archive (use with archivebuild)
|
||||
-archivebuild-compress enable deflate compression in the .zip
|
||||
(no zip compression by default since it hurts compression of release packages)
|
||||
-buildarchive (disabled)
|
||||
|
||||
|
||||
+1
-1
@@ -509,7 +509,7 @@ static void RunGameOrAtlas(int argc, const char* argv[])
|
||||
zip = mod.Filename().ChangeExtension(L".zip");
|
||||
|
||||
CArchiveBuilder builder(mod, paths.Cache());
|
||||
builder.Build(zip);
|
||||
builder.Build(zip, args.Has("archivebuild-compress"));
|
||||
|
||||
CXeromyces::Terminate();
|
||||
return;
|
||||
|
||||
@@ -64,14 +64,14 @@ void CArchiveBuilder::AddBaseMod(const OsPath& mod)
|
||||
m_VFS->Mount(L"", mod/"", VFS_MOUNT_MUST_EXIST);
|
||||
}
|
||||
|
||||
void CArchiveBuilder::Build(const OsPath& archive)
|
||||
void CArchiveBuilder::Build(const OsPath& archive, bool compress)
|
||||
{
|
||||
// Disable zip compression because it significantly hurts download size
|
||||
// for releases (which re-compress all files with better compression
|
||||
// By default we disable zip compression because it significantly hurts download
|
||||
// size for releases (which re-compress all files with better compression
|
||||
// algorithms) - it's probably most important currently to optimise for
|
||||
// download size rather than install size or startup performance.
|
||||
// (See http://trac.wildfiregames.com/ticket/671)
|
||||
const bool noDeflate = true;
|
||||
const bool noDeflate = !compress;
|
||||
|
||||
PIArchiveWriter writer = CreateArchiveWriter_Zip(archive, noDeflate);
|
||||
|
||||
|
||||
@@ -52,8 +52,9 @@ public:
|
||||
/**
|
||||
* Do all the processing and packing of files into the archive.
|
||||
* @param archive path of .zip file to generate (will be overwritten if it exists)
|
||||
* @param compress whether to compress the contents of the .zip file
|
||||
*/
|
||||
void Build(const OsPath& archive);
|
||||
void Build(const OsPath& archive, bool compress);
|
||||
|
||||
private:
|
||||
static Status CollectFileCB(const VfsPath& pathname, const FileInfo& fileInfo, const uintptr_t cbData);
|
||||
|
||||
Reference in New Issue
Block a user