Module zmodel: Change committed
havoc at icculus.org
havoc at icculus.org
Sun Feb 13 17:51:34 EST 2005
Commiter : havoc
CVSROOT : /cvs/cvsroot/twilight
Module : zmodel
Commit time: 2005-02-13 22:51:34 UTC
Log message:
added keepallbones variable (defaults to 1, no way to disable it currently) which bypasses the removal of unused bones, since some of them may be useful for attachments
Modified files:
zmodel.c
------=MIME.1451d085591e53d3105eede1d35704a6
Content-Type: text/plain; name="zmodel.20050213.225134.havoc.diff"
Content-Disposition: attachment; filename="zmodel.20050213.225134.havoc.diff"
Content-Transfer-Encoding: 8bit
Index: zmodel/zmodel.c
diff -u zmodel/zmodel.c:1.3 zmodel/zmodel.c:1.4
--- zmodel/zmodel.c:1.3 Mon May 3 06:21:11 2004
+++ zmodel/zmodel.c Sun Feb 13 17:51:24 2005
@@ -35,6 +35,9 @@
float modelorigin[3], modelscale;
+// this makes it keep all bones, not removing unused ones (as they might be used for attachments)
+int keepallbones = 1;
+
void cleancopyname(char *out, char *in, int size)
{
char *end = out + size - 1;
@@ -192,7 +195,7 @@
out = scriptfilebuffer;
while (*in && *in <= ' ')
in++;
- while (*in &&
+ while (*in &&
while (scriptfiles < 256)
{
scriptfile[scriptfiles++] = name;
@@ -285,7 +288,7 @@
void computebonematrix(float x, float y, float z, float a, float b, float c, bonepose_t *out)
{
float sr, sp, sy, cr, cp, cy;
-
+
sy = sin(c);
cy = cos(c);
sp = sin(b);
@@ -853,6 +856,8 @@
numtbones = 0;
for (i = 0;i < numbones;i++)
{
+ if (keepallbones)
+ boneusage[i] = 1;
if (boneusage[i])
{
boneremap[i] = numtbones;
@@ -988,7 +993,7 @@
// normally the scene will loop, if this is set it will stay on the final frame
#define ZYMSCENEFLAG_NOLOOP 1
-
+
if (scene[i].noloop)
j |= ZYMSCENEFLAG_NOLOOP;
putlong(j);
More information about the twilight-commits
mailing list