mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-11-07 01:01:59 +00:00
* 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]>
51 lines
1.3 KiB
C++
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
|