mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
refactor: refactor ZoneDefWriter
This commit is contained in:
parent
eec643fab5
commit
c034ac790a
@ -36,6 +36,7 @@ public:
|
|||||||
IGame& operator=(const IGame& other) = default;
|
IGame& operator=(const IGame& other) = default;
|
||||||
IGame& operator=(IGame&& other) noexcept = default;
|
IGame& operator=(IGame&& other) noexcept = default;
|
||||||
|
|
||||||
|
virtual GameId GetId() = 0;
|
||||||
virtual std::string GetFullName() = 0;
|
virtual std::string GetFullName() = 0;
|
||||||
virtual std::string GetShortName() = 0;
|
virtual std::string GetShortName() = 0;
|
||||||
virtual void AddZone(Zone* zone) = 0;
|
virtual void AddZone(Zone* zone) = 0;
|
||||||
|
@ -8,6 +8,11 @@ using namespace IW3;
|
|||||||
|
|
||||||
GameIW3 g_GameIW3;
|
GameIW3 g_GameIW3;
|
||||||
|
|
||||||
|
GameId GameIW3::GetId()
|
||||||
|
{
|
||||||
|
return GameId::IW3;
|
||||||
|
}
|
||||||
|
|
||||||
std::string GameIW3::GetFullName()
|
std::string GameIW3::GetFullName()
|
||||||
{
|
{
|
||||||
return "Call Of Duty 4: Modern Warfare";
|
return "Call Of Duty 4: Modern Warfare";
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Game/IGame.h"
|
#include "Game/IGame.h"
|
||||||
|
|
||||||
class GameIW3 : public IGame
|
class GameIW3 final : public IGame
|
||||||
{
|
{
|
||||||
std::vector<Zone*> m_zones;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
GameId GetId() override;
|
||||||
std::string GetFullName() override;
|
std::string GetFullName() override;
|
||||||
std::string GetShortName() override;
|
std::string GetShortName() override;
|
||||||
void AddZone(Zone* zone) override;
|
void AddZone(Zone* zone) override;
|
||||||
void RemoveZone(Zone* zone) override;
|
void RemoveZone(Zone* zone) override;
|
||||||
std::vector<Zone*> GetZones() override;
|
std::vector<Zone*> GetZones() override;
|
||||||
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<Zone*> m_zones;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GameIW3 g_GameIW3;
|
extern GameIW3 g_GameIW3;
|
||||||
|
@ -8,6 +8,11 @@ using namespace IW4;
|
|||||||
|
|
||||||
GameIW4 g_GameIW4;
|
GameIW4 g_GameIW4;
|
||||||
|
|
||||||
|
GameId GameIW4::GetId()
|
||||||
|
{
|
||||||
|
return GameId::IW4;
|
||||||
|
}
|
||||||
|
|
||||||
std::string GameIW4::GetFullName()
|
std::string GameIW4::GetFullName()
|
||||||
{
|
{
|
||||||
return "Call Of Duty: Modern Warfare 2";
|
return "Call Of Duty: Modern Warfare 2";
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Game/IGame.h"
|
#include "Game/IGame.h"
|
||||||
|
|
||||||
class GameIW4 : public IGame
|
class GameIW4 final : public IGame
|
||||||
{
|
{
|
||||||
std::vector<Zone*> m_zones;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
GameId GetId() override;
|
||||||
std::string GetFullName() override;
|
std::string GetFullName() override;
|
||||||
std::string GetShortName() override;
|
std::string GetShortName() override;
|
||||||
void AddZone(Zone* zone) override;
|
void AddZone(Zone* zone) override;
|
||||||
void RemoveZone(Zone* zone) override;
|
void RemoveZone(Zone* zone) override;
|
||||||
std::vector<Zone*> GetZones() override;
|
std::vector<Zone*> GetZones() override;
|
||||||
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<Zone*> m_zones;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GameIW4 g_GameIW4;
|
extern GameIW4 g_GameIW4;
|
||||||
|
@ -8,6 +8,11 @@ using namespace IW5;
|
|||||||
|
|
||||||
GameIW5 g_GameIW5;
|
GameIW5 g_GameIW5;
|
||||||
|
|
||||||
|
GameId GameIW5::GetId()
|
||||||
|
{
|
||||||
|
return GameId::IW5;
|
||||||
|
}
|
||||||
|
|
||||||
std::string GameIW5::GetFullName()
|
std::string GameIW5::GetFullName()
|
||||||
{
|
{
|
||||||
return "Call Of Duty: Modern Warfare 3";
|
return "Call Of Duty: Modern Warfare 3";
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Game/IGame.h"
|
#include "Game/IGame.h"
|
||||||
|
|
||||||
class GameIW5 : public IGame
|
class GameIW5 final : public IGame
|
||||||
{
|
{
|
||||||
std::vector<Zone*> m_zones;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
GameId GetId() override;
|
||||||
std::string GetFullName() override;
|
std::string GetFullName() override;
|
||||||
std::string GetShortName() override;
|
std::string GetShortName() override;
|
||||||
void AddZone(Zone* zone) override;
|
void AddZone(Zone* zone) override;
|
||||||
void RemoveZone(Zone* zone) override;
|
void RemoveZone(Zone* zone) override;
|
||||||
std::vector<Zone*> GetZones() override;
|
std::vector<Zone*> GetZones() override;
|
||||||
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<Zone*> m_zones;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GameIW5 g_GameIW5;
|
extern GameIW5 g_GameIW5;
|
||||||
|
@ -8,6 +8,11 @@ using namespace T5;
|
|||||||
|
|
||||||
GameT5 g_GameT5;
|
GameT5 g_GameT5;
|
||||||
|
|
||||||
|
GameId GameT5::GetId()
|
||||||
|
{
|
||||||
|
return GameId::T5;
|
||||||
|
}
|
||||||
|
|
||||||
std::string GameT5::GetFullName()
|
std::string GameT5::GetFullName()
|
||||||
{
|
{
|
||||||
return "Call Of Duty: Black Ops";
|
return "Call Of Duty: Black Ops";
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Game/IGame.h"
|
#include "Game/IGame.h"
|
||||||
|
|
||||||
class GameT5 : public IGame
|
class GameT5 final : public IGame
|
||||||
{
|
{
|
||||||
std::vector<Zone*> m_zones;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
GameId GetId() override;
|
||||||
std::string GetFullName() override;
|
std::string GetFullName() override;
|
||||||
std::string GetShortName() override;
|
std::string GetShortName() override;
|
||||||
void AddZone(Zone* zone) override;
|
void AddZone(Zone* zone) override;
|
||||||
void RemoveZone(Zone* zone) override;
|
void RemoveZone(Zone* zone) override;
|
||||||
std::vector<Zone*> GetZones() override;
|
std::vector<Zone*> GetZones() override;
|
||||||
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<Zone*> m_zones;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GameT5 g_GameT5;
|
extern GameT5 g_GameT5;
|
||||||
|
@ -8,6 +8,11 @@ using namespace T6;
|
|||||||
|
|
||||||
GameT6 g_GameT6;
|
GameT6 g_GameT6;
|
||||||
|
|
||||||
|
GameId GameT6::GetId()
|
||||||
|
{
|
||||||
|
return GameId::T6;
|
||||||
|
}
|
||||||
|
|
||||||
std::string GameT6::GetFullName()
|
std::string GameT6::GetFullName()
|
||||||
{
|
{
|
||||||
return "Call Of Duty: Black Ops II";
|
return "Call Of Duty: Black Ops II";
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Game/IGame.h"
|
#include "Game/IGame.h"
|
||||||
|
|
||||||
class GameT6 : public IGame
|
class GameT6 final : public IGame
|
||||||
{
|
{
|
||||||
std::vector<Zone*> m_zones;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
GameId GetId() override;
|
||||||
std::string GetFullName() override;
|
std::string GetFullName() override;
|
||||||
std::string GetShortName() override;
|
std::string GetShortName() override;
|
||||||
void AddZone(Zone* zone) override;
|
void AddZone(Zone* zone) override;
|
||||||
void RemoveZone(Zone* zone) override;
|
void RemoveZone(Zone* zone) override;
|
||||||
std::vector<Zone*> GetZones() override;
|
std::vector<Zone*> GetZones() override;
|
||||||
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<Zone*> m_zones;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GameT6 g_GameT6;
|
extern GameT6 g_GameT6;
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
#include <format>
|
#include <format>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
ContentPrinter::ContentPrinter(Zone* zone)
|
ContentPrinter::ContentPrinter(const Zone& zone)
|
||||||
|
: m_zone(zone)
|
||||||
{
|
{
|
||||||
m_zone = zone;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentPrinter::PrintContent() const
|
void ContentPrinter::PrintContent() const
|
||||||
{
|
{
|
||||||
const auto* pools = m_zone->m_pools.get();
|
const auto* pools = m_zone.m_pools.get();
|
||||||
std::cout << std::format("Zone '{}' ({})\n", m_zone->m_name, m_zone->m_game->GetShortName());
|
std::cout << std::format("Zone '{}' ({})\n", m_zone.m_name, m_zone.m_game->GetShortName());
|
||||||
std::cout << "Content:\n";
|
std::cout << "Content:\n";
|
||||||
|
|
||||||
for (const auto& asset : *pools)
|
for (const auto& asset : *pools)
|
||||||
|
@ -4,10 +4,11 @@
|
|||||||
|
|
||||||
class ContentPrinter
|
class ContentPrinter
|
||||||
{
|
{
|
||||||
Zone* m_zone;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ContentPrinter(Zone* zone);
|
explicit ContentPrinter(const Zone& zone);
|
||||||
|
|
||||||
void PrintContent() const;
|
void PrintContent() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const Zone& m_zone;
|
||||||
};
|
};
|
||||||
|
@ -1,17 +1,42 @@
|
|||||||
#include "ZoneDefWriter.h"
|
#include "ZoneDefWriter.h"
|
||||||
|
|
||||||
void AbstractZoneDefWriter::WriteZoneDef(std::ostream& stream, const UnlinkerArgs* args, Zone* zone) const
|
#include "Game/IW3/ZoneDefWriterIW3.h"
|
||||||
|
#include "Game/IW4/ZoneDefWriterIW4.h"
|
||||||
|
#include "Game/IW5/ZoneDefWriterIW5.h"
|
||||||
|
#include "Game/T5/ZoneDefWriterT5.h"
|
||||||
|
#include "Game/T6/ZoneDefWriterT6.h"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
const IZoneDefWriter* IZoneDefWriter::GetZoneDefWriterForGame(GameId game)
|
||||||
|
{
|
||||||
|
static const IZoneDefWriter* zoneDefWriters[static_cast<unsigned>(GameId::COUNT)]{
|
||||||
|
new IW3::ZoneDefWriter(),
|
||||||
|
new IW4::ZoneDefWriter(),
|
||||||
|
new IW5::ZoneDefWriter(),
|
||||||
|
new T5::ZoneDefWriter(),
|
||||||
|
new T6::ZoneDefWriter(),
|
||||||
|
};
|
||||||
|
|
||||||
|
assert(static_cast<unsigned>(game) < static_cast<unsigned>(GameId::COUNT));
|
||||||
|
const auto* result = zoneDefWriters[static_cast<unsigned>(game)];
|
||||||
|
assert(result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbstractZoneDefWriter::WriteZoneDef(std::ostream& stream, const UnlinkerArgs& args, const Zone& zone) const
|
||||||
{
|
{
|
||||||
ZoneDefinitionOutputStream out(stream);
|
ZoneDefinitionOutputStream out(stream);
|
||||||
|
|
||||||
out.WriteComment(zone->m_game->GetFullName());
|
out.WriteComment(zone.m_game->GetFullName());
|
||||||
out.WriteMetaData(META_DATA_KEY_GAME, zone->m_game->GetShortName());
|
out.WriteMetaData(META_DATA_KEY_GAME, zone.m_game->GetShortName());
|
||||||
out.EmptyLine();
|
out.EmptyLine();
|
||||||
|
|
||||||
if (args->m_use_gdt)
|
if (args.m_use_gdt)
|
||||||
{
|
{
|
||||||
out.WriteComment("Load asset gdt files");
|
out.WriteComment("Load asset gdt files");
|
||||||
out.WriteMetaData(META_DATA_KEY_GDT, zone->m_name);
|
out.WriteMetaData(META_DATA_KEY_GDT, zone.m_name);
|
||||||
out.EmptyLine();
|
out.EmptyLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "UnlinkerArgs.h"
|
#include "UnlinkerArgs.h"
|
||||||
#include "Zone/Definition/ZoneDefinitionStream.h"
|
#include "Zone/Definition/ZoneDefinitionStream.h"
|
||||||
#include "Zone/Zone.h"
|
|
||||||
|
|
||||||
class IZoneDefWriter
|
class IZoneDefWriter
|
||||||
{
|
{
|
||||||
@ -14,19 +13,20 @@ public:
|
|||||||
IZoneDefWriter& operator=(const IZoneDefWriter& other) = default;
|
IZoneDefWriter& operator=(const IZoneDefWriter& other) = default;
|
||||||
IZoneDefWriter& operator=(IZoneDefWriter&& other) noexcept = default;
|
IZoneDefWriter& operator=(IZoneDefWriter&& other) noexcept = default;
|
||||||
|
|
||||||
virtual bool CanHandleZone(Zone* zone) const = 0;
|
virtual void WriteZoneDef(std::ostream& stream, const UnlinkerArgs& args, const Zone& zone) const = 0;
|
||||||
virtual void WriteZoneDef(std::ostream& stream, const UnlinkerArgs* args, Zone* zone) const = 0;
|
|
||||||
|
static const IZoneDefWriter* GetZoneDefWriterForGame(GameId game);
|
||||||
};
|
};
|
||||||
|
|
||||||
class AbstractZoneDefWriter : public IZoneDefWriter
|
class AbstractZoneDefWriter : public IZoneDefWriter
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
static constexpr const char* META_DATA_KEY_GAME = "game";
|
static constexpr auto META_DATA_KEY_GAME = "game";
|
||||||
static constexpr const char* META_DATA_KEY_GDT = "gdt";
|
static constexpr auto META_DATA_KEY_GDT = "gdt";
|
||||||
|
|
||||||
virtual void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const = 0;
|
virtual void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const = 0;
|
||||||
virtual void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const = 0;
|
virtual void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void WriteZoneDef(std::ostream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteZoneDef(std::ostream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
};
|
};
|
||||||
|
@ -1,22 +1,16 @@
|
|||||||
#include "ZoneDefWriterIW3.h"
|
#include "ZoneDefWriterIW3.h"
|
||||||
|
|
||||||
#include "Game/IW3/GameAssetPoolIW3.h"
|
#include "Game/IW3/GameAssetPoolIW3.h"
|
||||||
#include "Game/IW3/GameIW3.h"
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
using namespace IW3;
|
using namespace IW3;
|
||||||
|
|
||||||
bool ZoneDefWriter::CanHandleZone(Zone* zone) const
|
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const {}
|
||||||
{
|
|
||||||
return zone->m_game == &g_GameIW3;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const {}
|
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const
|
||||||
|
|
||||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const
|
|
||||||
{
|
{
|
||||||
const auto* pools = dynamic_cast<GameAssetPoolIW3*>(zone->m_pools.get());
|
const auto* pools = dynamic_cast<GameAssetPoolIW3*>(zone.m_pools.get());
|
||||||
|
|
||||||
assert(pools);
|
assert(pools);
|
||||||
if (!pools)
|
if (!pools)
|
||||||
@ -24,9 +18,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Unlin
|
|||||||
|
|
||||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
// 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())
|
if (!pools->m_localize->m_asset_lookup.empty())
|
||||||
{
|
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone->m_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& asset : *pools)
|
for (const auto& asset : *pools)
|
||||||
{
|
{
|
||||||
|
@ -7,10 +7,7 @@ namespace IW3
|
|||||||
class ZoneDefWriter final : public AbstractZoneDefWriter
|
class ZoneDefWriter final : public AbstractZoneDefWriter
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
|
|
||||||
public:
|
|
||||||
bool CanHandleZone(Zone* zone) const override;
|
|
||||||
};
|
};
|
||||||
} // namespace IW3
|
} // namespace IW3
|
||||||
|
@ -1,22 +1,16 @@
|
|||||||
#include "ZoneDefWriterIW4.h"
|
#include "ZoneDefWriterIW4.h"
|
||||||
|
|
||||||
#include "Game/IW4/GameAssetPoolIW4.h"
|
#include "Game/IW4/GameAssetPoolIW4.h"
|
||||||
#include "Game/IW4/GameIW4.h"
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
using namespace IW4;
|
using namespace IW4;
|
||||||
|
|
||||||
bool ZoneDefWriter::CanHandleZone(Zone* zone) const
|
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const {}
|
||||||
{
|
|
||||||
return zone->m_game == &g_GameIW4;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const {}
|
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const
|
||||||
|
|
||||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const
|
|
||||||
{
|
{
|
||||||
const auto* pools = dynamic_cast<GameAssetPoolIW4*>(zone->m_pools.get());
|
const auto* pools = dynamic_cast<GameAssetPoolIW4*>(zone.m_pools.get());
|
||||||
|
|
||||||
assert(pools);
|
assert(pools);
|
||||||
if (!pools)
|
if (!pools)
|
||||||
@ -24,9 +18,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Unlin
|
|||||||
|
|
||||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
// 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())
|
if (!pools->m_localize->m_asset_lookup.empty())
|
||||||
{
|
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone->m_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& asset : *pools)
|
for (const auto& asset : *pools)
|
||||||
{
|
{
|
||||||
|
@ -7,10 +7,7 @@ namespace IW4
|
|||||||
class ZoneDefWriter final : public AbstractZoneDefWriter
|
class ZoneDefWriter final : public AbstractZoneDefWriter
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
|
|
||||||
public:
|
|
||||||
bool CanHandleZone(Zone* zone) const override;
|
|
||||||
};
|
};
|
||||||
} // namespace IW4
|
} // namespace IW4
|
||||||
|
@ -1,22 +1,16 @@
|
|||||||
#include "ZoneDefWriterIW5.h"
|
#include "ZoneDefWriterIW5.h"
|
||||||
|
|
||||||
#include "Game/IW5/GameAssetPoolIW5.h"
|
#include "Game/IW5/GameAssetPoolIW5.h"
|
||||||
#include "Game/IW5/GameIW5.h"
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
using namespace IW5;
|
using namespace IW5;
|
||||||
|
|
||||||
bool ZoneDefWriter::CanHandleZone(Zone* zone) const
|
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const {}
|
||||||
{
|
|
||||||
return zone->m_game == &g_GameIW5;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const {}
|
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const
|
||||||
|
|
||||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const
|
|
||||||
{
|
{
|
||||||
const auto* pools = dynamic_cast<GameAssetPoolIW5*>(zone->m_pools.get());
|
const auto* pools = dynamic_cast<GameAssetPoolIW5*>(zone.m_pools.get());
|
||||||
|
|
||||||
assert(pools);
|
assert(pools);
|
||||||
if (!pools)
|
if (!pools)
|
||||||
@ -24,9 +18,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Unlin
|
|||||||
|
|
||||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
// 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())
|
if (!pools->m_localize->m_asset_lookup.empty())
|
||||||
{
|
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone->m_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& asset : *pools)
|
for (const auto& asset : *pools)
|
||||||
{
|
{
|
||||||
|
@ -7,10 +7,7 @@ namespace IW5
|
|||||||
class ZoneDefWriter final : public AbstractZoneDefWriter
|
class ZoneDefWriter final : public AbstractZoneDefWriter
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
|
|
||||||
public:
|
|
||||||
bool CanHandleZone(Zone* zone) const override;
|
|
||||||
};
|
};
|
||||||
} // namespace IW5
|
} // namespace IW5
|
||||||
|
@ -1,22 +1,16 @@
|
|||||||
#include "ZoneDefWriterT5.h"
|
#include "ZoneDefWriterT5.h"
|
||||||
|
|
||||||
#include "Game/T5/GameAssetPoolT5.h"
|
#include "Game/T5/GameAssetPoolT5.h"
|
||||||
#include "Game/T5/GameT5.h"
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
using namespace T5;
|
using namespace T5;
|
||||||
|
|
||||||
bool ZoneDefWriter::CanHandleZone(Zone* zone) const
|
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const 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, const Zone& zone) const
|
||||||
|
|
||||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const
|
|
||||||
{
|
{
|
||||||
const auto* pools = dynamic_cast<GameAssetPoolT5*>(zone->m_pools.get());
|
const auto* pools = dynamic_cast<GameAssetPoolT5*>(zone.m_pools.get());
|
||||||
|
|
||||||
assert(pools);
|
assert(pools);
|
||||||
if (!pools)
|
if (!pools)
|
||||||
@ -24,9 +18,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Unlin
|
|||||||
|
|
||||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
// 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())
|
if (!pools->m_localize->m_asset_lookup.empty())
|
||||||
{
|
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone->m_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& asset : *pools)
|
for (const auto& asset : *pools)
|
||||||
{
|
{
|
||||||
|
@ -7,10 +7,7 @@ namespace T5
|
|||||||
class ZoneDefWriter final : public AbstractZoneDefWriter
|
class ZoneDefWriter final : public AbstractZoneDefWriter
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
|
|
||||||
public:
|
|
||||||
bool CanHandleZone(Zone* zone) const override;
|
|
||||||
};
|
};
|
||||||
} // namespace T5
|
} // namespace T5
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "Game/T6/CommonT6.h"
|
#include "Game/T6/CommonT6.h"
|
||||||
#include "Game/T6/GameAssetPoolT6.h"
|
#include "Game/T6/GameAssetPoolT6.h"
|
||||||
#include "Game/T6/GameT6.h"
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
@ -10,7 +9,7 @@
|
|||||||
|
|
||||||
using namespace T6;
|
using namespace T6;
|
||||||
|
|
||||||
namespace T6
|
namespace
|
||||||
{
|
{
|
||||||
class KeyValuePairKnownKey
|
class KeyValuePairKnownKey
|
||||||
{
|
{
|
||||||
@ -31,50 +30,43 @@ namespace T6
|
|||||||
KeyValuePairKnownKey("initial_xmodels"),
|
KeyValuePairKnownKey("initial_xmodels"),
|
||||||
KeyValuePairKnownKey("initial_materials"),
|
KeyValuePairKnownKey("initial_materials"),
|
||||||
};
|
};
|
||||||
} // namespace T6
|
|
||||||
|
|
||||||
bool ZoneDefWriter::CanHandleZone(Zone* zone) const
|
void WriteKeyValuePair(ZoneDefinitionOutputStream& stream, const KeyValuePair& kvp)
|
||||||
{
|
|
||||||
return zone->m_game == &g_GameT6;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneDefWriter::WriteKeyValuePair(ZoneDefinitionOutputStream& stream, KeyValuePair* kvp)
|
|
||||||
{
|
|
||||||
for (const auto& knownKey : KEY_VALUE_PAIR_KNOWN_KEYS)
|
|
||||||
{
|
{
|
||||||
if (knownKey.m_hash == kvp->keyHash)
|
for (const auto& knownKey : KEY_VALUE_PAIR_KNOWN_KEYS)
|
||||||
{
|
{
|
||||||
stream.WriteMetaData("level." + knownKey.m_key, kvp->value);
|
if (knownKey.m_hash == kvp.keyHash)
|
||||||
return;
|
{
|
||||||
|
stream.WriteMetaData("level." + knownKey.m_key, kvp.value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::ostringstream str;
|
||||||
|
str << "level.@" << std::setfill('0') << std::setw(sizeof(int) * 2) << std::hex << kvp.keyHash;
|
||||||
|
stream.WriteMetaData(str.str(), kvp.value);
|
||||||
}
|
}
|
||||||
|
} // namespace
|
||||||
|
|
||||||
std::ostringstream str;
|
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const
|
||||||
str << "level.@" << std::setfill('0') << std::setw(sizeof(int) * 2) << std::hex << kvp->keyHash;
|
|
||||||
stream.WriteMetaData(str.str(), kvp->value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneDefWriter::WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const
|
|
||||||
{
|
{
|
||||||
auto* assetPoolT6 = dynamic_cast<GameAssetPoolT6*>(zone->m_pools.get());
|
const auto* assetPoolT6 = dynamic_cast<GameAssetPoolT6*>(zone.m_pools.get());
|
||||||
if (assetPoolT6 && !assetPoolT6->m_key_value_pairs->m_asset_lookup.empty())
|
if (assetPoolT6 && !assetPoolT6->m_key_value_pairs->m_asset_lookup.empty())
|
||||||
{
|
{
|
||||||
for (const auto* kvpAsset : *assetPoolT6->m_key_value_pairs)
|
for (const auto* kvpAsset : *assetPoolT6->m_key_value_pairs)
|
||||||
{
|
{
|
||||||
const auto* keyValuePairs = kvpAsset->Asset();
|
const auto* keyValuePairs = kvpAsset->Asset();
|
||||||
for (auto varIndex = 0; varIndex < keyValuePairs->numVariables; varIndex++)
|
for (auto varIndex = 0; varIndex < keyValuePairs->numVariables; varIndex++)
|
||||||
{
|
WriteKeyValuePair(stream, keyValuePairs->keyValuePairs[varIndex]);
|
||||||
WriteKeyValuePair(stream, &keyValuePairs->keyValuePairs[varIndex]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.EmptyLine();
|
stream.EmptyLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const
|
void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const
|
||||||
{
|
{
|
||||||
const auto* pools = dynamic_cast<GameAssetPoolT6*>(zone->m_pools.get());
|
const auto* pools = dynamic_cast<GameAssetPoolT6*>(zone.m_pools.get());
|
||||||
|
|
||||||
assert(pools);
|
assert(pools);
|
||||||
if (!pools)
|
if (!pools)
|
||||||
@ -82,9 +74,7 @@ void ZoneDefWriter::WriteContent(ZoneDefinitionOutputStream& stream, const Unlin
|
|||||||
|
|
||||||
// Localized strings are all collected in one string file. So only add this to the zone file.
|
// 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())
|
if (!pools->m_localize->m_asset_lookup.empty())
|
||||||
{
|
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone.m_name);
|
||||||
stream.WriteEntry(*pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), zone->m_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& asset : *pools)
|
for (const auto& asset : *pools)
|
||||||
{
|
{
|
||||||
|
@ -1,19 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ContentLister/ZoneDefWriter.h"
|
#include "ContentLister/ZoneDefWriter.h"
|
||||||
#include "Game/T6/T6.h"
|
|
||||||
|
|
||||||
namespace T6
|
namespace T6
|
||||||
{
|
{
|
||||||
class ZoneDefWriter final : public AbstractZoneDefWriter
|
class ZoneDefWriter final : public AbstractZoneDefWriter
|
||||||
{
|
{
|
||||||
static void WriteKeyValuePair(ZoneDefinitionOutputStream& stream, KeyValuePair* kvp);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteMetaData(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs* args, Zone* zone) const override;
|
void WriteContent(ZoneDefinitionOutputStream& stream, const UnlinkerArgs& args, const Zone& zone) const override;
|
||||||
|
|
||||||
public:
|
|
||||||
bool CanHandleZone(Zone* zone) const override;
|
|
||||||
};
|
};
|
||||||
} // namespace T6
|
} // namespace T6
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
#include "ContentLister/ContentPrinter.h"
|
#include "ContentLister/ContentPrinter.h"
|
||||||
#include "ContentLister/ZoneDefWriter.h"
|
#include "ContentLister/ZoneDefWriter.h"
|
||||||
#include "Game/IW3/ZoneDefWriterIW3.h"
|
|
||||||
#include "Game/IW4/ZoneDefWriterIW4.h"
|
|
||||||
#include "Game/IW5/ZoneDefWriterIW5.h"
|
|
||||||
#include "Game/T5/ZoneDefWriterT5.h"
|
|
||||||
#include "Game/T6/ZoneDefWriterT6.h"
|
|
||||||
#include "ObjContainer/IWD/IWD.h"
|
#include "ObjContainer/IWD/IWD.h"
|
||||||
#include "ObjLoading.h"
|
#include "ObjLoading.h"
|
||||||
#include "ObjWriting.h"
|
#include "ObjWriting.h"
|
||||||
@ -25,14 +20,6 @@
|
|||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
const IZoneDefWriter* const ZONE_DEF_WRITERS[]{
|
|
||||||
new IW3::ZoneDefWriter(),
|
|
||||||
new IW4::ZoneDefWriter(),
|
|
||||||
new IW5::ZoneDefWriter(),
|
|
||||||
new T5::ZoneDefWriter(),
|
|
||||||
new T6::ZoneDefWriter(),
|
|
||||||
};
|
|
||||||
|
|
||||||
class Unlinker::Impl
|
class Unlinker::Impl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -166,51 +153,41 @@ private:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WriteZoneDefinitionFile(Zone* zone, const fs::path& zoneDefinitionFileFolder) const
|
bool WriteZoneDefinitionFile(const Zone& zone, const fs::path& zoneDefinitionFileFolder) const
|
||||||
{
|
{
|
||||||
auto zoneDefinitionFilePath(zoneDefinitionFileFolder);
|
auto zoneDefinitionFilePath(zoneDefinitionFileFolder);
|
||||||
zoneDefinitionFilePath.append(zone->m_name);
|
zoneDefinitionFilePath.append(zone.m_name);
|
||||||
zoneDefinitionFilePath.replace_extension(".zone");
|
zoneDefinitionFilePath.replace_extension(".zone");
|
||||||
|
|
||||||
std::ofstream zoneDefinitionFile(zoneDefinitionFilePath, std::fstream::out | std::fstream::binary);
|
std::ofstream zoneDefinitionFile(zoneDefinitionFilePath, std::fstream::out | std::fstream::binary);
|
||||||
if (!zoneDefinitionFile.is_open())
|
if (!zoneDefinitionFile.is_open())
|
||||||
{
|
{
|
||||||
std::cerr << std::format("Failed to open file for zone definition file of zone \"{}\".\n", zone->m_name);
|
std::cerr << std::format("Failed to open file for zone definition file of zone \"{}\".\n", zone.m_name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = false;
|
const auto* zoneDefWriter = IZoneDefWriter::GetZoneDefWriterForGame(zone.m_game->GetId());
|
||||||
for (const auto* zoneDefWriter : ZONE_DEF_WRITERS)
|
zoneDefWriter->WriteZoneDef(zoneDefinitionFile, m_args, zone);
|
||||||
{
|
|
||||||
if (zoneDefWriter->CanHandleZone(zone))
|
|
||||||
{
|
|
||||||
zoneDefWriter->WriteZoneDef(zoneDefinitionFile, &m_args, zone);
|
|
||||||
result = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!result)
|
|
||||||
std::cerr << std::format("Failed to find writer for zone definition file of zone \"{}\".\n", zone->m_name);
|
|
||||||
|
|
||||||
zoneDefinitionFile.close();
|
zoneDefinitionFile.close();
|
||||||
return result;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool OpenGdtFile(Zone* zone, const fs::path& outputFolder, std::ofstream& stream)
|
static bool OpenGdtFile(const Zone& zone, const fs::path& outputFolder, std::ofstream& stream)
|
||||||
{
|
{
|
||||||
auto gdtFilePath(outputFolder);
|
auto gdtFilePath(outputFolder);
|
||||||
gdtFilePath.append("source_data");
|
gdtFilePath.append("source_data");
|
||||||
|
|
||||||
fs::create_directories(gdtFilePath);
|
fs::create_directories(gdtFilePath);
|
||||||
|
|
||||||
gdtFilePath.append(zone->m_name);
|
gdtFilePath.append(zone.m_name);
|
||||||
gdtFilePath.replace_extension(".gdt");
|
gdtFilePath.replace_extension(".gdt");
|
||||||
|
|
||||||
stream = std::ofstream(gdtFilePath, std::fstream::out | std::fstream::binary);
|
stream = std::ofstream(gdtFilePath, std::fstream::out | std::fstream::binary);
|
||||||
if (!stream.is_open())
|
if (!stream.is_open())
|
||||||
{
|
{
|
||||||
std::cerr << std::format("Failed to open file for zone definition file of zone \"{}\".\n", zone->m_name);
|
std::cerr << std::format("Failed to open file for zone definition file of zone \"{}\".\n", zone.m_name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +251,7 @@ private:
|
|||||||
* \param zone The zone to handle.
|
* \param zone The zone to handle.
|
||||||
* \return \c true if handling the zone was successful, otherwise \c false.
|
* \return \c true if handling the zone was successful, otherwise \c false.
|
||||||
*/
|
*/
|
||||||
bool HandleZone(ISearchPath& searchPath, Zone* zone) const
|
bool HandleZone(ISearchPath& searchPath, Zone& zone) const
|
||||||
{
|
{
|
||||||
if (m_args.m_task == UnlinkerArgs::ProcessingTask::LIST)
|
if (m_args.m_task == UnlinkerArgs::ProcessingTask::LIST)
|
||||||
{
|
{
|
||||||
@ -295,7 +272,7 @@ private:
|
|||||||
|
|
||||||
std::ofstream gdtStream;
|
std::ofstream gdtStream;
|
||||||
AssetDumpingContext context;
|
AssetDumpingContext context;
|
||||||
context.m_zone = zone;
|
context.m_zone = &zone;
|
||||||
context.m_base_path = outputFolderPath;
|
context.m_base_path = outputFolderPath;
|
||||||
context.m_obj_search_path = &searchPath;
|
context.m_obj_search_path = &searchPath;
|
||||||
|
|
||||||
@ -305,7 +282,7 @@ private:
|
|||||||
return false;
|
return false;
|
||||||
auto gdt = std::make_unique<GdtOutputStream>(gdtStream);
|
auto gdt = std::make_unique<GdtOutputStream>(gdtStream);
|
||||||
gdt->BeginStream();
|
gdt->BeginStream();
|
||||||
gdt->WriteVersion(GdtVersion(zone->m_game->GetShortName(), 1));
|
gdt->WriteVersion(GdtVersion(zone.m_game->GetShortName(), 1));
|
||||||
context.m_gdt = std::move(gdt);
|
context.m_gdt = std::move(gdt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,7 +386,7 @@ private:
|
|||||||
if (ShouldLoadObj())
|
if (ShouldLoadObj())
|
||||||
ObjLoading::LoadReferencedContainersForZone(searchPathsForZone, *zone);
|
ObjLoading::LoadReferencedContainersForZone(searchPathsForZone, *zone);
|
||||||
|
|
||||||
if (!HandleZone(searchPathsForZone, zone.get()))
|
if (!HandleZone(searchPathsForZone, *zone))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (ShouldLoadObj())
|
if (ShouldLoadObj())
|
||||||
|
@ -377,7 +377,7 @@ bool UnlinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldCont
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string UnlinkerArgs::GetOutputFolderPathForZone(const Zone* zone) const
|
std::string UnlinkerArgs::GetOutputFolderPathForZone(const Zone& zone) const
|
||||||
{
|
{
|
||||||
return std::regex_replace(m_output_folder, m_zone_pattern, zone->m_name);
|
return std::regex_replace(m_output_folder, m_zone_pattern, zone.m_name);
|
||||||
}
|
}
|
||||||
|
@ -68,5 +68,5 @@ public:
|
|||||||
* \param zone The zone to resolve the path input for.
|
* \param zone The zone to resolve the path input for.
|
||||||
* \return An output path for the zone based on the user input.
|
* \return An output path for the zone based on the user input.
|
||||||
*/
|
*/
|
||||||
std::string GetOutputFolderPathForZone(const Zone* zone) const;
|
std::string GetOutputFolderPathForZone(const Zone& zone) const;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user