Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JPABaseShape.h
Go to the documentation of this file.
1#ifndef JPABASESHAPE_H
2#define JPABASESHAPE_H
3
5
8class JKRHeap;
9
15 // Common header.
16 /* 0x00 */ u8 mMagic[4];
17 /* 0x04 */ u32 mSize;
18
19 /* 0x08 */ u32 mFlags;
22 /* 0x10 */ f32 mBaseSizeX;
23 /* 0x14 */ f32 mBaseSizeY;
24 /* 0x18 */ u16 mBlendModeCfg;
25 /* 0x1A */ u8 mAlphaCompareCfg;
26 /* 0x1B */ u8 mAlphaRef0;
27 /* 0x1C */ u8 mAlphaRef1;
28 /* 0x1D */ u8 mZModeCfg;
29 /* 0x1E */ u8 mTexFlg;
30 /* 0x1F */ u8 mTexAnmNum;
31 /* 0x20 */ u8 mTexIdx;
32 /* 0x21 */ u8 mClrFlg;
33 /* 0x22 */ u8 mClrPrmKeyNum;
34 /* 0x23 */ u8 mClrEnvKeyNum;
35 /* 0x24 */ s16 mClrAnmFrmMax;
36 /* 0x26 */ GXColor mClrPrm;
37 /* 0x2A */ GXColor mClrEnv;
38 /* 0x2E */ u8 mAnmRndm;
39 /* 0x2F */ u8 mClrAnmRndmMask;
40 /* 0x30 */ u8 mTexAnmRndmMask;
41};
42
48public:
49 /* 8027A6DC */ JPABaseShape(u8 const*, JKRHeap*);
50 /* 8027A7E8 */ void setGX(JPAEmitterWorkData*) const;
51
52 static GXBlendMode st_bm[3];
53 static GXBlendFactor st_bf[10];
54 static GXLogicOp st_lo[16];
55 static GXCompare st_c[8];
56 static GXAlphaOp st_ao[4];
57 static GXTevColorArg st_ca[6][4];
58 static GXTevAlphaArg st_aa[2][4];
59
60 GXBlendMode getBlendMode() const { return st_bm[mpData->mBlendModeCfg & 0x03]; }
61 GXBlendFactor getBlendSrc() const { return st_bf[(mpData->mBlendModeCfg >> 2) & 0x0F]; }
62 GXBlendFactor getBlendDst() const { return st_bf[(mpData->mBlendModeCfg >> 6) & 0x0F]; }
63 GXLogicOp getLogicOp() const { return st_lo[(mpData->mBlendModeCfg >> 10) & 0x0F]; }
64 GXBool getZCompLoc() const { return (GXBool)((mpData->mZModeCfg >> 5) & 0x01); }
65
66 GXBool getZEnable() const { return (GXBool)(mpData->mZModeCfg & 0x01); }
67 GXCompare getZCmp() const { return st_c[(mpData->mZModeCfg >> 1) & 0x07]; }
68 GXBool getZUpd() const { return (GXBool)((mpData->mZModeCfg >> 4) & 0x01); }
69
70 GXCompare getAlphaCmp0() const { return st_c[mpData->mAlphaCompareCfg & 0x07]; }
71 u8 getAlphaRef0() const { return mpData->mAlphaRef0; }
72 GXAlphaOp getAlphaOp() const { return st_ao[(mpData->mAlphaCompareCfg >> 3) & 0x03]; }
73 GXCompare getAlphaCmp1() const { return st_c[(mpData->mAlphaCompareCfg >> 5) & 0x07]; }
74 u8 getAlphaRef1() const { return mpData->mAlphaRef1; }
75
76 const GXTevColorArg* getTevColorArg() const { return st_ca[(mpData->mFlags >> 0x0F) & 0x07]; }
77 const GXTevAlphaArg* getTevAlphaArg() const { return st_aa[(mpData->mFlags >> 0x12) & 0x01]; }
78
79 u32 getType() const { return (mpData->mFlags >> 0) & 0x0F; }
80 u32 getDirType() const { return (mpData->mFlags >> 4) & 0x07; }
81 u32 getRotType() const { return (mpData->mFlags >> 7) & 0x07; }
82 u32 getBasePlaneType() const { return (mpData->mFlags >> 10) & 0x01; }
83 u32 getTilingS() const { return (mpData->mFlags >> 25) & 0x01; }
84 u32 getTilingT() const { return (mpData->mFlags >> 26) & 0x01; }
85 BOOL isGlblClrAnm() const { return mpData->mFlags & 0x00001000; }
86 BOOL isGlblTexAnm() const { return mpData->mFlags & 0x00004000; }
87 BOOL isPrjTex() const { return mpData->mFlags & 0x00100000; }
88 bool isDrawFwdAhead() const { return !!(mpData->mFlags & 0x00200000); }
89 bool isDrawPrntAhead() const { return !!(mpData->mFlags & 0x00400000); }
90 bool isClipOn() const { return !!(mpData->mFlags & 0x00800000); }
91 BOOL isTexCrdAnm() const { return mpData->mFlags & 0x01000000; }
92 bool isNoDrawParent() const { return !!(mpData->mFlags & 0x08000000); }
93 bool isNoDrawChild() const { return !!(mpData->mFlags & 0x10000000); }
94
95 BOOL isPrmAnm() const { return mpData->mClrFlg & 0x02; }
96 BOOL isEnvAnm() const { return mpData->mClrFlg & 0x08; }
97 u8 getClrAnmType() const { return (mpData->mClrFlg >> 4) & 0x07; }
99 void getPrmClr(GXColor* dst) { *dst = mpData->mClrPrm; }
100 void getPrmClr(s16 idx, GXColor* dst) { *dst = mpPrmClrAnmTbl[idx]; }
101 void getEnvClr(GXColor* dst) { *dst = mpData->mClrEnv; }
102 void getEnvClr(s16 idx, GXColor* dst) { *dst = mpEnvClrAnmTbl[idx]; }
103
104 BOOL isTexAnm() const { return mpData->mTexFlg & 0x01; }
105 u8 getTexAnmType() const { return (mpData->mTexFlg >> 2) & 0x07; }
106 u32 getTexIdx() const { return mpData->mTexIdx; }
107 u8 getTexIdx(u8 idx) const { return mpTexIdxAnimTbl[idx]; }
108
109 f32 getBaseSizeX() const { return mpData->mBaseSizeX; }
110 f32 getBaseSizeY() const { return mpData->mBaseSizeY; }
116
117 f32 getIncTransX() const { return ((f32*)mpTexCrdMtxAnmTbl)[5]; }
118 f32 getInitTransX() const { return ((f32*)mpTexCrdMtxAnmTbl)[0]; }
119 f32 getIncTransY() const { return ((f32*)mpTexCrdMtxAnmTbl)[6]; }
120 f32 getInitTransY() const { return ((f32*)mpTexCrdMtxAnmTbl)[1]; }
121 f32 getIncScaleX() const { return ((f32*)mpTexCrdMtxAnmTbl)[7]; }
122 f32 getInitScaleX() const { return ((f32*)mpTexCrdMtxAnmTbl)[2]; }
123 f32 getIncScaleY() const { return ((f32*)mpTexCrdMtxAnmTbl)[8]; }
124 f32 getInitScaleY() const { return ((f32*)mpTexCrdMtxAnmTbl)[3]; }
125 f32 getIncRot() const { return ((f32*)mpTexCrdMtxAnmTbl)[9]; }
126 f32 getInitRot() const { return ((f32*)mpTexCrdMtxAnmTbl)[4]; }
127 u8 getTexAnmKeyNum() const { return mpData->mTexAnmNum; }
128
129public:
130 /* 0x00 */ const JPABaseShapeData* mpData;
131 /* 0x04 */ const void* mpTexCrdMtxAnmTbl;
132 /* 0x08 */ const u8* mpTexIdxAnimTbl;
135};
136
142 /* 0x0 */ s16 index;
143 /* 0x2 */ GXColor color;
144};
145
158
172
188
209
210#endif /* JPABASESHAPE_H */
enum _GXTevColorArg GXTevColorArg
enum _GXAlphaOp GXAlphaOp
enum _GXBlendMode GXBlendMode
enum _GXTevAlphaArg GXTevAlphaArg
enum _GXCompare GXCompare
enum _GXLogicOp GXLogicOp
u8 GXBool
Definition GXEnum.h:23
enum _GXBlendFactor GXBlendFactor
void JPAGenTexCrdMtxPrj(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:289
void JPADrawYBillboard(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:588
void JPACalcClrIdxRandom(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:230
void JPACalcClrIdxNormal(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:149
void JPALoadTexAnm(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:365
void JPASetPointSize(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:16
void JPADrawParticleCallBack(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:1261
void JPACalcTexIdxMerge(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:433
void JPALoadTex(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:360
void JPARegistPrm(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:38
void JPADrawRotDirection(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:870
void JPARegistAlpha(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:76
void JPACalcPrm(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:245
void JPADrawBillboard(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:533
void JPADrawDBillboard(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:914
void JPALoadPosMtxCam(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:461
void JPASetLineWidth(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:21
void JPADrawRotBillboard(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:558
void JPAGenCalcTexCrdMtxAnm(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:295
void JPARegistAlphaEnv(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:120
void JPADrawRotation(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:951
void JPACalcClrIdxMerge(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:215
void JPADrawRotYBillboard(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:614
void JPACalcTexIdxNormal(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:377
void JPARegistEnv(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:49
void JPADrawStripeX(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:1111
void JPACalcTexIdxRepeat(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:395
void JPARegistPrmAlphaEnv(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:102
void JPADrawPoint(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:972
void JPADrawLine(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:988
void JPACalcClrIdxReverse(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:193
void JPALoadCalcTexCrdMtxAnm(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:328
void JPADrawStripe(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:1024
void JPACalcColorCopy(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:269
void JPADrawDirection(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:831
void JPACalcTexIdxRandom(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:448
void JPACalcEnv(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:257
void JPARegistPrmEnv(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:59
void JPACalcClrIdxRepeat(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:177
void JPAGenTexCrdMtxAnm(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:283
void JPACalcTexIdxReverse(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:411
void JPAGenTexCrdMtxIdt(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:277
void JPADrawEmitterCallBackB(JPAEmitterWorkData *)
Definition JPABaseShape.cpp:1252
void JPARegistPrmAlpha(JPAEmitterWorkData *, JPABaseParticle *)
Definition JPABaseShape.cpp:89
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition JKRHeap.h:16
Definition JPAParticle.h:20
Definition JPABaseShape.h:14
u8 mMagic[4]
Definition JPABaseShape.h:16
u8 mClrAnmRndmMask
Definition JPABaseShape.h:39
s16 mClrEnvAnmOffset
Definition JPABaseShape.h:21
u8 mClrFlg
Definition JPABaseShape.h:32
u8 mClrEnvKeyNum
Definition JPABaseShape.h:34
s16 mClrAnmFrmMax
Definition JPABaseShape.h:35
u8 mTexIdx
Definition JPABaseShape.h:31
u8 mTexFlg
Definition JPABaseShape.h:29
u8 mZModeCfg
Definition JPABaseShape.h:28
u16 mBlendModeCfg
Definition JPABaseShape.h:24
s16 mClrPrmAnmOffset
Definition JPABaseShape.h:20
u8 mClrPrmKeyNum
Definition JPABaseShape.h:33
GXColor mClrEnv
Definition JPABaseShape.h:37
u8 mAlphaRef0
Definition JPABaseShape.h:26
u8 mTexAnmRndmMask
Definition JPABaseShape.h:40
u32 mSize
Definition JPABaseShape.h:17
u32 mFlags
Definition JPABaseShape.h:19
u8 mAnmRndm
Definition JPABaseShape.h:38
u8 mAlphaRef1
Definition JPABaseShape.h:27
u8 mAlphaCompareCfg
Definition JPABaseShape.h:25
f32 mBaseSizeY
Definition JPABaseShape.h:23
GXColor mClrPrm
Definition JPABaseShape.h:36
f32 mBaseSizeX
Definition JPABaseShape.h:22
u8 mTexAnmNum
Definition JPABaseShape.h:30
Definition JPABaseShape.h:47
const void * mpTexCrdMtxAnmTbl
Definition JPABaseShape.h:131
BOOL isPrmAnm() const
Definition JPABaseShape.h:95
u32 getTilingT() const
Definition JPABaseShape.h:84
f32 getIncTransX() const
Definition JPABaseShape.h:117
f32 getInitTransY() const
Definition JPABaseShape.h:120
f32 getInitScaleX() const
Definition JPABaseShape.h:122
u32 getClrLoopOfst(u32 param_1) const
Definition JPABaseShape.h:112
BOOL isGlblTexAnm() const
Definition JPABaseShape.h:86
BOOL isTexCrdAnm() const
Definition JPABaseShape.h:91
void getPrmClr(s16 idx, GXColor *dst)
Definition JPABaseShape.h:100
GXColor * mpEnvClrAnmTbl
Definition JPABaseShape.h:134
u8 getTexIdx(u8 idx) const
Definition JPABaseShape.h:107
GXBlendMode getBlendMode() const
Definition JPABaseShape.h:60
bool isDrawPrntAhead() const
Definition JPABaseShape.h:89
void setGX(JPAEmitterWorkData *) const
Definition JPABaseShape.cpp:1438
f32 getBaseSizeX() const
Definition JPABaseShape.h:109
f32 getIncRot() const
Definition JPABaseShape.h:125
u8 getAlphaRef0() const
Definition JPABaseShape.h:71
u32 getDirType() const
Definition JPABaseShape.h:80
static GXAlphaOp st_ao[4]
Definition JPABaseShape.h:1373
f32 getIncTransY() const
Definition JPABaseShape.h:119
u32 getTilingS() const
Definition JPABaseShape.h:83
static GXTevAlphaArg st_aa[2][4]
Definition JPABaseShape.h:1421
f32 getBaseSizeY() const
Definition JPABaseShape.h:110
u32 getBasePlaneType() const
Definition JPABaseShape.h:82
GXBool getZEnable() const
Definition JPABaseShape.h:66
static GXTevColorArg st_ca[6][4]
Definition JPABaseShape.h:1381
BOOL isTexAnm() const
Definition JPABaseShape.h:104
const GXTevAlphaArg * getTevAlphaArg() const
Definition JPABaseShape.h:77
u8 getTexAnmKeyNum() const
Definition JPABaseShape.h:127
GXAlphaOp getAlphaOp() const
Definition JPABaseShape.h:72
const u8 * mpTexIdxAnimTbl
Definition JPABaseShape.h:132
u32 getType() const
Definition JPABaseShape.h:79
f32 getIncScaleX() const
Definition JPABaseShape.h:121
GXBlendFactor getBlendSrc() const
Definition JPABaseShape.h:61
void getEnvClr(s16 idx, GXColor *dst)
Definition JPABaseShape.h:102
GXCompare getZCmp() const
Definition JPABaseShape.h:67
GXCompare getAlphaCmp0() const
Definition JPABaseShape.h:70
void getEnvClr(GXColor *dst)
Definition JPABaseShape.h:101
static GXBlendFactor st_bf[10]
Definition JPABaseShape.h:1354
bool isDrawFwdAhead() const
Definition JPABaseShape.h:88
const GXTevColorArg * getTevColorArg() const
Definition JPABaseShape.h:76
u8 getTexAnmType() const
Definition JPABaseShape.h:105
bool isClipOn() const
Definition JPABaseShape.h:90
bool isNoDrawParent() const
Definition JPABaseShape.h:92
u8 getLoopOfstValue()
Definition JPABaseShape.h:115
u8 getTexLoopOfstMask() const
Definition JPABaseShape.h:113
f32 getInitRot() const
Definition JPABaseShape.h:126
GXBool getZUpd() const
Definition JPABaseShape.h:68
static GXCompare st_c[8]
Definition JPABaseShape.h:1368
s16 getClrAnmMaxFrm() const
Definition JPABaseShape.h:98
void getPrmClr(GXColor *dst)
Definition JPABaseShape.h:99
u32 getTexLoopOfst(u8 param_1) const
Definition JPABaseShape.h:114
f32 getInitScaleY() const
Definition JPABaseShape.h:124
u8 getClrLoopOfstMask() const
Definition JPABaseShape.h:111
BOOL isEnvAnm() const
Definition JPABaseShape.h:96
u8 getClrAnmType() const
Definition JPABaseShape.h:97
BOOL isGlblClrAnm() const
Definition JPABaseShape.h:85
GXCompare getAlphaCmp1() const
Definition JPABaseShape.h:73
static GXBlendMode st_bm[3]
Definition JPABaseShape.h:1347
f32 getInitTransX() const
Definition JPABaseShape.h:118
GXBlendFactor getBlendDst() const
Definition JPABaseShape.h:62
u8 getAlphaRef1() const
Definition JPABaseShape.h:74
f32 getIncScaleY() const
Definition JPABaseShape.h:123
const JPABaseShapeData * mpData
Definition JPABaseShape.h:130
u32 getRotType() const
Definition JPABaseShape.h:81
GXLogicOp getLogicOp() const
Definition JPABaseShape.h:63
GXColor * mpPrmClrAnmTbl
Definition JPABaseShape.h:133
BOOL isPrjTex() const
Definition JPABaseShape.h:87
u32 getTexIdx() const
Definition JPABaseShape.h:106
bool isNoDrawChild() const
Definition JPABaseShape.h:93
static GXLogicOp st_lo[16]
Definition JPABaseShape.h:1361
GXBool getZCompLoc() const
Definition JPABaseShape.h:64
Definition JPABaseShape.h:141
GXColor color
Definition JPABaseShape.h:143
s16 index
Definition JPABaseShape.h:142
Definition JPAEmitter.h:21
Definition d_a_ep.cpp:68
int BOOL
Definition types.h:27
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8