43 {
48 s32 numParts;
49 f32 var_f30;
50 f32 angle;
51 f32 angle2;
52 s32 i;
53
54 switch (arg0) {
55 case 0:
56 numParts = 36;
57 var_f30 = arg4;
58 break;
59 case 1:
60 numParts = 4;
61 var_f30 = arg4;
62 break;
63 case 2:
64 numParts = 8;
65 var_f30 = arg4;
66 break;
67 case 3:
68 numParts = 4;
69 var_f30 = 8.0f;
70 break;
71 default:
72 numParts = 8;
73 var_f30 = 8.0f;
74 break;
75 }
76
77 numParts++;
78
85
90
97
98 part++;
99 for (i = 1; i < numParts; i++, part++) {
100 f32 rand1 =
rand_int(arg4 * 1000.0f) / 1000.0f;
101 f32 rand2 =
rand_int(var_f30 * 1000.0f) / 1000.0f;
102
103 switch (arg0) {
104 case 0:
105 angle = (360.0f / (numParts - 1)) * i;
106 angle2 = (1800.0f / (numParts - 1)) * i - 90.0f;
108 part->
unk_10 = (
sin_deg(angle) * (85.0f -
sin_deg(angle2) * 15.0f - (i & 1) * 5) / 100.0f) * arg4;
109 part->
unk_14 = (
cos_deg(angle) * (85.0f -
sin_deg(angle2) * 15.0f - (i & 1) * 5) / 100.0f) * arg4;
112 break;
113 case 1:
114 case 2:
115 angle = (360.0f / (numParts - 1)) * i +
rand_int(359);
116 if (i & 1) {
118 } else {
120 }
127 part->
unk_24 = i * 2 + 30;
130 break;
131 case 3:
132 case 4:
133 default:
134 angle = (360.0f / (numParts - 1)) * i +
rand_int(359);
142 part->
unk_24 = i * 2 + 18;
145 break;
146 }
147 }
148}
#define general_heap_malloc
#define create_effect_instance
#define ASSERT(condition)
void sparkles_init(EffectInstance *effect)
void sparkles_update(EffectInstance *effect)
void sparkles_render(EffectInstance *effect)
void(* renderUI)(EffectInstance *effectInst)
void(* init)(EffectInstance *effectInst)
void(* update)(EffectInstance *effectInst)
void(* renderWorld)(EffectInstance *effectInst)