CActorParameters 99%

Former-commit-id: 752c4e9c39
This commit is contained in:
Luke Street 2022-11-03 23:46:49 -04:00
parent 45846dcb58
commit dc04591f0d
17 changed files with 97 additions and 89 deletions

View File

@ -1188,7 +1188,7 @@ SetCalculateLighting__6CActorFb:
/* 8005399C 000508FC 39 40 00 00 */ li r10, 0
/* 800539A0 00050900 91 61 00 0C */ stw r11, 0xc(r1)
/* 800539A4 00050904 90 01 00 10 */ stw r0, 0x10(r1)
/* 800539A8 00050908 48 0B 18 25 */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 800539A8 00050908 48 0B 18 25 */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 800539AC 0005090C 7C 7F 1B 78 */ mr r31, r3
lbl_800539B0:
/* 800539B0 00050910 80 7D 00 90 */ lwz r3, 0x90(r29)

View File

@ -2485,8 +2485,8 @@ lbl_801051B4:
/* 801051C4 00102124 38 21 00 10 */ addi r1, r1, 0x10
/* 801051C8 00102128 4E 80 00 20 */ blr
.global __ct__12CActorLightsFUiRC9CVector3fiibbbf
__ct__12CActorLightsFUiRC9CVector3fiibbbf:
.global __ct__12CActorLightsFUi9CVector3fiifbbb
__ct__12CActorLightsFUi9CVector3fiifbbb:
/* 801051CC 0010212C 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 801051D0 00102130 3D 60 80 5A */ lis r11, sZeroVector__9CVector3f@ha
/* 801051D4 00102134 55 40 06 3F */ clrlwi. r0, r10, 0x18

View File

@ -91,7 +91,7 @@ MakeActorLights__16CLightParametersCFv:
/* 801064B4 00103414 38 A1 00 18 */ addi r5, r1, 0x18
/* 801064B8 00103418 55 29 D9 7E */ srwi r9, r9, 5
/* 801064BC 0010341C 54 0A D9 7E */ srwi r10, r0, 5
/* 801064C0 00103420 4B FF ED 0D */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 801064C0 00103420 4B FF ED 0D */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 801064C4 00103424 7C 7D 1B 78 */ mr r29, r3
lbl_801064C8:
/* 801064C8 00103428 7C 1D 00 D0 */ neg r0, r29

View File

@ -943,7 +943,7 @@ __ct__13CArtifactDollFv:
/* 8029D570 0029A4D0 39 40 00 00 */ li r10, 0
/* 8029D574 0029A4D4 91 61 00 24 */ stw r11, 0x24(r1)
/* 8029D578 0029A4D8 90 01 00 28 */ stw r0, 0x28(r1)
/* 8029D57C 0029A4DC 4B E6 7C 51 */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 8029D57C 0029A4DC 4B E6 7C 51 */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 8029D580 0029A4E0 7C 60 1B 78 */ mr r0, r3
lbl_8029D584:
/* 8029D584 0029A4E4 90 1F 00 20 */ stw r0, 0x20(r31)

View File

@ -442,7 +442,7 @@ __ct__13CGameCubeDollFv:
/* 8029EC88 0029BBE8 39 40 00 00 */ li r10, 0
/* 8029EC8C 0029BBEC 91 61 00 1C */ stw r11, 0x1c(r1)
/* 8029EC90 0029BBF0 90 01 00 20 */ stw r0, 0x20(r1)
/* 8029EC94 0029BBF4 4B E6 65 39 */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 8029EC94 0029BBF4 4B E6 65 39 */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 8029EC98 0029BBF8 7C 60 1B 78 */ mr r0, r3
lbl_8029EC9C:
/* 8029EC9C 0029BBFC 90 1F 00 18 */ stw r0, 0x18(r31)

View File

@ -4338,7 +4338,7 @@ lbl_800DE350:
/* 800DE418 000DB378 39 40 00 00 */ li r10, 0
/* 800DE41C 000DB37C 91 61 00 8C */ stw r11, 0x8c(r1)
/* 800DE420 000DB380 90 01 00 90 */ stw r0, 0x90(r1)
/* 800DE424 000DB384 48 02 6D A9 */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 800DE424 000DB384 48 02 6D A9 */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 800DE428 000DB388 7C 60 1B 78 */ mr r0, r3
lbl_800DE42C:
/* 800DE42C 000DB38C 90 1F 02 4C */ stw r0, 0x24c(r31)

View File

@ -1472,7 +1472,7 @@ DrawAllModels__18CWorldTransManagerCFv:
/* 8020A224 00207184 91 01 00 40 */ stw r8, 0x40(r1)
/* 8020A228 00207188 39 00 00 00 */ li r8, 0
/* 8020A22C 0020718C 90 01 00 44 */ stw r0, 0x44(r1)
/* 8020A230 00207190 4B EF AF 9D */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 8020A230 00207190 4B EF AF 9D */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 8020A234 00207194 C0 22 B1 80 */ lfs f1, lbl_805ACEA0@sda21(r2)
/* 8020A238 00207198 38 61 00 08 */ addi r3, r1, 8
/* 8020A23C 0020719C C0 82 B1 30 */ lfs f4, lbl_805ACE50@sda21(r2)

View File

@ -2819,7 +2819,7 @@ SoftwareLight__17CWallCrawlerSwarmCFRC13CStateManagerRC6CAABox:
/* 801E9BE4 001E6B44 90 01 00 44 */ stw r0, 0x44(r1)
/* 801E9BE8 001E6B48 39 20 00 00 */ li r9, 0
/* 801E9BEC 001E6B4C 39 40 00 00 */ li r10, 0
/* 801E9BF0 001E6B50 4B F1 B5 DD */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 801E9BF0 001E6B50 4B F1 B5 DD */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 801E9BF4 001E6B54 88 01 02 E0 */ lbz r0, 0x2e0(r1)
/* 801E9BF8 001E6B58 38 60 00 01 */ li r3, 1
/* 801E9BFC 001E6B5C 50 60 3E 30 */ rlwimi r0, r3, 7, 0x18, 0x18
@ -2967,7 +2967,7 @@ HardwareLight__17CWallCrawlerSwarmCFRC13CStateManagerRC6CAABox:
/* 801E9E18 001E6D78 90 E1 00 14 */ stw r7, 0x14(r1)
/* 801E9E1C 001E6D7C 38 E0 00 04 */ li r7, 4
/* 801E9E20 001E6D80 90 01 00 18 */ stw r0, 0x18(r1)
/* 801E9E24 001E6D84 4B F1 B3 A9 */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 801E9E24 001E6D84 4B F1 B3 A9 */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 801E9E28 001E6D88 88 01 02 B4 */ lbz r0, 0x2b4(r1)
/* 801E9E2C 001E6D8C 38 60 00 01 */ li r3, 1
/* 801E9E30 001E6D90 50 60 3E 30 */ rlwimi r0, r3, 7, 0x18, 0x18

View File

@ -7617,7 +7617,7 @@ __ct__9CSamusHudFRC13CStateManager:
/* 8006ABDC 00067B3C 39 40 00 00 */ li r10, 0
/* 8006ABE0 00067B40 91 61 00 38 */ stw r11, 0x38(r1)
/* 8006ABE4 00067B44 90 01 00 3C */ stw r0, 0x3c(r1)
/* 8006ABE8 00067B48 48 09 A5 E5 */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 8006ABE8 00067B48 48 09 A5 E5 */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 8006ABEC 00067B4C 7C 60 1B 78 */ mr r0, r3
lbl_8006ABF0:
/* 8006ABF0 00067B50 90 1F 03 3C */ stw r0, 0x33c(r31)

View File

@ -14641,7 +14641,7 @@ lbl_800F9EAC:
/* 800F9F04 000F6E64 39 40 00 00 */ li r10, 0
/* 800F9F08 000F6E68 91 61 00 E4 */ stw r11, 0xe4(r1)
/* 800F9F0C 000F6E6C 90 01 00 E8 */ stw r0, 0xe8(r1)
/* 800F9F10 000F6E70 48 00 B2 BD */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 800F9F10 000F6E70 48 00 B2 BD */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 800F9F14 000F6E74 7C 60 1B 78 */ mr r0, r3
lbl_800F9F18:
/* 800F9F18 000F6E78 3C 60 80 3D */ lis r3, lbl_803CEBF4@ha

View File

@ -10201,7 +10201,7 @@ __ct__10CPlayerGunF9TUniqueId:
/* 80043218 00040178 90 E1 00 5C */ stw r7, 0x5c(r1)
/* 8004321C 0004017C 38 E0 00 04 */ li r7, 4
/* 80043220 00040180 90 01 00 60 */ stw r0, 0x60(r1)
/* 80043224 00040184 48 0C 1F A9 */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 80043224 00040184 48 0C 1F A9 */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 80043228 00040188 38 E0 00 00 */ li r7, 0
/* 8004322C 0004018C 38 C0 00 01 */ li r6, 1
/* 80043230 00040190 90 FF 02 E0 */ stw r7, 0x2e0(r31)

View File

@ -651,7 +651,7 @@ __ct__20CSamusFaceReflectionFRC13CStateManager:
/* 8015B724 00158684 39 40 00 00 */ li r10, 0
/* 8015B728 00158688 91 61 00 0C */ stw r11, 0xc(r1)
/* 8015B72C 0015868C 90 01 00 10 */ stw r0, 0x10(r1)
/* 8015B730 00158690 4B FA 9A 9D */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 8015B730 00158690 4B FA 9A 9D */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 8015B734 00158694 7C 60 1B 78 */ mr r0, r3
lbl_8015B738:
/* 8015B738 00158698 3C 60 80 5A */ lis r3, sNoRotation__11CQuaternion@ha

View File

@ -644,7 +644,7 @@ __ct__Q220CIceAttackProjectile12CTrailObjectFP11CElementGen9TUniqueIdRC9CVector3
/* 801F226C 001EF1CC 91 81 00 14 */ stw r12, 0x14(r1)
/* 801F2270 001EF1D0 91 61 00 18 */ stw r11, 0x18(r1)
/* 801F2274 001EF1D4 90 01 00 1C */ stw r0, 0x1c(r1)
/* 801F2278 001EF1D8 4B F1 2F 55 */ bl __ct__12CActorLightsFUiRC9CVector3fiibbbf
/* 801F2278 001EF1D8 4B F1 2F 55 */ bl __ct__12CActorLightsFUi9CVector3fiifbbb
/* 801F227C 001EF1DC C0 1D 00 00 */ lfs f0, 0(r29)
/* 801F2280 001EF1E0 38 00 00 00 */ li r0, 0
/* 801F2284 001EF1E4 7F 83 E3 78 */ mr r3, r28

View File

@ -17,9 +17,9 @@ class CAABox;
class CActorLights {
public:
CActorLights(uint areaUpdateFramePeriod, const CVector3f& actorPosBias, int maxDynamicLights,
int maxAreaLights, bool ambientChannelOverflow, bool layer2, bool disableWorldLights,
float positionUpdateThreshold);
CActorLights(uint areaUpdateFramePeriod, CVector3f lightingPositionOffset, int maxDynamicLights,
int maxAreaLights, float positionUpdateThreshold, bool ambientChannelOverflow,
bool useLightSet2, bool disableWorldLights);
~CActorLights();
void BuildConstantAmbientLighting();
@ -57,7 +57,7 @@ private:
int x2a0_shadowLightIdx;
uint x2a4_lastUpdateFrame;
uint x2a8_areaUpdateFramePeriod;
CVector3f x2ac_actorPosBias;
CVector3f x2ac_lightingPositionOffset;
int x2b8_maxAreaLights;
int x2bc_maxDynamicLights;
CVector3f x2c0_lastActorPos;

View File

@ -27,21 +27,27 @@ public:
};
enum ELightRecalculationOptions {
kLR_LargeFrameCount,
kLR_Never,
kLR_EightFrames,
kLR_FourFrames,
kLR_OneFrame,
};
CLightParameters();
CLightParameters(bool, float, EShadowTessellation, float, float, const CColor&, bool,
EWorldLightingOptions, ELightRecalculationOptions, const CVector3f&, int, int,
bool, int);
CLightParameters(bool castShadow, float shadowScale,
CLightParameters::EShadowTessellation shadowTess, float shadowAlpha,
float maxShadowHeight, const CColor& ambientColor, bool makeLights,
CLightParameters::EWorldLightingOptions useWorldLighting,
CLightParameters::ELightRecalculationOptions lightRecalcOpts,
const CVector3f& lightingPositionOffset, int maxDynamicLights, int maxAreaLights,
bool ambChannelOverflow, int useLightSet);
virtual ~CLightParameters();
const CColor& GetAmbientColor() const { return x18_noLightsAmbient; }
const CColor& GetAmbientColor() const { return x18_ambientColor; }
bool ShouldMakeLights() const { return x1c_makeLights; }
CVector3f GetActorPosBias() const { return x2c_actorPosBias; }
bool GetAmbientChannelOverflow() const { return x1d_ambientChannelOverflow; }
const CVector3f& GetLightingPositionOffset() const { return x2c_lightingPositionOffset; }
int GetMaxDynamicLights() const { return x38_maxDynamicLights; }
int GetMaxAreaLights() const { return x3c_maxAreaLights; }
static CLightParameters None();
@ -55,13 +61,13 @@ private:
EShadowTessellation xc_shadowTesselation;
float x10_shadowAlpha;
float x14_maxShadowHeight;
CColor x18_noLightsAmbient;
CColor x18_ambientColor;
bool x1c_makeLights;
bool x1d_ambientChannelOverflow;
EWorldLightingOptions x20_worldLightingOptions;
ELightRecalculationOptions x24_lightRecalcOpts;
int x28_layerIdx;
CVector3f x2c_actorPosBias;
EWorldLightingOptions x20_useWorldLighting;
ELightRecalculationOptions x24_lightRecalculation;
int x28_useLightSet;
CVector3f x2c_lightingPositionOffset;
int x38_maxDynamicLights;
int x3c_maxAreaLights;
};
@ -81,7 +87,6 @@ CHECK_SIZEOF(CScannableParameters, 0x4)
class CVisorParameters {
public:
CVisorParameters() : x0_mask(0xf), x0_4_b1(false), x0_5_scanPassthrough(false) {}
CVisorParameters(uchar mask, bool b1, bool scanPassthrough)
: x0_mask(mask), x0_4_b1(b1), x0_5_scanPassthrough(scanPassthrough) {}
@ -90,7 +95,7 @@ public:
bool GetBool1() const { return x0_4_b1; }
bool GetScanPassthrough() const { return x0_5_scanPassthrough; }
static CVisorParameters None();
static CVisorParameters None() { return CVisorParameters(0xF, false, false); }
private:
uint x0_mask : 4;
@ -114,15 +119,15 @@ public:
CActorParameters HotInThermal(bool hot) const;
CActorParameters MakeDamageableTriggerActorParms(const CVisorParameters& visorParam) const;
const CLightParameters& GetLighting() const { return x0_lightParams; }
const CScannableParameters& GetScannable() const { return x40_scanParams; }
const CLightParameters& GetLighting() const { return x0_lighting; }
const CScannableParameters& GetScannable() const { return x40_scannable; }
const rstl::pair< CAssetId, CAssetId >& GetXRay() const { return x44_xrayAssets; }
const rstl::pair< CAssetId, CAssetId >& GetInfra() const { return x4c_thermalAssets; }
const CVisorParameters& GetVisorParameters() const { return x54_visorParams; }
const CVisorParameters& GetVisorParameters() const { return x54_visor; }
float GetThermalMag() const { return x64_thermalMag; }
bool GetUseGlobalRenderTime() const { return x58_24_globalTimeProvider; }
bool UseGlobalRenderTime() const { return x58_24_useGlobalRenderTime; }
bool IsHotInThermal() const { return x58_25_thermalHeat; }
bool ForceRenderUnsorted() const { return x58_26_renderUnsorted; }
bool ForceRenderUnsorted() const { return x58_26_forceRenderUnsorted; }
bool NoSortThermal() const { return x58_27_noSortThermal; }
float GetFadeInTime() const { return x5c_fadeInTime; }
float GetFadeOutTime() const { return x60_fadeOutTime; }
@ -130,15 +135,15 @@ public:
static CActorParameters None();
private:
CLightParameters x0_lightParams;
CScannableParameters x40_scanParams;
CLightParameters x0_lighting;
CScannableParameters x40_scannable;
rstl::pair< CAssetId, CAssetId > x44_xrayAssets;
rstl::pair< CAssetId, CAssetId > x4c_thermalAssets;
CVisorParameters x54_visorParams;
bool x58_24_globalTimeProvider : 1;
bool x58_25_thermalHeat : 1;
bool x58_26_renderUnsorted : 1;
bool x58_27_noSortThermal : 1;
CVisorParameters x54_visor;
uchar x58_24_useGlobalRenderTime : 1;
uchar x58_25_thermalHeat : 1;
uchar x58_26_forceRenderUnsorted : 1;
uchar x58_27_noSortThermal : 1;
float x5c_fadeInTime;
float x60_fadeOutTime;
float x64_thermalMag;

View File

@ -68,7 +68,7 @@ CActor::CActor(TUniqueId uid, bool active, const rstl::string& name, const CEnti
, xe5_26_muted(false)
, xe5_27_useInSortedLists(true)
, xe5_28_callTouch(true)
, xe5_29_globalTimeProvider(params.GetUseGlobalRenderTime())
, xe5_29_globalTimeProvider(params.UseGlobalRenderTime())
, xe5_30_renderUnsorted(params.ForceRenderUnsorted())
, xe5_31_pointGeneratorParticles(false)
, xe6_24_fluidCounter(0)

View File

@ -3,38 +3,41 @@
#include "MetroidPrime/CActorLights.hpp"
CActorParameters::CActorParameters()
: x0_lightParams(CLightParameters::None())
, x40_scanParams(kInvalidAssetId)
: x0_lighting(CLightParameters::None())
, x40_scannable(kInvalidAssetId)
, x44_xrayAssets(0, 0)
, x4c_thermalAssets(0, 0)
, x54_visorParams()
, x58_24_globalTimeProvider(true)
, x54_visor(CVisorParameters::None())
, x58_24_useGlobalRenderTime(true)
, x58_25_thermalHeat(false)
, x58_27_noSortThermal(false)
, x5c_fadeInTime(0.f)
, x60_fadeOutTime(0.f)
, x64_thermalMag(0.f) {}
CActorParameters::CActorParameters(const CLightParameters& lightParms, const CScannableParameters& scanParms,
const rstl::pair<CAssetId, CAssetId>& xrayAssets, const rstl::pair<CAssetId, CAssetId>& thermalAssets,
const CVisorParameters& visorParms, bool globalTimeProvider, bool thermalHeat, bool renderUnsorted,
bool noSortThermal, float fadeInTime, float fadeOutTime, float thermalMag)
: x0_lightParams(lightParms)
, x40_scanParams(scanParms)
, x44_xrayAssets(xrayAssets)
, x4c_thermalAssets(thermalAssets)
, x54_visorParams(visorParms)
, x58_24_globalTimeProvider(globalTimeProvider)
, x58_25_thermalHeat(thermalHeat)
, x58_26_renderUnsorted(renderUnsorted)
, x58_27_noSortThermal(noSortThermal)
, x5c_fadeInTime(fadeInTime)
, x60_fadeOutTime(fadeOutTime)
, x64_thermalMag(thermalMag) {}
CActorParameters::CActorParameters(const CLightParameters& lightParms,
const CScannableParameters& scanParms,
const rstl::pair< CAssetId, CAssetId >& xrayAssets,
const rstl::pair< CAssetId, CAssetId >& thermalAssets,
const CVisorParameters& visorParms, bool globalTimeProvider,
bool thermalHeat, bool renderUnsorted, bool noSortThermal,
float fadeInTime, float fadeOutTime, float thermalMag)
: x0_lighting(lightParms)
, x40_scannable(scanParms)
, x44_xrayAssets(xrayAssets)
, x4c_thermalAssets(thermalAssets)
, x54_visor(visorParms)
, x58_24_useGlobalRenderTime(globalTimeProvider)
, x58_25_thermalHeat(thermalHeat)
, x58_26_forceRenderUnsorted(renderUnsorted)
, x58_27_noSortThermal(noSortThermal)
, x5c_fadeInTime(fadeInTime)
, x60_fadeOutTime(fadeOutTime)
, x64_thermalMag(thermalMag) {}
CActorParameters CActorParameters::Scannable(const CScannableParameters& sParms) const {
CActorParameters result(*this);
result.x40_scanParams = sParms;
result.x40_scannable = sParms;
return result;
}
@ -47,30 +50,30 @@ CActorParameters CActorParameters::HotInThermal(bool hot) const {
CActorParameters
CActorParameters::MakeDamageableTriggerActorParms(const CVisorParameters& visorParam) const {
CActorParameters result(*this);
result.x54_visorParams = visorParam;
result.x54_visor = visorParam;
return result;
}
CLightParameters::CLightParameters(bool castShadow, float shadowScale,
CLightParameters::EShadowTessellation shadowTess,
float shadowAlpha, float maxShadowHeight,
const CColor& noLightsAmbient, bool makeLights,
CLightParameters::EWorldLightingOptions lightingOpts,
CLightParameters::ELightRecalculationOptions lightRecalcOpts,
const CVector3f& actorPosBias, int maxDynamicLights,
int maxAreaLights, bool ambChannelOverflow, int layerIdx)
const CColor& ambientColor, bool makeLights,
CLightParameters::EWorldLightingOptions useWorldLighting,
CLightParameters::ELightRecalculationOptions lightRecalculation,
const CVector3f& lightingPositionOffset, int maxDynamicLights,
int maxAreaLights, bool ambChannelOverflow, int useLightSet)
: x4_castShadow(castShadow)
, x8_shadowScale(shadowScale)
, xc_shadowTesselation(shadowTess)
, x10_shadowAlpha(shadowAlpha)
, x14_maxShadowHeight(maxShadowHeight)
, x18_noLightsAmbient(noLightsAmbient)
, x18_ambientColor(ambientColor)
, x1c_makeLights(makeLights)
, x1d_ambientChannelOverflow(ambChannelOverflow)
, x20_worldLightingOptions(lightingOpts)
, x24_lightRecalcOpts(lightRecalcOpts)
, x28_layerIdx(layerIdx)
, x2c_actorPosBias(actorPosBias)
, x20_useWorldLighting(useWorldLighting)
, x24_lightRecalculation(lightRecalculation)
, x28_useLightSet(useLightSet)
, x2c_lightingPositionOffset(lightingPositionOffset)
, x38_maxDynamicLights(maxDynamicLights)
, x3c_maxAreaLights(maxAreaLights) {
if (x38_maxDynamicLights > 4 || x38_maxDynamicLights == -1)
@ -85,13 +88,13 @@ CLightParameters::CLightParameters()
, xc_shadowTesselation(kST_Zero)
, x10_shadowAlpha(0.f)
, x14_maxShadowHeight(0.f)
, x18_noLightsAmbient(CColor::White())
, x18_ambientColor(CColor::White())
, x1c_makeLights(false)
, x1d_ambientChannelOverflow(false)
, x20_worldLightingOptions(kLO_Zero)
, x24_lightRecalcOpts(kLR_EightFrames)
, x28_layerIdx(0)
, x2c_actorPosBias(CVector3f::Zero())
, x20_useWorldLighting(kLO_Zero)
, x24_lightRecalculation(kLR_EightFrames)
, x28_useLightSet(0)
, x2c_lightingPositionOffset(CVector3f::Zero())
, x38_maxDynamicLights(4)
, x3c_maxAreaLights(4) {}
@ -99,7 +102,7 @@ CLightParameters::~CLightParameters() {}
uint CLightParameters::GetFramesBetweenRecalculation(ELightRecalculationOptions opts) {
switch (opts) {
case kLR_LargeFrameCount:
case kLR_Never:
return 0x3FFFFFFF;
case kLR_EightFrames:
return 8;
@ -115,15 +118,15 @@ uint CLightParameters::GetFramesBetweenRecalculation(ELightRecalculationOptions
rstl::auto_ptr< CActorLights > CLightParameters::MakeActorLights() const {
rstl::auto_ptr< CActorLights > result;
if (x1c_makeLights) {
result =
new CActorLights(GetFramesBetweenRecalculation(x24_lightRecalcOpts), GetActorPosBias(),
x38_maxDynamicLights, x3c_maxAreaLights, x1d_ambientChannelOverflow,
x28_layerIdx == 1, x20_worldLightingOptions == kLO_DisableWorld, 0.1f);
if (x20_worldLightingOptions == kLO_NoShadowCast) {
result = new CActorLights(GetFramesBetweenRecalculation(x24_lightRecalculation),
x2c_lightingPositionOffset, x38_maxDynamicLights, x3c_maxAreaLights,
0.1f, x1d_ambientChannelOverflow, x28_useLightSet == 1,
x20_useWorldLighting == kLO_DisableWorld);
if (x20_useWorldLighting == kLO_NoShadowCast) {
result->SetCastShadows(false);
}
if (x3c_maxAreaLights == 0 && x1c_makeLights) {
result->SetAmbientColor(x18_noLightsAmbient);
result->SetAmbientColor(x18_ambientColor);
}
}
return result;