Fixes corruption of the lightning particle FX that was caused by an incorrect order of vertex attributes being passed to the vertex buffer. (#43)

The other FX classes were also adapted to use the same vertex attribute ordering as the vanilla base class.
This commit is contained in:
shartte
2016-08-24 19:07:54 +02:00
committed by Elix_x
parent 255083e00c
commit 999401c50c
4 changed files with 29 additions and 23 deletions
@@ -35,6 +35,7 @@ public class LightningFX extends Particle
private static final Random RANDOM_GENERATOR = new Random();
private static final int STEPS = 5;
private static final int BRIGHTNESS = 13 << 4;
private final double[][] precomputedSteps;
private final double[] vertices = new double[3];
@@ -75,13 +76,6 @@ public class LightningFX extends Particle
return LightningFX.STEPS;
}
@Override
public int getBrightnessForRender( final float par1 )
{
final int j1 = 13;
return j1 << 20 | j1 << 4;
}
@Override
public void onUpdate()
{
@@ -232,10 +226,10 @@ public class LightningFX extends Particle
{
if( this.hasData )
{
tess.color( red, green, blue, this.particleAlpha ).pos( a[0], a[1], a[2] ).tex( f6, f8 ).endVertex();
tess.color( red, green, blue, this.particleAlpha ).pos( this.vertices[0], this.vertices[1], this.vertices[2] ).tex( f6, f8 ).endVertex();
tess.color( red, green, blue, this.particleAlpha ).pos( this.verticesWithUV[0], this.verticesWithUV[1], this.verticesWithUV[2] ).tex( f6, f8 ).endVertex();
tess.color( red, green, blue, this.particleAlpha ).pos( b[0], b[1], b[2] ).tex( f6, f8 ).endVertex();
tess.pos( a[0], a[1], a[2] ).tex( f6, f8 ).color( red, green, blue, this.particleAlpha ).lightmap( BRIGHTNESS, BRIGHTNESS ).endVertex();
tess.pos( this.vertices[0], this.vertices[1], this.vertices[2] ).tex( f6, f8 ).color( red, green, blue, this.particleAlpha ).lightmap( BRIGHTNESS, BRIGHTNESS ).endVertex();
tess.pos( this.verticesWithUV[0], this.verticesWithUV[1], this.verticesWithUV[2] ).tex( f6, f8 ).color( red, green, blue, this.particleAlpha ).lightmap( BRIGHTNESS, BRIGHTNESS ).endVertex();
tess.pos( b[0], b[1], b[2] ).tex( f6, f8 ).color( red, green, blue, this.particleAlpha ).lightmap( BRIGHTNESS, BRIGHTNESS ).endVertex();
}
this.hasData = true;
for( int x = 0; x < 3; x++ )