mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
Reformat code with clang format
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
#include "DdsLoader.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "Image/DdsTypes.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Utils/FileUtils.h"
|
||||
#include "Image/DdsTypes.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class DdsLoaderInternal
|
||||
{
|
||||
@ -145,9 +145,8 @@ class DdsLoaderInternal
|
||||
|
||||
const auto* unsignedImageFormat = dynamic_cast<const ImageFormatUnsigned*>(imageFormat);
|
||||
|
||||
if (unsignedImageFormat->m_r_offset == rOffset && unsignedImageFormat->m_r_size == rSize
|
||||
&& unsignedImageFormat->m_g_offset == gOffset && unsignedImageFormat->m_g_size == gSize
|
||||
&& unsignedImageFormat->m_b_offset == bOffset && unsignedImageFormat->m_b_size == bSize
|
||||
if (unsignedImageFormat->m_r_offset == rOffset && unsignedImageFormat->m_r_size == rSize && unsignedImageFormat->m_g_offset == gOffset
|
||||
&& unsignedImageFormat->m_g_size == gSize && unsignedImageFormat->m_b_offset == bOffset && unsignedImageFormat->m_b_size == bSize
|
||||
&& unsignedImageFormat->m_a_offset == aOffset && unsignedImageFormat->m_a_size == aSize)
|
||||
{
|
||||
m_format = imageFormat;
|
||||
@ -155,10 +154,8 @@ class DdsLoaderInternal
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "Failed to find dds pixel format: R=" << std::hex << pf.dwRBitMask
|
||||
<< " G=" << std::hex << pf.dwGBitMask
|
||||
<< " B=" << std::hex << pf.dwBBitMask
|
||||
<< " A=" << std::hex << pf.dwABitMask << std::endl;
|
||||
std::cout << "Failed to find dds pixel format: R=" << std::hex << pf.dwRBitMask << " G=" << std::hex << pf.dwGBitMask << " B=" << std::hex
|
||||
<< pf.dwBBitMask << " A=" << std::hex << pf.dwABitMask << std::endl;
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -258,8 +255,7 @@ public:
|
||||
|
||||
Texture* LoadDds()
|
||||
{
|
||||
if (!ReadMagic()
|
||||
|| !ReadHeader())
|
||||
if (!ReadMagic() || !ReadHeader())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <istream>
|
||||
#include "Utils/MemoryManager.h"
|
||||
#include "Image/Texture.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
|
||||
#include <istream>
|
||||
|
||||
class DdsLoader
|
||||
{
|
||||
|
@ -4,12 +4,12 @@
|
||||
|
||||
Dx12TextureLoader::Dx12TextureLoader(MemoryManager* memoryManager)
|
||||
: m_memory_manager(memoryManager),
|
||||
m_format(DXGI_FORMAT_UNKNOWN),
|
||||
m_type(TextureType::T_2D),
|
||||
m_has_mip_maps(false),
|
||||
m_width(1u),
|
||||
m_height(1u),
|
||||
m_depth(1u)
|
||||
m_format(DXGI_FORMAT_UNKNOWN),
|
||||
m_type(TextureType::T_2D),
|
||||
m_has_mip_maps(false),
|
||||
m_width(1u),
|
||||
m_height(1u),
|
||||
m_depth(1u)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Image/DxgiFormat.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
#include "Image/Texture.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
class Dx12TextureLoader
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Image/D3DFormat.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
#include "Image/Texture.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
class Dx9TextureLoader
|
||||
{
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "IwiLoader.h"
|
||||
|
||||
#include "Image/IwiTypes.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
#include "Image/IwiTypes.h"
|
||||
|
||||
IwiLoader::IwiLoader(MemoryManager* memoryManager)
|
||||
{
|
||||
m_memory_manager = memoryManager;
|
||||
@ -33,7 +33,7 @@ const ImageFormat* IwiLoader::GetFormat6(int8_t format)
|
||||
case iwi6::IwiFormat::IMG_FORMAT_BITMAP_LUMINANCE:
|
||||
return &ImageFormat::FORMAT_R8;
|
||||
case iwi6::IwiFormat::IMG_FORMAT_WAVELET_RGBA: // used
|
||||
case iwi6::IwiFormat::IMG_FORMAT_WAVELET_RGB: // used
|
||||
case iwi6::IwiFormat::IMG_FORMAT_WAVELET_RGB: // used
|
||||
case iwi6::IwiFormat::IMG_FORMAT_WAVELET_LUMINANCE_ALPHA:
|
||||
case iwi6::IwiFormat::IMG_FORMAT_WAVELET_LUMINANCE:
|
||||
case iwi6::IwiFormat::IMG_FORMAT_WAVELET_ALPHA:
|
||||
@ -133,7 +133,7 @@ const ImageFormat* IwiLoader::GetFormat8(int8_t format)
|
||||
case iwi8::IwiFormat::IMG_FORMAT_BITMAP_LUMINANCE:
|
||||
return &ImageFormat::FORMAT_R8;
|
||||
case iwi8::IwiFormat::IMG_FORMAT_WAVELET_RGBA: // used
|
||||
case iwi8::IwiFormat::IMG_FORMAT_WAVELET_RGB: // used
|
||||
case iwi8::IwiFormat::IMG_FORMAT_WAVELET_RGB: // used
|
||||
case iwi8::IwiFormat::IMG_FORMAT_WAVELET_LUMINANCE_ALPHA:
|
||||
case iwi8::IwiFormat::IMG_FORMAT_WAVELET_LUMINANCE:
|
||||
case iwi8::IwiFormat::IMG_FORMAT_WAVELET_ALPHA:
|
||||
@ -251,7 +251,7 @@ const ImageFormat* IwiLoader::GetFormat13(int8_t format)
|
||||
case iwi13::IwiFormat::IMG_FORMAT_BITMAP_LUMINANCE:
|
||||
return &ImageFormat::FORMAT_R8;
|
||||
case iwi13::IwiFormat::IMG_FORMAT_WAVELET_RGBA: // used
|
||||
case iwi13::IwiFormat::IMG_FORMAT_WAVELET_RGB: // used
|
||||
case iwi13::IwiFormat::IMG_FORMAT_WAVELET_RGB: // used
|
||||
case iwi13::IwiFormat::IMG_FORMAT_WAVELET_LUMINANCE_ALPHA:
|
||||
case iwi13::IwiFormat::IMG_FORMAT_WAVELET_LUMINANCE:
|
||||
case iwi13::IwiFormat::IMG_FORMAT_WAVELET_ALPHA:
|
||||
@ -448,9 +448,7 @@ Texture* IwiLoader::LoadIwi(std::istream& stream)
|
||||
if (stream.gcount() != sizeof(iwiVersion))
|
||||
return nullptr;
|
||||
|
||||
if (iwiVersion.tag[0] != 'I'
|
||||
|| iwiVersion.tag[1] != 'W'
|
||||
|| iwiVersion.tag[2] != 'i')
|
||||
if (iwiVersion.tag[0] != 'I' || iwiVersion.tag[1] != 'W' || iwiVersion.tag[2] != 'i')
|
||||
{
|
||||
printf("Invalid IWI magic\n");
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <istream>
|
||||
#include "Utils/MemoryManager.h"
|
||||
#include "Image/Texture.h"
|
||||
#include "Utils/MemoryManager.h"
|
||||
|
||||
#include <istream>
|
||||
|
||||
class IwiLoader
|
||||
{
|
||||
|
Reference in New Issue
Block a user