From 7a8472ed6bcaaca4ffcebe67bf9e1c7fa0763b83 Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 6 Apr 2022 19:23:57 +0000 Subject: [PATCH] Eukara complained about .fatness not working with hlmdl. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6225 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_hlmdl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/engine/gl/gl_hlmdl.c b/engine/gl/gl_hlmdl.c index 2ac8dee4..00b64e0a 100644 --- a/engine/gl/gl_hlmdl.c +++ b/engine/gl/gl_hlmdl.c @@ -1377,7 +1377,7 @@ unsigned int HLMDL_Contents (model_t *model, int hulloverride, const framestate_ #ifndef SERVERONLY -void R_HL_BuildFrame(hlmodel_t *model, int bodypart, int bodyidx, int meshidx, struct hlmodelshaders_s *texinfo, mesh_t *outmesh) +static void R_HL_BuildFrame(hlmodel_t *model, int bodypart, int bodyidx, int meshidx, struct hlmodelshaders_s *texinfo, mesh_t *outmesh, float fatness) { int v; int w = texinfo->defaulttex.base->width; @@ -1420,6 +1420,10 @@ void R_HL_BuildFrame(hlmodel_t *model, int bodypart, int bodyidx, int meshidx, s //FIXME: svector, tvector! } + + if (fatness) + for(v = 0; v < srcmesh->numvertexes; v++) + VectorMA(nxyz[v], fatness, nnorm[v], nxyz[v]); } } @@ -1437,7 +1441,7 @@ static void R_HL_BuildMeshes(batch_t *b) float *bones; int numbones; - if (b->shader->prog && (b->shader->prog->supportedpermutations & PERMUTATION_SKELETAL) && model->header->numbones < sh_config.max_gpu_bones) + if (b->shader->prog && (b->shader->prog->supportedpermutations & PERMUTATION_SKELETAL) && model->header->numbones < sh_config.max_gpu_bones && !b->ent->fatness) { //okay, we can use gpu gones. yay. b->mesh = mptr; *b->mesh = &model->mesh; @@ -1540,7 +1544,7 @@ static void R_HL_BuildMeshes(batch_t *b) skinidx += rent->skinnum * model->numskinrefs; texinfo = &model->shaders[model->skinref[skinidx]]; - R_HL_BuildFrame(model, body, bodyindex, m, texinfo, *b->mesh); + R_HL_BuildFrame(model, body, bodyindex, m, texinfo, *b->mesh, b->ent->fatness); } } }