1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-05 07:24:34 +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:
fig02 2020-09-05 09:45:10 -04:00 committed by GitHub
parent 612980f90c
commit bb1aacbd0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 614 additions and 1244 deletions

View file

@ -50,11 +50,12 @@ void EffectShieldParticle_Init(void* thisx, void* initParamsx) {
this->lightDecay = initParams->lightDecay;
if (this->lightDecay == true) {
this->lightInfo.type = 0;
this->lightInfo.params = initParams->lightParams;
this->light = Lights_Insert(Effect_GetGlobalCtx(), &Effect_GetGlobalCtx()->lightCtx, &this->lightInfo);
this->lightInfo.type = LIGHT_POINT_NOGLOW;
this->lightInfo.params.point = initParams->lightPoint;
this->lightNode =
LightContext_InsertLight(Effect_GetGlobalCtx(), &Effect_GetGlobalCtx()->lightCtx, &this->lightInfo);
} else {
this->light = NULL;
this->lightNode = NULL;
}
}
}
@ -63,10 +64,10 @@ void EffectShieldParticle_Destroy(void* thisx) {
EffectShieldParticle* this = (EffectShieldParticle*)thisx;
if ((this != NULL) && (this->lightDecay == true)) {
if (this->light == Effect_GetGlobalCtx()->lightCtx.lightsHead) {
Effect_GetGlobalCtx()->lightCtx.lightsHead = this->light->next;
if (this->lightNode == Effect_GetGlobalCtx()->lightCtx.listHead) {
Effect_GetGlobalCtx()->lightCtx.listHead = this->lightNode->next;
}
Lights_Remove(Effect_GetGlobalCtx(), &Effect_GetGlobalCtx()->lightCtx, this->light);
LightContext_RemoveLight(Effect_GetGlobalCtx(), &Effect_GetGlobalCtx()->lightCtx, this->lightNode);
}
}
@ -100,7 +101,7 @@ s32 EffectShieldParticle_Update(void* thisx) {
}
if (this->lightDecay == true) {
this->lightInfo.params.radius /= 2;
this->lightInfo.params.point.radius /= 2;
}
this->timer++;