Browse Source

Fix errors in plDrawable.

It builds almost the whole project now... until it hits plVisLOSMgr :(
Darryl Pogue 13 years ago
parent
commit
41495b8e03
  1. 3
      Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp
  2. 5
      Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp
  3. 2
      Sources/Plasma/PubUtilLib/plDrawable/plDynaBulletMgr.cpp
  4. 10
      Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp
  5. 4
      Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h
  6. 4
      Sources/Plasma/PubUtilLib/plDrawable/plDynaFootMgr.cpp
  7. 2
      Sources/Plasma/PubUtilLib/plDrawable/plDynaPuddleMgr.cpp
  8. 7
      Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgr.cpp
  9. 5
      Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp
  10. 2
      Sources/Plasma/PubUtilLib/plDrawable/plDynaTorpedoMgr.cpp
  11. 5
      Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp
  12. 18
      Sources/Plasma/PubUtilLib/plDrawable/plParticleFiller.cpp
  13. 3
      Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp

3
Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp

@ -547,7 +547,8 @@ plDrawableSpans *plDrawableGenerator::GenerateConicalDrawable( hsScalar radi
direction.Set( 0, 0, height ); direction.Set( 0, 0, height );
return GenerateConicalDrawable( hsPoint3( 0, 0, 0 ), direction, radius, material, localToWorld, blended, hsPoint3 zero(0, 0, 0);
return GenerateConicalDrawable(zero, direction, radius, material, localToWorld, blended,
multColor, retIndex, toAddTo ); multColor, retIndex, toAddTo );
} }

5
Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp

@ -3549,8 +3549,9 @@ plParticleSpan *plDrawableSpans::ICreateParticleIcicle( hsGMaterial *material,
icicle->fLocalBounds.MakeEmpty(); icicle->fLocalBounds.MakeEmpty();
icicle->fWorldBounds.MakeEmpty(); icicle->fWorldBounds.MakeEmpty();
icicle->fLocalBounds.Union( &hsPoint3(0,0,0) ); hsPoint3 zero(0, 0, 0);
icicle->fWorldBounds.Union( &hsPoint3(0,0,0) ); icicle->fLocalBounds.Union( &zero );
icicle->fWorldBounds.Union( &zero );
icicle->fGroupIdx = set->fGroupIdx; icicle->fGroupIdx = set->fGroupIdx;
icicle->fVBufferIdx = set->fVBufferIdx; icicle->fVBufferIdx = set->fVBufferIdx;

2
Sources/Plasma/PubUtilLib/plDrawable/plDynaBulletMgr.cpp

@ -103,7 +103,7 @@ hsBool plDynaBulletMgr::IHandleShot(plBulletMsg* bull)
fCutter->SetLength(hsVector3(bull->Radius() * fScale.fX, bull->Radius() * fScale.fY, bull->Range())); fCutter->SetLength(hsVector3(bull->Radius() * fScale.fX, bull->Radius() * fScale.fY, bull->Range()));
fCutter->Set(pos, up, -bull->Dir()); fCutter->Set(pos, up, -bull->Dir());
plDynaDecalInfo& info = IGetDecalInfo(UInt32(this), GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(this), GetKey());
if( bull->PartyTime() > 0 ) if( bull->PartyTime() > 0 )
fPartyTime = bull->PartyTime(); fPartyTime = bull->PartyTime();

10
Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp

@ -348,7 +348,7 @@ hsBool plDynaDecalMgr::IWetParts(const plDynaDecalEnableMsg* enaMsg)
const plPrintShape* shape = IGetPrintShape(enaMsg->GetShapeKey()); const plPrintShape* shape = IGetPrintShape(enaMsg->GetShapeKey());
if( shape ) if( shape )
{ {
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
IWetInfo(info, enaMsg); IWetInfo(info, enaMsg);
} }
} }
@ -362,7 +362,7 @@ hsBool plDynaDecalMgr::IWetParts(const plDynaDecalEnableMsg* enaMsg)
const plPrintShape* shape = IGetPrintShape(avMod, fPartIDs[i]); const plPrintShape* shape = IGetPrintShape(avMod, fPartIDs[i]);
if( shape ) if( shape )
{ {
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
IWetInfo(info, enaMsg); IWetInfo(info, enaMsg);
} }
} }
@ -381,7 +381,7 @@ hsBool plDynaDecalMgr::IWetPart(UInt32 id, const plDynaDecalEnableMsg* enaMsg)
const plPrintShape* shape = IGetPrintShape(avMod, id); const plPrintShape* shape = IGetPrintShape(avMod, id);
if( shape ) if( shape )
{ {
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
IWetInfo(info, enaMsg); IWetInfo(info, enaMsg);
} }
return true; return true;
@ -484,7 +484,7 @@ hsBool plDynaDecalMgr::MsgReceive(plMessage* msg)
return true; return true;
case kRefAvatar: case kRefAvatar:
if( refMsg->GetContext() & (plRefMsg::kOnRemove|plRefMsg::kOnDestroy) ) if( refMsg->GetContext() & (plRefMsg::kOnRemove|plRefMsg::kOnDestroy) )
IRemoveDecalInfo(UInt32(refMsg->GetRef())); IRemoveDecalInfo(unsigned_ptr(refMsg->GetRef()));
return true; return true;
} }
} }
@ -537,7 +537,7 @@ plDynaDecalInfo& plDynaDecalInfo::Init(const plKey& key)
return *this; return *this;
} }
plDynaDecalInfo& plDynaDecalMgr::IGetDecalInfo(UInt32 id, const plKey& key) plDynaDecalInfo& plDynaDecalMgr::IGetDecalInfo(unsigned_ptr id, const plKey& key)
{ {
plDynaDecalMap::iterator iter = fDecalMap.find(id); plDynaDecalMap::iterator iter = fDecalMap.find(id);
if( iter == fDecalMap.end() ) if( iter == fDecalMap.end() )

4
Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h

@ -104,7 +104,7 @@ public:
plDynaDecalInfo& Init(const plKey& key); plDynaDecalInfo& Init(const plKey& key);
}; };
typedef std::map< UInt32, plDynaDecalInfo, std::less<UInt32> > plDynaDecalMap; typedef std::map< unsigned_ptr, plDynaDecalInfo, std::less<unsigned_ptr> > plDynaDecalMap;
// plDynaDecalMgr // plDynaDecalMgr
// Primary responsibilities: // Primary responsibilities:
@ -189,7 +189,7 @@ protected:
hsBool IWetPart(UInt32 id, const plDynaDecalEnableMsg* enaMsg); hsBool IWetPart(UInt32 id, const plDynaDecalEnableMsg* enaMsg);
void IWetInfo(plDynaDecalInfo& info, const plDynaDecalEnableMsg* enaMsg) const; void IWetInfo(plDynaDecalInfo& info, const plDynaDecalEnableMsg* enaMsg) const;
hsScalar IHowWet(plDynaDecalInfo& info, double t) const; hsScalar IHowWet(plDynaDecalInfo& info, double t) const;
plDynaDecalInfo& IGetDecalInfo(UInt32 id, const plKey& key); plDynaDecalInfo& IGetDecalInfo(unsigned_ptr id, const plKey& key);
void IRemoveDecalInfo(UInt32 id); void IRemoveDecalInfo(UInt32 id);
void IRemoveDecalInfos(const plKey& key); void IRemoveDecalInfos(const plKey& key);

4
Sources/Plasma/PubUtilLib/plDrawable/plDynaFootMgr.cpp

@ -115,7 +115,7 @@ hsBool plDynaFootMgr::MsgReceive(plMessage* msg)
const plPrintShape* shape = IGetPrintShape(armMod, id); const plPrintShape* shape = IGetPrintShape(armMod, id);
if( shape ) if( shape )
{ {
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
if( IPrintFromShape(shape, footMsg->IsLeft()) ) if( IPrintFromShape(shape, footMsg->IsLeft()) )
{ {
INotifyActive(info, armMod->GetKey(), id); INotifyActive(info, armMod->GetKey(), id);
@ -138,7 +138,7 @@ hsBool plDynaFootMgr::IPrintFromShape(const plPrintShape* shape, hsBool flip)
if( shape ) if( shape )
{ {
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
double secs = hsTimer::GetSysSeconds(); double secs = hsTimer::GetSysSeconds();
hsScalar wetness = IHowWet(info, secs); hsScalar wetness = IHowWet(info, secs);

2
Sources/Plasma/PubUtilLib/plDrawable/plDynaPuddleMgr.cpp

@ -94,7 +94,7 @@ hsBool plDynaPuddleMgr::MsgReceive(plMessage* msg)
const plPrintShape* shape = IGetPrintShape(armMod, fPartIDs[i]); const plPrintShape* shape = IGetPrintShape(armMod, fPartIDs[i]);
if( shape ) if( shape )
{ {
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
if( IRippleFromShape(shape, true) ) if( IRippleFromShape(shape, true) )
{ {
INotifyActive(info, armMod->GetKey(), fPartIDs[i]); INotifyActive(info, armMod->GetKey(), fPartIDs[i]);

7
Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgr.cpp

@ -146,7 +146,7 @@ hsBool plDynaRippleMgr::MsgReceive(plMessage* msg)
const plPrintShape* shape = IGetPrintShape(armMsg->fArmature, fPartIDs[i]); const plPrintShape* shape = IGetPrintShape(armMsg->fArmature, fPartIDs[i]);
if( shape ) if( shape )
{ {
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
if( IRippleFromShape(shape, false) ) if( IRippleFromShape(shape, false) )
{ {
INotifyActive(info, armMsg->fArmature->GetKey(), fPartIDs[i]); INotifyActive(info, armMsg->fArmature->GetKey(), fPartIDs[i]);
@ -182,7 +182,7 @@ hsBool plDynaRippleMgr::IRippleFromShape(const plPrintShape* shape, hsBool force
hsBool retVal = false; hsBool retVal = false;
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld(); const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();
@ -191,7 +191,8 @@ hsBool plDynaRippleMgr::IRippleFromShape(const plPrintShape* shape, hsBool force
double t = hsTimer::GetSysSeconds(); double t = hsTimer::GetSysSeconds();
hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne(); hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne();
hsBool longEnough = (dt >= kMinTime); hsBool longEnough = (dt >= kMinTime);
hsBool farEnough = (hsVector3(&info.fLastPos, &shapeL2W.GetTranslate()).Magnitude() > kMinDist); hsPoint3 xlate = shapeL2W.GetTranslate();
hsBool farEnough = (hsVector3(&info.fLastPos, &xlate).Magnitude() > kMinDist);
if( force || longEnough || farEnough ) if( force || longEnough || farEnough )
{ {
hsPoint3 pos = shapeL2W.GetTranslate(); hsPoint3 pos = shapeL2W.GetTranslate();

5
Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp

@ -172,7 +172,7 @@ hsBool plDynaRippleVSMgr::IRippleFromShape(const plPrintShape* shape, hsBool for
hsBool retVal = false; hsBool retVal = false;
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld(); const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();
@ -181,7 +181,8 @@ hsBool plDynaRippleVSMgr::IRippleFromShape(const plPrintShape* shape, hsBool for
double t = hsTimer::GetSysSeconds(); double t = hsTimer::GetSysSeconds();
hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne(); hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne();
hsBool longEnough = (dt >= kMinTime); hsBool longEnough = (dt >= kMinTime);
hsBool farEnough = (hsVector3(&info.fLastPos, &shapeL2W.GetTranslate()).Magnitude() > kMinDist); hsPoint3 xlate = shapeL2W.GetTranslate();
hsBool farEnough = (hsVector3(&info.fLastPos, &xlate).Magnitude() > kMinDist);
if( force || longEnough || farEnough ) if( force || longEnough || farEnough )
{ {
hsPoint3 pos = shapeL2W.GetTranslate(); hsPoint3 pos = shapeL2W.GetTranslate();

2
Sources/Plasma/PubUtilLib/plDrawable/plDynaTorpedoMgr.cpp

@ -124,7 +124,7 @@ hsBool plDynaTorpedoMgr::IHandleShot(plBulletMsg* bull)
fCutter->SetLength(hsVector3(scaleX, scaleY, bull->Range())); fCutter->SetLength(hsVector3(scaleX, scaleY, bull->Range()));
fCutter->Set(pos, up, -bull->Dir()); fCutter->Set(pos, up, -bull->Dir());
plDynaDecalInfo& info = IGetDecalInfo(UInt32(this), GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(this), GetKey());
if( bull->PartyTime() > 0 ) if( bull->PartyTime() > 0 )
fPartyTime = bull->PartyTime(); fPartyTime = bull->PartyTime();

5
Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp

@ -173,7 +173,7 @@ hsBool plDynaWakeMgr::IRippleFromShape(const plPrintShape* shape, hsBool force)
hsBool retVal = false; hsBool retVal = false;
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey()); plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld(); const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();
@ -182,7 +182,8 @@ hsBool plDynaWakeMgr::IRippleFromShape(const plPrintShape* shape, hsBool force)
double t = hsTimer::GetSysSeconds(); double t = hsTimer::GetSysSeconds();
hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne(); hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne();
hsBool longEnough = (dt >= kMinTime); hsBool longEnough = (dt >= kMinTime);
hsBool farEnough = (hsVector3(&info.fLastPos, &shapeL2W.GetTranslate()).Magnitude() > kMinDist); hsPoint3 xlate = shapeL2W.GetTranslate();
hsBool farEnough = (hsVector3(&info.fLastPos, &xlate).Magnitude() > kMinDist);
if( force || longEnough || farEnough ) if( force || longEnough || farEnough )
{ {
hsPoint3 pos = shapeL2W.GetTranslate(); hsPoint3 pos = shapeL2W.GetTranslate();

18
Sources/Plasma/PubUtilLib/plDrawable/plParticleFiller.cpp

@ -104,7 +104,8 @@ void inline IInlSetParticlePathFollow( const plParticleCore &particle, const hsM
/// Follow path specified by interpreting orientation as a velocity vector. /// Follow path specified by interpreting orientation as a velocity vector.
hsVector3 viewDir(&particle.fPos, &viewToWorld.GetTranslate()); hsPoint3 xlate = viewToWorld.GetTranslate();
hsVector3 viewDir(&particle.fPos, &xlate);
hsFastMath::NormalizeAppr(viewDir); hsFastMath::NormalizeAppr(viewDir);
zVec = viewDir; zVec = viewDir;
@ -152,7 +153,8 @@ void inline IInlSetParticlePathStretch( const plParticleCore &particle, const hs
// Note that we could probably slim away a normalize or two, but the actual number // Note that we could probably slim away a normalize or two, but the actual number
// of normalizes we're doing hasn't gone up, I've just moved them up from IInlSetParticlePoints(). // of normalizes we're doing hasn't gone up, I've just moved them up from IInlSetParticlePoints().
hsVector3 viewDir(&particle.fPos, &viewToWorld.GetTranslate()); hsPoint3 xlate = viewToWorld.GetTranslate();
hsVector3 viewDir(&particle.fPos, &xlate);
hsScalar invD = hsFastMath::InvSqrtAppr(viewDir.MagnitudeSquared()); hsScalar invD = hsFastMath::InvSqrtAppr(viewDir.MagnitudeSquared());
viewDir *= invD; viewDir *= invD;
@ -191,7 +193,8 @@ void inline IInlSetParticlePathFlow( const plParticleCore &particle, const hsMat
// difference is that we're going to keep the area of the particle constant, // difference is that we're going to keep the area of the particle constant,
// so the longer it stretches, the narrower it gets orthogonal to the velocity. // so the longer it stretches, the narrower it gets orthogonal to the velocity.
hsVector3 viewDir(&particle.fPos, &viewToWorld.GetTranslate()); hsPoint3 xlate = viewToWorld.GetTranslate();
hsVector3 viewDir(&particle.fPos, &xlate);
hsScalar invD = hsFastMath::InvSqrtAppr(viewDir.MagnitudeSquared()); hsScalar invD = hsFastMath::InvSqrtAppr(viewDir.MagnitudeSquared());
viewDir *= invD; viewDir *= invD;
@ -242,10 +245,12 @@ void inline IInlSetParticleExplicit( const hsMatrix44 &viewToWorld, const plPart
// to calculate the vector from camera to particle and normalize it than // to calculate the vector from camera to particle and normalize it than
// to transform the vector (0,0,-1) (though not as fast as pulling the // to transform the vector (0,0,-1) (though not as fast as pulling the
// camera direction directly from the viewToWorld). // camera direction directly from the viewToWorld).
hsVector3 del(&particle.fPos, &viewToWorld.GetTranslate()); hsPoint3 xlate = viewToWorld.GetTranslate();
hsVector3 del(&particle.fPos, &xlate);
hsFastMath::NormalizeAppr(del); hsFastMath::NormalizeAppr(del);
zVec = del; zVec = del;
yVec.Set(&(viewToWorld * orientation)); hsVector3 tmp = viewToWorld * orientation;
yVec.Set(&tmp);
xVec = yVec % zVec; xVec = yVec % zVec;
#endif // See notes below - mf #endif // See notes below - mf
@ -320,7 +325,8 @@ void inline IInlSetNormalStrongestLight( hsVector3 &partNorm, const plParticleCo
{ {
if( omniLight != nil ) if( omniLight != nil )
{ {
partNorm.Set( &particle.fPos, &omniLight->GetWorldPosition() ); hsPoint3 pos = omniLight->GetWorldPosition();
partNorm.Set( &particle.fPos, &pos );
partNorm = -partNorm; partNorm = -partNorm;
} }
else if( directionLight != nil ) else if( directionLight != nil )

3
Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp

@ -551,7 +551,8 @@ plSpaceTree* plSpaceTreeMaker::IMakeEmptyTree()
plSpaceTree* tree = TRACKED_NEW plSpaceTree; plSpaceTree* tree = TRACKED_NEW plSpaceTree;
tree->fTree.SetCount(1); tree->fTree.SetCount(1);
tree->fTree[0].fWorldBounds.Reset(&hsPoint3(0,0,0)); hsPoint3 zero(0, 0, 0);
tree->fTree[0].fWorldBounds.Reset(&zero);
tree->fTree[0].fFlags = plSpaceTreeNode::kEmpty; tree->fTree[0].fFlags = plSpaceTreeNode::kEmpty;
tree->fRoot = 0; tree->fRoot = 0;
tree->fNumLeaves = 0; tree->fNumLeaves = 0;

Loading…
Cancel
Save