diff options
author | Zack Middleton <zturtleman@gmail.com> | 2013-10-29 23:22:02 -0500 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2014-06-17 17:43:35 +0100 |
commit | 9dc7556b7a1d3cc63e9055a0f98b1187b1e3fdcf (patch) | |
tree | 06d8fab65ca3d4d34d1596fa014f0f7af6d05913 /src/renderergl2 | |
parent | 0b82fba3827931d45903305f5f9a93b053a48bfa (diff) |
Merge last two commits into renderergl2
Diffstat (limited to 'src/renderergl2')
-rw-r--r-- | src/renderergl2/tr_local.h | 2 | ||||
-rw-r--r-- | src/renderergl2/tr_model_iqm.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 05662f99..bbeda0b4 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1105,7 +1105,7 @@ typedef struct { // depending upon the exporter, blend indices and weights might be int/float // as opposed to the recommended byte/byte, for example Noesis exports // 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; float *jointMats; diff --git a/src/renderergl2/tr_model_iqm.c b/src/renderergl2/tr_model_iqm.c index 43c6963e..8e826212 100644 --- a/src/renderergl2/tr_model_iqm.c +++ b/src/renderergl2/tr_model_iqm.c @@ -206,6 +206,8 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na return qfalse; } + blendIndexesType = blendWeightsType = IQM_UBYTE; + // check and swap vertex arrays if( IQM_CheckRange( header, header->ofs_vertexarrays, header->num_vertexarrays, @@ -1059,7 +1061,7 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) { for ( numWeights = 0; numWeights < 4; numWeights++ ) { if ( data->blendWeightsType == IQM_FLOAT ) blendWeights[numWeights] = data->blendWeights.f[4*vtx + numWeights]; - else // IQM_BYTE + else blendWeights[numWeights] = (float)data->blendWeights.b[4*vtx + numWeights] / 255.0f; if ( blendWeights[numWeights] <= 0 ) |