Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JUTTexture.h
Go to the documentation of this file.
1#ifndef JUTTEXTURE_H
2#define JUTTEXTURE_H
3
4#include <dolphin/gx.h>
5#include <stdint.h>
6
7class JUTPalette;
8
18struct ResTIMG {
19 /* 0x00 */ u8 format;
20 /* 0x01 */ u8 alphaEnabled;
21 /* 0x02 */ u16 width;
22 /* 0x04 */ u16 height;
23 /* 0x06 */ u8 wrapS;
24 /* 0x07 */ u8 wrapT;
25 /* 0x08 */ u8 indexTexture;
26 /* 0x09 */ u8 colorFormat;
27 /* 0x0A */ u16 numColors;
28 /* 0x0C */ uintptr_t paletteOffset;
29 /* 0x10 */ u8 mipmapEnabled;
30 /* 0x11 */ u8 doEdgeLOD;
31 /* 0x12 */ u8 biasClamp;
32 /* 0x13 */ u8 maxAnisotropy;
33 /* 0x14 */ u8 minFilter;
34 /* 0x15 */ u8 magFilter;
35 /* 0x16 */ s8 minLOD;
36 /* 0x17 */ s8 maxLOD;
37 /* 0x18 */ u8 mipmapCount;
38 /* 0x19 */ u8 unknown;
39 /* 0x1A */ s16 LODBias;
40 /* 0x1C */ uintptr_t imageOffset;
41}; // Size: 0x20
42
48public:
50 setCaptureFlag(false);
51 mEmbPalette = NULL;
52 mTexInfo = NULL;
53 }
54
55 JUTTexture(const ResTIMG* p_timg, u8 param_1) {
56 mEmbPalette = NULL;
57 storeTIMG(p_timg, param_1);
58 setCaptureFlag(false);
59 }
60
62 void storeTIMG(ResTIMG const*, JUTPalette*, GXTlut);
63 void storeTIMG(ResTIMG const*, u8);
64 void storeTIMG(ResTIMG const*, JUTPalette*);
66 void init();
67 void initTexObj(GXTlut);
68 void initTexObj();
69 void load(GXTexMapID);
70
71 const ResTIMG* getTexInfo() const { return mTexInfo; }
72 s32 getFormat() const { return mTexInfo->format; }
74 s32 getWidth() const { return mTexInfo->width; }
75 s32 getHeight() const { return mTexInfo->height; }
76 void setCaptureFlag(bool flag) { mFlags &= 2 | flag; }
77 bool getCaptureFlag() const { return mFlags & 1; }
78 bool getEmbPaletteDelFlag() const { return mFlags & 2; }
79 void setEmbPaletteDelFlag(bool flag) { mFlags = (mFlags & 1) | (flag << 1);}
80 int getTlutName() const { return mTlutName; }
81 bool operator==(const JUTTexture& other) {
82 return mTexInfo == other.mTexInfo
83 && field_0x2c == other.field_0x2c
84 && mWrapS == other.mWrapS
85 && mWrapT == other.mWrapT
86 && mMinFilter == other.mMinFilter
87 && mMagFilter == other.mMagFilter
88 && mMinLOD == other.mMinLOD
89 && mMinLOD == other.mMinLOD
90 && mLODBias == other.mLODBias;
91 }
92 bool operator!=(const JUTTexture& other) {
93 return !operator==(other);
94 }
95
96private:
97 /* 0x00 */ GXTexObj mTexObj;
98 /* 0x20 */ const ResTIMG* mTexInfo;
99 /* 0x24 */ void* mTexData;
102 /* 0x30 */ u8 mWrapS;
103 /* 0x31 */ u8 mWrapT;
104 /* 0x32 */ u8 mMinFilter;
105 /* 0x33 */ u8 mMagFilter;
106 /* 0x34 */ u16 mMinLOD;
107 /* 0x36 */ u16 mMaxLOD;
108 /* 0x38 */ s16 mLODBias;
109 /* 0x3A */ u8 mTlutName;
110 /* 0x3B */ u8 mFlags;
111 /* 0x3C */ void* field_0x3c;
112};
113
114#endif /* JUTTEXTURE_H */
static BOOL flag
Definition DEMOAVX.c:20
Definition JUTPalette.h:22
Definition JUTTexture.h:47
u8 mMinFilter
Definition JUTTexture.h:104
void init()
Definition JUTTexture.cpp:120
bool getEmbPaletteDelFlag() const
Definition JUTTexture.h:78
JUTTexture()
Definition JUTTexture.h:49
s32 getTransparency() const
Definition JUTTexture.h:73
void load(GXTexMapID)
Definition JUTTexture.cpp:159
const ResTIMG * getTexInfo() const
Definition JUTTexture.h:71
void * field_0x3c
Definition JUTTexture.h:111
int getTlutName() const
Definition JUTTexture.h:80
u16 mMaxLOD
Definition JUTTexture.h:107
JUTPalette * mEmbPalette
Definition JUTTexture.h:100
u8 mWrapT
Definition JUTTexture.h:103
JUTTexture(const ResTIMG *p_timg, u8 param_1)
Definition JUTTexture.h:55
s32 getWidth() const
Definition JUTTexture.h:74
s32 getHeight() const
Definition JUTTexture.h:75
s32 getFormat() const
Definition JUTTexture.h:72
s16 mLODBias
Definition JUTTexture.h:108
u8 mMagFilter
Definition JUTTexture.h:105
void attachPalette(JUTPalette *)
Definition JUTTexture.cpp:109
void setEmbPaletteDelFlag(bool flag)
Definition JUTTexture.h:79
void * mTexData
Definition JUTTexture.h:99
void initTexObj()
Definition JUTTexture.cpp:134
u16 mMinLOD
Definition JUTTexture.h:106
u8 mFlags
Definition JUTTexture.h:110
JUTPalette * field_0x2c
Definition JUTTexture.h:101
void setCaptureFlag(bool flag)
Definition JUTTexture.h:76
u8 mWrapS
Definition JUTTexture.h:102
GXTexObj mTexObj
Definition JUTTexture.h:97
const ResTIMG * mTexInfo
Definition JUTTexture.h:98
bool operator!=(const JUTTexture &other)
Definition JUTTexture.h:92
void storeTIMG(ResTIMG const *, JUTPalette *, GXTlut)
Definition JUTTexture.cpp:71
bool getCaptureFlag() const
Definition JUTTexture.h:77
u8 mTlutName
Definition JUTTexture.h:109
~JUTTexture()
Definition JUTTexture.cpp:7
bool operator==(const JUTTexture &other)
Definition JUTTexture.h:81
enum _GXTlut GXTlut
enum _GXTexMapID GXTexMapID
signed char s8
Definition types.h:7
signed short int s16
Definition types.h:9
unsigned short int u16
Definition types.h:10
signed long s32
Definition types.h:11
unsigned char u8
Definition types.h:8
Image data header.
Definition JUTTexture.h:18
uintptr_t imageOffset
Definition JUTTexture.h:40
u8 doEdgeLOD
Definition JUTTexture.h:30
u16 width
Definition JUTTexture.h:21
u8 alphaEnabled
Definition JUTTexture.h:20
u8 colorFormat
Definition JUTTexture.h:26
u8 minFilter
Definition JUTTexture.h:33
u8 maxAnisotropy
Definition JUTTexture.h:32
u8 unknown
Definition JUTTexture.h:38
u8 biasClamp
Definition JUTTexture.h:31
u8 mipmapCount
Definition JUTTexture.h:37
s8 maxLOD
Definition JUTTexture.h:36
u8 magFilter
Definition JUTTexture.h:34
u8 mipmapEnabled
Definition JUTTexture.h:29
uintptr_t paletteOffset
Definition JUTTexture.h:28
s16 LODBias
Definition JUTTexture.h:39
u8 wrapS
Definition JUTTexture.h:23
u8 wrapT
Definition JUTTexture.h:24
u8 indexTexture
Definition JUTTexture.h:25
u16 height
Definition JUTTexture.h:22
u8 format
Definition JUTTexture.h:19
u16 numColors
Definition JUTTexture.h:27
s8 minLOD
Definition JUTTexture.h:35
Definition GXStruct.h:38