IQM int/float vertex arrays were already swapped

This commit is contained in:
Zack Middleton 2013-10-29 23:07:15 -05:00
parent 0bf1f3d0ba
commit c28fabf505
2 changed files with 8 additions and 10 deletions

View file

@ -663,7 +663,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
if( blendIndexesType == IQM_INT ) { if( blendIndexesType == IQM_INT ) {
int *data = (int*)((byte*)header + vertexarray->offset); int *data = (int*)((byte*)header + vertexarray->offset);
for ( j = 0; j < n; j++ ) { for ( j = 0; j < n; j++ ) {
iqmData->blendIndexes[j] = (byte)LittleLong( data[j] ); iqmData->blendIndexes[j] = (byte)data[j];
} }
} else { } else {
Com_Memcpy( iqmData->blendIndexes, Com_Memcpy( iqmData->blendIndexes,
@ -673,10 +673,9 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
break; break;
case IQM_BLENDWEIGHTS: case IQM_BLENDWEIGHTS:
if( blendWeightsType == IQM_FLOAT ) { if( blendWeightsType == IQM_FLOAT ) {
float *data = (float*)((byte*)header + vertexarray->offset); Com_Memcpy( iqmData->blendWeights.f,
for ( j = 0; j < n; j++ ) { (byte *)header + vertexarray->offset,
iqmData->blendWeights.f[j] = LittleFloat( data[j] ); n * sizeof(float) );
}
} else { } else {
Com_Memcpy( iqmData->blendWeights.b, Com_Memcpy( iqmData->blendWeights.b,
(byte *)header + vertexarray->offset, (byte *)header + vertexarray->offset,

View file

@ -663,7 +663,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
if( blendIndexesType == IQM_INT ) { if( blendIndexesType == IQM_INT ) {
int *data = (int*)((byte*)header + vertexarray->offset); int *data = (int*)((byte*)header + vertexarray->offset);
for ( j = 0; j < n; j++ ) { for ( j = 0; j < n; j++ ) {
iqmData->blendIndexes[j] = (byte)LittleLong( data[j] ); iqmData->blendIndexes[j] = (byte)data[j];
} }
} else { } else {
Com_Memcpy( iqmData->blendIndexes, Com_Memcpy( iqmData->blendIndexes,
@ -673,10 +673,9 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
break; break;
case IQM_BLENDWEIGHTS: case IQM_BLENDWEIGHTS:
if( blendWeightsType == IQM_FLOAT ) { if( blendWeightsType == IQM_FLOAT ) {
float *data = (float*)((byte*)header + vertexarray->offset); Com_Memcpy( iqmData->blendWeights.f,
for ( j = 0; j < n; j++ ) { (byte *)header + vertexarray->offset,
iqmData->blendWeights.f[j] = LittleFloat( data[j] ); n * sizeof(float) );
}
} else { } else {
Com_Memcpy( iqmData->blendWeights.b, Com_Memcpy( iqmData->blendWeights.b,
(byte *)header + vertexarray->offset, (byte *)header + vertexarray->offset,