mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-10-28 17:16:56 +00:00
refactor: do not nest asset namespaces in game namespaces
* Duplicated namespace names are kind of annoying
This commit is contained in:
@@ -131,14 +131,14 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
bool CsvDumper::ShouldDump(XAssetInfo<FontIcon>* asset)
|
||||
bool CsvDumperT6::ShouldDump(XAssetInfo<FontIcon>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CsvDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset)
|
||||
void CsvDumperT6::DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset)
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
@@ -148,4 +148,4 @@ namespace T6::font_icon
|
||||
Dumper dumper(*assetFile);
|
||||
dumper.Dump(*asset->Asset());
|
||||
}
|
||||
} // namespace T6::font_icon
|
||||
} // namespace font_icon
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
class CsvDumper final : public AbstractAssetDumper<FontIcon>
|
||||
class CsvDumperT6 final : public AbstractAssetDumper<T6::FontIcon>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<FontIcon>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<T6::FontIcon>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<T6::FontIcon>* asset) override;
|
||||
};
|
||||
} // namespace T6::font_icon
|
||||
} // namespace font_icon
|
||||
|
||||
@@ -7,14 +7,14 @@ using namespace T6;
|
||||
|
||||
// #define DUMP_FONT_ICON_AS_CSV 1
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
std::unique_ptr<IAssetDumper<FontIcon>> CreateDumper()
|
||||
std::unique_ptr<IAssetDumper<FontIcon>> CreateDumperT6()
|
||||
{
|
||||
#ifdef DUMP_FONT_ICON_AS_CSV
|
||||
return std::make_unique<CsvDumper>();
|
||||
return std::make_unique<CsvDumperT6>();
|
||||
#else
|
||||
return std::make_unique<JsonDumper>();
|
||||
return std::make_unique<JsonDumperT6>();
|
||||
#endif
|
||||
}
|
||||
} // namespace T6::font_icon
|
||||
} // namespace font_icon
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
namespace T6::font_icon
|
||||
#include <memory>
|
||||
|
||||
namespace font_icon
|
||||
{
|
||||
std::unique_ptr<IAssetDumper<FontIcon>> CreateDumper();
|
||||
} // namespace T6::font_icon
|
||||
std::unique_ptr<IAssetDumper<T6::FontIcon>> CreateDumperT6();
|
||||
} // namespace font_icon
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "FontIconJsonDumperT6.h"
|
||||
|
||||
#include "FontIcon/FontIconCommon.h"
|
||||
#include "Game/T6/CommonT6.h"
|
||||
#include "Game/T6/FontIcon/FontIconCommonT6.h"
|
||||
#include "Game/T6/FontIcon/JsonFontIconT6.h"
|
||||
#include "KnownFontIconAliasesT6.h"
|
||||
|
||||
@@ -76,20 +76,20 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
bool JsonDumper::ShouldDump(XAssetInfo<FontIcon>* asset)
|
||||
bool JsonDumperT6::ShouldDump(XAssetInfo<FontIcon>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void JsonDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset)
|
||||
void JsonDumperT6::DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset)
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile(font_icon::GetJsonFileNameForAssetName(asset->m_name));
|
||||
const auto assetFile = context.OpenAssetFile(GetJsonFileNameForAssetName(asset->m_name));
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
DumpFontIcon(*assetFile, *asset->Asset());
|
||||
}
|
||||
} // namespace T6::font_icon
|
||||
} // namespace font_icon
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
namespace T6::font_icon
|
||||
namespace font_icon
|
||||
{
|
||||
class JsonDumper final : public AbstractAssetDumper<FontIcon>
|
||||
class JsonDumperT6 final : public AbstractAssetDumper<T6::FontIcon>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<FontIcon>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<T6::FontIcon>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<T6::FontIcon>* asset) override;
|
||||
};
|
||||
} // namespace T6::font_icon
|
||||
} // namespace font_icon
|
||||
|
||||
Reference in New Issue
Block a user