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

View File

@ -1357,6 +1357,7 @@ CCollision::DistToLine(const CVector *l0, const CVector *l1, const CVector *poin
void
CCollision::CalculateTrianglePlanes(CColModel *model)
{
assert(model);
if(model->numTriangles == 0)
return;
@ -1367,7 +1368,6 @@ CCollision::CalculateTrianglePlanes(CColModel *model)
lptr->Remove();
ms_colModelCache.head.Insert(lptr);
}else{
assert(model);
lptr = ms_colModelCache.Insert(model);
if(lptr == nil){
// 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));
GetNameAndLOD(nodename, name, &n);
mi = (CClumpModelInfo*)CModelInfo::GetModelInfo(name, nil);
if(mi){
assert(mi->IsClump());
if(mi)
mi->SetClump(clump);
else
}else
RpClumpDestroy(clump);
}
}

View File

@ -1824,7 +1824,7 @@ char *CPad::EditString(char *pStr, int32 nSize)
}
// 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 )
{

View File

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

View File

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

View File

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

View File

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

View File

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