fixed RB_CalcDeformNormals from accessing floats as doubles, which was breaking the rendering of flags and probably many other things

This commit is contained in:
myT 2017-03-14 05:18:59 +01:00
parent 1efd5b6d82
commit ddb6f080f3

View file

@ -160,22 +160,22 @@ static void RB_CalcDeformVertexes( const deformStage_t* ds )
static void RB_CalcDeformNormals( const deformStage_t* ds )
{
int i;
double scale;
double *xyz = ( double * ) tess.xyz;
float *normal = ( float * ) tess.normal;
float scale;
const float *xyz = ( const float * ) tess.xyz;
float *normal = ( float * ) tess.normal;
for ( i = 0; i < tess.numVertexes; i++, xyz += 4, normal += 4 ) {
scale = 0.98;
scale = 0.98f;
scale = R_NoiseGet4f( xyz[0] * scale, xyz[1] * scale, xyz[2] * scale,
tess.shaderTime * ds->deformationWave.frequency );
normal[ 0 ] += ds->deformationWave.amplitude * scale;
scale = 0.98;
scale = 0.98f;
scale = R_NoiseGet4f( 100 + xyz[0] * scale, xyz[1] * scale, xyz[2] * scale,
tess.shaderTime * ds->deformationWave.frequency );
normal[ 1 ] += ds->deformationWave.amplitude * scale;
scale = 0.98;
scale = 0.98f;
scale = R_NoiseGet4f( 200 + xyz[0] * scale, xyz[1] * scale, xyz[2] * scale,
tess.shaderTime * ds->deformationWave.frequency );
normal[ 2 ] += ds->deformationWave.amplitude * scale;