From cfadc8e71772dcca8b545f6ca69a9f326575e92f Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 7 Jul 2009 06:35:15 +0000 Subject: [PATCH] Now works properly with larger multi-surface md5 models. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3243 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/com_mesh.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/engine/common/com_mesh.c b/engine/common/com_mesh.c index 7870d8612..8c14dd7f8 100644 --- a/engine/common/com_mesh.c +++ b/engine/common/com_mesh.c @@ -4480,6 +4480,7 @@ qboolean Mod_ParseMD5Anim(char *buffer, galiasinfo_t *prototype, void**poseofs, float tx, ty, tz, qx, qy, qz; int fac, flags; float f; + char com_token[8192]; EXPECT("MD5Version"); EXPECT("10"); @@ -4679,12 +4680,13 @@ qboolean Mod_LoadCompositeAnim(model_t *mod, void *buffer) int i; char *file; - galiasinfo_t *root = NULL; + galiasinfo_t *root = NULL, *surf; int numgroups = 0; galiasgroup_t *grouplist = NULL; galiasgroup_t *newgroup = NULL; void **poseofs; int hunkstart, hunkend, hunktotal; + char com_token[8192]; loadmodel=mod; @@ -4828,13 +4830,13 @@ qboolean Mod_LoadCompositeAnim(model_t *mod, void *buffer) newgroup = grouplist; grouplist = Hunk_Alloc(sizeof(galiasgroup_t)*numgroups); - for(;;) + for(surf = root;;) { - root->groupofs = (char*)grouplist - (char*)root; - root->groups = numgroups; - if (!root->nextsurf) + surf->groupofs = (char*)grouplist - (char*)surf; + surf->groups = numgroups; + if (!surf->nextsurf) break; - root = (galiasinfo_t*)((char*)root + root->nextsurf); + surf = (galiasinfo_t*)((char*)surf + surf->nextsurf); } for (i = 0; i < numgroups; i++) {