|
27 | 27 |
|
28 | 28 | extern const char _stringBase0_7[]; |
29 | 29 |
|
| 30 | +/* Global variables from .comm segment */ |
| 31 | +xFXRing ringlist[RING_COUNT]; |
| 32 | +xFXStreak sStreakList[10]; |
| 33 | +xFXShine sShineList[2]; |
| 34 | + |
30 | 35 | RpAtomicCallBackRender gAtomicRenderCallBack = NULL; |
31 | | -F32 EnvMapShininess = 1.0f; |
32 | 36 | RpLight* MainLight = NULL; |
| 37 | +F32 EnvMapShininess = 1.0f; |
33 | 38 |
|
34 | | -static U32 num_fx_atomics = 0; |
| 39 | +/* End global variables */ |
35 | 40 |
|
| 41 | +static U32 num_fx_atomics = 0; |
36 | 42 | static U32 xfx_initted = 0; |
37 | 43 |
|
38 | | -xFXStreak sStreakList[10]; |
39 | | -xFXShine sShineList[2]; |
40 | | - |
41 | 44 | static void LightResetFrame(RpLight* light); |
42 | 45 |
|
43 | 46 | void xFXInit() |
@@ -91,8 +94,6 @@ static U32 sFresnelMap = 0; |
91 | 94 | static U32 sEnvMap = 0; |
92 | 95 | static S32 sTweaked = 0; |
93 | 96 |
|
94 | | -xFXRing ringlist[RING_COUNT]; |
95 | | - |
96 | 97 | static RxPipeline* xFXanimUVPipeline = NULL; |
97 | 98 | F32 xFXanimUVRotMat0[2] = { 1.0f, 0.0f }; |
98 | 99 | F32 xFXanimUVRotMat1[2] = { 0.0f, 1.0f }; |
@@ -687,6 +688,74 @@ void xFXStreakUpdate(U32 id, const xVec3* a, const xVec3* b) |
687 | 688 |
|
688 | 689 | U32 xFXStreakStart(F32 frequency, F32 alphaFadeRate, F32 alphaStart, U32 textureID, const iColor_tag* edge_a, const iColor_tag* edge_b, S32 taper) |
689 | 690 | { |
| 691 | + for (U32 i = 0; i < 10; i++) |
| 692 | + { |
| 693 | + if (sStreakList[i].flags == 0x0) |
| 694 | + { |
| 695 | + sStreakList[i].flags = 0x1; |
| 696 | + |
| 697 | + if (taper != 0) |
| 698 | + { |
| 699 | + sStreakList[i].flags |= 0x4; |
| 700 | + } |
| 701 | + |
| 702 | + sStreakList[i].frequency = frequency; |
| 703 | + sStreakList[i].alphaFadeRate = alphaFadeRate; |
| 704 | + sStreakList[i].alphaStart = alphaStart; |
| 705 | + sStreakList[i].head = 0; |
| 706 | + sStreakList[i].elapsed = 0.0f; |
| 707 | + sStreakList[i].lifetime = 0.0f; |
| 708 | + sStreakList[i].textureRasterPtr = NULL; |
| 709 | + sStreakList[i].texturePtr = NULL; |
| 710 | + |
| 711 | + for (S32 j = 0; j < 50; j++) |
| 712 | + { |
| 713 | + sStreakList[i].elem[j].flag = 0x0; |
| 714 | + } |
| 715 | + |
| 716 | + if (edge_a != NULL) |
| 717 | + { |
| 718 | + sStreakList[i].color_a = *edge_a; |
| 719 | + } |
| 720 | + else |
| 721 | + { |
| 722 | + sStreakList[i].color_a.a = 255; |
| 723 | + sStreakList[i].color_a.b = 255; |
| 724 | + sStreakList[i].color_a.g = 255; |
| 725 | + sStreakList[i].color_a.r = 255; |
| 726 | + } |
| 727 | + |
| 728 | + if (edge_b != NULL) |
| 729 | + { |
| 730 | + sStreakList[i].color_b = *edge_a; |
| 731 | + } |
| 732 | + else |
| 733 | + { |
| 734 | + sStreakList[i].color_b.a = 255; |
| 735 | + sStreakList[i].color_b.b = 255; |
| 736 | + sStreakList[i].color_b.g = 255; |
| 737 | + sStreakList[i].color_b.r = 255; |
| 738 | + } |
| 739 | + |
| 740 | + if (textureID == 0) |
| 741 | + { |
| 742 | + textureID = xStrHash("fx_streak1"); |
| 743 | + } |
| 744 | + |
| 745 | + sStreakList[i].texturePtr = (RwTexture*) xSTFindAsset(textureID, NULL); |
| 746 | + if (sStreakList[i].texturePtr != NULL) |
| 747 | + { |
| 748 | + sStreakList[i].textureRasterPtr = RwTextureGetRaster(sStreakList[i].texturePtr); |
| 749 | + } |
| 750 | + else |
| 751 | + { |
| 752 | + return 0; |
| 753 | + } |
| 754 | + |
| 755 | + } |
| 756 | + } |
| 757 | + |
| 758 | + return 10; |
690 | 759 | } |
691 | 760 |
|
692 | 761 | void xFXStreakStop(U32) |
|
0 commit comments