Load T5 fastfiles

This commit is contained in:
Jan
2021-05-12 21:47:34 +02:00
parent e3a3d012e6
commit bb3e7d9e88
18 changed files with 711 additions and 6 deletions

View File

@ -0,0 +1,45 @@
#include "ZoneDefWriterT5.h"
#include <cassert>
#include "Game/T5/GameT5.h"
#include "Game/T5/GameAssetPoolT5.h"
using namespace T5;
bool ZoneDefWriter::CanHandleZone(Zone* zone) const
{
return zone->m_game == &g_GameT5;
}
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const
{
}
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const
{
const auto* pools = dynamic_cast<GameAssetPoolT5*>(zone->m_pools.get());
assert(pools);
if (!pools)
return;
// Localized strings are all collected in one string file. So only add this to the zone file.
if (!pools->m_localize->m_asset_lookup.empty())
{
stream.WriteEntry(pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone->m_name);
}
for (const auto& asset : *pools)
{
switch (asset->m_type)
{
case ASSET_TYPE_LOCALIZE_ENTRY:
break;
default:
stream.WriteEntry(pools->GetAssetTypeName(asset->m_type), asset->m_name);
break;
}
}
}

View File

@ -0,0 +1,16 @@
#pragma once
#include "ContentLister/ZoneDefWriter.h"
namespace T5
{
class ZoneDefWriter final : public AbstractZoneDefWriter
{
protected:
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
public:
bool CanHandleZone(Zone* zone) const override;
};
}