summaryrefslogtreecommitdiffstats
path: root/src/modelinfo
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/modelinfo/ClumpModelInfo.cpp27
-rw-r--r--src/modelinfo/PedModelInfo.h3
-rw-r--r--src/modelinfo/SimpleModelInfo.cpp2
3 files changed, 15 insertions, 17 deletions
diff --git a/src/modelinfo/ClumpModelInfo.cpp b/src/modelinfo/ClumpModelInfo.cpp
index 44faf3c5..ccfcd304 100644
--- a/src/modelinfo/ClumpModelInfo.cpp
+++ b/src/modelinfo/ClumpModelInfo.cpp
@@ -43,7 +43,7 @@ CClumpModelInfo::CreateInstance(void)
RpClumpForAllAtomics(clone, SetHierarchyForSkinAtomic, hier);
anim = HAnimAnimationCreateForHierarchy(hier);
RpHAnimHierarchySetCurrentAnim(hier, anim);
-// RpHAnimHierarchySetFlags(hier, (RpHAnimHierarchyFlag)(rpHANIMHIERARCHYUPDATEMODELLINGMATRICES|rpHANIMHIERARCHYUPDATELTMS));
+ RpHAnimHierarchySetFlags(hier, (RpHAnimHierarchyFlag)(rpHANIMHIERARCHYUPDATEMODELLINGMATRICES|rpHANIMHIERARCHYUPDATELTMS));
// the rest is xbox only:
// RpSkinGetNumBones(RpSkinGeometryGetSkin(RpAtomicGetGeometry(IsClumpSkinned(clone))));
RpHAnimHierarchyUpdateMatrices(hier);
@@ -113,7 +113,7 @@ CClumpModelInfo::SetClump(RpClump *clump)
weights->w2 /= sum;
weights->w3 /= sum;
}
-// RpHAnimHierarchySetFlags(hier, (RpHAnimHierarchyFlag)(rpHANIMHIERARCHYUPDATEMODELLINGMATRICES|rpHANIMHIERARCHYUPDATELTMS));
+ RpHAnimHierarchySetFlags(hier, (RpHAnimHierarchyFlag)(rpHANIMHIERARCHYUPDATEMODELLINGMATRICES|rpHANIMHIERARCHYUPDATELTMS));
}
#endif
}
@@ -139,13 +139,12 @@ CClumpModelInfo::FindFrameFromIdCB(RwFrame *frame, void *data)
{
RwObjectIdAssociation *assoc = (RwObjectIdAssociation*)data;
- if(CVisibilityPlugins::GetFrameHierarchyId(frame) != assoc->id){
- RwFrameForAllChildren(frame, FindFrameFromIdCB, assoc);
- return assoc->frame ? nil : frame;
- }else{
+ if(CVisibilityPlugins::GetFrameHierarchyId(frame) == assoc->id){
assoc->frame = frame;
return nil;
}
+ RwFrameForAllChildren(frame, FindFrameFromIdCB, assoc);
+ return assoc->frame ? nil : frame;
}
RwFrame*
@@ -153,13 +152,12 @@ CClumpModelInfo::FindFrameFromNameCB(RwFrame *frame, void *data)
{
RwObjectNameAssociation *assoc = (RwObjectNameAssociation*)data;
- if(CGeneral::faststricmp(GetFrameNodeName(frame), assoc->name)){
- RwFrameForAllChildren(frame, FindFrameFromNameCB, assoc);
- return assoc->frame ? nil : frame;
- }else{
+ if(!CGeneral::faststricmp(GetFrameNodeName(frame), assoc->name)){
assoc->frame = frame;
return nil;
}
+ RwFrameForAllChildren(frame, FindFrameFromNameCB, assoc);
+ return assoc->frame ? nil : frame;
}
RwFrame*
@@ -167,14 +165,13 @@ CClumpModelInfo::FindFrameFromNameWithoutIdCB(RwFrame *frame, void *data)
{
RwObjectNameAssociation *assoc = (RwObjectNameAssociation*)data;
- if(CVisibilityPlugins::GetFrameHierarchyId(frame) ||
- CGeneral::faststricmp(GetFrameNodeName(frame), assoc->name)){
- RwFrameForAllChildren(frame, FindFrameFromNameWithoutIdCB, assoc);
- return assoc->frame ? nil : frame;
- }else{
+ if(CVisibilityPlugins::GetFrameHierarchyId(frame) == 0 &&
+ !CGeneral::faststricmp(GetFrameNodeName(frame), assoc->name)){
assoc->frame = frame;
return nil;
}
+ RwFrameForAllChildren(frame, FindFrameFromNameWithoutIdCB, assoc);
+ return assoc->frame ? nil : frame;
}
RwFrame*
diff --git a/src/modelinfo/PedModelInfo.h b/src/modelinfo/PedModelInfo.h
index a2bfd122..75f43be3 100644
--- a/src/modelinfo/PedModelInfo.h
+++ b/src/modelinfo/PedModelInfo.h
@@ -36,7 +36,8 @@ public:
static RwObjectNameIdAssocation m_pPedIds[PED_NODE_MAX];
- CPedModelInfo(void) : CClumpModelInfo(MITYPE_PED) { }
+ CPedModelInfo(void) : CClumpModelInfo(MITYPE_PED) { m_hitColModel = nil; }
+ ~CPedModelInfo(void) { delete m_hitColModel; }
void DeleteRwObject(void);
void SetClump(RpClump *);
diff --git a/src/modelinfo/SimpleModelInfo.cpp b/src/modelinfo/SimpleModelInfo.cpp
index 36e98e18..a781cf58 100644
--- a/src/modelinfo/SimpleModelInfo.cpp
+++ b/src/modelinfo/SimpleModelInfo.cpp
@@ -150,7 +150,7 @@ void
CSimpleModelInfo::SetupBigBuilding(void)
{
CSimpleModelInfo *related;
- if(m_lodDistances[0] > LOD_DISTANCE && m_atomics[2] == nil){
+ if(m_lodDistances[0] > LOD_DISTANCE && GetRelatedModel() == nil){
m_isBigBuilding = 1;
FindRelatedModel();
related = GetRelatedModel();