[ZB]: Use mem allocator for branding (#781)
Co-authored-by: Roxanne <roxanne@thegamebakers.com>
This commit is contained in:
parent
512b7cb2ae
commit
a588dea4b6
@ -25,27 +25,25 @@ 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;
|
|
||||||
builder->loadAsset(Game::ASSET_TYPE_TECHNIQUE_SET, ptr, false);
|
|
||||||
|
|
||||||
for (size_t i = 0; i < Game::TECHNIQUE_COUNT; i++)
|
|
||||||
{
|
{
|
||||||
const auto technique = ptr->techniques[i];
|
ptr = ptr->remappedTechniqueSet;
|
||||||
if (technique)
|
builder->loadAsset(Game::ASSET_TYPE_TECHNIQUE_SET, ptr, false);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < Game::TECHNIQUE_COUNT; i++)
|
||||||
{
|
{
|
||||||
for (size_t j = 0; j < technique->passCount; j++)
|
const auto technique = ptr->techniques[i];
|
||||||
|
if (technique)
|
||||||
{
|
{
|
||||||
const auto pass = &technique->passArray[j];
|
for (size_t j = 0; j < technique->passCount; j++)
|
||||||
builder->loadAsset(Game::ASSET_TYPE_VERTEXDECL, pass->vertexDecl, true);
|
{
|
||||||
builder->loadAsset(Game::ASSET_TYPE_PIXELSHADER, pass->pixelShader, true);
|
const auto pass = &technique->passArray[j];
|
||||||
builder->loadAsset(Game::ASSET_TYPE_VERTEXSHADER, pass->vertexShader, true);
|
builder->loadAsset(Game::ASSET_TYPE_VERTEXDECL, pass->vertexDecl, true);
|
||||||
|
builder->loadAsset(Game::ASSET_TYPE_PIXELSHADER, pass->pixelShader, true);
|
||||||
|
builder->loadAsset(Game::ASSET_TYPE_VERTEXSHADER, pass->vertexShader, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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…
Reference in New Issue
Block a user