mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-08 07:20:16 +00:00
z_lights.c OK (#343)
* rename some structs * changes * rename stuff and start a func * progress * progress * progress * remove unwanted file * progress * match last few funcs * done, i think * small changes * match Lights_Draw (thanks krim) * comments * cleanup * most pr suggestions * name changes * rename
This commit is contained in:
parent
612980f90c
commit
bb1aacbd0b
111 changed files with 614 additions and 1244 deletions
|
@ -55,17 +55,15 @@ void EnLight_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (gSaveContext.gameMode == 3) {
|
||||
// special case for the credits
|
||||
yOffset = (this->actor.params < 0) ? 1 : 40;
|
||||
Lights_InitType0PositionalLight(&this->posLightInfo, this->actor.posRot.pos.x,
|
||||
yOffset + (s16)this->actor.posRot.pos.y, this->actor.posRot.pos.z, 255, 255,
|
||||
180, -1);
|
||||
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, yOffset + (s16)this->actor.posRot.pos.y,
|
||||
this->actor.posRot.pos.z, 255, 255, 180, -1);
|
||||
} else {
|
||||
yOffset = (this->actor.params < 0) ? 1 : 40;
|
||||
Lights_InitType2PositionalLight(&this->posLightInfo, this->actor.posRot.pos.x,
|
||||
yOffset + (s16)this->actor.posRot.pos.y, this->actor.posRot.pos.z, 255, 255,
|
||||
180, -1);
|
||||
Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, yOffset + (s16)this->actor.posRot.pos.y,
|
||||
this->actor.posRot.pos.z, 255, 255, 180, -1);
|
||||
}
|
||||
|
||||
this->lightNode = Lights_Insert(globalCtx, &globalCtx->lightCtx, &this->posLightInfo);
|
||||
this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo);
|
||||
Actor_SetScale(&this->actor, D_80A9E840[this->actor.params & 0xF].scale * 0.0001f);
|
||||
this->timer = (s32)(Math_Rand_ZeroOne() * 255.0f);
|
||||
|
||||
|
@ -77,7 +75,7 @@ void EnLight_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
void EnLight_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnLight* this = THIS;
|
||||
|
||||
Lights_Remove(globalCtx, &globalCtx->lightCtx, this->lightNode);
|
||||
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode);
|
||||
}
|
||||
|
||||
void EnLight_UpdatePosRot(EnLight* this, GlobalContext* globalCtx) {
|
||||
|
@ -101,9 +99,9 @@ void EnLight_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
flameParams = &D_80A9E840[this->actor.params & 0xF];
|
||||
intensity = (Math_Rand_ZeroOne() * 0.5f) + 0.5f;
|
||||
radius = (this->actor.params < 0) ? 100 : 300;
|
||||
Lights_SetPositionalLightColorAndRadius(&this->posLightInfo, (flameParams->primColor.r * intensity),
|
||||
(flameParams->primColor.g * intensity),
|
||||
(flameParams->primColor.b * intensity), radius);
|
||||
Lights_PointSetColorAndRadius(&this->lightInfo, (flameParams->primColor.r * intensity),
|
||||
(flameParams->primColor.g * intensity), (flameParams->primColor.b * intensity),
|
||||
radius);
|
||||
EnLight_UpdatePosRot(this, globalCtx);
|
||||
|
||||
if (this->actor.params >= 0) {
|
||||
|
@ -144,9 +142,9 @@ void EnLight_UpdateSwitch(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
Actor_SetScale(&this->actor, ((f32)flameParams->scale * 0.0001) * scale);
|
||||
intensity = (Math_Rand_ZeroOne() * 0.5f) + 0.5f;
|
||||
Lights_SetPositionalLightColorAndRadius(&this->posLightInfo, (flameParams->primColor.r * intensity),
|
||||
(flameParams->primColor.g * intensity),
|
||||
(flameParams->primColor.b * intensity), 300.0f * scale);
|
||||
Lights_PointSetColorAndRadius(&this->lightInfo, (flameParams->primColor.r * intensity),
|
||||
(flameParams->primColor.g * intensity), (flameParams->primColor.b * intensity),
|
||||
300.0f * scale);
|
||||
EnLight_UpdatePosRot(this, globalCtx);
|
||||
|
||||
if (this->actor.params >= 0) {
|
||||
|
|
|
@ -9,8 +9,8 @@ struct EnLight;
|
|||
typedef struct EnLight {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ u8 timer;
|
||||
/* 0x0150 */ z_Light* lightNode;
|
||||
/* 0x0154 */ LightInfoPositional posLightInfo;
|
||||
/* 0x0150 */ LightNode* lightNode;
|
||||
/* 0x0154 */ LightInfo lightInfo;
|
||||
} EnLight; // size = 0x0164
|
||||
|
||||
extern const ActorInit En_Light_InitVars;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue