Fix HOB deallocation
All checks were successful
JCS-Prod/RSE-Model/pipeline/pr-master This commit looks good
JCS-Prod/RSE-Model/pipeline/head This commit looks good

Removed logging in library by default
This commit is contained in:
JackCarterSmith 2023-01-22 01:00:44 +01:00
parent 7ba1037230
commit a6ba8fe15a
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
2 changed files with 5 additions and 8 deletions

View File

@ -71,8 +71,6 @@ void RSPModel_freeHOB( T_RSPMODEL_HOB* hobStruct ) {
}
free(hobStruct->objects);
}
free(hobStruct);
}

View File

@ -108,9 +108,9 @@ static unsigned short ExtractObjects(T_RSPMODEL_HOB* pHobStruct, const MEMFILE p
// Retrieve object count from the header
pHobStruct->obj_count = RSP_ModelLib_getObjectsCount(pMemfile);
printf("[INFO] - Object(s) quantity: %d\n", pHobStruct->obj_count);
if (pParams->verbose_mode) printf("[INFO] - Object(s) quantity: %d\n", pHobStruct->obj_count);
if (pHobStruct->obj_count <= 0) {
printf("[INFO] Can't process empty file!\n");
if (pParams->verbose_mode) printf("[INFO] Can't process empty file!\n");
return RSPLIB_ERROR_GENERIC;
}
@ -125,8 +125,7 @@ static unsigned short ExtractObjects(T_RSPMODEL_HOB* pHobStruct, const MEMFILE p
memcpy(pHobStruct->objects[i].name, ((T_HOBFILE_OBJ_DESCRIPTOR *)(pMemfile + sizeof(T_HOBFILE_HEADER)
+ sizeof(T_HOBFILE_OBJ_DESCRIPTOR) * i))->object_name, 16);
if (pParams->verbose_mode) printf("\n");
printf("[INFO] - Process %s object...\n", pHobStruct->objects[i].name);
if (pParams->verbose_mode) printf("\n[INFO] - Process %s object...\n", pHobStruct->objects[i].name);
// Get offsets
@ -159,8 +158,8 @@ static unsigned short ExtractObjects(T_RSPMODEL_HOB* pHobStruct, const MEMFILE p
* Seem "object" are independant structure like xwing, turret, etc.
* Facegroup is more like part of previous object, like wing-left, turret-barrel, etc.
*/
if (pHobStruct->objects[i].object_part_count != pHobStruct->objects[i].face_group_count && (pParams->verbose_mode))
printf("[DBG] > Object parts / facegroup count are different!\n");
if (pHobStruct->objects[i].object_part_count != pHobStruct->objects[i].face_group_count)
if (pParams->verbose_mode) printf("[DBG] > Object parts / facegroup count are different!\n");
// Get facegroup datas
ExtractObjParts(&pHobStruct->objects[i], pMemfile, pParams);