summaryrefslogtreecommitdiff
path: root/include/JSystem/J2DGraph
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2021-12-06 06:51:53 -0500
committerGitHub <noreply@github.com>2021-12-06 12:51:53 +0100
commitc15d8fcb3e91890c3aa779b391258ff9d6ce1e61 (patch)
tree0bc477448f6b4c64925d2480b6a66f1a63a090be /include/JSystem/J2DGraph
parentf7916ebde17cb384c75921cf55878f5b7b305366 (diff)
more simple J2D/J3D funcs (#166)
* more simple J2D/J3D funcs * JPABaseShape constructor * fmt Co-authored-by: lepelog <25211966+lepelog@users.noreply.github.com>
Diffstat (limited to 'include/JSystem/J2DGraph')
-rw-r--r--include/JSystem/J2DGraph/J2DTevs.h53
1 files changed, 41 insertions, 12 deletions
diff --git a/include/JSystem/J2DGraph/J2DTevs.h b/include/JSystem/J2DGraph/J2DTevs.h
index 1019ffcb7e..e5a18e9c1e 100644
--- a/include/JSystem/J2DGraph/J2DTevs.h
+++ b/include/JSystem/J2DGraph/J2DTevs.h
@@ -1,6 +1,7 @@
#ifndef J2DTEVS_H
#define J2DTEVS_H
+#include "dolphin/gx/GX.h"
#include "dolphin/mtx/mtxvec.h"
#include "dolphin/types.h"
@@ -13,12 +14,19 @@ struct J2DTextureSRTInfo {
}; // Size: 0x14
struct J2DTexMtxInfo {
- /* 0x00 */ u8 field_0x0;
- /* 0x01 */ u8 field_0x1;
+ enum {
+ /* 0x0 */ DCC_NONE,
+ /* 0x1 */ DCC_MAYA,
+ };
+
+ /* 0x00 */ u8 mTexMtxType;
+ /* 0x01 */ u8 mTexMtxDCC;
/* 0x02 */ u8 field_0x2; // padding ?
/* 0x03 */ u8 field_0x3; // padding ?
- /* 0x04 */ Vec field_0x4;
+ /* 0x04 */ Vec mCenter;
/* 0x10 */ J2DTextureSRTInfo mTexSRTInfo;
+
+ GXTexMtxType getTexMtxType() const { return (GXTexMtxType)mTexMtxType; }
}; // Size: 0x24
class J2DTexMtx {
@@ -29,13 +37,16 @@ public:
/* 802E9EBC */ void getTextureMtxMaya(J2DTextureSRTInfo const&, f32 (*)[4]);
private:
- /* 0x00 */ J2DTexMtxInfo mTexMtxInfo;
+ /* 0x00 */ J2DTexMtxInfo mInfo;
/* 0x24 */ Mtx mTexMtx;
};
struct J2DIndTexOrderInfo {
- /* 0x0 */ u8 field_0x0;
- /* 0x1 */ u8 field_0x1;
+ /* 0x0 */ u8 mTexCoordID;
+ /* 0x1 */ u8 mTexMapID;
+
+ GXTexCoordID getTexCoordID() const { return (GXTexCoordID)mTexCoordID; }
+ GXTexMapID getTexMapID() const { return (GXTexMapID)mTexMapID; }
};
class J2DIndTexOrder {
@@ -44,12 +55,12 @@ public:
/* 802EA0FC */ void load(u8);
private:
- /* 0x0 */ J2DIndTexOrderInfo mIndTexOrderInfo;
+ /* 0x0 */ J2DIndTexOrderInfo mInfo;
};
struct J2DIndTexMtxInfo {
/* 0x00 */ Mtx23 mMtx;
- /* 0x18 */ u8 field_0x18;
+ /* 0x18 */ s8 mScaleExp;
};
class J2DIndTexMtx {
@@ -65,8 +76,11 @@ private:
}; // Size: 0x1C
struct J2DIndTexCoordScaleInfo {
- /* 0x0 */ u8 field_0x0;
- /* 0x0 */ u8 field_0x1;
+ /* 0x0 */ u8 mScaleS;
+ /* 0x0 */ u8 mScaleT;
+
+ GXIndTexScale getScaleS() const { return (GXIndTexScale)mScaleS; }
+ GXIndTexScale getScaleT() const { return (GXIndTexScale)mScaleT; }
};
class J2DIndTexCoordScale {
@@ -76,7 +90,7 @@ public:
/* 802EA0CC */ void load(u8);
private:
- /* 0x0 */ J2DIndTexCoordScaleInfo mIndTexCoordScaleInfo;
+ /* 0x0 */ J2DIndTexCoordScaleInfo mInfo;
}; // Size: 0x2
class J2DIndTevStage {
@@ -86,6 +100,16 @@ public:
private:
/* 0x0 */ u32 mFlags;
+
+ GXIndTexStageID getIndStage() const { return (GXIndTexStageID)(mFlags & 0x03); }
+ GXIndTexFormat getIndFormat() const { return (GXIndTexFormat)((mFlags >> 2) & 0x03); }
+ GXIndTexBiasSel getBiasSel() const { return (GXIndTexBiasSel)((mFlags >> 4) & 0x07); }
+ GXIndTexWrap getWrapS() const { return (GXIndTexWrap)((mFlags >> 8) & 0x07); }
+ GXIndTexWrap getWrapT() const { return (GXIndTexWrap)((mFlags >> 11) & 0x07); }
+ GXIndTexMtxID getMtxSel() const { return (GXIndTexMtxID)((mFlags >> 16) & 0x0F); }
+ GXBool getPrev() const { return (GXBool)((mFlags >> 20) & 0x01); }
+ GXBool getLod() const { return (GXBool)((mFlags >> 21) & 0x01); }
+ GXIndTexAlphaSel getAlphaSel() const { return (GXIndTexAlphaSel)((mFlags >> 22) & 0x03); }
};
struct J2DTexCoordInfo {
@@ -156,7 +180,12 @@ private:
/* 0x7 */ u8 field_0x7;
};
-struct J2DTevSwapModeInfo {};
+struct J2DTevSwapModeInfo {
+ /* 0x0 */ u8 mR;
+ /* 0x1 */ u8 mG;
+ /* 0x2 */ u8 mB;
+ /* 0x3 */ u8 mA;
+};
class J2DTevSwapModeTable {
public: