From 47afae3dfe9699a5662b282af741e5ec515f6286 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 21 Dec 2004 04:32:34 +0000 Subject: [PATCH] Fixing tags. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@665 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_alias.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/engine/gl/gl_alias.c b/engine/gl/gl_alias.c index d88ae0d9e..f5ef6949a 100644 --- a/engine/gl/gl_alias.c +++ b/engine/gl/gl_alias.c @@ -2588,10 +2588,29 @@ void GLMod_GetTag(model_t *model, int tagnum, int frame, float **org, float **ax tagnum--; //tagnum 0 is 'use my angles/org' t += tagnum; + t += inf->numtags*frame; *org = t->org; *axis = (float*)t->ang; } +int GLMod_TagNumForName(model_t *model, char *name) +{ + int i; + galiasinfo_t *inf; + md3tag_t *t; + + if (!model || model->type != mod_alias) + return 0; + + inf = Mod_Extradata(model); + t = (md3tag_t*)((char*)inf + inf->ofstags); + for (i = 0; i < inf->numtags; i++) + { + if (!strcmp(t->name, name)) + return i+1; + } + return 0; +}