NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
g3d_fog.h
1#ifndef NW4R_G3D_FOG_H
2#define NW4R_G3D_FOG_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/g3d/res/g3d_rescommon.h>
6
7#include <nw4r/math.h>
8#include <nw4r/ut.h>
9
10#include <revolution/GX.h>
11
12namespace nw4r {
13namespace g3d {
14
15struct FogData {
16 GXFogType type; // at 0x0
17 f32 startz; // at 0x4
18 f32 endz; // at 0x8
19 f32 nearz; // at 0xC
20 f32 farz; // at 0x10
21 GXColor color; // at 0x14
22 GXBool adjEnable; // at 0x18
23 u8 PADDING_0x19; // at 0x19
24 u16 adjCenter; // at 0x1A
25 GXFogAdjTable adjTable; // at 0x1C
26};
27
28class Fog : public ResCommon<FogData> {
29public:
30 explicit Fog(FogData* pData);
31
32 void Init();
33 Fog CopyTo(void* pDst) const;
34
35 void SetFogRangeAdjParam(u16 width, u16 center,
36 const math::MTX44& rProjMtx);
37 void SetGP() const;
38
39 void SetFogType(GXFogType type) {
40 if (!IsValid()) {
41 return;
42 }
43
44 ref().type = type;
45 }
46
47 void SetZ(f32 startZ, f32 endZ) {
48 if (!IsValid()) {
49 return;
50 }
51
52 FogData& r = ref();
53
54 r.startz = startZ;
55 r.endz = endZ;
56 }
57
58 void SetNearFar(f32 nearZ, f32 farZ) {
59 if (!IsValid()) {
60 return;
61 }
62
63 FogData& r = ref();
64
65 r.nearz = nearZ;
66 r.farz = farZ;
67 }
68
69 void SetFogColor(GXColor color) {
70 if (!IsValid()) {
71 return;
72 }
73
74 ref().color = color;
75 }
76
77 bool IsFogRangeAdjEnable() const {
78 return IsValid() && ref().adjEnable == TRUE;
79 }
80};
81
82} // namespace g3d
83} // namespace nw4r
84
85#endif
3D graphics drawing library.
Definition g3d_3dsmax.h:10