Fixes loading regular Carma1 data directory (#53)
This commit is contained in:
parent
6cc2db6201
commit
a8f34c5815
|
|
@ -643,7 +643,13 @@ void FlicPaletteAllocate() {
|
|||
// IDA: void __usercall AssertFlicPixelmap(tFlic_descriptor_ptr pFlic_info@<EAX>, br_pixelmap *pDest_pixelmap@<EDX>)
|
||||
void AssertFlicPixelmap(tFlic_descriptor_ptr pFlic_info, br_pixelmap* pDest_pixelmap) {
|
||||
LOG_TRACE("(%d, %p)", pFlic_info, pDest_pixelmap);
|
||||
NOT_IMPLEMENTED();
|
||||
|
||||
if (pDest_pixelmap) {
|
||||
pFlic_info->first_pixel = (tU8*)pDest_pixelmap->pixels
|
||||
+ pFlic_info->x_offset
|
||||
+ pFlic_info->y_offset * pDest_pixelmap->row_bytes;
|
||||
}
|
||||
pFlic_info->the_pixelmap = pDest_pixelmap;
|
||||
}
|
||||
|
||||
// IDA: int __usercall StartFlic@<EAX>(char *pFile_name@<EAX>, int pIndex@<EDX>, tFlic_descriptor_ptr pFlic_info@<EBX>, tU32 pSize@<ECX>, tS8 *pData_ptr, br_pixelmap *pDest_pixelmap, int pX_offset, int pY_offset, int pFrame_rate)
|
||||
|
|
|
|||
|
|
@ -510,7 +510,7 @@ void ChangeActionTo(tPedestrian_data* pPedestrian, int pAction_index, int pRedo_
|
|||
int the_sound;
|
||||
tU32 the_pitch;
|
||||
LOG_TRACE("(%p, %d, %d)", pPedestrian, pAction_index, pRedo_frames_etc);
|
||||
NOT_IMPLEMENTED();
|
||||
STUB();
|
||||
}
|
||||
|
||||
// IDA: int __usercall MungePedestrianAction@<EAX>(tPedestrian_data *pPedestrian@<EAX>, float pDanger_level)
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ void FindBestY(br_vector3* pPosition, br_actor* gWorld, br_scalar pStarting_heig
|
|||
*pNearest_below_model = gBelow_model;
|
||||
*pNearest_above_face_index = gAbove_face_index;
|
||||
*pNearest_below_face_index = gBelow_face_index;
|
||||
LOG_DEBUG("FindBestY %f %f '%s' '%s' %d %d", gLowest_y_above, gHighest_y_below, gAbove_model->identifier, gBelow_model->identifier, gAbove_face_index, gBelow_face_index);
|
||||
//LOG_DEBUG("FindBestY %f %f '%s' '%s' %d %d", gLowest_y_above, gHighest_y_below, gAbove_model->identifier, gBelow_model->identifier, gAbove_face_index, gBelow_face_index);
|
||||
}
|
||||
|
||||
// IDA: int __cdecl FindYVerticallyBelowPolyCallBack(br_model *pModel, br_material *pMaterial, br_vector3 *pRay_pos, br_vector3 *pRay_dir, br_scalar pT, int pF, int pE, int pV, br_vector3 *pPoint, br_vector2 *pMap, void *pArg)
|
||||
|
|
|
|||
|
|
@ -463,10 +463,24 @@ br_actor* DRActorFindRecurse(br_actor* pSearch_root, char* pName) {
|
|||
}
|
||||
|
||||
// IDA: br_uint_32 __usercall DRActorEnumRecurseWithMat@<EAX>(br_actor *pActor@<EAX>, br_material *pMat@<EDX>, br_uint_32 (*pCall_back)(br_actor*, br_material*, void*)@<EBX>, void *pArg@<ECX>)
|
||||
br_uint_32 DRActorEnumRecurseWithMat(br_actor* pActor, br_material* pMat, br_uint_32 (*pCall_back)(br_actor*, br_material*, void*), void* pArg) {
|
||||
br_uint_32 DRActorEnumRecurseWithMat(br_actor* pActor, br_material* pMat, recurse_with_mat_cbfn* pCall_back, void* pArg) {
|
||||
br_uint_32 result;
|
||||
LOG_TRACE("(%p, %p, %p, %p)", pActor, pMat, pCall_back, pArg);
|
||||
NOT_IMPLEMENTED();
|
||||
|
||||
if (pActor->material) {
|
||||
pMat = pActor->material;
|
||||
}
|
||||
result = pCall_back(pActor, pMat, pArg);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
for (pActor = pActor->children; pActor != NULL; pActor = pActor->next) {
|
||||
result = DRActorEnumRecurseWithMat(pActor, pMat, pCall_back, pArg);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// IDA: br_uint_32 __usercall DRActorEnumRecurseWithTrans@<EAX>(br_actor *pActor@<EAX>, br_matrix34 *pMatrix@<EDX>, br_uint_32 (*pCall_back)(br_actor*, br_matrix34*, void*)@<EBX>, void *pArg@<ECX>)
|
||||
|
|
|
|||
|
|
@ -804,14 +804,20 @@ void DisposeFunkotronics(int pOwner) {
|
|||
// IDA: void __usercall AddProximityVertex(br_vector3 *pV@<EAX>, tFunkotronic_spec *pThe_funk@<EDX>)
|
||||
void AddProximityVertex(br_vector3* pV, tFunkotronic_spec* pThe_funk) {
|
||||
LOG_TRACE("(%p, %p)", pV, pThe_funk);
|
||||
NOT_IMPLEMENTED();
|
||||
|
||||
pThe_funk->proximity_array[pThe_funk->proximity_count] = *pV;
|
||||
pThe_funk->proximity_count++;
|
||||
}
|
||||
|
||||
// IDA: void __cdecl AddProximityVertexXYZ(br_scalar pX, br_scalar pY, br_scalar pZ, tFunkotronic_spec *pThe_funk)
|
||||
void AddProximityVertexXYZ(br_scalar pX, br_scalar pY, br_scalar pZ, tFunkotronic_spec* pThe_funk) {
|
||||
br_vector3 v;
|
||||
LOG_TRACE("(%f, %f, %f, %p)", pX, pY, pZ, pThe_funk);
|
||||
NOT_IMPLEMENTED();
|
||||
|
||||
v.v[0] = pX;
|
||||
v.v[1] = pY;
|
||||
v.v[2] = pZ;
|
||||
AddProximityVertex(&v, pThe_funk);
|
||||
}
|
||||
|
||||
// IDA: br_uint_32 __usercall CalcProximities@<EAX>(br_actor *pActor@<EAX>, br_material *pMat@<EDX>, tFunkotronic_spec *pThe_funk@<EBX>)
|
||||
|
|
@ -819,7 +825,21 @@ br_uint_32 CalcProximities(br_actor* pActor, br_material* pMat, tFunkotronic_spe
|
|||
br_face* the_face;
|
||||
int i;
|
||||
LOG_TRACE("(%p, %p, %p)", pActor, pMat, pThe_funk);
|
||||
NOT_IMPLEMENTED();
|
||||
|
||||
if (pActor->model) {
|
||||
if (pThe_funk->material == pMat) {
|
||||
pThe_funk->proximity_count += 8;
|
||||
} else {
|
||||
the_face = pActor->model->faces;
|
||||
for (i = 0; i < pActor->model->nfaces; i++) {
|
||||
if (pThe_funk->material == the_face->material) {
|
||||
pThe_funk->proximity_count += 3;
|
||||
}
|
||||
the_face++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// IDA: br_uint_32 __usercall AddProximities@<EAX>(br_actor *pActor@<EAX>, br_material *pMat@<EDX>, tFunkotronic_spec *pThe_funk@<EBX>)
|
||||
|
|
@ -827,7 +847,62 @@ br_uint_32 AddProximities(br_actor* pActor, br_material* pMat, tFunkotronic_spec
|
|||
br_face* the_face;
|
||||
int i;
|
||||
LOG_TRACE("(%p, %p, %p)", pActor, pMat, pThe_funk);
|
||||
NOT_IMPLEMENTED();
|
||||
|
||||
if (pActor->model) {
|
||||
if (pThe_funk->material == pMat) {
|
||||
AddProximityVertexXYZ(
|
||||
pActor->model->bounds.min.v[0],
|
||||
pActor->model->bounds.min.v[1],
|
||||
pActor->model->bounds.min.v[2],
|
||||
pThe_funk);
|
||||
AddProximityVertexXYZ(
|
||||
pActor->model->bounds.min.v[0],
|
||||
pActor->model->bounds.min.v[1],
|
||||
pActor->model->bounds.max.v[2],
|
||||
pThe_funk);
|
||||
AddProximityVertexXYZ(
|
||||
pActor->model->bounds.min.v[0],
|
||||
pActor->model->bounds.max.v[1],
|
||||
pActor->model->bounds.min.v[2],
|
||||
pThe_funk);
|
||||
AddProximityVertexXYZ(
|
||||
pActor->model->bounds.min.v[0],
|
||||
pActor->model->bounds.max.v[1],
|
||||
pActor->model->bounds.max.v[2],
|
||||
pThe_funk);
|
||||
AddProximityVertexXYZ(
|
||||
pActor->model->bounds.max.v[0],
|
||||
pActor->model->bounds.min.v[1],
|
||||
pActor->model->bounds.min.v[2],
|
||||
pThe_funk);
|
||||
AddProximityVertexXYZ(
|
||||
pActor->model->bounds.max.v[0],
|
||||
pActor->model->bounds.min.v[1],
|
||||
pActor->model->bounds.max.v[2],
|
||||
pThe_funk);
|
||||
AddProximityVertexXYZ(
|
||||
pActor->model->bounds.max.v[0],
|
||||
pActor->model->bounds.max.v[1],
|
||||
pActor->model->bounds.min.v[2],
|
||||
pThe_funk);
|
||||
AddProximityVertexXYZ(
|
||||
pActor->model->bounds.max.v[0],
|
||||
pActor->model->bounds.max.v[1],
|
||||
pActor->model->bounds.max.v[2],
|
||||
pThe_funk);
|
||||
} else {
|
||||
the_face = pActor->model->faces;
|
||||
for (i = 0; i < pActor->model->nfaces; i++) {
|
||||
if (pThe_funk->material == the_face->material) {
|
||||
AddProximityVertex(&pActor->model->vertices[the_face->vertices[0]].p, pThe_funk);
|
||||
AddProximityVertex(&pActor->model->vertices[the_face->vertices[1]].p, pThe_funk);
|
||||
AddProximityVertex(&pActor->model->vertices[the_face->vertices[2]].p, pThe_funk);
|
||||
}
|
||||
the_face++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// IDA: void __usercall Adjust2FloatsForExceptions(float *pVictim1@<EAX>, float *pVictim2@<EDX>, br_pixelmap *pCulprit@<EBX>)
|
||||
|
|
@ -1605,27 +1680,21 @@ void RevealStoredTextures(tBrender_storage* pStorage) {
|
|||
// IDA: void __usercall SetCarStorageTexturingLevel(tBrender_storage *pStorage@<EAX>, tCar_texturing_level pNew@<EDX>, tCar_texturing_level pOld@<EBX>)
|
||||
void SetCarStorageTexturingLevel(tBrender_storage* pStorage, tCar_texturing_level pNew, tCar_texturing_level pOld) {
|
||||
LOG_TRACE("(%p, %d, %d)", pStorage, pNew, pOld);
|
||||
switch (pNew) {
|
||||
case eCTL_none:
|
||||
HideStoredTextures(pStorage);
|
||||
break;
|
||||
|
||||
case eCTL_transparent:
|
||||
if (pOld) {
|
||||
if (pOld == 2) {
|
||||
HideStoredOpaqueTextures(pStorage);
|
||||
if (pNew) {
|
||||
if (pNew == eCTL_transparent) {
|
||||
if (pOld) {
|
||||
if (pOld == eCTL_full) {
|
||||
HideStoredOpaqueTextures(pStorage);
|
||||
}
|
||||
} else {
|
||||
RevealStoredTransparentTextures(pStorage);
|
||||
}
|
||||
} else {
|
||||
RevealStoredTransparentTextures(pStorage);
|
||||
} else if (pNew == eCTL_full) {
|
||||
RevealStoredTextures(pStorage);
|
||||
}
|
||||
break;
|
||||
|
||||
case eCTL_full:
|
||||
RevealStoredTextures(pStorage);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_PANIC("not handled");
|
||||
} else {
|
||||
HideStoredTextures(pStorage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue