Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
J3DTexture.h
Go to the documentation of this file.
1#ifndef J3DTEXTURE_H
2#define J3DTEXTURE_H
3
6#include "dolphin/types.h"
7
13private:
14 /* 0x0 */ u16 mNum;
15 /* 0x2 */ u16 field_0x2;
16 /* 0x4 */ ResTIMG* mpRes;
17
18public:
20 /* 8031204C */ void loadGX(u16, _GXTexMapID) const;
21 /* 803121A4 */ void entryNum(u16);
22 /* 8031221C */ void addResTIMG(u16, ResTIMG const*);
23 /* 803366A4 */ virtual ~J3DTexture() {}
24
25 u16 getNum() const { return mNum; }
26 ResTIMG* getResTIMG(u16 entry) const { return &mpRes[entry]; }
27 void setResTIMG(u16 entry, const ResTIMG& timg) {
28 mpRes[entry] = timg;
29 mpRes[entry].imageOffset = ((mpRes[entry].imageOffset + (u32)&timg - (u32)(mpRes + entry)));
30 mpRes[entry].paletteOffset = ((mpRes[entry].paletteOffset + (u32)&timg - (u32)(mpRes + entry)));
31 }
32};
33
35
40class J3DTexMtx {
41public:
45 J3DTexMtx(const J3DTexMtxInfo& info) {
46 mTexMtxInfo = info;
47 }
48 /* 803238C4 */ void load(u32) const;
49 /* 80323900 */ void calc(const Mtx);
50 /* 80323920 */ void calcTexMtx(const Mtx);
51 /* 80323C0C */ void calcPostTexMtx(const Mtx);
52 /* 80324358 */ void loadTexMtx(u32) const;
53 /* 803243BC */ void loadPostTexMtx(u32) const;
54
56 Mtx& getMtx() { return mMtx; }
58
59private:
61 /* 0x64 */ Mtx mMtx;
62}; // Size: 0x94
63
69 /* 0x0 */ u8 mTexGenType;
70 /* 0x1 */ u8 mTexGenSrc;
71 /* 0x2 */ u8 mTexGenMtx;
72 /* 0x3 */ u8 pad;
73};
74
76
87 setTexCoordInfo(info);
89 }
90 void setTexCoordInfo(J3DTexCoordInfo const& info) {
91 __memcpy(this, &info, sizeof(J3DTexCoordInfo));
92 }
93
96 u8 getTexGenMtx() { return mTexGenMtx & 0xff; }
97 u16 getTexMtxReg() { return mTexMtxReg & 0xff; }
101 // Fake match (__memcpy or = doesn't match)
102 *(u32*)this = *(u32*)&other;
103 return *this;
104 }
105
108 }
109
110 /* 0x4 */ u16 mTexMtxReg;
111}; // Size: 0x6
112
113#endif /* J3DTEXTURE_H */
_GXTexMapID
Definition GXEnum.h:30
J3DTexMtxInfo const j3dDefaultTexMtxInfo
J3DTexCoordInfo const j3dDefaultTexCoordInfo[8]
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition J3DTexture.h:40
J3DTexMtx(const J3DTexMtxInfo &info)
Definition J3DTexture.h:45
Mtx & getMtx()
Definition J3DTexture.h:56
void calcPostTexMtx(const Mtx)
Definition J3DTevs.cpp:158
J3DTexMtxInfo mTexMtxInfo
Definition J3DTexture.h:60
void calc(const Mtx)
Definition J3DTevs.cpp:56
void loadTexMtx(u32) const
Definition J3DTevs.cpp:458
void calcTexMtx(const Mtx)
Definition J3DTevs.cpp:61
void loadPostTexMtx(u32) const
Definition J3DTevs.cpp:464
J3DTexMtxInfo & getTexMtxInfo()
Definition J3DTexture.h:55
Mtx mMtx
Definition J3DTexture.h:61
void load(u32) const
Definition J3DTevs.cpp:47
J3DTexMtx()
Definition J3DTexture.h:42
void setEffectMtx(Mtx effectMtx)
Definition J3DTexture.h:57
Definition J3DTexture.h:12
void setResTIMG(u16 entry, const ResTIMG &timg)
Definition J3DTexture.h:27
void addResTIMG(u16, ResTIMG const *)
Definition J3DTexture.cpp:50
ResTIMG * getResTIMG(u16 entry) const
Definition J3DTexture.h:26
virtual ~J3DTexture()
Definition J3DTexture.h:23
u16 getNum() const
Definition J3DTexture.h:25
void loadGX(u16, _GXTexMapID) const
Definition J3DTexture.cpp:10
u16 mNum
Definition J3DTexture.h:14
u16 field_0x2
Definition J3DTexture.h:15
ResTIMG * mpRes
Definition J3DTexture.h:16
J3DTexture(u16 num, ResTIMG *res)
Definition J3DTexture.h:19
void entryNum(u16)
Definition J3DTexture.cpp:39
f32 Mtx[3][4]
Definition mtx.h:15
Definition J3DTexture.h:68
u8 mTexGenSrc
Definition J3DTexture.h:70
u8 mTexGenMtx
Definition J3DTexture.h:71
u8 mTexGenType
Definition J3DTexture.h:69
u8 pad
Definition J3DTexture.h:72
Definition J3DTexture.h:81
void setTexMtxReg(u16 reg)
Definition J3DTexture.h:99
u8 getTexGenType()
Definition J3DTexture.h:94
J3DTexCoord(J3DTexCoordInfo const &info)
Definition J3DTexture.h:86
void setTexGenMtx(u8 param_1)
Definition J3DTexture.h:98
u8 getTexGenSrc()
Definition J3DTexture.h:95
void resetTexMtxReg()
Definition J3DTexture.h:106
void setTexCoordInfo(J3DTexCoordInfo const &info)
Definition J3DTexture.h:90
u16 mTexMtxReg
Definition J3DTexture.h:110
u8 getTexGenMtx()
Definition J3DTexture.h:96
J3DTexCoord()
Definition J3DTexture.h:82
J3DTexCoord & operator=(const J3DTexCoord &other)
Definition J3DTexture.h:100
u16 getTexMtxReg()
Definition J3DTexture.h:97
Definition J3DStruct.h:93
void setEffectMtx(Mtx)
Definition J3DStruct.cpp:33
Image data header.
Definition d_menu_dmap_map.cpp:109
u32 imageOffset
Definition JUTTexture.h:39
u32 paletteOffset
Definition JUTTexture.h:27
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8