couple of fixes

This commit is contained in:
aap 2019-07-20 14:39:38 +02:00
parent 29d7b983d7
commit 60045ec6cd
9 changed files with 22 additions and 24 deletions

View File

@ -116,14 +116,13 @@ CAnimBlendAssocGroup::CreateAssociations(const char *name)
for(i = 0; i < animBlock->numAnims; i++){ for(i = 0; i < animBlock->numAnims; i++){
CAnimBlendHierarchy *anim = CAnimManager::GetAnimation(animBlock->firstIndex + i); CAnimBlendHierarchy *anim = CAnimManager::GetAnimation(animBlock->firstIndex + i);
CBaseModelInfo *model = GetModelFromName(anim->name); CBaseModelInfo *model = GetModelFromName(anim->name);
assert(model);
printf("Associated anim %s with model %s\n", anim->name, model->GetName()); printf("Associated anim %s with model %s\n", anim->name, model->GetName());
if(model){ RpClump *clump = (RpClump*)model->CreateInstance();
RpClump *clump = (RpClump*)model->CreateInstance(); RpAnimBlendClumpInit(clump);
RpAnimBlendClumpInit(clump); assocList[i].Init(clump, anim);
assocList[i].Init(clump, anim); RpClumpDestroy(clump);
RpClumpDestroy(clump); assocList[i].animId = i;
assocList[i].animId = i;
}
} }
numAssociations = animBlock->numAnims; numAssociations = animBlock->numAnims;
} }

View File

@ -1357,6 +1357,7 @@ CCollision::DistToLine(const CVector *l0, const CVector *l1, const CVector *poin
void void
CCollision::CalculateTrianglePlanes(CColModel *model) CCollision::CalculateTrianglePlanes(CColModel *model)
{ {
assert(model);
if(model->numTriangles == 0) if(model->numTriangles == 0)
return; return;
@ -1367,7 +1368,6 @@ CCollision::CalculateTrianglePlanes(CColModel *model)
lptr->Remove(); lptr->Remove();
ms_colModelCache.head.Insert(lptr); ms_colModelCache.head.Insert(lptr);
}else{ }else{
assert(model);
lptr = ms_colModelCache.Insert(model); lptr = ms_colModelCache.Insert(model);
if(lptr == nil){ if(lptr == nil){
// make room if we have to, remove last in list // make room if we have to, remove last in list

View File

@ -361,10 +361,10 @@ CFileLoader::LoadClumpFile(const char *filename)
nodename = GetFrameNodeName(RpClumpGetFrame(clump)); nodename = GetFrameNodeName(RpClumpGetFrame(clump));
GetNameAndLOD(nodename, name, &n); GetNameAndLOD(nodename, name, &n);
mi = (CClumpModelInfo*)CModelInfo::GetModelInfo(name, nil); mi = (CClumpModelInfo*)CModelInfo::GetModelInfo(name, nil);
assert(mi->IsClump()); if(mi){
if(mi) assert(mi->IsClump());
mi->SetClump(clump); mi->SetClump(clump);
else }else
RpClumpDestroy(clump); RpClumpDestroy(clump);
} }
} }

View File

@ -1824,7 +1824,7 @@ char *CPad::EditString(char *pStr, int32 nSize)
} }
// numbers // numbers
for ( int32 i = 0; i < ('0' - '9' + 1); i++ ) for ( int32 i = 0; i < ('9' - '0' + 1); i++ )
{ {
if ( GetPad(0)->GetCharJustDown(i + '0') && pos < nSize - 1 ) if ( GetPad(0)->GetCharJustDown(i + '0') && pos < nSize - 1 )
{ {

View File

@ -240,7 +240,6 @@ public:
m_matrix.at.y = 0.0f; m_matrix.at.y = 0.0f;
m_matrix.at.z = 1.0f; m_matrix.at.z = 1.0f;
m_matrix.pos.x = 0.0f; m_matrix.pos.x = 0.0f;
m_matrix.pos.x = 0.0f;
m_matrix.pos.y = 0.0f; m_matrix.pos.y = 0.0f;
m_matrix.pos.z = 0.0f; m_matrix.pos.z = 0.0f;
} }

View File

@ -173,9 +173,8 @@ CWaterLevel::CreateWavyAtomic()
{ {
wavyMorphTarget = RpGeometryGetMorphTarget(wavyGeometry, 0); wavyMorphTarget = RpGeometryGetMorphTarget(wavyGeometry, 0);
wavyVert = RpMorphTargetGetVertices(wavyMorphTarget);
ASSERT(wavyMorphTarget != NULL); ASSERT(wavyMorphTarget != NULL);
wavyVert = RpMorphTargetGetVertices(wavyMorphTarget);
ASSERT(wavyVert != NULL); ASSERT(wavyVert != NULL);
for ( int32 i = 0; i < 9; i++ ) for ( int32 i = 0; i < 9; i++ )
@ -1149,10 +1148,10 @@ CWaterLevel::AllocateBoatWakeArray()
ASSERT(ms_pWavyAtomic != NULL ); ASSERT(ms_pWavyAtomic != NULL );
RpGeometry *wavyGeometry = RpAtomicGetGeometry(ms_pWavyAtomic); RpGeometry *wavyGeometry = RpAtomicGetGeometry(ms_pWavyAtomic);
ASSERT(wavyGeometry != NULL );
RpMorphTarget *wavyMorphTarget = RpGeometryGetMorphTarget(wavyGeometry, 0); RpMorphTarget *wavyMorphTarget = RpGeometryGetMorphTarget(wavyGeometry, 0);
RpMaterial *wavyMaterial = RpGeometryGetMaterial(wavyGeometry, 0); RpMaterial *wavyMaterial = RpGeometryGetMaterial(wavyGeometry, 0);
ASSERT(wavyGeometry != NULL );
ASSERT(wavyMorphTarget != NULL ); ASSERT(wavyMorphTarget != NULL );
ASSERT(wavyMaterial != NULL ); ASSERT(wavyMaterial != NULL );

View File

@ -775,7 +775,7 @@ HandlePadButtonUp(RsPadButtonStatus *padButtonStatus)
bool bCam = false; bool bCam = false;
int16 mode = TheCamera.Cams[TheCamera.ActiveCam].Mode; int16 mode = TheCamera.Cams[TheCamera.ActiveCam].Mode;
if ( mode == CCam::MODE_FLYBY || mode == CCam::MODE_FIXED ) if ( mode == CCam::MODE_FLYBY || mode == CCam::MODE_FIXED )
bool bCam = true; bCam = true;
ControlsManager.UpdateJoyButtonState(padNumber); ControlsManager.UpdateJoyButtonState(padNumber);

View File

@ -180,8 +180,6 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
bExplosionProof = true; bExplosionProof = true;
bBulletProof = true; bBulletProof = true;
} }
*(void**)this = (void*)0x600C1C;
} }
@ -1443,9 +1441,11 @@ CAutomobile::RcbanditCheckHitWheels(void)
{ EAXJMP(0x53C990); { EAXJMP(0x53C990);
} }
//WRAPPER void #if 0
//CAutomobile::VehicleDamage(float impulse, uint16 damagedPiece) WRAPPER void
//{ EAXJMP(0x52F390); CAutomobile::VehicleDamage(float impulse, uint16 damagedPiece)
{ EAXJMP(0x52F390); }
#else
void void
CAutomobile::VehicleDamage(float impulse, uint16 damagedPiece) CAutomobile::VehicleDamage(float impulse, uint16 damagedPiece)
{ {
@ -1494,7 +1494,7 @@ CAutomobile::VehicleDamage(float impulse, uint16 damagedPiece)
return; return;
if(m_pDamageEntity){ if(m_pDamageEntity){
if(m_pDamageEntity->m_status == STATUS_PLAYER_PLAYBACKFROMBUFFER && if(m_pDamageEntity->IsBuilding() &&
DotProduct(m_vecDamageNormal, GetUp()) > 0.6f) DotProduct(m_vecDamageNormal, GetUp()) > 0.6f)
return; return;
} }
@ -1686,6 +1686,7 @@ CAutomobile::VehicleDamage(float impulse, uint16 damagedPiece)
} }
} }
} }
#endif
void void
CAutomobile::dmgDrawCarCollidingParticles(const CVector &pos, float amount) CAutomobile::dmgDrawCarCollidingParticles(const CVector &pos, float amount)

View File

@ -70,7 +70,7 @@ char VehicleNames[NUMHANDLINGS][14] = {
cHandlingDataMgr::cHandlingDataMgr(void) cHandlingDataMgr::cHandlingDataMgr(void)
{ {
memset(this, 0, sizeof(this)); memset(this, 0, sizeof(*this));
} }
void void