Files
o3de/Code/Framework/AzFramework/AzFramework/Asset/AssetBundleManifest.h
T
lumberyard-employee-dm 9d22c98c26 Add support for configuring default Archive File Search Mode through a Cache Var (#5668)
* Renamed ArchiveLocationPriority enum to FileSearchPriority and made it a proper enum class

Added an ArchiveVars.cpp which checks the a new define: `LY_ARCHIVE_FILE_SEARCH_MODE_DEFAULT`
That define represents the default value to use for the Archive system search mode

Moved the FileSearchLocation enum to the ArchiveVars.h header

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated the AssetBundleComponent to use AZ::IO::Path for level dirs

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Added a LY_ARCHIVE_FILE_SEARCH_MODE cache variable

The Cache Variable default value is to Archive File Search Mode to PakOnly
in Release. This can be overridden using a value for all configurations
by specifying a number of 0, 1 or 2.
Alternatively a generator expression can be used to set the Archive File
Search Mode in specific configurations.
For example to set the FileSearchMode to 1 in profile and 2 in release
the following LY_ARCHIVE_FILE_SEARCH_MODE value can be used
`$<$<CONFIG:profile>:1>$<$<CONFIG:release>:2>`

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated AssetBundler(Batch) VS Debugger arguments to populate the
project-path optoin if a single project is configured.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Add support for serializing older versions of the AssetBundleManifest

This is done by attaching the "ObjectStreamWriteElementOverride"
attribute to the AssetBundleManifest reflection.
That attribute contains a function which outputs an older serialized
version of the AssetBundleManifest based on the `m_bundleVersion` member
value.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* AZStd::variant Serialization fix

The AttributeData<T> type is no longer suitable for storing the
ObjectStreamWriterOverrideCB function

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
2021-11-18 10:22:08 -06:00

59 lines
2.2 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/IO/Path/Path_fwd.h>
#include <AzCore/RTTI/TypeInfo.h>
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/std/string/string.h>
#include <AzCore/std/containers/vector.h>
namespace AZ
{
class SerializeContext;
}
namespace AzFramework
{
// Class to describe metadata about an AssetBundle in Open 3D Engine
class AssetBundleManifest
{
public:
AZ_TYPE_INFO(AssetBundleManifest, "{8628A669-7B19-4C48-A7CB-F670CC9586FD}");
AZ_CLASS_ALLOCATOR(AssetBundleManifest, AZ::SystemAllocator, 0);
AssetBundleManifest();
~AssetBundleManifest();
static void ReflectSerialize(AZ::SerializeContext* serializeContext);
// Each AssetBundle contains a Catalog file with a unique name used to describe the list
// of files within the AssetBundle in order to update the Asset Registry at runtime when
// loading the bundle
const AZStd::string& GetCatalogName() const { return m_catalogName; }
AZStd::vector<AZStd::string> GetDependentBundleNames() const { return m_dependentBundleNames; }
const AZStd::vector<AZ::IO::Path>& GetLevelDirectories() const;
int GetBundleVersion() const { return m_bundleVersion; }
void SetCatalogName(const AZStd::string& catalogName) { m_catalogName = catalogName; }
void SetBundleVersion(int bundleVersion) { m_bundleVersion = bundleVersion; }
void SetDependentBundleNames(const AZStd::vector<AZStd::string>& dependentBundleNames) { m_dependentBundleNames = dependentBundleNames; }
void SetLevelsDirectory(const AZStd::vector<AZ::IO::Path>& levelDirs);
static const char s_manifestFileName[];
static const int CurrentBundleVersion;
private:
AZStd::string m_catalogName;
AZStd::vector<AZStd::string> m_dependentBundleNames;
AZStd::vector<AZ::IO::Path> m_levelDirs;
int m_bundleVersion = CurrentBundleVersion;
};
} // namespace AzFramework