summaryrefslogtreecommitdiff
path: root/src/code/z_effect_soft_sprite.c
diff options
context:
space:
mode:
authorTom Overton <tom-overton@users.noreply.github.com>2022-06-26 08:57:37 -0700
committerGitHub <noreply@github.com>2022-06-26 11:57:37 -0400
commit158d1b26b0455c2214741ebc4406130a559b8f8f (patch)
tree21fdb81df213038f1f7f7cd9e2f096594ad7695e /src/code/z_effect_soft_sprite.c
parentf77c4770f7ae50b522d9183b79abe60070f6895b (diff)
PlayState rename (#835)
* PlayState rename * Make this work with the latest master and run format * Respond to hensldm's review * Respond to Elliptic's review * Add Effect_GetPlayState to namefixer.py * Add missed comma
Diffstat (limited to 'src/code/z_effect_soft_sprite.c')
-rw-r--r--src/code/z_effect_soft_sprite.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c
index 56eab9e8a..422bb401e 100644
--- a/src/code/z_effect_soft_sprite.c
+++ b/src/code/z_effect_soft_sprite.c
@@ -3,12 +3,12 @@
EffectSsInfo sEffectSsInfo = { NULL, 0, 0 };
-void EffectSS_Init(GlobalContext* globalCtx, s32 numEntries) {
+void EffectSS_Init(PlayState* play, s32 numEntries) {
u32 i;
EffectSs* effectsSs;
EffectSsOverlay* overlay;
- sEffectSsInfo.data_table = (EffectSs*)THA_AllocEndAlign16(&globalCtx->state.heap, numEntries * sizeof(EffectSs));
+ sEffectSsInfo.data_table = (EffectSs*)THA_AllocEndAlign16(&play->state.heap, numEntries * sizeof(EffectSs));
sEffectSsInfo.searchIndex = 0;
sEffectSsInfo.size = numEntries;
@@ -24,7 +24,7 @@ void EffectSS_Init(GlobalContext* globalCtx, s32 numEntries) {
}
}
-void EffectSS_Clear(GlobalContext* globalCtx) {
+void EffectSS_Clear(PlayState* play) {
u32 i;
EffectSs* effectsSs;
EffectSsOverlay* overlay;
@@ -150,10 +150,10 @@ s32 EffectSS_FindFreeSpace(s32 priority, s32* tableEntry) {
return false;
}
-void EffectSS_Copy(GlobalContext* globalCtx, EffectSs* effectsSs) {
+void EffectSS_Copy(PlayState* play, EffectSs* effectsSs) {
s32 index;
- if (FrameAdvance_IsEnabled(&globalCtx->state) != true) {
+ if (FrameAdvance_IsEnabled(&play->state) != true) {
if (EffectSS_FindFreeSpace(effectsSs->priority, &index) == 0) {
sEffectSsInfo.searchIndex = index + 1;
sEffectSsInfo.data_table[index] = *effectsSs;
@@ -161,7 +161,7 @@ void EffectSS_Copy(GlobalContext* globalCtx, EffectSs* effectsSs) {
}
}
-void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* initData) {
+void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initData) {
s32 index;
u32 overlaySize;
EffectSsOverlay* entry = &gParticleOverlayTable[type];
@@ -199,13 +199,13 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
sEffectSsInfo.data_table[index].type = type;
sEffectSsInfo.data_table[index].priority = priority;
- if (initInfo->init(globalCtx, index, &sEffectSsInfo.data_table[index], initData) == 0) {
+ if (initInfo->init(play, index, &sEffectSsInfo.data_table[index], initData) == 0) {
EffectSS_ResetEntry(&sEffectSsInfo.data_table[index]);
}
}
}
-void EffectSS_UpdateParticle(GlobalContext* globalCtx, s32 index) {
+void EffectSS_UpdateParticle(PlayState* play, s32 index) {
EffectSs* particle = &sEffectSsInfo.data_table[index];
if (particle->update != NULL) {
@@ -217,11 +217,11 @@ void EffectSS_UpdateParticle(GlobalContext* globalCtx, s32 index) {
particle->pos.y += particle->velocity.y;
particle->pos.z += particle->velocity.z;
- particle->update(globalCtx, index, particle);
+ particle->update(play, index, particle);
}
}
-void EffectSS_UpdateAllParticles(GlobalContext* globalCtx) {
+void EffectSS_UpdateAllParticles(PlayState* play) {
s32 i;
for (i = 0; i < sEffectSsInfo.size; i++) {
@@ -234,25 +234,25 @@ void EffectSS_UpdateAllParticles(GlobalContext* globalCtx) {
}
if (sEffectSsInfo.data_table[i].life > -1) {
- EffectSS_UpdateParticle(globalCtx, i);
+ EffectSS_UpdateParticle(play, i);
}
}
}
-void EffectSS_DrawParticle(GlobalContext* globalCtx, s32 index) {
+void EffectSS_DrawParticle(PlayState* play, s32 index) {
EffectSs* entry = &sEffectSsInfo.data_table[index];
if (entry->draw != NULL) {
- entry->draw(globalCtx, index, entry);
+ entry->draw(play, index, entry);
}
}
-void EffectSS_DrawAllParticles(GlobalContext* globalCtx) {
- Lights* lights = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx);
+void EffectSS_DrawAllParticles(PlayState* play) {
+ Lights* lights = LightContext_NewLights(&play->lightCtx, play->state.gfxCtx);
s32 i;
- Lights_BindAll(lights, globalCtx->lightCtx.listHead, NULL, globalCtx);
- Lights_Draw(lights, globalCtx->state.gfxCtx);
+ Lights_BindAll(lights, play->lightCtx.listHead, NULL, play);
+ Lights_Draw(lights, play->state.gfxCtx);
for (i = 0; i < sEffectSsInfo.size; i++) {
if (sEffectSsInfo.data_table[i].life > -1) {
@@ -264,7 +264,7 @@ void EffectSS_DrawAllParticles(GlobalContext* globalCtx) {
(sEffectSsInfo.data_table[i].pos.z < BGCHECK_Y_MIN)) {
EffectSS_Delete(&sEffectSsInfo.data_table[i]);
} else {
- EffectSS_DrawParticle(globalCtx, i);
+ EffectSS_DrawParticle(play, i);
}
}
}