New Super Mario Bros. U Headers
Loading...
Searching...
No Matches
LightMapMgr.h
Go to the documentation of this file.
1#pragma once
2
3#include <graphics/RenderObj.h>
4
5#include <container/seadSafeArray.h>
6#include <framework/seadCalculateTask.h>
7#include <framework/seadTaskMgr.h>
8#include <gfx/seadCamera.h>
9#include <gfx/seadProjection.h>
10#include <layer/aglDrawMethod.h>
11#include <lighting/aglLightMapMgr.h>
12
13#include <nw/g3d/res/g3d_ResTexture.h>
14
15class ModelG3d;
16
17// vtbl Address: 0x100BBA94
19{
20 // setInstance_() Address: 0x024E3A78
21 // deleteInstance() Address: Deleted
22 // sInstance Address: 0x101D2C60
23 // SingletonDisposer_::~SingletonDisposer_() Address: 0x024E3990
25
26public:
27 static const s32 cLightMapNum = 2;
28
40 static_assert(cEnvTypeCourse_Num == 7);
41
59 static_assert(cEnvTypeCourseSelect_Num == 13);
60
62
64 static const s32 cHemisphereLightNum = cLightMapHemisphereLightNum;
65
69 static const s32 cLightMapDirectionalLightNum = 4; // max(cLightMapDirectionalLightNumMain, cLightMapDirectionalLightNumCourse, cLightMapDirectionalLightNumCourseSelect)
70
71 static const s32 cDirectionalLightNumMain = cLightMapDirectionalLightNumMain;
72 static const s32 cDirectionalLightNumCourse = cEnvTypeCourse_Num * cLightMapDirectionalLightNumCourse;
73 static const s32 cDirectionalLightNumCourseSelect = cEnvTypeCourseSelect_Num * cLightMapDirectionalLightNumCourseSelect;
74 static const s32 cDirectionalLightNumAll = cDirectionalLightNumMain + cDirectionalLightNumCourse + cDirectionalLightNumCourseSelect;
75
91 static_assert(cAmbColorType_Num == 11);
92
100 static_assert(cRenderStep_Num == 3);
101
102private:
103 class CalcObj : public RenderObjBase
104 {
105 public:
107
108 private:
110
111 friend class LightMapMgr;
112 };
113 static_assert(sizeof(CalcObj) == 8);
114
123 static_assert(cView_Num == 4);
124
125public:
126 // Address: 0x024E3A98
127 LightMapMgr(const sead::TaskConstructArg& arg);
128 // Address: 0x024E39BC
129 virtual ~LightMapMgr();
130
131 agl::lght::LightMapMgr& getLightMapMgr() { return mLightMapMgr; }
132 const agl::lght::LightMapMgr& getLightMapMgr() const { return mLightMapMgr; }
133
135 void setOverrideModelLightMap(bool enable) { mOverrideModelLightMap = enable; }
136
137 // Address: 0x024E4398
139 // Address: 0x024E4E30
141 // Address: 0x024E5008
143
144 // Address: 0x024E3DC0
145 void loadAglEnvBinary(void* data, s32 = -1);
146 // Address: 0x024E3EC0
147 void loadAglEnvBinary(const sead::SafeString& name, s32 = -1, sead::Heap* heap = nullptr);
148 // Address: 0x024E3F14
149 void loadAglEnvBinary(const sead::SafeString& name, sead::Heap* heap = nullptr);
150
151 // Address: 0x024E3FB0
153 const sead::Camera* camera, const sead::Projection* projection,
154 const sead::Camera* camera_drc = nullptr, const sead::Projection* projection_drc = nullptr
155 );
156 // Address: 0x024E3FFC
158
159 // Address: 0x024E4094
160 void loadAglLmapBinary(void* data);
161 // Address: 0x024E42D8
162 void loadAglLmapBinary(const sead::SafeString& name, sead::Heap* heap = nullptr);
163
164 // Address: 0x024E4318
165 void initialize(sead::Heap* heap = nullptr);
166
167 // Address: 0x024E5040
168 void setModelLightMap(ModelG3d* model, bool set_mdl_dl_dirty) const;
169
170 // Address: 0x024E51C0
171 void loadAglEnvBinaryWithType(const sead::SafeString& name, const sead::SafeString& type, sead::Heap* heap = nullptr);
172
173 // Address: 0x024E51C8
174 void initializeForCourseSelect(sead::Heap* heap = nullptr);
175 // Address: 0x024E53B4
177
178 // Address: 0x024E54E4
180 // Address: 0x024E5534
182
183 // Address: 0x024E5584
184 void getAmbColor(sead::Color4f* color, AmbColorType type) const;
185
186 // Address: 0x024E5900
187 void setCobModelLightMapForCourseSelect(ModelG3d* model, u8 world, u8 world_sub_letter) const;
188 // Address: 0x024E5A14
190
191 // Address: 0x024E5AF8
193
194private:
195 // Address: 0x024E3F20
197
198 // Address: 0x024E5734
199 void setModelLightMapWithName_(ModelG3d* model, const sead::SafeString& name, s32 idx_lghtmap, s32 model_light_map_index) const;
200
201 // Address: 0x024E5B0C
202 void draw_(const agl::lyr::RenderInfo& render_info, View view, bool view_dependent, const sead::Matrix34f* view_mtx, const sead::Projection* projection);
203
204 // Address: 0x024E5DB0
205 void drawMain_(const agl::lyr::RenderInfo& render_info);
206 // Address: 0x024E5DC4
207 void drawMainDRC_(const agl::lyr::RenderInfo& render_info);
208 // Address: 0x024E5DD8
209 void drawReflection_(const agl::lyr::RenderInfo& render_info);
210 // Address: 0x024E5F60
211 void drawReflectionDRC_(const agl::lyr::RenderInfo& render_info);
212
213private:
214 u32 _cc[4 / sizeof(u32)];
215 nw::g3d::res::ResTexture* mResTexture[cLightMapNumAll];
231 s32,
233 >,
237 s32,
240 const void* mAglEnvBinary1;
241 const void* mAglEnvBinary2;
243};
244static_assert(sizeof(LightMapMgr) == 0x52CC);
Definition LightMapMgr.h:104
agl::lght::LightMapMgr * mLightMapMgr
Definition LightMapMgr.h:109
void calc() override
Definition LightMapMgr.h:19
void initializeViewDependent_()
void setModelLightMapForCourseSelect(ModelG3d *model) const
const sead::Projection * mProjection
Definition LightMapMgr.h:226
AmbColorType
Definition LightMapMgr.h:77
@ cAmbColorType_Num
Definition LightMapMgr.h:89
@ cAmbColorType_WaterHalfBehindColor0
Definition LightMapMgr.h:87
@ cAmbColorType_WaterHalfFrontKonst1
Definition LightMapMgr.h:86
@ cAmbColorType_EffectColor15_0
Definition LightMapMgr.h:82
@ cAmbColorType_WaterHalfFrontKonst0
Definition LightMapMgr.h:85
@ cAmbColorType_WaterHalfFrontColor0
Definition LightMapMgr.h:84
@ cAmbColorType_EffectColor14_1
Definition LightMapMgr.h:81
@ cAmbColorType_WaterHalfBehindColor1
Definition LightMapMgr.h:88
@ cAmbColorType_EffectColor15_1
Definition LightMapMgr.h:83
@ cAmbColorType_EffectColor13_1
Definition LightMapMgr.h:79
@ cAmbColorType_EffectColor14_0
Definition LightMapMgr.h:80
@ cAmbColorType_EffectColor13_0
Definition LightMapMgr.h:78
void loadAglEnvBinaryWithType(const sead::SafeString &name, const sead::SafeString &type, sead::Heap *heap=nullptr)
void loadAglEnvBinary(const sead::SafeString &name, sead::Heap *heap=nullptr)
static const s32 cLightMapHemisphereLightNum
Definition LightMapMgr.h:63
const void * mAglEnvBinary2
Definition LightMapMgr.h:241
void loadAglLmapBinary(const sead::SafeString &name, sead::Heap *heap=nullptr)
static const s32 cLightMapNumAll
Definition LightMapMgr.h:61
const sead::Camera * mCameraDRC
Definition LightMapMgr.h:227
agl::lyr::DrawMethod mDrawMethodMain
Definition LightMapMgr.h:217
const sead::Projection * mProjectionDRC
Definition LightMapMgr.h:228
const agl::lght::LightMapMgr & getLightMapMgr() const
Definition LightMapMgr.h:132
void initialize(sead::Heap *heap=nullptr)
static const s32 cHemisphereLightNum
Definition LightMapMgr.h:64
RenderStep
Definition LightMapMgr.h:94
@ cRenderStep_CalcView
Definition LightMapMgr.h:95
@ cRenderStep_UpdateGPUBuffer
Definition LightMapMgr.h:96
@ cRenderStep_Num
Definition LightMapMgr.h:98
@ cRenderStep_LightDraw
Definition LightMapMgr.h:97
static const s32 cDirectionalLightNumCourse
Definition LightMapMgr.h:72
EnvTypeCourseSelect
Definition LightMapMgr.h:43
@ cEnvTypeCourseSelect_W6b
Definition LightMapMgr.h:52
@ cEnvTypeCourseSelect_W4a
Definition LightMapMgr.h:48
@ cEnvTypeCourseSelect_Num
Definition LightMapMgr.h:57
@ cEnvTypeCourseSelect_W8b
Definition LightMapMgr.h:55
@ cEnvTypeCourseSelect_W5b
Definition LightMapMgr.h:50
@ cEnvTypeCourseSelect_W1a
Definition LightMapMgr.h:44
@ cEnvTypeCourseSelect_W5a
Definition LightMapMgr.h:49
@ cEnvTypeCourseSelect_W2b
Definition LightMapMgr.h:46
@ cEnvTypeCourseSelect_W2a
Definition LightMapMgr.h:45
@ cEnvTypeCourseSelect_W7a
Definition LightMapMgr.h:53
@ cEnvTypeCourseSelect_W6a
Definition LightMapMgr.h:51
@ cEnvTypeCourseSelect_W9a
Definition LightMapMgr.h:56
@ cEnvTypeCourseSelect_W8a
Definition LightMapMgr.h:54
@ cEnvTypeCourseSelect_W3a
Definition LightMapMgr.h:47
agl::env::EnvObjMgr mEnvObjMgr
Definition LightMapMgr.h:223
void enter() override
bool mOverrideModelLightMap
Definition LightMapMgr.h:242
nw::g3d::res::ResTextureData mResTextureData[cLightMapNumAll]
Definition LightMapMgr.h:216
void initializeForCourseSelect(sead::Heap *heap=nullptr)
agl::lyr::DrawMethod mDrawMethodReflection
Definition LightMapMgr.h:219
View
Definition LightMapMgr.h:116
@ cView_Num
Definition LightMapMgr.h:121
@ cView_MainDRC
Definition LightMapMgr.h:118
@ cView_ReflectionDRC
Definition LightMapMgr.h:120
@ cView_Reflection
Definition LightMapMgr.h:119
@ cView_Main
Definition LightMapMgr.h:117
const void * mAglEnvBinary1
Definition LightMapMgr.h:240
void loadAglEnvBinary(void *data, s32=-1)
static const s32 cLightMapDirectionalLightNumCourse
Definition LightMapMgr.h:67
const sead::Camera * mCamera
Definition LightMapMgr.h:225
static const s32 cDirectionalLightNumAll
Definition LightMapMgr.h:74
void loadAglEnvBinary(const sead::SafeString &name, s32=-1, sead::Heap *heap=nullptr)
static const s32 cDirectionalLightNumMain
Definition LightMapMgr.h:71
LightMapMgr(const sead::TaskConstructArg &arg)
void initializeViewDependent(const sead::Camera *camera, const sead::Projection *projection, const sead::Camera *camera_drc=nullptr, const sead::Projection *projection_drc=nullptr)
const sead::SafeString & getEnvTypeCourseStr(EnvTypeCourse type) const
bool mIsViewDependent
Definition LightMapMgr.h:224
void drawMainDRC_(const agl::lyr::RenderInfo &render_info)
static const s32 cLightMapDirectionalLightNum
Definition LightMapMgr.h:69
void draw_(const agl::lyr::RenderInfo &render_info, View view, bool view_dependent, const sead::Matrix34f *view_mtx, const sead::Projection *projection)
void initializeViewIndependent()
sead::SafeArray< s32, cAmbColorType_Num > mAmbientLightTypeIndex
Definition LightMapMgr.h:239
nw::g3d::res::ResTexture * mResTexture[cLightMapNumAll]
Definition LightMapMgr.h:215
static const s32 cDirectionalLightNumCourseSelect
Definition LightMapMgr.h:73
void drawMain_(const agl::lyr::RenderInfo &render_info)
void loadAglEnvBinaryWithLerpForCourseSelect(f32 t)
u32 _cc[4/sizeof(u32)]
Definition LightMapMgr.h:214
CalcObj mCalcObj
Definition LightMapMgr.h:222
agl::lyr::DrawMethod mDrawMethodMainDRC
Definition LightMapMgr.h:218
static const s32 cLightMapDirectionalLightNumCourseSelect
Definition LightMapMgr.h:68
void calc() override
void drawReflectionDRC_(const agl::lyr::RenderInfo &render_info)
void drawReflection_(const agl::lyr::RenderInfo &render_info)
agl::lght::LightMapMgr mLightMapMgr
Definition LightMapMgr.h:221
void loadAglLmapBinary(void *data)
const agl::TextureSampler & getLightmap1(EnvTypeCourse type) const
virtual ~LightMapMgr()
void setOverrideModelLightMap(bool enable)
Definition LightMapMgr.h:135
const agl::TextureSampler & getLightmap2(EnvTypeCourse type) const
void setCobModelLightMapForCourseSelect(ModelG3d *model, u8 world, u8 world_sub_letter) const
void setModelLightMap(ModelG3d *model, bool set_mdl_dl_dirty) const
static const s32 cLightMapDirectionalLightNumMain
Definition LightMapMgr.h:66
agl::lyr::DrawMethod mDrawMethodReflectionDRC
Definition LightMapMgr.h:220
void getAmbColor(sead::Color4f *color, AmbColorType type) const
EnvTypeCourse
Definition LightMapMgr.h:30
@ cEnvTypeCourse_Enemy
Definition LightMapMgr.h:31
@ cEnvTypeCourse_Player
Definition LightMapMgr.h:35
@ cEnvTypeCourse_DistantView
Definition LightMapMgr.h:36
@ cEnvTypeCourse_Item
Definition LightMapMgr.h:34
@ cEnvTypeCourse_MapObj
Definition LightMapMgr.h:33
@ cEnvTypeCourse_Effect
Definition LightMapMgr.h:37
@ cEnvTypeCourse_Num
Definition LightMapMgr.h:38
@ cEnvTypeCourse_Boss
Definition LightMapMgr.h:32
void prepare() override
agl::lght::LightMapMgr & getLightMapMgr()
Definition LightMapMgr.h:131
bool overrideModelLightMap() const
Definition LightMapMgr.h:134
void setModelLightMapWithName_(ModelG3d *model, const sead::SafeString &name, s32 idx_lghtmap, s32 model_light_map_index) const
Definition ModelG3d.h:28