Merge last two commits into renderergl2

This commit is contained in:
Zack Middleton 2013-10-29 23:22:02 -05:00
parent 611d913443
commit 0f30dad10a
2 changed files with 4 additions and 2 deletions

View file

@ -1104,7 +1104,7 @@ typedef struct {
// depending upon the exporter, blend indices and weights might be int/float // depending upon the exporter, blend indices and weights might be int/float
// as opposed to the recommended byte/byte, for example Noesis exports // as opposed to the recommended byte/byte, for example Noesis exports
// int/float whereas the official IQM tool exports byte/byte // int/float whereas the official IQM tool exports byte/byte
byte blendWeightsType; // IQM_BYTE or IQM_FLOAT byte blendWeightsType; // IQM_UBYTE or IQM_FLOAT
int *jointParents; int *jointParents;
float *jointMats; float *jointMats;

View file

@ -206,6 +206,8 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
return qfalse; return qfalse;
} }
blendIndexesType = blendWeightsType = IQM_UBYTE;
// check and swap vertex arrays // check and swap vertex arrays
if( IQM_CheckRange( header, header->ofs_vertexarrays, if( IQM_CheckRange( header, header->ofs_vertexarrays,
header->num_vertexarrays, header->num_vertexarrays,
@ -1059,7 +1061,7 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
for ( numWeights = 0; numWeights < 4; numWeights++ ) { for ( numWeights = 0; numWeights < 4; numWeights++ ) {
if ( data->blendWeightsType == IQM_FLOAT ) if ( data->blendWeightsType == IQM_FLOAT )
blendWeights[numWeights] = data->blendWeights.f[4*vtx + numWeights]; blendWeights[numWeights] = data->blendWeights.f[4*vtx + numWeights];
else // IQM_BYTE else
blendWeights[numWeights] = (float)data->blendWeights.b[4*vtx + numWeights] / 255.0f; blendWeights[numWeights] = (float)data->blendWeights.b[4*vtx + numWeights] / 255.0f;
if ( blendWeights[numWeights] <= 0 ) if ( blendWeights[numWeights] <= 0 )