[ZB]: Use mem allocator for branding (#781)
Co-authored-by: Roxanne <roxanne@thegamebakers.com>
This commit is contained in:
parent
512b7cb2ae
commit
a588dea4b6
@ -25,11 +25,8 @@ namespace Assets
|
|||||||
header->techniqueSet = builder->getIW4OfApi()->read<Game::MaterialTechniqueSet>(Game::ASSET_TYPE_TECHNIQUE_SET, name);
|
header->techniqueSet = builder->getIW4OfApi()->read<Game::MaterialTechniqueSet>(Game::ASSET_TYPE_TECHNIQUE_SET, name);
|
||||||
|
|
||||||
auto ptr = header->techniqueSet;
|
auto ptr = header->techniqueSet;
|
||||||
if (!ptr)
|
if (ptr)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (ptr->remappedTechniqueSet && ptr->remappedTechniqueSet != ptr)
|
while (ptr->remappedTechniqueSet && ptr->remappedTechniqueSet != ptr)
|
||||||
{
|
{
|
||||||
ptr = ptr->remappedTechniqueSet;
|
ptr = ptr->remappedTechniqueSet;
|
||||||
@ -51,6 +48,7 @@ namespace Assets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void IMaterialTechniqueSet::mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
|
void IMaterialTechniqueSet::mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
|
||||||
{
|
{
|
||||||
|
@ -535,13 +535,12 @@ namespace Components
|
|||||||
// Add branding asset
|
// Add branding asset
|
||||||
void ZoneBuilder::Zone::addBranding()
|
void ZoneBuilder::Zone::addBranding()
|
||||||
{
|
{
|
||||||
static std::string zoneBranding;
|
|
||||||
|
|
||||||
const auto now = std::chrono::system_clock::now();
|
const auto now = std::chrono::system_clock::now();
|
||||||
zoneBranding = std::format("Built using the IW4x ZoneBuilder! {:%d-%m-%Y %H:%M:%OS}", now);
|
|
||||||
|
auto zoneBranding = std::format("Built using the IW4x ZoneBuilder! {:%d-%m-%Y %H:%M:%OS}", now);
|
||||||
auto brandingLen = zoneBranding.size(); // + 1 is added by the save code
|
auto brandingLen = zoneBranding.size(); // + 1 is added by the save code
|
||||||
|
|
||||||
this->branding = {this->zoneName.data(), 0, static_cast<int>(brandingLen), zoneBranding.data()};
|
this->branding = {this->zoneName.data(), 0, static_cast<int>(brandingLen), getAllocator()->duplicateString(zoneBranding)};
|
||||||
|
|
||||||
if (this->findAsset(Game::ASSET_TYPE_RAWFILE, this->branding.name) != -1)
|
if (this->findAsset(Game::ASSET_TYPE_RAWFILE, this->branding.name) != -1)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user