NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
ef_drawinfo.h
1#ifndef NW4R_EF_DRAW_INFO_H
2#define NW4R_EF_DRAW_INFO_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/math.h>
6
7#include <revolution/GX.h>
8
9namespace nw4r {
10namespace ef {
11
12class DrawInfo {
13private:
14 math::MTX34 mViewMtx; // at 0x0
15 math::MTX34 mProjMtx; // at 0x30
16 bool mLightEnable; // at 0x60
17 GXLightID mLightMask; // at 0x64
18 bool mIsSpotLight; // at 0x6C
19 GXFogType mFogType; // at 0x70
20 f32 mFogStartz; // at 0x74
21 f32 mFogEndz; // at 0x78
22 f32 mFogNearz; // at 0x7C
23 f32 mFogFarz; // at 0x80
24 GXColor mFogColor; // at 0x84
25 f32 mZOffset; // at 0x88
26 math::VEC3 mZOffsetOrig; // at 0x8C
27 GXColor mChanMatColor; // at 0x98
28 GXColor mChanAmbColor; // at 0x9C
29
30public:
31 DrawInfo()
32 : mLightEnable(false),
33 mLightMask(GX_LIGHT_NULL),
34 mIsSpotLight(true),
35 mFogType(GX_FOG_NONE),
36 mFogStartz(0.0f),
37 mFogEndz(1.0f),
38 mFogNearz(0.0f),
39 mFogFarz(1.0f),
40 mZOffset(0.0f) {
41
42 mZOffsetOrig.x = 0.0f;
43 mZOffsetOrig.y = 0.0f;
44 mZOffsetOrig.z = 0.0f;
45
46 mChanMatColor.r = mChanMatColor.g = mChanMatColor.b = mChanMatColor.a =
47 255;
48
49 mChanAmbColor.r = mChanAmbColor.g = mChanAmbColor.b = 0;
50 mChanAmbColor.a = 255;
51 }
52
53 const math::MTX34* GetViewMtx() const {
54 return &mViewMtx;
55 }
56 void SetViewMtx(const math::MTX34& rMtx) {
57 mViewMtx = rMtx;
58 }
59
60 const math::MTX34* GetProjMtx() const {
61 return &mProjMtx;
62 }
63 void SetProjMtx(const math::MTX34& rMtx) {
64 mProjMtx = rMtx;
65 }
66
67 bool IsLightEnable() const {
68 return mLightEnable;
69 }
70
71 GXLightID GetLightMask() const {
72 return mLightMask;
73 }
74
75 bool IsSpotLight() const {
76 return mIsSpotLight;
77 }
78
79 void GetFog(GXFogType* pType, f32* pStartZ, f32* pEndZ, f32* pNearZ,
80 f32* pFarZ, GXColor* pColor) const {
81
82 *pType = mFogType;
83 *pStartZ = mFogStartz;
84 *pEndZ = mFogEndz;
85 *pNearZ = mFogNearz;
86 *pFarZ = mFogFarz;
87 *pColor = mFogColor;
88 }
89
90 void GetZOffset(f32& rOffset, math::VEC3& rPos) const {
91 rOffset = mZOffset;
92 rPos = mZOffsetOrig;
93 }
94 void SetZOffset(f32 offset, const math::VEC3& rPos) {
95 mZOffset = offset;
96 mZOffsetOrig = rPos;
97 }
98
99 const GXColor& GetChanMatColor() const {
100 return mChanMatColor;
101 }
102 const GXColor& GetChanAmbColor() const {
103 return mChanAmbColor;
104 }
105};
106
107} // namespace ef
108} // namespace nw4r
109
110#endif