mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-15 12:24:39 +00:00
PlayState Rename (#1231)
* global context -> play * fix PlayState* PlayState
This commit is contained in:
parent
154f44b6da
commit
2e6279bc8e
912 changed files with 40489 additions and 41078 deletions
|
@ -195,8 +195,8 @@ s32 Lights_FreeNode(LightNode* light) {
|
|||
}
|
||||
}
|
||||
|
||||
void LightContext_Init(GlobalContext* globalCtx, LightContext* lightCtx) {
|
||||
LightContext_InitList(globalCtx, lightCtx);
|
||||
void LightContext_Init(PlayState* play, LightContext* lightCtx) {
|
||||
LightContext_InitList(play, lightCtx);
|
||||
LightContext_SetAmbientColor(lightCtx, 80, 80, 80);
|
||||
LightContext_SetFog(lightCtx, 0, 0, 0, 996, 12800);
|
||||
bzero(&sLightsBuffer, sizeof(sLightsBuffer));
|
||||
|
@ -223,13 +223,13 @@ Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx)
|
|||
return Lights_New(gfxCtx, lightCtx->ambientColor[0], lightCtx->ambientColor[1], lightCtx->ambientColor[2]);
|
||||
}
|
||||
|
||||
void LightContext_InitList(GlobalContext* globalCtx, LightContext* lightCtx) {
|
||||
void LightContext_InitList(PlayState* play, LightContext* lightCtx) {
|
||||
lightCtx->listHead = NULL;
|
||||
}
|
||||
|
||||
void LightContext_DestroyList(GlobalContext* globalCtx, LightContext* lightCtx) {
|
||||
void LightContext_DestroyList(PlayState* play, LightContext* lightCtx) {
|
||||
while (lightCtx->listHead != NULL) {
|
||||
LightContext_RemoveLight(globalCtx, lightCtx, lightCtx->listHead);
|
||||
LightContext_RemoveLight(play, lightCtx, lightCtx->listHead);
|
||||
lightCtx->listHead = lightCtx->listHead->next;
|
||||
}
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ void LightContext_DestroyList(GlobalContext* globalCtx, LightContext* lightCtx)
|
|||
* Note: Due to the limited number of slots in a Lights group, inserting too many lights in the
|
||||
* list may result in older entries not being bound to a Light when calling Lights_BindAll
|
||||
*/
|
||||
LightNode* LightContext_InsertLight(GlobalContext* globalCtx, LightContext* lightCtx, LightInfo* info) {
|
||||
LightNode* LightContext_InsertLight(PlayState* play, LightContext* lightCtx, LightInfo* info) {
|
||||
LightNode* node;
|
||||
|
||||
node = Lights_FindBufSlot();
|
||||
|
@ -260,7 +260,7 @@ LightNode* LightContext_InsertLight(GlobalContext* globalCtx, LightContext* ligh
|
|||
return node;
|
||||
}
|
||||
|
||||
void LightContext_RemoveLight(GlobalContext* globalCtx, LightContext* lightCtx, LightNode* node) {
|
||||
void LightContext_RemoveLight(PlayState* play, LightContext* lightCtx, LightNode* node) {
|
||||
if (node != NULL) {
|
||||
if (node->prev != NULL) {
|
||||
node->prev->next = node->next;
|
||||
|
@ -316,7 +316,7 @@ Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambient
|
|||
return lights;
|
||||
}
|
||||
|
||||
void Lights_GlowCheck(GlobalContext* globalCtx) {
|
||||
void Lights_GlowCheck(PlayState* play) {
|
||||
LightNode* node;
|
||||
LightPoint* params;
|
||||
Vec3f pos;
|
||||
|
@ -327,7 +327,7 @@ void Lights_GlowCheck(GlobalContext* globalCtx) {
|
|||
s32 wZ;
|
||||
s32 zBuf;
|
||||
|
||||
node = globalCtx->lightCtx.listHead;
|
||||
node = play->lightCtx.listHead;
|
||||
|
||||
while (node != NULL) {
|
||||
params = &node->info->params.point;
|
||||
|
@ -336,7 +336,7 @@ void Lights_GlowCheck(GlobalContext* globalCtx) {
|
|||
pos.x = params->x;
|
||||
pos.y = params->y;
|
||||
pos.z = params->z;
|
||||
Actor_ProjectPos(globalCtx, &pos, &multDest, &cappedInvWDest);
|
||||
Actor_ProjectPos(play, &pos, &multDest, &cappedInvWDest);
|
||||
params->drawGlow = false;
|
||||
wX = multDest.x * cappedInvWDest;
|
||||
wY = multDest.y * cappedInvWDest;
|
||||
|
@ -356,13 +356,13 @@ void Lights_GlowCheck(GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void Lights_DrawGlow(GlobalContext* globalCtx) {
|
||||
void Lights_DrawGlow(PlayState* play) {
|
||||
s32 pad;
|
||||
LightNode* node;
|
||||
|
||||
node = globalCtx->lightCtx.listHead;
|
||||
node = play->lightCtx.listHead;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_lights.c", 887);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_lights.c", 887);
|
||||
|
||||
POLY_XLU_DISP = func_800947AC(POLY_XLU_DISP++);
|
||||
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE);
|
||||
|
@ -384,7 +384,7 @@ void Lights_DrawGlow(GlobalContext* globalCtx) {
|
|||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, params->color[0], params->color[1], params->color[2], 50);
|
||||
Matrix_Translate(params->x, params->y, params->z, MTXMODE_NEW);
|
||||
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_lights.c", 918),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_lights.c", 918),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGlowCircleDL);
|
||||
}
|
||||
|
@ -392,5 +392,5 @@ void Lights_DrawGlow(GlobalContext* globalCtx) {
|
|||
node = node->next;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_lights.c", 927);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_lights.c", 927);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue