Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/ArchiveBuilder.cpp
/* Copyright (C) 2020 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 20 Lines | |||||
CArchiveBuilder::CArchiveBuilder(const OsPath& mod, const OsPath& tempdir) : | CArchiveBuilder::CArchiveBuilder(const OsPath& mod, const OsPath& tempdir) : | ||||
m_TempDir(tempdir), m_NumBaseMods(0) | m_TempDir(tempdir), m_NumBaseMods(0) | ||||
{ | { | ||||
m_VFS = CreateVfs(); | m_VFS = CreateVfs(); | ||||
DeleteDirectory(m_TempDir/"_archivecache"); // clean up in case the last run failed | DeleteDirectory(m_TempDir/"_archivecache"); // clean up in case the last run failed | ||||
m_VFS->Mount(L"cache/", m_TempDir/"_archivecache"/""); | m_VFS->Mount(L"cache/", m_TempDir/"_archivecache"/"", 0, VFS_MAX_PRIORITY); | ||||
// Mount with highest priority so base mods do not overwrite files in this mod | // Mount with highest priority so base mods do not overwrite files in this mod | ||||
m_VFS->Mount(L"", mod/"", VFS_MOUNT_MUST_EXIST | VFS_MOUNT_KEEP_DELETED, (size_t)-1); | m_VFS->Mount(L"", mod/"", VFS_MOUNT_MUST_EXIST | VFS_MOUNT_KEEP_DELETED, VFS_MAX_PRIORITY); | ||||
// Collect the list of files before loading any base mods | // Collect the list of files before loading any base mods | ||||
vfs::ForEachFile(m_VFS, L"", &CollectFileCB, (uintptr_t)static_cast<void*>(this), 0, vfs::DIR_RECURSIVE); | vfs::ForEachFile(m_VFS, L"", &CollectFileCB, (uintptr_t)static_cast<void*>(this), 0, vfs::DIR_RECURSIVE); | ||||
} | } | ||||
CArchiveBuilder::~CArchiveBuilder() | CArchiveBuilder::~CArchiveBuilder() | ||||
{ | { | ||||
m_VFS.reset(); | m_VFS.reset(); | ||||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator