mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 14:41:42 +00:00
Fix size reserved for IQM jointMats (allocated more than used)
This commit is contained in:
parent
fd937a47ac
commit
89ee8b050f
2 changed files with 4 additions and 4 deletions
|
@ -423,7 +423,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
|
||||||
// allocate the model and copy the data
|
// allocate the model and copy the data
|
||||||
size = sizeof(iqmData_t);
|
size = sizeof(iqmData_t);
|
||||||
size += header->num_meshes * sizeof( srfIQModel_t );
|
size += header->num_meshes * sizeof( srfIQModel_t );
|
||||||
size += header->num_joints * header->num_frames * 12 * sizeof( float ); // joint mats
|
size += header->num_joints * 12 * sizeof( float ); // joint mats
|
||||||
size += header->num_joints * header->num_frames * 12 * sizeof( float ); // pose mats
|
size += header->num_joints * header->num_frames * 12 * sizeof( float ); // pose mats
|
||||||
if(header->ofs_bounds)
|
if(header->ofs_bounds)
|
||||||
size += header->num_frames * 6 * sizeof(float); // model bounds
|
size += header->num_frames * 6 * sizeof(float); // model bounds
|
||||||
|
@ -450,7 +450,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
|
||||||
iqmData->num_joints = header->num_joints;
|
iqmData->num_joints = header->num_joints;
|
||||||
iqmData->surfaces = (srfIQModel_t *)(iqmData + 1);
|
iqmData->surfaces = (srfIQModel_t *)(iqmData + 1);
|
||||||
iqmData->jointMats = (float *) (iqmData->surfaces + iqmData->num_surfaces);
|
iqmData->jointMats = (float *) (iqmData->surfaces + iqmData->num_surfaces);
|
||||||
iqmData->poseMats = iqmData->jointMats + 12 * header->num_joints * header->num_frames;
|
iqmData->poseMats = iqmData->jointMats + 12 * header->num_joints;
|
||||||
if(header->ofs_bounds)
|
if(header->ofs_bounds)
|
||||||
{
|
{
|
||||||
iqmData->bounds = iqmData->poseMats + 12 * header->num_joints * header->num_frames;
|
iqmData->bounds = iqmData->poseMats + 12 * header->num_joints * header->num_frames;
|
||||||
|
|
|
@ -423,7 +423,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
|
||||||
// allocate the model and copy the data
|
// allocate the model and copy the data
|
||||||
size = sizeof(iqmData_t);
|
size = sizeof(iqmData_t);
|
||||||
size += header->num_meshes * sizeof( srfIQModel_t );
|
size += header->num_meshes * sizeof( srfIQModel_t );
|
||||||
size += header->num_joints * header->num_frames * 12 * sizeof( float ); // joint mats
|
size += header->num_joints * 12 * sizeof( float ); // joint mats
|
||||||
size += header->num_joints * header->num_frames * 12 * sizeof( float ); // pose mats
|
size += header->num_joints * header->num_frames * 12 * sizeof( float ); // pose mats
|
||||||
if(header->ofs_bounds)
|
if(header->ofs_bounds)
|
||||||
size += header->num_frames * 6 * sizeof(float); // model bounds
|
size += header->num_frames * 6 * sizeof(float); // model bounds
|
||||||
|
@ -450,7 +450,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
|
||||||
iqmData->num_joints = header->num_joints;
|
iqmData->num_joints = header->num_joints;
|
||||||
iqmData->surfaces = (srfIQModel_t *)(iqmData + 1);
|
iqmData->surfaces = (srfIQModel_t *)(iqmData + 1);
|
||||||
iqmData->jointMats = (float *) (iqmData->surfaces + iqmData->num_surfaces);
|
iqmData->jointMats = (float *) (iqmData->surfaces + iqmData->num_surfaces);
|
||||||
iqmData->poseMats = iqmData->jointMats + 12 * header->num_joints * header->num_frames;
|
iqmData->poseMats = iqmData->jointMats + 12 * header->num_joints;
|
||||||
if(header->ofs_bounds)
|
if(header->ofs_bounds)
|
||||||
{
|
{
|
||||||
iqmData->bounds = iqmData->poseMats + 12 * header->num_joints * header->num_frames;
|
iqmData->bounds = iqmData->poseMats + 12 * header->num_joints * header->num_frames;
|
||||||
|
|
Loading…
Reference in a new issue