135 if (
alpha[i] <= 0.0f) {
147 frame[i] = (int) (5.0f * rand() / 2147483648.0f) * 0x30;
153 if (
alpha[i] <= 0.0f) {
159 if (!(
alpha[i] < 128.0f)) {
179 if (
alpha[i] == 0.0f) {
180 size[i] = 2.0f + 6.0f * rand() / 2147483648.0f;
182 alpha[i] = 1.0f + 48.0f * rand() / 2147483648.0f;
188 frame[i] = (int) (5.0f * rand() / 2147483648.0f) * 0x30;
213 texture = TexManager.GetTexture(
"element", -1);
214 sceVu0CopyVector(base, *
origin);
220 if (
alpha[i] <= 0.0f) {
225 pos[0] = base[0] +
offset[i][0];
226 pos[1] = base[1] +
offset[i][1];
227 pos[2] = base[2] +
offset[i][2];
229 if (MGRotTransPers3DSprite(corner[0], corner[3], pos, width, width / 2.0f, 0) != 1) {
235 corner[1][0] = corner[3][0];
236 corner[1][1] = corner[0][1];
237 corner[1][2] = corner[0][2];
238 corner[2][0] = corner[0][0];
239 corner[2][1] = corner[3][1];
240 corner[2][2] = corner[3][2];
246 set3DSprite(Vif1Packet, texture, rect, corner[0], corner[1], corner[2], corner[3], (u8)
alpha[i]);
284 if (
alpha[i] <= 0.0f) {
287 offset[i][1] -= 0.1f + 0.3f * rand() / 2147483648.0f;
296 frame[i] = (int) (5.0f * rand() / 2147483648.0f) * 0x30;
302 if (
alpha[i] <= 0.0f) {
308 if (!(
alpha[i] < 128.0f)) {
327 if (
alpha[i] == 0.0f) {
328 size[i] = 3.0f + 6.0f * rand() / 2147483648.0f;
330 alpha[i] = 1.0f + 48.0f * rand() / 2147483648.0f;
336 frame[i] = (int) (5.0f * rand() / 2147483648.0f) * 0x30;
361 texture = TexManager.GetTexture(
"element", -1);
362 sceVu0CopyVector(base, *
origin);
368 if (
alpha[i] <= 0.0f) {
373 pos[0] = base[0] +
offset[i][0];
374 pos[1] = base[1] +
offset[i][1];
375 pos[2] = base[2] +
offset[i][2];
377 if (MGRotTransPers3DSprite(corner[0], corner[3], pos, width, width / 2.0f, 0) != 1) {
383 corner[1][0] = corner[3][0];
384 corner[1][1] = corner[0][1];
385 corner[1][2] = corner[0][2];
386 corner[2][0] = corner[0][0];
387 corner[2][1] = corner[3][1];
388 corner[2][2] = corner[3][2];
394 set3DSprite(Vif1Packet, texture, rect, corner[0], corner[1], corner[2], corner[3], (u8)
alpha[i]);
412 for (
int i = 0; i <
count; i++) {
413 size[i] = 2.0f + 4.0f * rand() / 2147483648.0f;
415 alpha[i] = 1.0f + 48.0f * rand() / 2147483648.0f;
426 spin[i] = 2.0f * (PI_SHORT * rand()) / 2147483648.0f - PI_SHORT;
427 spin_speed[i] = 0.09817475f + SIXTEENTH_PI_SHORT * rand() / 2147483648.0f;
428 frame[i] = (int) (5.0f * rand() / 2147483648.0f) * 0x30;
439 if (
alpha[i] <= 0.0f) {
445 if (
alpha[i] <= 0.0f) {
451 if (!(
alpha[i] < 128.0f)) {
457 frame[i] = (int) (5.0f * rand() / 2147483648.0f) * 0x30;
462 if (!(
spin[i] <= PI_SHORT)) {
463 spin[i] -= TWO_PI_SHORT;
484 if (
alpha[i] == 0.0f) {
485 size[i] = 2.0f + 4.0f * rand() / 2147483648.0f;
487 alpha[i] = 1.0f + 48.0f * rand() / 2147483648.0f;
496 spin[i] = 2.0f * (PI_SHORT * rand()) / 2147483648.0f - PI_SHORT;
497 spin_speed[i] = 0.09817475f + SIXTEENTH_PI_SHORT * rand() / 2147483648.0f;
498 frame[i] = (int) (5.0f * rand() / 2147483648.0f) * 0x30;
525 texture = TexManager.GetTexture(
"element", -1);
526 sceVu0CopyVector(base, *
origin);
532 if (
alpha[i] <= 0.0f) {
539 sceVu0UnitMatrix(unit);
540 sceVu0RotMatrixY(turn, unit,
spin[i]);
541 sceVu0ApplyMatrix(pos, turn,
offset[i]);
546 if (MGRotTransPers3DSprite(corner[0], corner[3], pos, width, width / 2.0f, 0) != 1) {
552 corner[1][0] = corner[3][0];
553 corner[1][1] = corner[0][1];
554 corner[1][2] = corner[0][2];
555 corner[2][0] = corner[0][0];
556 corner[2][1] = corner[3][1];
557 corner[2][2] = corner[3][2];
563 set3DSprite(Vif1Packet, texture, rect, corner[0], corner[1], corner[2], corner[3], (u8)
alpha[i]);
604 if (
alpha[i] <= 0.0f) {
607 offset[i][1] += 0.01f + 0.6f * rand() / 2147483648.0f;
616 frame[i] = (int) (5.0f * rand() / 2147483648.0f) * 0x30;
622 if (
alpha[i] <= 0.0f) {
628 if (!(
alpha[i] < 128.0f)) {
647 if (
alpha[i] == 0.0f) {
648 size[i] = 2.0f + 6.0f * rand() / 2147483648.0f;
650 alpha[i] = 1.0f + 48.0f * rand() / 2147483648.0f;
656 frame[i] = (int) (5.0f * rand() / 2147483648.0f) * 0x30;
681 texture = TexManager.GetTexture(
"element", -1);
688 if (
alpha[i] <= 0.0f) {
693 pos[0] = base[0] +
offset[i][0];
694 pos[1] = base[1] +
offset[i][1];
695 pos[2] = base[2] +
offset[i][2];
697 if (MGRotTransPers3DSprite(corner[0], corner[3], pos, width, width / 2.0f, 0) != 1) {
703 corner[1][0] = corner[3][0];
704 corner[1][1] = corner[0][1];
705 corner[1][2] = corner[0][2];
706 corner[2][0] = corner[0][0];
707 corner[2][1] = corner[3][1];
708 corner[2][2] = corner[3][2];
714 set3DSprite(Vif1Packet, texture, rect, corner[0], corner[1], corner[2], corner[3], (u8)
alpha[i]);
726 for (
int i = 0; i <
count; i++) {
727 velocity[i][0] = 8.0f * rand() / 2147483648.0f - 4.0f;
728 velocity[i][1] = 4.0f * rand() / 2147483648.0f - 2.0f;
729 velocity[i][2] = 8.0f * rand() / 2147483648.0f - 4.0f;
733 sceVu0ScaleVectorXYZ(reach, dir,
spread);
734 offset[i][0] = position[0] +
velocity[i][0] + reach[0] * rand() / 2147483648.0f;
735 offset[i][1] = position[1] +
velocity[i][1] + reach[1] * rand() / 2147483648.0f;
736 offset[i][2] = position[2] +
velocity[i][2] + reach[2] * rand() / 2147483648.0f;
738 sceVu0ScaleVectorXYZ(
velocity[i], dir, 0.3f * rand() / 2147483648.0f);
739 size[i] = 0.5f + 2.5f * rand() / 2147483648.0f;
741 alpha[i] = 96.0f + (int) (64.0f * rand() / 2147483648.0f);
747 bolt_timer[i] = (int) (6.0f * rand() / 2147483648.0f) * 3 + 3;
748 bolt_frame[i] = (int) (4.0f * rand() / 2147483648.0f);
805 texture = TexManager.GetTexture(
"element", -1);
806 sceVu0CopyVector(base, *
origin);
808 for (i = 0; i <
count; i++) {
809 if (
alpha[i] <= 0.0f) {
815 if (MGRotTransPers3DSprite(corner[0], corner[3],
offset[i], width, width / 2.0f, 0) != 1) {
821 corner[1][0] = corner[3][0];
822 corner[1][1] = corner[0][1];
823 corner[1][2] = corner[0][2];
824 corner[2][0] = corner[0][0];
825 corner[2][1] = corner[3][1];
826 corner[2][2] = corner[3][2];
828 set3DSprite(Vif1Packet, texture,
CRect_i_(0, 0, 0x30, 0x30), corner[0], corner[1], corner[2], corner[3], (u8)
alpha[i]);
831 int bolt_uv[4][2] = {
844 MGRotTransPers(corner[0], pos, 0);
846 MGRotTransPers(corner[1], pos, 0);
849 MGRotTransPers(corner[2], pos, 0);
851 MGRotTransPers(corner[3], pos, 0);
854 int u = bolt_uv[shape][0];
855 int v = bolt_uv[shape][1];
857 set3DSprite(Vif1Packet, texture,
CRect_i_(u, v, 0x18, 0x68), corner[0], corner[1], corner[2], corner[3], (u8) (1.6f *
alpha[
bolt_head[i]]));