Skip to content

Commit fe970db

Browse files
committed
xFX: Progress on xFXStreakStart
1 parent 0c3f6e4 commit fe970db

File tree

1 file changed

+76
-7
lines changed

1 file changed

+76
-7
lines changed

src/SB/Core/x/xFX.cpp

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,20 @@
2727

2828
extern const char _stringBase0_7[];
2929

30+
/* Global variables from .comm segment */
31+
xFXRing ringlist[RING_COUNT];
32+
xFXStreak sStreakList[10];
33+
xFXShine sShineList[2];
34+
3035
RpAtomicCallBackRender gAtomicRenderCallBack = NULL;
31-
F32 EnvMapShininess = 1.0f;
3236
RpLight* MainLight = NULL;
37+
F32 EnvMapShininess = 1.0f;
3338

34-
static U32 num_fx_atomics = 0;
39+
/* End global variables */
3540

41+
static U32 num_fx_atomics = 0;
3642
static U32 xfx_initted = 0;
3743

38-
xFXStreak sStreakList[10];
39-
xFXShine sShineList[2];
40-
4144
static void LightResetFrame(RpLight* light);
4245

4346
void xFXInit()
@@ -91,8 +94,6 @@ static U32 sFresnelMap = 0;
9194
static U32 sEnvMap = 0;
9295
static S32 sTweaked = 0;
9396

94-
xFXRing ringlist[RING_COUNT];
95-
9697
static RxPipeline* xFXanimUVPipeline = NULL;
9798
F32 xFXanimUVRotMat0[2] = { 1.0f, 0.0f };
9899
F32 xFXanimUVRotMat1[2] = { 0.0f, 1.0f };
@@ -687,6 +688,74 @@ void xFXStreakUpdate(U32 id, const xVec3* a, const xVec3* b)
687688

688689
U32 xFXStreakStart(F32 frequency, F32 alphaFadeRate, F32 alphaStart, U32 textureID, const iColor_tag* edge_a, const iColor_tag* edge_b, S32 taper)
689690
{
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;
690759
}
691760

692761
void xFXStreakStop(U32)

0 commit comments

Comments
 (0)