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

@ -1,12 +1,12 @@
#include "AssetLoaderGfxImage.h"
#include <cstring>
#include <iostream>
#include "Game/IW3/IW3.h"
#include "Image/DdsLoader.h"
#include "Pool/GlobalAssetPool.h"
#include "Image/IwiTypes.h"
#include "Pool/GlobalAssetPool.h"
#include <cstring>
#include <iostream>
using namespace IW3;
@ -23,7 +23,8 @@ bool AssetLoaderGfxImage::CanLoadFromRaw() const
return true;
}
bool AssetLoaderGfxImage::LoadFromRaw(const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const
bool AssetLoaderGfxImage::LoadFromRaw(
const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const
{
// Do not load any GfxImages from raw for now that are not loaded
// TODO: Load iwis and add streaming info to asset

View File

@ -1,7 +1,7 @@
#pragma once
#include "Game/IW3/IW3.h"
#include "AssetLoading/BasicAssetLoader.h"
#include "AssetLoading/IAssetLoadingManager.h"
#include "Game/IW3/IW3.h"
#include "SearchPath/ISearchPath.h"
namespace IW3
@ -11,6 +11,7 @@ namespace IW3
public:
_NODISCARD void* CreateEmptyAsset(const std::string& assetName, MemoryManager* memory) override;
_NODISCARD bool CanLoadFromRaw() const override;
bool LoadFromRaw(const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const override;
bool
LoadFromRaw(const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const override;
};
}
} // namespace IW3

View File

@ -1,10 +1,10 @@
#include "AssetLoaderRawFile.h"
#include <cstring>
#include "Game/IW3/IW3.h"
#include "Pool/GlobalAssetPool.h"
#include <cstring>
using namespace IW3;
void* AssetLoaderRawFile::CreateEmptyAsset(const std::string& assetName, MemoryManager* memory)
@ -20,7 +20,8 @@ bool AssetLoaderRawFile::CanLoadFromRaw() const
return true;
}
bool AssetLoaderRawFile::LoadFromRaw(const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const
bool AssetLoaderRawFile::LoadFromRaw(
const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const
{
const auto file = searchPath->Open(assetName);
if (!file.IsOpen())

View File

@ -1,7 +1,7 @@
#pragma once
#include "Game/IW3/IW3.h"
#include "AssetLoading/BasicAssetLoader.h"
#include "AssetLoading/IAssetLoadingManager.h"
#include "Game/IW3/IW3.h"
#include "SearchPath/ISearchPath.h"
namespace IW3
@ -11,6 +11,7 @@ namespace IW3
public:
_NODISCARD void* CreateEmptyAsset(const std::string& assetName, MemoryManager* memory) override;
_NODISCARD bool CanLoadFromRaw() const override;
bool LoadFromRaw(const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const override;
bool
LoadFromRaw(const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const override;
};
}
} // namespace IW3

View File

@ -1,22 +1,26 @@
#include "ObjLoaderIW3.h"
#include "Game/IW3/GameIW3.h"
#include "Game/IW3/GameAssetPoolIW3.h"
#include "ObjContainer/IPak/IPak.h"
#include "ObjLoading.h"
#include "AssetLoaders/AssetLoaderGfxImage.h"
#include "AssetLoaders/AssetLoaderRawFile.h"
#include "AssetLoading/AssetLoadingManager.h"
#include "Game/IW3/GameAssetPoolIW3.h"
#include "Game/IW3/GameIW3.h"
#include "Image/Dx9TextureLoader.h"
#include "Image/Texture.h"
#include "Image/IwiLoader.h"
#include "Image/IwiTypes.h"
#include "Image/Texture.h"
#include "ObjContainer/IPak/IPak.h"
#include "ObjLoading.h"
using namespace IW3;
ObjLoader::ObjLoader()
{
#define REGISTER_ASSET_LOADER(t) {auto l = std::make_unique<t>(); m_asset_loaders_by_type[l->GetHandlingAssetType()] = std::move(l);}
#define REGISTER_ASSET_LOADER(t) \
{ \
auto l = std::make_unique<t>(); \
m_asset_loaders_by_type[l->GetHandlingAssetType()] = std::move(l); \
}
#define BASIC_LOADER(assetType, assetClass) BasicAssetLoader<assetType, assetClass>
REGISTER_ASSET_LOADER(BASIC_LOADER(ASSET_TYPE_PHYSPRESET, PhysPreset))
@ -58,23 +62,17 @@ bool ObjLoader::SupportsZone(Zone* zone) const
bool ObjLoader::IsMpZone(Zone* zone)
{
return zone->m_name.compare(0, 3, "mp_") == 0
|| zone->m_name.compare(zone->m_name.length() - 3, 3, "_mp") == 0;
return zone->m_name.compare(0, 3, "mp_") == 0 || zone->m_name.compare(zone->m_name.length() - 3, 3, "_mp") == 0;
}
bool ObjLoader::IsZmZone(Zone* zone)
{
return zone->m_name.compare(0, 3, "zm_") == 0
|| zone->m_name.compare(zone->m_name.length() - 3, 3, "_zm") == 0;
return zone->m_name.compare(0, 3, "zm_") == 0 || zone->m_name.compare(zone->m_name.length() - 3, 3, "_zm") == 0;
}
void ObjLoader::LoadReferencedContainersForZone(ISearchPath* searchPath, Zone* zone) const
{
}
void ObjLoader::LoadReferencedContainersForZone(ISearchPath* searchPath, Zone* zone) const {}
void ObjLoader::UnloadContainersOfZone(Zone* zone) const
{
}
void ObjLoader::UnloadContainersOfZone(Zone* zone) const {}
void ObjLoader::LoadImageFromLoadDef(GfxImage* image, Zone* zone)
{
@ -183,4 +181,4 @@ void ObjLoader::FinalizeAssetsForZone(AssetLoadingContext* context) const
{
for (const auto& [type, loader] : m_asset_loaders_by_type)
loader->FinalizeAssetsForZone(context);
}
}

View File

@ -1,13 +1,13 @@
#pragma once
#include "AssetLoading/IAssetLoader.h"
#include "Game/IW3/IW3.h"
#include "IObjLoader.h"
#include "SearchPath/ISearchPath.h"
#include <map>
#include <memory>
#include "IObjLoader.h"
#include "AssetLoading/IAssetLoader.h"
#include "SearchPath/ISearchPath.h"
#include "Game/IW3/IW3.h"
namespace IW3
{
class ObjLoader final : public IObjLoader
@ -34,4 +34,4 @@ namespace IW3
bool LoadAssetForZone(AssetLoadingContext* context, asset_type_t assetType, const std::string& assetName) const override;
void FinalizeAssetsForZone(AssetLoadingContext* context) const override;
};
}
} // namespace IW3