mirror of
https://github.com/PrimeDecomp/prime.git
synced 2026-07-12 18:18:56 -07:00
* Update tool versions * Initial CMorphBall * Cleanup CMorphBall, link RMathUtils * Rematch a couple symbols * Fix _01 DolphinCGraphics .sdata size regression
100 lines
3.6 KiB
C++
100 lines
3.6 KiB
C++
#ifndef _CACTORLIGHTS
|
|
#define _CACTORLIGHTS
|
|
|
|
#include "types.h"
|
|
|
|
#include "MetroidPrime/TGameTypes.hpp"
|
|
|
|
#include "Kyoto/Graphics/CColor.hpp"
|
|
#include "Kyoto/Graphics/CLight.hpp"
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
|
|
|
#include "rstl/reserved_vector.hpp"
|
|
#include "rstl/vector.hpp"
|
|
|
|
class CGameArea;
|
|
class CStateManager;
|
|
class CAABox;
|
|
|
|
class CActorLights {
|
|
public:
|
|
static const float kDefaultPositionUpdateThreshold;
|
|
|
|
CActorLights(const uint areaUpdateFramePeriod, CVector3f lightingPositionOffset,
|
|
const int maxDynamicLights, const int maxAreaLights,
|
|
float positionUpdateThreshold = kDefaultPositionUpdateThreshold,
|
|
const bool ambientChannelOverflow = false, const bool useLightSet2 = false,
|
|
const bool disableWorldLights = false);
|
|
~CActorLights();
|
|
|
|
void BuildConstantAmbientLighting();
|
|
void BuildConstantAmbientLighting(const CColor&);
|
|
bool BuildAreaLightList(const CStateManager& mgr, const CGameArea& area, const CAABox& bounds);
|
|
void BuildDynamicLightList(const CStateManager& mgr, const CAABox& bounds);
|
|
void BuildFakeLightList(const rstl::vector< CLight >&, const CColor&);
|
|
void BuildFaceLightList(const CStateManager& mgr, const CGameArea& area, const CAABox& aabb);
|
|
|
|
void ActivateLights() const;
|
|
uint GetActiveLightCount() const;
|
|
|
|
bool GetNeedsRelight() const { return x298_24_dirty == TRUE; }
|
|
bool HasShadowLight() const { return x29c_shadowLightArrIdx != kInvalidShadowLightIndex; }
|
|
const TAreaId GetAreaLightIndexForShadowLight() const { return x29c_shadowLightArrIdx; }
|
|
uint GetShadowLightArrIndex() const { return x29c_shadowLightArrIdx; }
|
|
int GetShadowLightIndex() const { return x2a0_shadowLightIdx; }
|
|
const CVector3f& GetAmbientColor() const { return x288_ambientColor; }
|
|
|
|
void SetAmbientColor(const CColor& color);
|
|
void SetNeedsRelight(bool v) { x298_24_dirty = v; }
|
|
void SetCastShadows(bool v) { x298_25_castShadows = v; }
|
|
void SetFindShadowLight(bool v) { x298_27_findShadowLight = v; }
|
|
void SetShadowDynamicRangeThreshold(float t) { x2d0_shadowDynamicRangeThreshold = t; }
|
|
|
|
void SetMaxAreaLights(int n) {
|
|
x2b8_maxAreaLights = n;
|
|
x298_26_hasAreaLights = x2b8_maxAreaLights > 0;
|
|
}
|
|
void SetInArea(bool v) { x298_28_inArea = v; }
|
|
void SetMaxDynamicLights(int n) { x2bc_maxDynamicLights = n; }
|
|
void SetAmbienceGenerated(bool v) { x298_29_ambienceGenerated = v; }
|
|
void SetFindNearestDynamicLights(bool v) { x29a_findNearestDynamicLights = v; }
|
|
bool GetIsDirty() const { return x298_24_dirty; }
|
|
int GetMaxAreaLights() const { return x2b8_maxAreaLights; }
|
|
|
|
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;
|
|
uint x29c_shadowLightArrIdx;
|
|
int x2a0_shadowLightIdx;
|
|
uint x2a4_lastUpdateFrame;
|
|
uint x2a8_areaUpdateFramePeriod;
|
|
CVector3f x2ac_lightingPositionOffset;
|
|
int x2b8_maxAreaLights;
|
|
int x2bc_maxDynamicLights;
|
|
CVector3f x2c0_lastActorPos;
|
|
float x2cc_actorPositionDeltaUpdateThreshold;
|
|
float x2d0_shadowDynamicRangeThreshold;
|
|
float x2d4_worldLightingLevel;
|
|
int x2d8_brightLightIdx;
|
|
uint x2dc_brightLightLag;
|
|
|
|
static int kInvalidShadowLightIndex;
|
|
};
|
|
CHECK_SIZEOF(CActorLights, 0x2e0)
|
|
|
|
#endif // _CACTORLIGHTS
|