mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-19 03:07:58 -05:00
Reformat code with clang format
This commit is contained in:
@ -2,8 +2,7 @@
|
||||
|
||||
#include "IAssetDumper.h"
|
||||
|
||||
template<class T>
|
||||
class AbstractAssetDumper : public IAssetDumper<T>
|
||||
template<class T> class AbstractAssetDumper : public IAssetDumper<T>
|
||||
{
|
||||
protected:
|
||||
virtual bool ShouldDump(XAssetInfo<T>* asset)
|
||||
|
@ -4,9 +4,8 @@
|
||||
|
||||
AbstractTextDumper::AbstractTextDumper(std::ostream& stream)
|
||||
: m_stream(stream),
|
||||
m_indent(0u)
|
||||
m_indent(0u)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void AbstractTextDumper::Indent() const
|
||||
@ -25,4 +24,4 @@ void AbstractTextDumper::DecIndent()
|
||||
assert(m_indent > 0);
|
||||
if (m_indent > 0)
|
||||
m_indent--;
|
||||
}
|
||||
}
|
||||
|
@ -13,4 +13,4 @@ protected:
|
||||
void DecIndent();
|
||||
|
||||
explicit AbstractTextDumper(std::ostream& stream);
|
||||
};
|
||||
};
|
||||
|
@ -1,15 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <ostream>
|
||||
#include <memory>
|
||||
#include <typeindex>
|
||||
|
||||
#include "IZoneAssetDumperState.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Obj/Gdt/GdtStream.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Zone/Zone.h"
|
||||
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <typeindex>
|
||||
|
||||
class AssetDumpingContext
|
||||
{
|
||||
std::unordered_map<std::type_index, std::unique_ptr<IZoneAssetDumperState>> m_zone_asset_dumper_states;
|
||||
@ -23,8 +23,7 @@ public:
|
||||
|
||||
_NODISCARD std::unique_ptr<std::ostream> OpenAssetFile(const std::string& fileName) const;
|
||||
|
||||
template<typename T>
|
||||
T* GetZoneAssetDumperState()
|
||||
template<typename T> T* GetZoneAssetDumperState()
|
||||
{
|
||||
static_assert(std::is_base_of_v<IZoneAssetDumperState, T>, "T must inherit IZoneAssetDumperState");
|
||||
// T must also have a public default constructor
|
||||
|
@ -3,8 +3,7 @@
|
||||
#include "AssetDumpingContext.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
|
||||
template<class T>
|
||||
class IAssetDumper
|
||||
template<class T> class IAssetDumper
|
||||
{
|
||||
public:
|
||||
IAssetDumper() = default;
|
||||
@ -15,4 +14,4 @@ public:
|
||||
IAssetDumper& operator=(IAssetDumper&& other) noexcept = default;
|
||||
|
||||
virtual void DumpPool(AssetDumpingContext& context, AssetPool<T>* pool) = 0;
|
||||
};
|
||||
};
|
||||
|
@ -14,4 +14,4 @@ public:
|
||||
|
||||
virtual bool CanHandleZone(AssetDumpingContext& assetDumpingContext) const = 0;
|
||||
virtual bool DumpZone(AssetDumpingContext& assetDumpingContext) const = 0;
|
||||
};
|
||||
};
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include "StringFileDumper.h"
|
||||
#include <regex>
|
||||
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
#include <regex>
|
||||
|
||||
StringFileDumper::StringFileDumper(Zone* zone, std::ostream& stream)
|
||||
: AbstractTextDumper(stream),
|
||||
m_zone(zone),
|
||||
@ -14,7 +15,8 @@ StringFileDumper::StringFileDumper(Zone* zone, std::ostream& stream)
|
||||
void StringFileDumper::SetLanguageName(std::string language)
|
||||
{
|
||||
m_language_caps = std::move(language);
|
||||
for (auto& c : m_language_caps) c = toupper(c);
|
||||
for (auto& c : m_language_caps)
|
||||
c = toupper(c);
|
||||
}
|
||||
|
||||
void StringFileDumper::SetConfigFile(std::string configFile)
|
||||
|
@ -128,13 +128,10 @@ void MapFileDumper::WritePhysicsBox(const PhysicsBox box)
|
||||
IncIndent();
|
||||
|
||||
Indent();
|
||||
m_stream << std::fixed << std::setprecision(6)
|
||||
<< box.m_orientation[0].m_x << " " << box.m_orientation[0].m_y << " " << box.m_orientation[0].m_z
|
||||
<< " " << box.m_orientation[1].m_x << " " << box.m_orientation[1].m_y << " " << box.m_orientation[1].m_z
|
||||
<< " " << box.m_orientation[2].m_x << " " << box.m_orientation[2].m_y << " " << box.m_orientation[2].m_z
|
||||
<< " " << box.m_middle_point.m_x << " " << box.m_middle_point.m_y << " " << box.m_middle_point.m_z
|
||||
<< " " << box.m_half_size.m_x << " " << box.m_half_size.m_y << " " << box.m_half_size.m_z
|
||||
<< "\n";
|
||||
m_stream << std::fixed << std::setprecision(6) << box.m_orientation[0].m_x << " " << box.m_orientation[0].m_y << " " << box.m_orientation[0].m_z << " "
|
||||
<< box.m_orientation[1].m_x << " " << box.m_orientation[1].m_y << " " << box.m_orientation[1].m_z << " " << box.m_orientation[2].m_x << " "
|
||||
<< box.m_orientation[2].m_y << " " << box.m_orientation[2].m_z << " " << box.m_middle_point.m_x << " " << box.m_middle_point.m_y << " "
|
||||
<< box.m_middle_point.m_z << " " << box.m_half_size.m_x << " " << box.m_half_size.m_y << " " << box.m_half_size.m_z << "\n";
|
||||
|
||||
DecIndent();
|
||||
Indent();
|
||||
@ -150,11 +147,9 @@ void MapFileDumper::WritePhysicsCylinder(PhysicsCylinder cylinder)
|
||||
IncIndent();
|
||||
|
||||
Indent();
|
||||
m_stream << std::fixed << std::setprecision(6)
|
||||
<< cylinder.m_orientation.m_x << " " << cylinder.m_orientation.m_y << " " << cylinder.m_orientation.m_z
|
||||
<< " " << cylinder.m_middle_point.m_x << " " << cylinder.m_middle_point.m_y << " " << cylinder.m_middle_point.m_z
|
||||
<< " " << cylinder.m_height << " " << cylinder.m_radius
|
||||
<< "\n";
|
||||
m_stream << std::fixed << std::setprecision(6) << cylinder.m_orientation.m_x << " " << cylinder.m_orientation.m_y << " " << cylinder.m_orientation.m_z
|
||||
<< " " << cylinder.m_middle_point.m_x << " " << cylinder.m_middle_point.m_y << " " << cylinder.m_middle_point.m_z << " " << cylinder.m_height
|
||||
<< " " << cylinder.m_radius << "\n";
|
||||
|
||||
DecIndent();
|
||||
Indent();
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#include "Dumping/AbstractTextDumper.h"
|
||||
|
||||
#include <ostream>
|
||||
|
||||
class MapFileDumper : AbstractTextDumper
|
||||
{
|
||||
public:
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#include "Dumping/AbstractTextDumper.h"
|
||||
|
||||
#include <ostream>
|
||||
|
||||
class SndCurveDumper : AbstractTextDumper
|
||||
{
|
||||
static constexpr auto DEFAULT_PRECISION = 4;
|
||||
|
Reference in New Issue
Block a user