Changeset 604
- Timestamp:
- 07/17/08 22:22:36 (4 months ago)
- Files:
-
- branches/morph-targets/libx42/anim-skin.c (modified) (3 diffs)
- branches/morph-targets/libx42/anim.c (modified) (1 diff)
- branches/morph-targets/libx42/include/x42.h (modified) (1 diff)
- branches/morph-targets/libx42/local.h (modified) (1 diff)
- branches/morph-targets/libx42/platform/null/null_platform.c (modified) (2 diffs)
- branches/morph-targets/libx42/vertattribs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/morph-targets/libx42/anim-skin.c
r597 r604 187 187 } 188 188 189 bool anim_skin_vertices( x42memStream_t *oPos, x42memStream_t *oNorm, x42memStream_t *oTan, x42memStream_t *oBin, 190 x42memStream_t *iPos, x42vertNormal_t * RESTRICT iNorm, x42vertTangent_t * RESTRICT iTan, 191 const x42data_t *x42, uint groupNum, const affine_t *boneMats ) 192 { 193 uint i, maxInfs; 189 void anim_skin_get_influences( affine_t *infs, const x42data_t *x42, uint groupNum, const affine_t *boneMats ) 190 { 191 uint i; 194 192 const x42group_t *grp; 195 affine_t infs[X42_MAX_INFLUENCES_PER_BATCH_V5];196 193 197 194 grp = x42->groups + groupNum; … … 208 205 affine_cpy( infs + i, &inf->meshToBone ); 209 206 } 210 207 } 208 209 bool anim_skin_vertices( x42memStream_t *oPos, x42memStream_t *oNorm, x42memStream_t *oTan, x42memStream_t *oBin, 210 x42memStream_t *iPos, x42vertNormal_t * RESTRICT iNorm, x42vertTangent_t * RESTRICT iTan, 211 const x42data_t *x42, uint groupNum, const affine_t *boneMats ) 212 { 213 uint maxInfs; 214 const x42group_t *grp; 215 affine_t infs[X42_MAX_INFLUENCES_PER_BATCH_V5]; 216 217 anim_skin_get_influences( infs, x42, groupNum, boneMats ); 218 219 grp = x42->groups + groupNum; 211 220 maxInfs = grp->maxVertInfluences > 0 ? grp->maxVertInfluences : 1; 212 221 … … 243 252 return true; 244 253 } 254 255 X42_EXPORT size_t X42_CALL x42_GetAnimInfluenceMatricesSize( const x42data_t *x42, uint groupNum ) 256 { 257 #ifndef LIBX42_NO_PARAM_VALIDATION 258 demand_rz( x42 != NULL, X42_ERR_BADPTR, "x42 is NULL" ); 259 demand_rz( x42_ValidateHeader( &x42->header ), X42_ERR_BADDATA, "invalid x42 header data" ); 260 demand_rz( groupNum < x42->header.numGroups, X42_ERR_OUTOFRANGE, "group number out of range" ); 261 #endif 262 263 return sizeof( affine_t ) * x42->groups[groupNum].numInfluences; 264 } 265 266 X42_EXPORT affine_t* X42_CALL x42_GetAnimInfluenceMatrices( void *out_buffer, const x42data_t *x42, 267 const affine_t *boneMats, uint groupNum, x42opts_t *opts ) 268 { 269 affine_t *ret; 270 271 #ifndef LIBX42_NO_PARAM_VALIDATION 272 demand_rn( x42 != NULL, X42_ERR_BADPTR, "x42 is NULL" ); 273 demand_rn( x42_ValidateHeader( &x42->header ), X42_ERR_BADDATA, "invalid x42 header data" ); 274 demand_rn( out_buffer != NULL, X42_ERR_BADPTR, "out_buffer is NULL" ); 275 demand_rn( boneMats != NULL, X42_ERR_BADPTR, "boneMats is NULL" ); 276 demand_rn( groupNum < x42->header.numGroups, X42_ERR_OUTOFRANGE, "group number out of range" ); 277 #endif 278 279 REF_PARAM( opts ); 280 281 ret = (affine_t*)out_buffer; 282 283 anim_skin_get_influences( ret, x42, groupNum, boneMats ); 284 285 return ret; 286 } branches/morph-targets/libx42/anim.c
r593 r604 72 72 x42tempMem_t *tmpMem, x42opts_t *opts ) 73 73 { 74 #ifndef LIBX42_NO_PARAM_VALIDATION 74 75 uint i; 76 #endif 75 77 76 78 x42memStream_t vPos; branches/morph-targets/libx42/include/x42.h
r593 r604 474 474 */ 475 475 476 X42_EXPORT size_t X42_CALL x42_GetAnimInfluenceMatricesSize( const x42data_t *x42, uint groupNum ); 477 X42_EXPORT affine_t* X42_CALL x42_GetAnimInfluenceMatrices( void *out_buffer, const x42data_t *x42, 478 const affine_t *boneMats, uint groupNum, x42opts_t *opts ); 479 476 480 #define X42_MEMSTREAM_UNRESTRICTED 0 477 481 #define X42_MEMSTREAM_WRITE_ONLY 0x00000001 branches/morph-targets/libx42/local.h
r593 r604 125 125 126 126 /* internal calls */ 127 void anim_skin_get_influences( affine_t *infs, const x42data_t *x42, uint groupNum, const affine_t *boneMats ); 128 127 129 bool anim_morph_vertices( vec4_t * RESTRICT oPos, x42vertNormal_t * RESTRICT oNorm, x42vertTangent_t * RESTRICT oTan, 128 130 const x42data_t *x42, uint groupNum, const x42morphState_t *morphs, uint numMorphs, bool renormalize ); branches/morph-targets/libx42/platform/null/null_platform.c
r462 r604 103 103 } 104 104 105 bool opt_ CopyStreamToStream( x42memStream_t *dest, x42memStream_t *src,105 bool opt_copy_stream_to_stream( x42memStream_t *dest, x42memStream_t *src, 106 106 size_t elemSize, uint numElems, x42opts_t *opts ) 107 107 { … … 114 114 return false; 115 115 } 116 117 bool opt_skin_vertices( x42memStream_t *oPos, x42memStream_t *oNorm, x42memStream_t *oTan, x42memStream_t *oBin, 118 x42memStream_t *iPos, x42vertNormal_t * RESTRICT iNorm, x42vertTangent_t * RESTRICT iTan, 119 const x42data_t *x42, uint groupNum, const affine_t *boneMats, x42opts_t *opts ) 120 { 121 REF_PARAM( oPos ); 122 REF_PARAM( oNorm ); 123 REF_PARAM( oTan ); 124 REF_PARAM( oBin ); 125 REF_PARAM( iPos ); 126 REF_PARAM( iNorm ); 127 REF_PARAM( iTan ); 128 REF_PARAM( x42 ); 129 REF_PARAM( groupNum ); 130 REF_PARAM( boneMats ); 131 REF_PARAM( opts ); 132 133 return false; 134 } 135 136 bool opt_morph_vertices( vec4_t * RESTRICT oPos, x42vertNormal_t * RESTRICT oNorm, x42vertTangent_t * RESTRICT oTan, const x42data_t *x42, uint groupNum, const x42morphState_t *morphs, uint numMorphs, bool renormalize, x42opts_t *opts ) 137 { 138 REF_PARAM( oPos ); 139 REF_PARAM( oNorm ); 140 REF_PARAM( oTan ); 141 REF_PARAM( x42 ); 142 REF_PARAM( groupNum ); 143 REF_PARAM( morphs ); 144 REF_PARAM( numMorphs ); 145 REF_PARAM( renormalize ); 146 REF_PARAM( opts ); 147 148 return false; 149 } 150 branches/morph-targets/libx42/vertattribs.c
r462 r604 84 84 return true; 85 85 86 if( oTc )86 if( oTc && x42->vertTc ) 87 87 copy_tc( x42->vertTc + g->firstVert, g->numVerts, oTc ); 88 88 89 if( oCl )89 if( oCl && x42->vertCl ) 90 90 { 91 91 switch( color_type )
