From: eihrul Date: Wed, 17 Feb 2010 08:45:57 +0000 (+0000) Subject: Mod_Decompile_SMD blend weight fixes X-Git-Tag: xonotic-v0.1.0preview~230^2~502 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=96c3530b7406fd52b113fb5441afa9ed56147518;p=xonotic%2Fdarkplaces.git Mod_Decompile_SMD blend weight fixes git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9967 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/model_shared.c b/model_shared.c index 44f57d7b..ab5adb45 100644 --- a/model_shared.c +++ b/model_shared.c @@ -2814,12 +2814,12 @@ static void Mod_Decompile_SMD(dp_model_t *model, const char *filename, int first const float *v = model->surfmesh.data_vertex3f + index * 3; const float *vn = model->surfmesh.data_normal3f + index * 3; const float *vt = model->surfmesh.data_texcoordtexture2f + index * 2; - unsigned short b = model->surfmesh.blends[index]; + const int b = model->surfmesh.blends[index]; if (b < model->num_bones) l = dpsnprintf(outbuffer + outbufferpos, outbuffermax - outbufferpos, "%3i %f %f %f %f %f %f %f %f\n" , b, v[0], v[1], v[2], vn[0], vn[1], vn[2], vt[0], 1 - vt[1]); else { - const blendweights_t *w = model->surfmesh.data_blendweights + b; + const blendweights_t *w = model->surfmesh.data_blendweights + b - model->num_bones; const unsigned char *wi = w->index; const unsigned char *wf = w->influence; if (wf[3]) l = dpsnprintf(outbuffer + outbufferpos, outbuffermax - outbufferpos, "%3i %f %f %f %f %f %f %f %f 4 %i %f %i %f %i %f %i %f\n", wi[0], v[0], v[1], v[2], vn[0], vn[1], vn[2], vt[0], 1 - vt[1], wi[0], wf[0]/255.0f, wi[1], wf[1]/255.0f, wi[2], wf[2]/255.0f, wi[3], wf[3]/255.0f);