diff --git a/src/core2/code_B6EA0.h b/src/core2/code_B6EA0.h index 8a883ccb..98f04270 100644 --- a/src/core2/code_B6EA0.h +++ b/src/core2/code_B6EA0.h @@ -58,10 +58,10 @@ ParticleStruct0s *func_8033E960(void); void func_8033E984(void); void projectile_setSprite(u8, enum asset_e); void func_8033FC34(u8, s32); -void func_8033FC60(u8, s32, s32, s32); +void projectile_setColor(u8, s32, s32, s32); void func_8033FCD8(u8, s32); -void func_8033FD98(u8, f32[3]); -void func_8033FE2C(u8, f32); +void projectile_setRotation(u8, f32[3]); +void projectile_addRoll(u8, f32); void projectile_setPosition(u8, f32[3]); void func_8033FFE4(u8, s32, s32); void func_80344E18(u8, s32); diff --git a/src/core2/code_B8860.c b/src/core2/code_B8860.c index 200879a2..472cf486 100644 --- a/src/core2/code_B8860.c +++ b/src/core2/code_B8860.c @@ -8,8 +8,8 @@ extern void func_80252330(f32, f32, f32); typedef struct { BKSprite *sprite_0; - f32 unk4[3]; - f32 unk10[3]; + f32 position[3]; + f32 rotation[3]; f32 unk1C; s16 unk20[2]; u8 color[3]; @@ -22,23 +22,23 @@ typedef struct { u32 pad28_11:12; } Struct_B8860_0s; -void func_8033FE6C(u8 arg0, f32 arg1); -f32 func_8033FE9C(u8 arg0); +void projectile_setRoll(u8 indx, f32 angle); +f32 projectile_getRoll(u8 indx); void func_8033FB64(u8 arg0); /* .bss */ Struct_B8860_0s D_80385000[0x32]; /* .code */ -void func_8033F7F0(u8 arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){ +void func_8033F7F0(u8 indx, Gfx **gfx, Mtx **mtx, Vtx **vtx){ Struct_B8860_0s *sp54; f32 sp48[3]; f32 sp3C[3]; f32 sp30[3]; - sp54 = &D_80385000[arg0]; + sp54 = &D_80385000[indx]; if(sp54->unk28_23 != 1){ - ml_vec3f_copy(sp48, sp54->unk4); + ml_vec3f_copy(sp48, sp54->position); sp48[1] += (sp54->unk1C*sp54->unk20[1])/100.0; viewport_get_position_vec3f(sp3C); ml_vec3f_diff_copy(sp30, sp48, sp3C); @@ -48,7 +48,7 @@ void func_8033F7F0(u8 arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){ else{ mlMtxIdent(); } - mlMtxRotatePYR(sp54->unk10[0], sp54->unk10[1], sp54->unk10[2]); + mlMtxRotatePYR(sp54->rotation[0], sp54->rotation[1], sp54->rotation[2]); func_80252330(sp30[0], sp30[1], sp30[2]); mlMtxApply(*mtx); gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -83,8 +83,8 @@ u8 func_8033FA84(void){ int i; for(i = 1; i < 0x32; i++){ if(!D_80385000[i].unk28_13){ - ml_vec3f_clear(D_80385000[i].unk4); - ml_vec3f_clear(D_80385000[i].unk10); + ml_vec3f_clear(D_80385000[i].position); + ml_vec3f_clear(D_80385000[i].rotation); D_80385000[i].frame_28_31 = 0; D_80385000[i].unk28_13 = TRUE; D_80385000[i].unk28_23 = 0; @@ -104,92 +104,88 @@ u8 func_8033FA84(void){ return 0; } -void func_8033FB64(u8 arg0){ - if(D_80385000[arg0].sprite_0){ - func_8033BD4C(D_80385000[arg0].sprite_0); +void func_8033FB64(u8 indx){ + if(D_80385000[indx].sprite_0){ + func_8033BD4C(D_80385000[indx].sprite_0); } - D_80385000[arg0].sprite_0 = NULL; - D_80385000[arg0].unk28_13 = 0; + D_80385000[indx].sprite_0 = NULL; + D_80385000[indx].unk28_13 = 0; } -void projectile_setSprite(u8 arg0, enum asset_e arg1){ - if(D_80385000[arg0].sprite_0){ - func_8033BD4C(D_80385000[arg0].sprite_0); +void projectile_setSprite(u8 indx, enum asset_e arg1){ + if(D_80385000[indx].sprite_0){ + func_8033BD4C(D_80385000[indx].sprite_0); } - D_80385000[arg0].sprite_0 = assetcache_get(arg1); + D_80385000[indx].sprite_0 = assetcache_get(arg1); } -void func_8033FC34(u8 arg0, s32 arg1){ - D_80385000[arg0].unk27 = arg1; +void func_8033FC34(u8 indx, s32 arg1){ + D_80385000[indx].unk27 = arg1; } -void func_8033FC60(u8 arg0, s32 r, s32 g, s32 b){ - D_80385000[arg0].color[0] = r; - D_80385000[arg0].color[1] = g; - D_80385000[arg0].color[2] = b; +void projectile_setColor(u8 indx, s32 r, s32 g, s32 b){ + D_80385000[indx].color[0] = r; + D_80385000[indx].color[1] = g; + D_80385000[indx].color[2] = b; } -void func_8033FC98(u8 arg0, s32 arg1){ - D_80385000[arg0].unk28_23 = arg1; +void func_8033FC98(u8 indx, s32 arg1){ + D_80385000[indx].unk28_23 = arg1; } -void func_8033FCD8(u8 arg0, s32 arg1){ - D_80385000[arg0].unk28_21 = arg1; +void func_8033FCD8(u8 indx, s32 arg1){ + D_80385000[indx].unk28_21 = arg1; } -void func_8033FD20(u8 arg0, s32 arg1){ - D_80385000[arg0].unk28_12 = arg1; +void func_8033FD20(u8 indx, s32 arg1){ + D_80385000[indx].unk28_12 = arg1; } -s32 func_8033FD64(u8 arg0){ - return D_80385000[arg0].unk28_23; +s32 func_8033FD64(u8 indx){ + return D_80385000[indx].unk28_23; } -//projectile?_setRotation -void func_8033FD98(u8 arg0, f32 arg1[3]){ - ml_vec3f_copy(D_80385000[arg0].unk10, arg1); +void projectile_setRotation(u8 indx, f32 rotation[3]){ + ml_vec3f_copy(D_80385000[indx].rotation, rotation); } -//projectile?_getRotation -void func_8033FDE0(u8 arg0, f32 arg1[3]){ - ml_vec3f_copy(arg1, D_80385000[arg0].unk10); +void projectile_getRotation(u8 indx, f32 rotation[3]){ + ml_vec3f_copy(rotation, D_80385000[indx].rotation); } -void func_8033FE2C(u8 arg0, f32 arg1){ - func_8033FE6C(arg0, mlNormalizeAngle(func_8033FE9C(arg0) + arg1)); +void projectile_addRoll(u8 indx, f32 angle){ + projectile_setRoll(indx, mlNormalizeAngle(projectile_getRoll(indx) + angle)); } -//projectile?_setRoll -void func_8033FE6C(u8 arg0, f32 arg1){ - D_80385000[arg0].unk10[2] = arg1; +void projectile_setRoll(u8 indx, f32 angle){ + D_80385000[indx].rotation[2] = angle; } -//projectile?_getRoll -f32 func_8033FE9C(u8 arg0){ - return D_80385000[arg0].unk10[2]; +f32 projectile_getRoll(u8 indx){ + return D_80385000[indx].rotation[2]; } -void projectile_setPosition(u8 arg0, f32 arg1[3]){ - ml_vec3f_copy(D_80385000[arg0].unk4, arg1); +void projectile_setPosition(u8 indx, f32 position[3]){ + ml_vec3f_copy(D_80385000[indx].position, position); } -void projectile_getPosition(u8 arg0, f32 arg1[3]){ - ml_vec3f_copy(arg1, D_80385000[arg0].unk4); +void projectile_getPosition(u8 indx, f32 position[3]){ + ml_vec3f_copy(position, D_80385000[indx].position); } -void func_8033FF5C(u8 arg0, f32 arg1){ - D_80385000[arg0].unk1C = arg1; +void func_8033FF5C(u8 indx, f32 arg1){ + D_80385000[indx].unk1C = arg1; } -f32 func_8033FF8C(u8 arg0){ - return D_80385000[arg0].unk1C; +f32 func_8033FF8C(u8 indx){ + return D_80385000[indx].unk1C; } -void func_8033FFB8(u8 arg0, s32 frame){ - D_80385000[arg0].frame_28_31 = frame; +void func_8033FFB8(u8 indx, s32 frame){ + D_80385000[indx].frame_28_31 = frame; } -void func_8033FFE4(u8 arg0, s32 arg1, s32 arg2){ - D_80385000[arg0].unk20[0] = arg1; - D_80385000[arg0].unk20[1] = arg2; +void func_8033FFE4(u8 indx, s32 arg1, s32 arg2){ + D_80385000[indx].unk20[0] = arg1; + D_80385000[indx].unk20[1] = arg2; } diff --git a/src/core2/code_CB610.c b/src/core2/code_CB610.c index 4134a9a3..30002dd5 100644 --- a/src/core2/code_CB610.c +++ b/src/core2/code_CB610.c @@ -28,7 +28,7 @@ void func_80352614(void){} void func_8035261C(void) { ParticleStruct0s *sp2C; - u8 sp2B; + u8 projectile_indx; AnimSprite *sp24; u8 sp23; s32 sp1C; @@ -36,15 +36,17 @@ void func_8035261C(void) { s32 temp_f16; sp2C = func_8033E960(); - sp2B = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp24 = func_8033E8F4(); sp23 = func_8033E93C(); sp1C = (s32) (randf() * 20.0f + 60.0f); sp2C->unk20 = sp1C; sp2C->unk0 = 0.0f; - projectile_setSprite(sp2B, ASSET_718_SPRITE_SPARKLE_WHITE_2); - func_8033FFE4(sp2B, sp1C, sp1C); - func_8033FCD8(sp2B, 0xC); + + projectile_setSprite(projectile_indx, ASSET_718_SPRITE_SPARKLE_WHITE_2); + func_8033FFE4(projectile_indx, sp1C, sp1C); + func_8033FCD8(projectile_indx, 0xC); + animsprite_default(sp24); animsprite_set_state(sp24, ANIM_SPRITE_STATE_STOPPED); func_80344E18(sp23, 3); @@ -53,24 +55,24 @@ void func_8035261C(void) { void func_803526DC(void) { ParticleStruct0s *temp_s0; - u8 sp43; + u8 projectile_indx; s32 temp_f16; f32 sp38; f32 temp_f20; f32 sp30; temp_s0 = func_8033E960(); - sp43 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp38 = temp_s0->unk4; temp_f20 = temp_s0->unk0; sp30 =temp_s0->unk20; - func_8033FE2C(sp43, 9.0f); + projectile_addRoll(projectile_indx, 9.0f); temp_f16 = (s32) ml_map_f(temp_f20, 0.0f, sp38, sp30, 10.0f); - func_8033FFE4(sp43, temp_f16, temp_f16); + func_8033FFE4(projectile_indx, temp_f16, temp_f16); if (temp_f20 < 0.1) { - func_8033FC34(sp43, (s32) ml_map_f(temp_f20, 0.0f, 0.08f, 20.0f, 255.0f)); + func_8033FC34(projectile_indx, (s32) ml_map_f(temp_f20, 0.0f, 0.08f, 20.0f, 255.0f)); } else { - func_8033FC34(sp43, (s32) ml_map_f(temp_f20, 0.1f, sp38, 255.0f, 20.0f)); + func_8033FC34(projectile_indx, (s32) ml_map_f(temp_f20, 0.1f, sp38, 255.0f, 20.0f)); } temp_f20 += time_getDelta(); temp_s0->unk0 = temp_f20; diff --git a/src/core2/code_CBD10.c b/src/core2/code_CBD10.c index e2da7b97..0a21cf01 100644 --- a/src/core2/code_CBD10.c +++ b/src/core2/code_CBD10.c @@ -69,7 +69,7 @@ s32 func_80352D9C(void) { } void func_80352DE4(void) { - u8 temp_s0; + u8 projectile_indx; AnimSprite *sp58; u8 sp57; ParticleStruct0s *temp_s1; @@ -77,7 +77,7 @@ void func_80352DE4(void) { f32 sp38[3]; f32 sp2C[3]; - temp_s0 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp58 = func_8033E8F4(); sp57 = func_8033E93C(); temp_s1 = func_8033E960(); @@ -86,14 +86,14 @@ void func_80352DE4(void) { temp_s1->unk4 = 8.0f; temp_s1->unk8 = 255.0f; temp_s1->unkC = -11.0f; - projectile_setSprite(temp_s0, ASSET_70D_SPRITE_SMOKE_1); - func_8033FCD8(temp_s0, 0xC); - func_8033FC60(temp_s0, func_80352D9C(), func_80352D9C(), func_80352D9C()); - projectile_setPosition(temp_s0, sp44); + projectile_setSprite(projectile_indx, ASSET_70D_SPRITE_SMOKE_1); + func_8033FCD8(projectile_indx, 0xC); + projectile_setColor(projectile_indx, func_80352D9C(), func_80352D9C(), func_80352D9C()); + projectile_setPosition(projectile_indx, sp44); sp2C[0] = 0.0f; sp2C[1] = 0.0f; sp2C[2] = randf() * 359.0f; - func_8033FD98(temp_s0, sp2C); + projectile_setRotation(projectile_indx, sp2C); animsprite_default(sp58); animsprite_set_state(sp58, ANIM_SPRITE_STATE_ONCE); animsprite_set_steps(sp58, D_80372670, sizeof(D_80372670)); @@ -104,7 +104,7 @@ void func_80352DE4(void) { func_80344E18(sp57, 2); func_80344E3C(sp57, sp38); func_80344D94(sp57, sp44); - func_80352CA0(temp_s0, temp_s1); + func_80352CA0(projectile_indx, temp_s1); } void func_80352F58(void){ diff --git a/src/core2/code_CD0A0.c b/src/core2/code_CD0A0.c index 8004dc33..f0dc366a 100644 --- a/src/core2/code_CD0A0.c +++ b/src/core2/code_CD0A0.c @@ -31,19 +31,19 @@ void func_803540AC(void){} void func_803540B4(void){ ParticleStruct0s *sp34; - u8 sp33; + u8 projectile_indx; AnimSprite *sp2C; u8 sp2B; f32 sp1C[3]; sp34 = func_8033E960(); - sp33 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp2C = func_8033E8F4(); sp2B = func_8033E93C(); sp34->unk20 = D_803863D0.unk4; - projectile_setSprite(sp33, D_803863D0.unk0 + 0x710); - func_8033FFE4(sp33, D_803863D0.unk4, D_803863D0.unk4); - func_8033FCD8(sp33, 0xC); + projectile_setSprite(projectile_indx, D_803863D0.unk0 + 0x710); + func_8033FFE4(projectile_indx, D_803863D0.unk4, D_803863D0.unk4); + func_8033FCD8(projectile_indx, 0xC); animsprite_default(sp2C); animsprite_set_state(sp2C, ANIM_SPRITE_STATE_STOPPED); sp1C[0] = randf2(-100.0f, 100.0f); @@ -64,26 +64,26 @@ void func_803541CC(s32 arg0){ void func_803541D8(void) { ParticleStruct0s *sp44; - u8 sp43; + u8 projectile_indx; f32 temp_f20; f32 temp_f22; s32 temp_f10; f32 sp30; sp44 = func_8033E960(); - sp43 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); temp_f22 = sp44->unk4; temp_f20 = sp44->unk0; sp30 = (f32) sp44->unk20; - func_8033FE2C(sp43, 8.0f); + projectile_addRoll(projectile_indx, 8.0f); temp_f10 = (s32) ml_map_f(temp_f20, 0.0f, temp_f22, sp30, 20.0f); - func_8033FFE4(sp43, temp_f10, temp_f10); + func_8033FFE4(projectile_indx, temp_f10, temp_f10); if ((f64) temp_f22 < 0.3) { - func_8033FC34(sp43, (s32) ml_map_f(temp_f20, 0.0f, temp_f22, 255.0f, 20.0f)); + func_8033FC34(projectile_indx, (s32) ml_map_f(temp_f20, 0.0f, temp_f22, 255.0f, 20.0f)); } else if ((f64) temp_f20 < 0.1) { - func_8033FC34(sp43, (s32) ml_map_f(temp_f20, 0.0f, 0.1f, 20.0f, 255.0f)); + func_8033FC34(projectile_indx, (s32) ml_map_f(temp_f20, 0.0f, 0.1f, 20.0f, 255.0f)); } else { - func_8033FC34(sp43, (s32) ml_map_f(temp_f20, 0.1f, temp_f22, 255.0f, 20.0f)); + func_8033FC34(projectile_indx, (s32) ml_map_f(temp_f20, 0.1f, temp_f22, 255.0f, 20.0f)); } temp_f20 += time_getDelta(); sp44->unk0 = temp_f20; diff --git a/src/core2/code_CD3F0.c b/src/core2/code_CD3F0.c index 3cc6c690..1d569a5a 100644 --- a/src/core2/code_CD3F0.c +++ b/src/core2/code_CD3F0.c @@ -27,22 +27,22 @@ void func_803543F4(void){} void func_803543FC(void) { ParticleStruct0s* sp3C; - u8 sp3B; + u8 projectile_indx; AnimSprite* sp34; u8 sp33; f32 sp24[3]; s32 temp_f16; sp3C = func_8033E960(); - sp3B = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp34 = func_8033E8F4(); sp33 = func_8033E93C(); temp_f16 = ((randf() * 20.0f) + 80.0f); sp3C->unk0 = 0.0f; sp3C->unk20 = temp_f16; - projectile_setSprite(sp3B, ASSET_710_SPRITE_SPARKLE_PURPLE); - func_8033FFE4(sp3B, temp_f16, temp_f16); - func_8033FCD8(sp3B, 0xC); + projectile_setSprite(projectile_indx, ASSET_710_SPRITE_SPARKLE_PURPLE); + func_8033FFE4(projectile_indx, temp_f16, temp_f16); + func_8033FCD8(projectile_indx, 0xC); animsprite_default(sp34); animsprite_set_state(sp34, ANIM_SPRITE_STATE_STOPPED); sp24[0] = randf2(-100.0f, 100.0f); @@ -55,7 +55,7 @@ void func_803543FC(void) { void func_8035451C(void) { ParticleStruct0s* temp_s0; - u8 temp_v0; + u8 projectile_indx; f32 sp3c; f32 sp38; f32 temp_f20; @@ -63,17 +63,17 @@ void func_8035451C(void) { s32 temp_f16; temp_s0 = func_8033E960(); - temp_v0 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp38 = temp_s0->unk4; temp_f20 = temp_s0->unk0; sp30 = temp_s0->unk20; - func_8033FE2C(temp_v0, 9.0f); + projectile_addRoll(projectile_indx, 9.0f); temp_f16 = ml_map_f(temp_f20, 0.0f, sp38, sp30, 20.0f); - func_8033FFE4(temp_v0, temp_f16, temp_f16); + func_8033FFE4(projectile_indx, temp_f16, temp_f16); if (temp_f20 < 0.1) { - func_8033FC34(temp_v0, ml_map_f(temp_f20, 0.0f, 0.1f, 20.0f, 210.0f)); + func_8033FC34(projectile_indx, ml_map_f(temp_f20, 0.0f, 0.1f, 20.0f, 210.0f)); } else { - func_8033FC34(temp_v0, ml_map_f(temp_f20, 0.1f, sp38, 210.0f, 20.0f)); + func_8033FC34(projectile_indx, ml_map_f(temp_f20, 0.1f, sp38, 210.0f, 20.0f)); } temp_f20 += time_getDelta(); temp_s0->unk0 = temp_f20; diff --git a/src/core2/code_CD6E0.c b/src/core2/code_CD6E0.c index e73f4481..023a4785 100644 --- a/src/core2/code_CD6E0.c +++ b/src/core2/code_CD6E0.c @@ -22,18 +22,19 @@ void func_80354670(u8 arg0, s32 arg1) { } void func_803546E8(void) { - u8 sp4F; + u8 projectile_indx; AnimSprite* sp48; u8 sp47; ParticleStruct1s* temp_s0; - f32 sp34[3]; + f32 plyr_pos[3]; f32 sp28[3]; - sp4F = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp48 = func_8033E8F4(); sp47 = func_8033E93C(); temp_s0 = func_8033E960(); - player_getPosition(sp34); + player_getPosition(plyr_pos); + temp_s0->unk0[0] = randf2(-10.0f, 10.0f); temp_s0->unk0[1] = (randf() * 35.0f) + 50.0f; temp_s0->unk0[2] = randf2(-10.0f, 10.0f); @@ -42,9 +43,9 @@ void func_803546E8(void) { temp_s0->unk0[0] += sp28[0]; temp_s0->unk0[1] += sp28[1]; temp_s0->unk0[2] += sp28[2]; - projectile_setSprite(sp4F, ASSET_713_SPRITE_SPARKLE_YELLOW); - projectile_setPosition(sp4F, sp34); - func_8033FCD8(sp4F, 0xC); + projectile_setSprite(projectile_indx, ASSET_713_SPRITE_SPARKLE_YELLOW); + projectile_setPosition(projectile_indx, plyr_pos); + func_8033FCD8(projectile_indx, 0xC); animsprite_default(sp48); animsprite_set_state(sp48, ANIM_SPRITE_STATE_STOPPED); func_80344E18(sp47, 5); @@ -53,26 +54,26 @@ void func_803546E8(void) { sp28[1] = 250.0f; D_803726EC = mlNormalizeAngle(D_803726EC + 45.0); func_80344E3C(sp47, sp28); - func_80344D94(sp47, sp34); + func_80344D94(sp47, plyr_pos); temp_s0->unk20 = 0x14; - func_80354670(sp4F, 0x14); + func_80354670(projectile_indx, 0x14); } void func_8035489C(void) { ParticleStruct1s* temp_s0; - u8 temp_v0; + u8 projectile_indx; f32 playerVelocity[3]; f32 playerPosition[3]; temp_s0 = func_8033E960(); - temp_v0 = func_8033E8D0(); - func_8033FE2C(temp_v0, 7.0f); + projectile_indx = func_8033E8D0(); + projectile_addRoll(projectile_indx, 7.0f); temp_s0->unk20--; if (temp_s0->unk20 < 0) { func_8033E984(); return; } - func_80354670(temp_v0, temp_s0->unk20); + func_80354670(projectile_indx, temp_s0->unk20); if (temp_s0->unk20 >= 0x10) { player_getPosition(playerPosition); player_getVelocity(playerVelocity); @@ -82,7 +83,7 @@ void func_8035489C(void) { playerPosition[0] += temp_s0->unk0[0]; playerPosition[1] += temp_s0->unk0[1]; playerPosition[2] += temp_s0->unk0[2]; - projectile_setPosition(temp_v0, playerPosition); + projectile_setPosition(projectile_indx, playerPosition); } } @@ -173,28 +174,28 @@ void func_80354C18(void) { s32 sp40; f32 sp34[3]; f32 sp28[3]; - u8 temp_s1; + u8 projectile_indx; temp_s0 = func_8033E960(); - temp_s1 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp4C = func_8033E864(); sp4B = func_8033E93C(); sp44 = func_8033E888(); sp40 = func_8033E8AC(); - func_8033FE2C(temp_s1, 7.0f); + projectile_addRoll(projectile_indx, 7.0f); temp_s0->unk20--; if (temp_s0->unk20 < 0) { func_8033E984(); } else { - func_80354670(temp_s1, temp_s0->unk20); + func_80354670(projectile_indx, temp_s0->unk20); if (temp_s0->unk20 >= 0x10) { if (sp44(sp4C, sp40, sp34) != 0) { - func_8033FC98(temp_s1, 0); + func_8033FC98(projectile_indx, 0); } else { - func_8033FC98(temp_s1, 1); + func_8033FC98(projectile_indx, 1); } } else { - projectile_getPosition(temp_s1, sp34); + projectile_getPosition(projectile_indx, sp34); } func_80344E7C(sp4B, sp28); sp28[0] += temp_s0->unkC[0]; @@ -207,10 +208,10 @@ void func_80354C18(void) { sp34[0] += temp_s0->unk0[0]; sp34[1] += temp_s0->unk0[1]; sp34[2] += temp_s0->unk0[2]; - projectile_setPosition(temp_s1, sp34); + projectile_setPosition(projectile_indx, sp34); } - func_8033FC34(temp_s1, 0xB4); - func_8033FCD8(temp_s1, 0xC); + func_8033FC34(projectile_indx, 0xB4); + func_8033FCD8(projectile_indx, 0xC); } void func_80354DC8(void){} @@ -220,11 +221,11 @@ void func_80354DD0(void) { AnimSprite* sp40; u8 sp3F; u8 pad3C[3]; - u8 temp_s1; + u8 projectile_indx; f32 sp2C[3]; f32 sp20[3]; - temp_s1 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp40 = func_8033E8F4(); sp3F = func_8033E93C(); temp_s0 = func_8033E960(); @@ -232,9 +233,9 @@ void func_80354DD0(void) { temp_s0->unk0[0] = randf2(-50.0f, 50.0f); temp_s0->unk0[1] = randf2(-65.0f, -65.0f); temp_s0->unk0[2] = randf2(-50.0f, 50.0f); - projectile_setSprite(temp_s1, ASSET_710_SPRITE_SPARKLE_PURPLE); - func_8033FC60(temp_s1, 0xE1, 0xFF, 0); - projectile_setPosition(temp_s1, sp2C); + projectile_setSprite(projectile_indx, ASSET_710_SPRITE_SPARKLE_PURPLE); + projectile_setColor(projectile_indx, 0xE1, 0xFF, 0); + projectile_setPosition(projectile_indx, sp2C); animsprite_default(sp40); animsprite_set_state(sp40, ANIM_SPRITE_STATE_STOPPED); func_80344E18(sp3F, 3); @@ -244,7 +245,7 @@ void func_80354DD0(void) { func_80344E3C(sp3F, sp20); func_80344D94(sp3F, sp2C); temp_s0->unk20 = 0x14; - func_80354670(temp_s1, 0x14); + func_80354670(projectile_indx, 0x14); } void func_80354EEC(void) { @@ -285,14 +286,14 @@ void func_80354EEC(void) { void func_80355004(void){} void func_8035500C(void) { - u8 sp47; + u8 projectile_indx; AnimSprite* sp40; u8 sp3F; ParticleStruct1s* temp_s0; f32 sp2C[3]; f32 sp20[3]; - sp47 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp40 = func_8033E8F4(); sp3F = func_8033E93C(); temp_s0 = func_8033E960(); @@ -300,9 +301,9 @@ void func_8035500C(void) { temp_s0->unk0[0] = randf2(-40.0f, 40.0f); temp_s0->unk0[1] = randf2(-40.0f, 40.0f); temp_s0->unk0[2] = randf2(-40.0f, 40.0f); - projectile_setSprite(sp47, 0x70F); - func_8033FC60(sp47, 0xFF, 0xE6, 0xF5); - projectile_setPosition(sp47, sp2C); + projectile_setSprite(projectile_indx, 0x70F); + projectile_setColor(projectile_indx, 0xFF, 0xE6, 0xF5); + projectile_setPosition(projectile_indx, sp2C); animsprite_default(sp40); animsprite_set_state(sp40, ANIM_SPRITE_STATE_STOPPED); animsprite_set_frame(sp40, 0); //set frame @@ -313,7 +314,7 @@ void func_8035500C(void) { func_80344E3C(sp3F, sp20); func_80344D94(sp3F, sp2C); temp_s0->unk20 = 0x14; - func_80354670(sp47, 0x14); + func_80354670(projectile_indx, 0x14); } void func_80355134(void) { @@ -356,14 +357,14 @@ void func_80355134(void) { void func_80355294(void){} void func_8035529C(void) { - u8 sp4F; + u8 projectile_indx; AnimSprite* sp48; u8 sp47; ParticleStruct1s* sp40; f32 sp34[3]; f32 sp28[3]; - sp4F = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp48 = func_8033E8F4(); sp47 = func_8033E93C(); sp40 = func_8033E960(); @@ -371,9 +372,9 @@ void func_8035529C(void) { sp40->unk0[0] = randf2(-40.0f, 40.0f); sp40->unk0[1] = 0.0f; sp40->unk0[2] = randf2(-40.0f, 40.0f); - projectile_setSprite(sp4F, 0x70F); - func_8033FC60(sp4F, randi2(0xD2, 0xFF), randi2(0xBE, 0xFF), randi2(0xC8, 0xFF)); - projectile_setPosition(sp4F, sp34); + projectile_setSprite(projectile_indx, 0x70F); + projectile_setColor(projectile_indx, randi2(0xD2, 0xFF), randi2(0xBE, 0xFF), randi2(0xC8, 0xFF)); + projectile_setPosition(projectile_indx, sp34); animsprite_default(sp48); animsprite_set_state(sp48, ANIM_SPRITE_STATE_STOPPED); animsprite_set_frame(sp48, 0); @@ -384,7 +385,7 @@ void func_8035529C(void) { func_80344E3C(sp47, sp28); func_80344D94(sp47, sp34); sp40->unk20 = 0xE; - func_80354670(sp4F, 0xE); + func_80354670(projectile_indx, 0xE); } void func_803553E8(void) { @@ -428,14 +429,14 @@ void func_80355548(void){} void func_80355550(void) { static s32 D_803863E0; - u8 sp3F; + u8 projectile_indx; AnimSprite *sp38; u8 sp37; ParticleStruct1s *sp30; f32 sp24[3]; f32 sp18[3]; - sp3F = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp38 = func_8033E8F4(); sp37 = func_8033E93C(); sp30 = func_8033E960(); @@ -444,14 +445,14 @@ void func_80355550(void) { sp30->unk0[1] = randf2(-30.0f, 30.0f); sp30->unk0[2] = randf2(-30.0f, 30.0f); if ((f64) randf() < 0.25) { - projectile_setSprite(sp3F, ASSET_711_SPRITE_SPARKLE_DARK_BLUE); + projectile_setSprite(projectile_indx, ASSET_711_SPRITE_SPARKLE_DARK_BLUE); } else if ((f64) randf() < 0.5) { - projectile_setSprite(sp3F, ASSET_716_SPRITE_SPARKLE_WHITE); + projectile_setSprite(projectile_indx, ASSET_716_SPRITE_SPARKLE_WHITE); } else { - projectile_setSprite(sp3F, ASSET_710_SPRITE_SPARKLE_PURPLE); + projectile_setSprite(projectile_indx, ASSET_710_SPRITE_SPARKLE_PURPLE); } - func_8033FC60(sp3F, 0xFF, 0xFF, 0xFF); - projectile_setPosition(sp3F, sp24); + projectile_setColor(projectile_indx, 0xFF, 0xFF, 0xFF); + projectile_setPosition(projectile_indx, sp24); animsprite_default(sp38); animsprite_set_state(sp38, ANIM_SPRITE_STATE_STOPPED); animsprite_set_frame(sp38, 0); @@ -465,7 +466,7 @@ void func_80355550(void) { func_80344E3C(sp37, sp18); func_80344D94(sp37, sp24); sp30->unk20 = 0x14; - func_80354670(sp3F, 0x14); + func_80354670(projectile_indx, 0x14); } void func_8035570C(void) { @@ -555,18 +556,18 @@ void func_80355864(void) { void func_80355B00(void) { ParticleStruct1s *sp44; - u8 sp43; + u8 projectile_indx; ActorMarker *pad40; Actor *sp38; f32 *sp34; f32 sp28[3]; sp44 = func_8033E960(); - sp43 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); pad40 = func_8033E864(); sp38 = marker_getActor(pad40); sp34 = func_802C9C0C(sp38); - func_8033FE2C(sp43, 7.0f); + projectile_addRoll(projectile_indx, 7.0f); sp28[0] = sp38->position[0]; sp28[1] = sp38->position[1]; sp28[2] = sp38->position[2]; @@ -581,7 +582,7 @@ void func_80355B00(void) { func_8033E984(); return; } - func_80354670(sp43, sp44->unk20); + func_80354670(projectile_indx, sp44->unk20); if (sp44->unk20 >= 0x10) { sp28[0] += sp34[0] * time_getDelta(); sp28[2] += sp34[2] * time_getDelta(); @@ -589,7 +590,7 @@ void func_80355B00(void) { sp28[0] += sp44->unk0[0]; sp28[1] += sp44->unk0[1]; sp28[2] += sp44->unk0[2]; - projectile_setPosition(sp43, sp28); + projectile_setPosition(projectile_indx, sp28); } } diff --git a/src/core2/code_CECD0.c b/src/core2/code_CECD0.c index 6d8a2813..0765cc90 100644 --- a/src/core2/code_CECD0.c +++ b/src/core2/code_CECD0.c @@ -40,19 +40,19 @@ void func_80355D50(void){} void func_80355D58(void){ ParticleStruct0s * sp3C; - u8 sp3B; + u8 projectile_indx; AnimSprite *sp34; u8 temp_s0; f32 sp24[3]; sp3C = func_8033E960(); - sp3B = func_8033E8D0(); + projectile_indx = func_8033E8D0(); sp34 = func_8033E8F4(); temp_s0 = func_8033E93C(); sp3C->unk20 = D_803726F0.unk4; - projectile_setSprite(sp3B, D_803726F0.unk0 + ASSET_710_SPRITE_SPARKLE_PURPLE); - func_8033FFE4(sp3B, D_803726F0.unk4, D_803726F0.unk4); - func_8033FCD8(sp3B, 0xC); + projectile_setSprite(projectile_indx, D_803726F0.unk0 + ASSET_710_SPRITE_SPARKLE_PURPLE); + func_8033FFE4(projectile_indx, D_803726F0.unk4, D_803726F0.unk4); + func_8033FCD8(projectile_indx, 0xC); animsprite_default(sp34); animsprite_set_state(sp34, ANIM_SPRITE_STATE_STOPPED); @@ -68,28 +68,28 @@ void func_80355D58(void){ void func_80355E80(void){ ParticleStruct0s *sp44; - u8 sp43; + u8 projectile_indx; f32 f22; f32 f20; s32 temp_a1; f32 sp30; sp44 = func_8033E960(); - sp43 = func_8033E8D0(); + projectile_indx = func_8033E8D0(); f20 = sp44->unk0;\ f22 = sp44->unk4;\ sp30 = (f32)sp44->unk20; - func_8033FE2C(sp43, 8.0f); + projectile_addRoll(projectile_indx, 8.0f); temp_a1 = (s32) ml_map_f(f20, 0.0f, f22, sp30, 20.0f); - func_8033FFE4(sp43, temp_a1, temp_a1); + func_8033FFE4(projectile_indx, temp_a1, temp_a1); if(f22 < 0.3){ - func_8033FC34(sp43, (s32)ml_map_f(f20, 0.0f, f22, 255.0f, 20.0f)); + func_8033FC34(projectile_indx, (s32)ml_map_f(f20, 0.0f, f22, 255.0f, 20.0f)); } else if(f20 < 0.1){ - func_8033FC34(sp43, (s32)ml_map_f(f20, 0.0f, 0.1f, 20.0f, 255.0f)); + func_8033FC34(projectile_indx, (s32)ml_map_f(f20, 0.0f, 0.1f, 20.0f, 255.0f)); }else{ - func_8033FC34(sp43, (s32)ml_map_f(f20, 0.1f, f22, 255.0f, 20.0f)); + func_8033FC34(projectile_indx, (s32)ml_map_f(f20, 0.1f, f22, 255.0f, 20.0f)); } f20 += time_getDelta(); diff --git a/src/core2/code_CF090.c b/src/core2/code_CF090.c index daacb50c..35deb22f 100644 --- a/src/core2/code_CF090.c +++ b/src/core2/code_CF090.c @@ -56,32 +56,32 @@ void func_80356074(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3){ } void func_8035611C(void){ - u8 temp_s0; + u8 projectile_indx; AnimSprite *sp58; u8 sp57; ParticleStruct0s *sp54; - f32 sp44[3]; + f32 plyr_pos[3]; f32 sp38[3]; f32 sp2C[3]; - temp_s0 = (u8)func_8033E8D0(); + projectile_indx = (u8)func_8033E8D0(); sp58 = func_8033E8F4(); sp57 = func_8033E93C(); sp54 = func_8033E960(); - player_getPosition(sp44); + player_getPosition(plyr_pos); sp54->unk0 = 10.0f; sp54->unk4 = 8.0f; sp54->unk8 = 255.0f; sp54->unkC = -6.0f; - projectile_setSprite(temp_s0, ASSET_70D_SPRITE_SMOKE_1); - func_8033FCD8(temp_s0, 5); + projectile_setSprite(projectile_indx, ASSET_70D_SPRITE_SMOKE_1); + func_8033FCD8(projectile_indx, 5); - func_8033FC60(temp_s0, (s32)(randf()*30.0f + 60.0f) ,(s32)(randf()*20.0f + 210.0f), (s32)(randf()*30.0f + 140.0f)); - projectile_setPosition(temp_s0, sp44); + projectile_setColor(projectile_indx, (s32)(randf()*30.0f + 60.0f) ,(s32)(randf()*20.0f + 210.0f), (s32)(randf()*30.0f + 140.0f)); + projectile_setPosition(projectile_indx, plyr_pos); sp2C[0] = 0.0f; sp2C[1] = 0.0f; sp2C[2] = randf()*359.0f; - func_8033FD98(temp_s0, sp2C); + projectile_setRotation(projectile_indx, sp2C); animsprite_default(sp58); animsprite_set_state(sp58, ANIM_SPRITE_STATE_ONCE); animsprite_set_steps(sp58, D_80372700, sizeof(D_80372700)); @@ -92,8 +92,8 @@ void func_8035611C(void){ sp38[2] = 0.0f; func_80344E18(sp57, 2); func_80344E3C(sp57, sp38); - func_80344D94(sp57, sp44); - func_80356020(temp_s0, sp54); + func_80344D94(sp57, plyr_pos); + func_80356020(projectile_indx, sp54); } void func_803562E8(void){