1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-08 15:30:14 +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

@ -48,13 +48,13 @@ void OceffSpot_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
OceffSpot_SetupAction(this, OceffSpot_GrowCylinder);
Lights_InitType0PositionalLight(&this->lightInfo1, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, 0x00, 0x00, 0x00, 0);
this->light1 = Lights_Insert(globalCtx, &globalCtx->lightCtx, &this->lightInfo1);
Lights_PointNoGlowSetInfo(&this->lightInfo1, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, 0, 0, 0, 0);
this->lightNode1 = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo1);
Lights_InitType0PositionalLight(&this->lightInfo2, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, 0x00, 0x00, 0x00, 0);
this->light2 = Lights_Insert(globalCtx, &globalCtx->lightCtx, &this->lightInfo2);
Lights_PointNoGlowSetInfo(&this->lightInfo2, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, 0, 0, 0, 0);
this->lightNode2 = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo2);
if (YREG(15)) {
this->actor.scale.y = 2.4f;
} else {
@ -69,8 +69,8 @@ void OceffSpot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
OceffSpot* this = THIS;
Player* player = PLAYER;
Lights_Remove(globalCtx, &globalCtx->lightCtx, this->light1);
Lights_Remove(globalCtx, &globalCtx->lightCtx, this->light2);
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode1);
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode2);
func_800876C8(globalCtx);
if (gSaveContext.nayrusLoveTimer && globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].length) {
player->unk_692 |= 0x40;
@ -135,16 +135,15 @@ void OceffSpot_Update(Actor* thisx, GlobalContext* globalCtx) {
temp = (2.0f - this->unk_174) * this->unk_174;
func_800773A8(globalCtx, temp * 0.5F, 880.0f, 0.2f, 0.9f);
Lights_InitType0PositionalLight(&this->lightInfo1, (s16)this->actor.posRot.pos.x,
(s16)this->actor.posRot.pos.y + 55.0f, (s16)this->actor.posRot.pos.z,
(s32)(255.0f * temp), (s32)(255.0f * temp), (s32)(200.0f * temp),
(s16)(100.0f * temp));
Lights_PointNoGlowSetInfo(&this->lightInfo1, (s16)this->actor.posRot.pos.x, (s16)this->actor.posRot.pos.y + 55.0f,
(s16)this->actor.posRot.pos.z, (s32)(255.0f * temp), (s32)(255.0f * temp),
(s32)(200.0f * temp), (s16)(100.0f * temp));
Lights_InitType0PositionalLight(
&this->lightInfo2, (s16)this->actor.posRot.pos.x + Math_Sins(player->actor.shape.rot.y) * 20.0f,
(s16)this->actor.posRot.pos.y + 20.0f,
(s16)this->actor.posRot.pos.z + Math_Coss(player->actor.shape.rot.y) * 20.0f, (s32)(255.0f * temp),
(s32)(255.0f * temp), (s32)(200.0f * temp), (s16)(100.0f * temp));
Lights_PointNoGlowSetInfo(&this->lightInfo2,
(s16)this->actor.posRot.pos.x + Math_Sins(player->actor.shape.rot.y) * 20.0f,
(s16)this->actor.posRot.pos.y + 20.0f,
(s16)this->actor.posRot.pos.z + Math_Coss(player->actor.shape.rot.y) * 20.0f,
(s32)(255.0f * temp), (s32)(255.0f * temp), (s32)(200.0f * temp), (s16)(100.0f * temp));
}
void OceffSpot_Draw(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -10,10 +10,10 @@ typedef void (*OceffSpotActionFunc)(struct OceffSpot*, GlobalContext*);
typedef struct OceffSpot {
/* 0x0000 */ Actor actor;
/* 0x014C */ z_Light* light1;
/* 0x0150 */ LightInfoPositional lightInfo1;
/* 0x0160 */ z_Light* light2;
/* 0x0164 */ LightInfoPositional lightInfo2;
/* 0x014C */ LightNode* lightNode1;
/* 0x0150 */ LightInfo lightInfo1;
/* 0x0160 */ LightNode* lightNode2;
/* 0x0164 */ LightInfo lightInfo2;
/* 0x0174 */ f32 unk_174;
/* 0x0178 */ u16 timer;
/* 0x017C */ OceffSpotActionFunc actionFunc;