mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-25 22:27:53 -05:00
Move unlinked gdt files to source_data and reference unlinked gdts in zone definition file
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#include "ZoneDefWriter.h"
|
||||
|
||||
void AbstractZoneDefWriter::WriteZoneDef(std::ostream& stream, Zone* zone) const
|
||||
void AbstractZoneDefWriter::WriteZoneDef(std::ostream& stream, const UnlinkerArgs* args, Zone* zone) const
|
||||
{
|
||||
ZoneDefinitionOutputStream out(stream);
|
||||
|
||||
@ -8,6 +8,13 @@ void AbstractZoneDefWriter::WriteZoneDef(std::ostream& stream, Zone* zone) const
|
||||
out.WriteMetaData(META_DATA_KEY_GAME, zone->m_game->GetShortName());
|
||||
out.EmptyLine();
|
||||
|
||||
WriteMetaData(out, zone);
|
||||
WriteContent(out, zone);
|
||||
if(args->m_use_gdt)
|
||||
{
|
||||
out.WriteComment("Load asset gdt files");
|
||||
out.WriteMetaData(META_DATA_KEY_GDT, zone->m_name);
|
||||
out.EmptyLine();
|
||||
}
|
||||
|
||||
WriteMetaData(out, args, zone);
|
||||
WriteContent(out, args, zone);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "UnlinkerArgs.h"
|
||||
#include "Zone/Zone.h"
|
||||
#include "Zone/Definition/ZoneDefinitionStream.h"
|
||||
|
||||
@ -14,17 +15,18 @@ public:
|
||||
IZoneDefWriter& operator=(IZoneDefWriter&& other) noexcept = default;
|
||||
|
||||
virtual bool CanHandleZone(Zone* zone) const = 0;
|
||||
virtual void WriteZoneDef(std::ostream& stream, Zone* zone) const = 0;
|
||||
virtual void WriteZoneDef(std::ostream& stream, const UnlinkerArgs* args, Zone* zone) const = 0;
|
||||
};
|
||||
|
||||
class AbstractZoneDefWriter : public IZoneDefWriter
|
||||
{
|
||||
protected:
|
||||
static constexpr const char* META_DATA_KEY_GAME = "game";
|
||||
static constexpr const char* META_DATA_KEY_GDT = "gdt";
|
||||
|
||||
virtual void WriteMetaData(ZoneDefinitionOutputStream& stream, Zone* zone) const = 0;
|
||||
virtual void WriteContent(ZoneDefinitionOutputStream& stream, Zone* zone) const = 0;
|
||||
virtual void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const = 0;
|
||||
virtual void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const = 0;
|
||||
|
||||
public:
|
||||
void WriteZoneDef(std::ostream& stream, Zone* zone) const override;
|
||||
void WriteZoneDef(std::ostream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
||||
};
|
Reference in New Issue
Block a user