2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CACTORLIGHTS
|
|
|
|
#define _CACTORLIGHTS
|
2022-08-13 01:26:00 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-08-16 02:14:28 +00:00
|
|
|
#include "MetroidPrime/TGameTypes.hpp"
|
|
|
|
|
|
|
|
#include "Kyoto/Graphics/CColor.hpp"
|
2022-10-06 08:40:00 +00:00
|
|
|
#include "Kyoto/Graphics/CLight.hpp"
|
2022-08-16 02:14:28 +00:00
|
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
|
|
|
|
|
|
|
#include "rstl/reserved_vector.hpp"
|
|
|
|
|
|
|
|
class CGameArea;
|
2022-10-05 22:55:57 +00:00
|
|
|
class CStateManager;
|
|
|
|
class CAABox;
|
2022-08-16 02:14:28 +00:00
|
|
|
|
2022-08-13 01:26:00 +00:00
|
|
|
class CActorLights {
|
|
|
|
public:
|
2022-10-09 05:13:17 +00:00
|
|
|
CActorLights(uint areaUpdateFramePeriod, const CVector3f& actorPosBias, int maxDynamicLights,
|
|
|
|
int maxAreaLights, bool ambientChannelOverflow, bool layer2, bool disableWorldLights,
|
|
|
|
float positionUpdateThreshold);
|
2022-08-13 01:26:00 +00:00
|
|
|
~CActorLights();
|
2022-08-16 02:14:28 +00:00
|
|
|
|
|
|
|
void BuildConstantAmbientLighting();
|
2022-10-06 11:37:57 +00:00
|
|
|
void BuildConstantAmbientLighting(const CColor&);
|
2022-08-16 02:14:28 +00:00
|
|
|
bool BuildAreaLightList(const CStateManager& mgr, const CGameArea& area, const CAABox& bounds);
|
|
|
|
void BuildDynamicLightList(const CStateManager& mgr, const CAABox& bounds);
|
|
|
|
|
2022-09-13 04:26:54 +00:00
|
|
|
bool GetNeedsRelight() const { return x298_24_dirty == TRUE; }
|
2022-10-06 11:37:57 +00:00
|
|
|
bool HasShadowLight() const { return x29c_shadowLightArrIdx != -1; }
|
2022-10-09 05:37:23 +00:00
|
|
|
int GetShadowLightIndex() const { return x2a0_shadowLightIdx; }
|
2022-10-06 11:37:57 +00:00
|
|
|
|
2022-11-03 23:54:33 +00:00
|
|
|
void SetAmbientColor(const CColor& color);
|
|
|
|
void SetCastShadows(bool v) { x298_25_castShadows = v; }
|
2022-10-06 11:37:57 +00:00
|
|
|
void SetFindShadowLight(bool v) { x298_27_findShadowLight = v; }
|
|
|
|
void SetShadowDynamicRangeThreshold(float t) { x2d0_shadowDynamicRangeThreshold = t; }
|
2022-08-16 02:14:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
rstl::reserved_vector< CLight, 4 > x0_areaLights;
|
|
|
|
rstl::reserved_vector< CLight, 4 > x144_dynamicLights;
|
|
|
|
CVector3f x288_ambientColor;
|
|
|
|
TAreaId x294_aid;
|
|
|
|
bool x298_24_dirty : 1;
|
|
|
|
bool x298_25_castShadows : 1;
|
|
|
|
bool x298_26_hasAreaLights : 1;
|
|
|
|
bool x298_27_findShadowLight : 1;
|
|
|
|
bool x298_28_inArea : 1;
|
|
|
|
bool x298_29_ambienceGenerated : 1;
|
|
|
|
bool x298_30_layer2 : 1;
|
|
|
|
bool x298_31_disableWorldLights : 1;
|
|
|
|
bool x299_24_inBrightLight : 1;
|
|
|
|
bool x299_25_useBrightLightLag : 1;
|
|
|
|
bool x299_26_ambientOnly : 1;
|
|
|
|
bool x29a_findNearestDynamicLights;
|
2022-09-05 04:01:13 +00:00
|
|
|
int x29c_shadowLightArrIdx;
|
|
|
|
int x2a0_shadowLightIdx;
|
|
|
|
uint x2a4_lastUpdateFrame;
|
|
|
|
uint x2a8_areaUpdateFramePeriod;
|
2022-08-16 02:14:28 +00:00
|
|
|
CVector3f x2ac_actorPosBias;
|
2022-09-05 04:01:13 +00:00
|
|
|
int x2b8_maxAreaLights;
|
|
|
|
int x2bc_maxDynamicLights;
|
2022-08-16 02:14:28 +00:00
|
|
|
CVector3f x2c0_lastActorPos;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x2cc_actorPositionDeltaUpdateThreshold;
|
|
|
|
float x2d0_shadowDynamicRangeThreshold;
|
|
|
|
float x2d4_worldLightingLevel;
|
2022-09-05 04:01:13 +00:00
|
|
|
int x2d8_brightLightIdx;
|
|
|
|
uint x2dc_brightLightLag;
|
2022-08-13 01:26:00 +00:00
|
|
|
};
|
2022-08-16 02:14:28 +00:00
|
|
|
CHECK_SIZEOF(CActorLights, 0x2e0)
|
2022-08-13 01:26:00 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CACTORLIGHTS
|