Files
OpenAssetTools/src/ObjImage/Image/Dx9TextureLoader.h
T
moandJan Laupetin cc71ec7387 fix: handle embedded cubemap face order correctly (#996)
* fix: handle embedded cubemap face order correctly

* chore: do not treat cubemaps as separate logic when not necessary

* chore: make sure face major image data is the default and chosen for any game other than qos

* chore: make new tests use no namespace

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-11-03 22:47:04 +01:00

51 lines
1.3 KiB
C++

#pragma once
#include "Image/D3DFormat.h"
#include "Image/Texture.h"
#include <memory>
namespace image
{
class Dx9TextureLoader
{
public:
enum class MipMapDataOrder
{
LargestToSmallest,
SmallestToLargest,
};
enum class CubeMapDataOrder
{
FaceMajor,
MipMajor,
};
Dx9TextureLoader();
Dx9TextureLoader& Format(oat::D3DFORMAT format);
Dx9TextureLoader& Type(TextureType textureType);
Dx9TextureLoader& HasMipMaps(bool hasMipMaps);
Dx9TextureLoader& MipMapOrder(MipMapDataOrder mipMapOrder);
Dx9TextureLoader& CubeMapOrder(CubeMapDataOrder cubeMapDataOrder);
Dx9TextureLoader& Width(unsigned width);
Dx9TextureLoader& Height(unsigned height);
Dx9TextureLoader& Depth(unsigned depth);
std::unique_ptr<Texture> LoadTexture(const void* data);
private:
[[nodiscard]] const ImageFormat* GetFormatForDx9Format() const;
oat::D3DFORMAT m_format;
TextureType m_type;
bool m_has_mip_maps;
MipMapDataOrder m_mip_map_order;
CubeMapDataOrder m_cube_map_data_order;
unsigned m_width;
unsigned m_height;
unsigned m_depth;
};
} // namespace image