NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
g3d_reslightset.h
1#ifndef NW4R_G3D_RES_RES_LIGHT_SET_H
2#define NW4R_G3D_RES_RES_LIGHT_SET_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/g3d/g3d_state.h>
6#include <nw4r/g3d/res/g3d_resanmscn.h>
7#include <nw4r/g3d/res/g3d_rescommon.h>
8
9namespace nw4r {
10namespace g3d {
11
12// Forward declarations
13class ResAnmScn;
14
16 static const ulong INVALID_ID = 0xFFFF;
17
18 ulong size; // at 0x0
19 s32 toResAnmScnData; // at 0x4
20 s32 name; // at 0x8
21 ulong id; // at 0xC
22 ulong refNumber; // at 0x10
23 s32 ambLightName; // at 0x14
24 u16 ambLightId; // at 0x18
25 u8 numLight; // at 0x1A
26 u8 PADDING_0x1B[0x1C - 0x1B]; // at 0x1B
27 s32 lightNames[G3DState::NUM_LIGHT_IN_LIGHT_SET]; // at 0x1C
28 u16 lightId[G3DState::NUM_LIGHT_IN_LIGHT_SET]; // at 0x3C
29};
30
31class ResLightSet : public ResCommon<ResLightSetData> {
32public:
33 NW4R_G3D_RESOURCE_FUNC_DEF(ResLightSet);
34
35 bool Bind(const ResAnmScn scene);
36
37 bool HasAmbLight() const {
38 return ref().ambLightName != 0;
39 }
40
41 ResName GetAmbLightResName() const {
42 const ResLightSetData& r = ref();
43
44 if (r.ambLightName != 0) {
45 return NW4R_G3D_OFS_TO_RESNAME(&r, r.ambLightName);
46 }
47
48 return ResName(NULL);
49 }
50
51 ulong GetAmbLightID() const {
52 return ref().ambLightId;
53 }
54
55 ulong GetNumLight() const {
56 return ref().numLight;
57 }
58
59 bool IsAmbLightBound() const {
60 return !HasAmbLight() || GetAmbLightID() != ResLightSetData::INVALID_ID;
61 }
62
63 ResName GetLightResName(ulong idx) const {
64 const ResLightSetData& r = ref();
65
66 const s32* pNames = r.lightNames;
67 return NW4R_G3D_OFS_TO_RESNAME(pNames, pNames[idx]);
68 }
69};
70
71} // namespace g3d
72} // namespace nw4r
73
74#endif
3D graphics drawing library.
Definition g3d_3dsmax.h:10