Reformat code with clang format

This commit is contained in:
Clang Format
2023-11-19 15:28:38 +01:00
committed by Jan
parent 22e17272fd
commit 6b4f5d94a8
1099 changed files with 16763 additions and 18076 deletions

View File

@ -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)

View File

@ -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--;
}
}

View File

@ -13,4 +13,4 @@ protected:
void DecIndent();
explicit AbstractTextDumper(std::ostream& stream);
};
};

View File

@ -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

View File

@ -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;
};
};

View File

@ -14,4 +14,4 @@ public:
virtual bool CanHandleZone(AssetDumpingContext& assetDumpingContext) const = 0;
virtual bool DumpZone(AssetDumpingContext& assetDumpingContext) const = 0;
};
};

View File

@ -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)

View File

@ -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();

View File

@ -1,9 +1,9 @@
#pragma once
#include <ostream>
#include "Dumping/AbstractTextDumper.h"
#include <ostream>
class MapFileDumper : AbstractTextDumper
{
public:

View File

@ -1,9 +1,9 @@
#pragma once
#include <ostream>
#include "Dumping/AbstractTextDumper.h"
#include <ostream>
class SndCurveDumper : AbstractTextDumper
{
static constexpr auto DEFAULT_PRECISION = 4;