[iortcw] 112/497: All: Make R_LerpTag for IQM model return tag index or -1 if tag is not found
Simon McVittie
smcv at debian.org
Wed Sep 21 19:47:38 UTC 2016
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.42d
in repository iortcw.
commit ccbad511d444fdd8f8849cf38f3e0f358a8550d9
Author: ZTurtleMan at gmail.com <ZTurtleMan at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date: Fri May 9 22:30:44 2014 +0000
All: Make R_LerpTag for IQM model return tag index or -1 if tag is not found
Use to return qfalse/qtrue like Q3 R_LerpTag API.
---
MP/code/rend2/tr_local.h | 2 +-
MP/code/rend2/tr_model.c | 2 +-
MP/code/rend2/tr_model_iqm.c | 8 ++++----
MP/code/renderer/tr_local.h | 2 +-
MP/code/renderer/tr_model.c | 2 +-
MP/code/renderer/tr_model_iqm.c | 8 ++++----
SP/code/rend2/tr_local.h | 2 +-
SP/code/rend2/tr_model.c | 2 +-
SP/code/rend2/tr_model_iqm.c | 8 ++++----
SP/code/renderer/tr_local.h | 2 +-
SP/code/renderer/tr_model.c | 2 +-
SP/code/renderer/tr_model_iqm.c | 8 ++++----
12 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/MP/code/rend2/tr_local.h b/MP/code/rend2/tr_local.h
index 0e93fb8..9b59b71 100644
--- a/MP/code/rend2/tr_local.h
+++ b/MP/code/rend2/tr_local.h
@@ -2536,7 +2536,7 @@ void R_AddIQMSurfaces( trRefEntity_t *ent );
void RB_IQMSurfaceAnim( surfaceType_t *surface );
int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame,
- float frac, const char *tagName );
+ float frac, const char *tagName, int startIndex );
/*
=============================================================
diff --git a/MP/code/rend2/tr_model.c b/MP/code/rend2/tr_model.c
index c2cdbf1..7e5e9fd 100644
--- a/MP/code/rend2/tr_model.c
+++ b/MP/code/rend2/tr_model.c
@@ -2219,7 +2219,7 @@ int R_LerpTag( orientation_t *tag, const refEntity_t *refent, const char *tagNam
else if( model->type == MOD_IQM ) {
return R_IQMLerpTag( tag, model->modelData,
startFrame, endFrame,
- frac, tagName );
+ frac, tagName, startIndex );
} else {
start = end = NULL;
}
diff --git a/MP/code/rend2/tr_model_iqm.c b/MP/code/rend2/tr_model_iqm.c
index b3843c5..5b404cc 100644
--- a/MP/code/rend2/tr_model_iqm.c
+++ b/MP/code/rend2/tr_model_iqm.c
@@ -1164,21 +1164,21 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame,
- float frac, const char *tagName ) {
+ float frac, const char *tagName, int startIndex ) {
float jointMats[IQM_MAX_JOINTS * 12];
int joint;
char *names = data->names;
// get joint number by reading the joint names
for( joint = 0; joint < data->num_joints; joint++ ) {
- if( !strcmp( tagName, names ) )
+ if( joint >= startIndex && !strcmp( tagName, names ) )
break;
names += strlen( names ) + 1;
}
if( joint >= data->num_joints ) {
AxisClear( tag->axis );
VectorClear( tag->origin );
- return qfalse;
+ return -1;
}
ComputeJointMats( data, startFrame, endFrame, frac, jointMats );
@@ -1196,5 +1196,5 @@ int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
tag->axis[2][2] = jointMats[12 * joint + 10];
tag->origin[2] = jointMats[12 * joint + 11];
- return qtrue;
+ return joint;
}
diff --git a/MP/code/renderer/tr_local.h b/MP/code/renderer/tr_local.h
index 5e2252c..5aecb72 100644
--- a/MP/code/renderer/tr_local.h
+++ b/MP/code/renderer/tr_local.h
@@ -1652,7 +1652,7 @@ void R_AddIQMSurfaces( trRefEntity_t *ent );
void RB_IQMSurfaceAnim( surfaceType_t *surface );
int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame,
- float frac, const char *tagName );
+ float frac, const char *tagName, int startIndex );
/*
=============================================================
diff --git a/MP/code/renderer/tr_model.c b/MP/code/renderer/tr_model.c
index 74a24dc..b89ca8f 100644
--- a/MP/code/renderer/tr_model.c
+++ b/MP/code/renderer/tr_model.c
@@ -2092,7 +2092,7 @@ int R_LerpTag( orientation_t *tag, const refEntity_t *refent, const char *tagNam
else if ( model->type == MOD_IQM ) {
return R_IQMLerpTag( tag, model->modelData,
startFrame, endFrame,
- frac, tagName );
+ frac, tagName, startIndex );
} else {
start = end = NULL;
}
diff --git a/MP/code/renderer/tr_model_iqm.c b/MP/code/renderer/tr_model_iqm.c
index 0f99f16..7da9c7b 100644
--- a/MP/code/renderer/tr_model_iqm.c
+++ b/MP/code/renderer/tr_model_iqm.c
@@ -1149,21 +1149,21 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame,
- float frac, const char *tagName ) {
+ float frac, const char *tagName, int startIndex ) {
float jointMats[IQM_MAX_JOINTS * 12];
int joint;
char *names = data->names;
// get joint number by reading the joint names
for( joint = 0; joint < data->num_joints; joint++ ) {
- if( !strcmp( tagName, names ) )
+ if( joint >= startIndex && !strcmp( tagName, names ) )
break;
names += strlen( names ) + 1;
}
if( joint >= data->num_joints ) {
AxisClear( tag->axis );
VectorClear( tag->origin );
- return qfalse;
+ return -1;
}
ComputeJointMats( data, startFrame, endFrame, frac, jointMats );
@@ -1181,5 +1181,5 @@ int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
tag->axis[2][2] = jointMats[12 * joint + 10];
tag->origin[2] = jointMats[12 * joint + 11];
- return qtrue;
+ return joint;
}
diff --git a/SP/code/rend2/tr_local.h b/SP/code/rend2/tr_local.h
index 9493f17..074cb60 100644
--- a/SP/code/rend2/tr_local.h
+++ b/SP/code/rend2/tr_local.h
@@ -2564,7 +2564,7 @@ void R_AddIQMSurfaces( trRefEntity_t *ent );
void RB_IQMSurfaceAnim( surfaceType_t *surface );
int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame,
- float frac, const char *tagName );
+ float frac, const char *tagName, int startIndex );
/*
=============================================================
diff --git a/SP/code/rend2/tr_model.c b/SP/code/rend2/tr_model.c
index fd46d1c..5a474b0 100644
--- a/SP/code/rend2/tr_model.c
+++ b/SP/code/rend2/tr_model.c
@@ -2216,7 +2216,7 @@ int R_LerpTag( orientation_t *tag, const refEntity_t *refent, const char *tagNam
else if ( model->type == MOD_IQM ) {
return R_IQMLerpTag( tag, model->modelData,
startFrame, endFrame,
- frac, tagName );
+ frac, tagName, startIndex );
} else {
start = end = NULL;
}
diff --git a/SP/code/rend2/tr_model_iqm.c b/SP/code/rend2/tr_model_iqm.c
index 1147212..d442b7a 100644
--- a/SP/code/rend2/tr_model_iqm.c
+++ b/SP/code/rend2/tr_model_iqm.c
@@ -1164,21 +1164,21 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame,
- float frac, const char *tagName ) {
+ float frac, const char *tagName, int startIndex ) {
float jointMats[IQM_MAX_JOINTS * 12];
int joint;
char *names = data->names;
// get joint number by reading the joint names
for( joint = 0; joint < data->num_joints; joint++ ) {
- if( !strcmp( tagName, names ) )
+ if( joint >= startIndex && !strcmp( tagName, names ) )
break;
names += strlen( names ) + 1;
}
if( joint >= data->num_joints ) {
AxisClear( tag->axis );
VectorClear( tag->origin );
- return qfalse;
+ return -1;
}
ComputeJointMats( data, startFrame, endFrame, frac, jointMats );
@@ -1196,5 +1196,5 @@ int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
tag->axis[2][2] = jointMats[12 * joint + 10];
tag->origin[2] = jointMats[12 * joint + 11];
- return qtrue;
+ return joint;
}
diff --git a/SP/code/renderer/tr_local.h b/SP/code/renderer/tr_local.h
index a114a2e..9646f5e 100644
--- a/SP/code/renderer/tr_local.h
+++ b/SP/code/renderer/tr_local.h
@@ -1679,7 +1679,7 @@ void R_AddIQMSurfaces( trRefEntity_t *ent );
void RB_IQMSurfaceAnim( surfaceType_t *surface );
int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame,
- float frac, const char *tagName );
+ float frac, const char *tagName, int startIndex );
/*
=============================================================
diff --git a/SP/code/renderer/tr_model.c b/SP/code/renderer/tr_model.c
index 7f09fcc..3fa4e1c 100644
--- a/SP/code/renderer/tr_model.c
+++ b/SP/code/renderer/tr_model.c
@@ -2086,7 +2086,7 @@ int R_LerpTag( orientation_t *tag, const refEntity_t *refent, const char *tagNam
else if ( model->type == MOD_IQM ) {
return R_IQMLerpTag( tag, model->modelData,
startFrame, endFrame,
- frac, tagName );
+ frac, tagName, startIndex );
} else {
start = end = NULL;
}
diff --git a/SP/code/renderer/tr_model_iqm.c b/SP/code/renderer/tr_model_iqm.c
index 4e41915..543aeeb 100644
--- a/SP/code/renderer/tr_model_iqm.c
+++ b/SP/code/renderer/tr_model_iqm.c
@@ -1149,21 +1149,21 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
int startFrame, int endFrame,
- float frac, const char *tagName ) {
+ float frac, const char *tagName, int startIndex ) {
float jointMats[IQM_MAX_JOINTS * 12];
int joint;
char *names = data->names;
// get joint number by reading the joint names
for( joint = 0; joint < data->num_joints; joint++ ) {
- if( !strcmp( tagName, names ) )
+ if( joint >= startIndex && !strcmp( tagName, names ) )
break;
names += strlen( names ) + 1;
}
if( joint >= data->num_joints ) {
AxisClear( tag->axis );
VectorClear( tag->origin );
- return qfalse;
+ return -1;
}
ComputeJointMats( data, startFrame, endFrame, frac, jointMats );
@@ -1181,5 +1181,5 @@ int R_IQMLerpTag( orientation_t *tag, iqmData_t *data,
tag->axis[2][2] = jointMats[12 * joint + 10];
tag->origin[2] = jointMats[12 * joint + 11];
- return qtrue;
+ return joint;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list