utils: mdldec: add fixed uv coords support.

pull/776/head
Andrey Akhmichin 10 months ago committed by a1batross
parent 203afda053
commit 9917cba8fc
  1. 12
      utils/mdldec/smd.c

@ -262,8 +262,16 @@ static void WriteTriangleInfo( FILE *fp, mstudiomodel_t *model, mstudiotexture_t
Matrix3x4_VectorRotate( bonetransform[bone_index], studionorms[norm_index], norm );
VectorNormalize( norm );
u = ( triverts[indices[i]]->s + 1.0f ) * s;
v = 1.0f - triverts[indices[i]]->t * t;
if( texture->flags & STUDIO_NF_UV_COORDS )
{
u = HalfToFloat( triverts[indices[i]]->s );
v = -HalfToFloat( triverts[indices[i]]->t );
}
else
{
u = ( triverts[indices[i]]->s + 1.0f ) * s;
v = 1.0f - triverts[indices[i]]->t * t;
}
fprintf( fp, "%3i %f %f %f %f %f %f %f %f\n",
bone_index,

Loading…
Cancel
Save