2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-05-16 23:11:42 +00:00
Files
OpenAssetTools/src/ZoneCommon/Game/IW3/Zone/Definition/ZoneDefWriterIW3.cpp
T
2026-05-15 11:48:33 +01:00

34 lines
1.1 KiB
C++

#include "ZoneDefWriterIW3.h"
#include "Game/IW3/IW3.h"
using namespace IW3;
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const Zone& zone) const {}
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Zone& zone, const DependencyAssetLookup& dependencyAssets) const
{
const auto* game = IGame::GetGameById(zone.m_game_id);
// Localized strings are all collected in one string file. So only add this to the zone file.
auto localizePoolAssets = zone.m_pools.PoolAssets<AssetLocalize>();
if (localizePoolAssets.begin() != localizePoolAssets.end())
stream.WriteEntry(*game->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
for (const auto& asset : zone.m_pools)
{
if (!ShouldWriteAsset(*asset, dependencyAssets))
continue;
switch (asset->m_type)
{
case ASSET_TYPE_LOCALIZE_ENTRY:
break;
default:
stream.WriteEntry(*game->GetAssetTypeName(asset->m_type), asset->m_name);
break;
}
}
}