Add ZoneScriptString class to store zone script strings

This commit is contained in:
Jan
2021-03-18 16:55:30 +01:00
parent 8736280ea8
commit 2a6d7c84c2
33 changed files with 239 additions and 119 deletions

View File

@ -260,7 +260,7 @@ void GameAssetPoolIW4::InitPoolDynamic(const asset_type_t type)
#undef CASE_INIT_POOL_STATIC
}
XAssetInfoGeneric* GameAssetPoolIW4::AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*>& dependencies)
XAssetInfoGeneric* GameAssetPoolIW4::AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone)
{
XAsset xAsset{};
@ -271,7 +271,7 @@ XAssetInfoGeneric* GameAssetPoolIW4::AddAssetToPool(asset_type_t type, std::stri
case assetType: \
{ \
assert((poolName) != nullptr); \
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, m_zone, dependencies); \
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
}
switch (xAsset.type)

View File

@ -14,7 +14,7 @@ class GameAssetPoolIW4 final : public ZoneAssetPools
static const char* ASSET_TYPE_NAMES[];
protected:
XAssetInfoGeneric* AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*>& dependencies) override;
XAssetInfoGeneric* AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone) override;
public:
std::unique_ptr<AssetPool<IW4::PhysPreset>> m_phys_preset;

View File

@ -329,7 +329,8 @@ void GameAssetPoolT6::InitPoolDynamic(const asset_type_t type)
#undef CASE_INIT_POOL_STATIC
}
XAssetInfoGeneric* GameAssetPoolT6::AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*>& dependencies)
XAssetInfoGeneric* GameAssetPoolT6::AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings,
Zone* zone)
{
XAsset xAsset{};
@ -340,7 +341,7 @@ XAssetInfoGeneric* GameAssetPoolT6::AddAssetToPool(asset_type_t type, std::strin
case assetType: \
{ \
assert((poolName) != nullptr); \
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, m_zone, dependencies); \
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
}
switch (xAsset.type)

View File

@ -12,7 +12,7 @@ class GameAssetPoolT6 final : public ZoneAssetPools
static const char* ASSET_TYPE_NAMES[];
protected:
XAssetInfoGeneric* AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*>& dependencies) override;
XAssetInfoGeneric* AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone) override;
public:
AssetPool<T6::PhysPreset>* m_phys_preset;