2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CTEXTURE
|
|
|
|
#define _CTEXTURE
|
2022-07-02 05:30:04 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-08-30 22:48:44 +00:00
|
|
|
#include <dolphin/gx/GXEnum.h>
|
|
|
|
|
2022-09-13 04:26:54 +00:00
|
|
|
class CInputStream;
|
|
|
|
|
2022-12-01 16:11:09 +00:00
|
|
|
enum ETexelFormat {
|
|
|
|
kTF_Invalid = -1,
|
|
|
|
kTF_I4 = 0,
|
|
|
|
kTF_I8 = 1,
|
|
|
|
kTF_IA4 = 2,
|
|
|
|
kTF_IA8 = 3,
|
|
|
|
kTF_C4 = 4,
|
|
|
|
kTF_C8 = 5,
|
|
|
|
kTF_C14X2 = 6,
|
|
|
|
kTF_RGB565 = 7,
|
|
|
|
kTF_RGB5A3 = 8,
|
|
|
|
kTF_RGBA8 = 9,
|
|
|
|
kTF_CMPR = 10,
|
|
|
|
};
|
|
|
|
|
2022-07-02 05:30:04 +00:00
|
|
|
class CTexture {
|
|
|
|
public:
|
|
|
|
enum EClampMode {
|
2022-10-17 02:33:08 +00:00
|
|
|
kCM_Clamp,
|
|
|
|
kCM_Repeat,
|
|
|
|
kCM_Mirror,
|
2022-07-02 05:30:04 +00:00
|
|
|
};
|
2022-09-13 04:26:54 +00:00
|
|
|
enum EAutoMipmap {
|
|
|
|
kAM_Zero,
|
|
|
|
};
|
|
|
|
enum EBlackKey {
|
|
|
|
kBK_Zero,
|
|
|
|
};
|
|
|
|
|
2022-12-01 16:11:09 +00:00
|
|
|
CTexture(ETexelFormat fmt, short w, short h, int mips);
|
2022-09-13 04:26:54 +00:00
|
|
|
CTexture(CInputStream& stream, EAutoMipmap mip, EBlackKey bk);
|
2022-12-01 16:11:09 +00:00
|
|
|
~CTexture();
|
|
|
|
|
|
|
|
// Used in certain destructors
|
|
|
|
void sub_8030e10c();
|
2022-07-02 05:30:04 +00:00
|
|
|
|
|
|
|
void Load(GXTexMapID texMapId, EClampMode clampMode) const;
|
2022-12-01 16:11:09 +00:00
|
|
|
void UnLock();
|
|
|
|
|
|
|
|
void* GetBitMapData(int);
|
2022-08-30 22:48:44 +00:00
|
|
|
|
|
|
|
static void InvalidateTexmap(GXTexMapID id);
|
2022-09-13 04:26:54 +00:00
|
|
|
|
2022-12-01 16:11:09 +00:00
|
|
|
uint GetTexelFormat() const { return mTexelFormat; }
|
2022-10-09 05:37:23 +00:00
|
|
|
short GetWidth() const { return mWidth; }
|
|
|
|
short GetHeight() const { return mHeight; }
|
2022-12-01 16:11:09 +00:00
|
|
|
|
|
|
|
void SetFlag1(bool b) { mFlag1 = b; }
|
2022-10-09 05:13:17 +00:00
|
|
|
|
2022-09-13 04:26:54 +00:00
|
|
|
private:
|
2022-10-09 05:37:23 +00:00
|
|
|
uint mTexelFormat; // TODO: Enum
|
|
|
|
short mWidth;
|
|
|
|
short mHeight;
|
2022-12-01 16:11:09 +00:00
|
|
|
uchar mNumMips;
|
|
|
|
uchar mBitsPerPixel;
|
|
|
|
uchar mFlag1 : 1;
|
2022-12-01 16:25:05 +00:00
|
|
|
uchar pad[0x5A];
|
2022-07-02 05:30:04 +00:00
|
|
|
};
|
2022-12-01 16:25:05 +00:00
|
|
|
CHECK_SIZEOF(CTexture, 0x68)
|
2022-07-02 05:30:04 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CTEXTURE
|