mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-23 03:01:08 +00:00
Use Mem_MallocA() in Model_md5.cpp
one step to making HD models (like https://www.moddb.com/mods/birdman-doom3/downloads/birdman-doom3-v11 ) work, but there's still other places in the code where the HD version of that model makes dhewm3 crash
This commit is contained in:
parent
5c9d9ff53c
commit
8bddc84e62
1 changed files with 8 additions and 2 deletions
|
@ -235,13 +235,16 @@ void idMD5Mesh::ParseMesh( idLexer &parser, int numJoints, const idJointMat *joi
|
|||
// build the information that will be common to all animations of this mesh:
|
||||
// silhouette edge connectivity and normal / tangent generation information
|
||||
//
|
||||
idDrawVert *verts = (idDrawVert *) _alloca16( texCoords.Num() * sizeof( idDrawVert ) );
|
||||
bool onStack;
|
||||
idDrawVert *verts = (idDrawVert*)Mem_MallocA( texCoords.Num()*sizeof(idDrawVert), onStack );
|
||||
|
||||
for ( i = 0; i < texCoords.Num(); i++ ) {
|
||||
verts[i].Clear();
|
||||
verts[i].st = texCoords[i];
|
||||
}
|
||||
TransformVerts( verts, joints );
|
||||
deformInfo = R_BuildDeformInfo( texCoords.Num(), verts, tris.Num(), tris.Ptr(), shader->UseUnsmoothedTangents() );
|
||||
Mem_FreeA( verts, onStack );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -352,12 +355,15 @@ idMD5Mesh::CalcBounds
|
|||
*/
|
||||
idBounds idMD5Mesh::CalcBounds( const idJointMat *entJoints ) {
|
||||
idBounds bounds;
|
||||
idDrawVert *verts = (idDrawVert *) _alloca16( texCoords.Num() * sizeof( idDrawVert ) );
|
||||
bool onStack;
|
||||
idDrawVert *verts = (idDrawVert*)Mem_MallocA( texCoords.Num()*sizeof(idDrawVert), onStack );
|
||||
|
||||
TransformVerts( verts, entJoints );
|
||||
|
||||
SIMDProcessor->MinMax( bounds[0], bounds[1], verts, texCoords.Num() );
|
||||
|
||||
Mem_FreeA( verts, onStack );
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue