mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Get rid of clang warnings in plAvatar.
This commit is contained in:
@ -614,10 +614,6 @@ void plAGMasterMod::DumpCurrentAnims(const char *header)
|
|||||||
// receive trigger messages
|
// receive trigger messages
|
||||||
bool plAGMasterMod::MsgReceive(plMessage* msg)
|
bool plAGMasterMod::MsgReceive(plMessage* msg)
|
||||||
{
|
{
|
||||||
plAnimCmdMsg* cmdMsg;
|
|
||||||
plAGCmdMsg* agMsg;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
plSDLNotificationMsg* nMsg = plSDLNotificationMsg::ConvertNoRef(msg);
|
plSDLNotificationMsg* nMsg = plSDLNotificationMsg::ConvertNoRef(msg);
|
||||||
if (nMsg)
|
if (nMsg)
|
||||||
{
|
{
|
||||||
@ -626,7 +622,8 @@ bool plAGMasterMod::MsgReceive(plMessage* msg)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmdMsg = plAnimCmdMsg::ConvertNoRef(msg))
|
plAnimCmdMsg* cmdMsg = plAnimCmdMsg::ConvertNoRef(msg);
|
||||||
|
if (cmdMsg)
|
||||||
{
|
{
|
||||||
plString targetName = cmdMsg->GetAnimName();
|
plString targetName = cmdMsg->GetAnimName();
|
||||||
|
|
||||||
@ -638,7 +635,7 @@ bool plAGMasterMod::MsgReceive(plMessage* msg)
|
|||||||
{
|
{
|
||||||
if (cmdMsg->CmdChangesAnimTime())
|
if (cmdMsg->CmdChangesAnimTime())
|
||||||
{
|
{
|
||||||
for (i = 0; i < GetNumAnimations(); i++)
|
for (int i = 0; i < GetNumAnimations(); i++)
|
||||||
{
|
{
|
||||||
plAGAnimInstance *currInst = GetAnimInstance(i);
|
plAGAnimInstance *currInst = GetAnimInstance(i);
|
||||||
if (currInst != inst && currInst->GetAnimation()->SharesPinsWith(inst->GetAnimation()))
|
if (currInst != inst && currInst->GetAnimation()->SharesPinsWith(inst->GetAnimation()))
|
||||||
@ -653,7 +650,8 @@ bool plAGMasterMod::MsgReceive(plMessage* msg)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (agMsg = plAGCmdMsg::ConvertNoRef(msg))
|
plAGCmdMsg* agMsg = plAGCmdMsg::ConvertNoRef(msg);
|
||||||
|
if (agMsg)
|
||||||
{
|
{
|
||||||
if (agMsg->Cmd(plAGCmdMsg::kSetAnimTime))
|
if (agMsg->Cmd(plAGCmdMsg::kSetAnimTime))
|
||||||
{
|
{
|
||||||
@ -678,7 +676,7 @@ bool plAGMasterMod::MsgReceive(plMessage* msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
plAGInstanceCallbackMsg *agicMsg = plAGInstanceCallbackMsg::ConvertNoRef(msg);
|
plAGInstanceCallbackMsg *agicMsg = plAGInstanceCallbackMsg::ConvertNoRef(msg);
|
||||||
if (agicMsg != nil)
|
if (agicMsg)
|
||||||
{
|
{
|
||||||
if (agicMsg->fEvent == kStart)
|
if (agicMsg->fEvent == kStart)
|
||||||
{
|
{
|
||||||
@ -697,16 +695,16 @@ bool plAGMasterMod::MsgReceive(plMessage* msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
plAGDetachCallbackMsg *detachMsg = plAGDetachCallbackMsg::ConvertNoRef(msg);
|
plAGDetachCallbackMsg *detachMsg = plAGDetachCallbackMsg::ConvertNoRef(msg);
|
||||||
if (detachMsg != nil)
|
if (detachMsg)
|
||||||
{
|
{
|
||||||
DetachAnimation(detachMsg->GetAnimName());
|
DetachAnimation(detachMsg->GetAnimName());
|
||||||
}
|
}
|
||||||
|
|
||||||
plGenRefMsg *genRefMsg;
|
plGenRefMsg *genRefMsg = plGenRefMsg::ConvertNoRef(msg);
|
||||||
if (genRefMsg = plGenRefMsg::ConvertNoRef(msg))
|
if (genRefMsg)
|
||||||
{
|
{
|
||||||
plAGAnim *anim;
|
plAGAnim *anim = plAGAnim::ConvertNoRef(genRefMsg->GetRef());
|
||||||
if (anim = plAGAnim::ConvertNoRef(genRefMsg->GetRef()))
|
if (anim)
|
||||||
{
|
{
|
||||||
if (genRefMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest))
|
if (genRefMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest))
|
||||||
{
|
{
|
||||||
@ -733,8 +731,9 @@ bool plAGMasterMod::MsgReceive(plMessage* msg)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
plAGModifier *agmod;
|
|
||||||
if (agmod = plAGModifier::ConvertNoRef(genRefMsg->GetRef()))
|
plAGModifier *agmod = plAGModifier::ConvertNoRef(genRefMsg->GetRef());
|
||||||
|
if (agmod)
|
||||||
{
|
{
|
||||||
if (genRefMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest))
|
if (genRefMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest))
|
||||||
fChannelMods[agmod->GetChannelName()] = agmod;
|
fChannelMods[agmod->GetChannelName()] = agmod;
|
||||||
@ -743,8 +742,9 @@ bool plAGMasterMod::MsgReceive(plMessage* msg)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
plMsgForwarder *msgfwd;
|
|
||||||
if (msgfwd = plMsgForwarder::ConvertNoRef(genRefMsg->GetRef()))
|
plMsgForwarder *msgfwd = plMsgForwarder::ConvertNoRef(genRefMsg->GetRef());
|
||||||
|
if (msgfwd)
|
||||||
{
|
{
|
||||||
if (genRefMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest))
|
if (genRefMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest))
|
||||||
fMsgForwarder = msgfwd;
|
fMsgForwarder = msgfwd;
|
||||||
@ -754,8 +754,9 @@ bool plAGMasterMod::MsgReceive(plMessage* msg)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plRefMsg* refMsg = plRefMsg::ConvertNoRef(msg);
|
plRefMsg* refMsg = plRefMsg::ConvertNoRef(msg);
|
||||||
if( refMsg )
|
if (refMsg)
|
||||||
{
|
{
|
||||||
if( refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace) )
|
if( refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace) )
|
||||||
AddTarget(plSceneObject::ConvertNoRef(refMsg->GetRef()));
|
AddTarget(plSceneObject::ConvertNoRef(refMsg->GetRef()));
|
||||||
|
@ -2380,7 +2380,7 @@ bool plArmatureMod::FindMatchingGenericBrain(const char *names[], int count)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
plString plArmatureMod::MakeAnimationName(const char *baseName) const
|
plString plArmatureMod::MakeAnimationName(const plString& baseName) const
|
||||||
{
|
{
|
||||||
return fAnimationPrefix + baseName;
|
return fAnimationPrefix + baseName;
|
||||||
}
|
}
|
||||||
@ -2395,7 +2395,7 @@ void plArmatureMod::SetRootName(const plString &name)
|
|||||||
fRootName = name;
|
fRootName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
plAGAnim *plArmatureMod::FindCustomAnim(const char *baseName) const
|
plAGAnim *plArmatureMod::FindCustomAnim(const plString& baseName) const
|
||||||
{
|
{
|
||||||
plString customName = MakeAnimationName(baseName);
|
plString customName = MakeAnimationName(baseName);
|
||||||
plAGAnim *result = plAGAnim::FindAnim(customName);
|
plAGAnim *result = plAGAnim::FindAnim(customName);
|
||||||
|
@ -226,7 +226,7 @@ public:
|
|||||||
virtual const plSceneObject *FindBone(uint32_t id) const; // use an id from an appropriate taxonomy, such as plAvBrainHuman::BoneID
|
virtual const plSceneObject *FindBone(uint32_t id) const; // use an id from an appropriate taxonomy, such as plAvBrainHuman::BoneID
|
||||||
virtual void AddBoneMapping(uint32_t id, const plSceneObject *bone);
|
virtual void AddBoneMapping(uint32_t id, const plSceneObject *bone);
|
||||||
plAGModifier *GetRootAGMod();
|
plAGModifier *GetRootAGMod();
|
||||||
plAGAnim *FindCustomAnim(const char *baseName) const;
|
plAGAnim *FindCustomAnim(const plString& baseName) const;
|
||||||
|
|
||||||
virtual void Spawn(double timeNow);
|
virtual void Spawn(double timeNow);
|
||||||
virtual void SpawnAt(int which, double timeNow);
|
virtual void SpawnAt(int which, double timeNow);
|
||||||
@ -305,7 +305,7 @@ public:
|
|||||||
int GetBodyType(int type) { return fBodyType; }
|
int GetBodyType(int type) { return fBodyType; }
|
||||||
int GetCurrentGenericType();
|
int GetCurrentGenericType();
|
||||||
bool FindMatchingGenericBrain(const char *names[], int count);
|
bool FindMatchingGenericBrain(const char *names[], int count);
|
||||||
plString MakeAnimationName(const char * baseName) const;
|
plString MakeAnimationName(const plString& baseName) const;
|
||||||
plString GetRootName();
|
plString GetRootName();
|
||||||
void SetRootName(const plString &name);
|
void SetRootName(const plString &name);
|
||||||
|
|
||||||
|
@ -244,18 +244,19 @@ bool plAvBrainClimb::Apply(double time, float elapsed)
|
|||||||
// MSGRECEIVE
|
// MSGRECEIVE
|
||||||
bool plAvBrainClimb::MsgReceive(plMessage *msg)
|
bool plAvBrainClimb::MsgReceive(plMessage *msg)
|
||||||
{
|
{
|
||||||
plClimbMsg *climbMsg;
|
plClimbMsg* climbMsg = plClimbMsg::ConvertNoRef(msg);
|
||||||
plLOSHitMsg *losMsg;
|
if (climbMsg)
|
||||||
|
|
||||||
if(climbMsg = plClimbMsg::ConvertNoRef(msg))
|
|
||||||
{
|
{
|
||||||
return IHandleClimbMsg(climbMsg);
|
return IHandleClimbMsg(climbMsg);
|
||||||
} else if(losMsg = plLOSHitMsg::ConvertNoRef(msg))
|
}
|
||||||
|
|
||||||
|
plLOSHitMsg *losMsg = plLOSHitMsg::ConvertNoRef(msg);
|
||||||
|
if (losMsg)
|
||||||
{
|
{
|
||||||
return IHandleLOSMsg(losMsg);
|
return IHandleLOSMsg(losMsg);
|
||||||
} else {
|
|
||||||
return plArmatureBrain::MsgReceive(msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return plArmatureBrain::MsgReceive(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IHANDLECLIMBMSG
|
// IHANDLECLIMBMSG
|
||||||
@ -296,6 +297,8 @@ bool plAvBrainClimb::IHandleClimbMsg(plClimbMsg *msg)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1047,6 +1050,6 @@ const char *plAvBrainClimb::ModeStr(Mode mode)
|
|||||||
case kFallingOff:
|
case kFallingOff:
|
||||||
return "FallingOff";
|
return "FallingOff";
|
||||||
default:
|
default:
|
||||||
return "WTF???!!!";
|
return "WTF?!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,6 +259,8 @@ bool plAvBrainGeneric::Apply(double time, float elapsed)
|
|||||||
case kNormal:
|
case kNormal:
|
||||||
result = IProcessNormal(time, elapsed);
|
result = IProcessNormal(time, elapsed);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
plArmatureBrain::Apply(time, elapsed);
|
plArmatureBrain::Apply(time, elapsed);
|
||||||
return result;
|
return result;
|
||||||
@ -653,15 +655,15 @@ bool plAvBrainGeneric::IHandleGenBrainMsg(const plAvBrainGenericMsg *msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef DEBUG_MULTISTAGE
|
|
||||||
default:
|
default:
|
||||||
|
#ifdef DEBUG_MULTISTAGE
|
||||||
{
|
{
|
||||||
char sbuf[256];
|
char sbuf[256];
|
||||||
sprintf(sbuf,"GenericMsg - Unknown command %d ",msg->fType);
|
sprintf(sbuf,"GenericMsg - Unknown command %d ",msg->fType);
|
||||||
plAvatarMgr::GetInstance()->GetLog()->AddLine(sbuf);
|
plAvatarMgr::GetInstance()->GetLog()->AddLine(sbuf);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -731,24 +733,21 @@ bool plAvBrainGeneric::IBrainIsCompatible(plAvBrainGeneric *otherBrain)
|
|||||||
{
|
{
|
||||||
case plAGAnim::kBodyUnknown:
|
case plAGAnim::kBodyUnknown:
|
||||||
return false;
|
return false;
|
||||||
break;
|
|
||||||
case plAGAnim::kBodyFull:
|
case plAGAnim::kBodyFull:
|
||||||
return false;
|
return false;
|
||||||
break;
|
|
||||||
case plAGAnim::kBodyUpper:
|
case plAGAnim::kBodyUpper:
|
||||||
if(otherUsage == plAGAnim::kBodyLower)
|
if(otherUsage == plAGAnim::kBodyLower)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
break;
|
|
||||||
case plAGAnim::kBodyLower:
|
case plAGAnim::kBodyLower:
|
||||||
if(otherUsage == plAGAnim::kBodyUpper)
|
if(otherUsage == plAGAnim::kBodyUpper)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
break;
|
default:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -389,6 +389,8 @@ bool plAvBrainHuman::IHandleControlMsg(plControlEventMsg* msg)
|
|||||||
IChatOn();
|
IChatOn();
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch(moveCode)
|
switch(moveCode)
|
||||||
@ -398,6 +400,8 @@ bool plAvBrainHuman::IHandleControlMsg(plControlEventMsg* msg)
|
|||||||
IChatOff();
|
IChatOff();
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -515,6 +519,8 @@ bool plAvBrainHuman::IHandleClimbMsg(plClimbMsg *msg)
|
|||||||
case plClimbMsg::kRight:
|
case plClimbMsg::kRight:
|
||||||
startMode = plAvBrainClimb::kMountingRight;
|
startMode = plAvBrainClimb::kMountingRight;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
plAvBrainClimb *brain = new plAvBrainClimb(startMode);
|
plAvBrainClimb *brain = new plAvBrainClimb(startMode);
|
||||||
plAvTaskBrain *brainTask = new plAvTaskBrain(brain);
|
plAvTaskBrain *brainTask = new plAvTaskBrain(brain);
|
||||||
|
@ -586,6 +586,8 @@ bool plAvBrainSwim::IHandleControlMsg(plControlEventMsg* msg)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -611,6 +613,8 @@ void plAvBrainSwim::DumpToDebugDisplay(int &x, int &y, int lineHeight, char *str
|
|||||||
case kAbort:
|
case kAbort:
|
||||||
sprintf(strBuf, "Mode: Abort (you should never see this)");
|
sprintf(strBuf, "Mode: Abort (you should never see this)");
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
debugTxt.DrawString(x, y, strBuf);
|
debugTxt.DrawString(x, y, strBuf);
|
||||||
y += lineHeight;
|
y += lineHeight;
|
||||||
|
@ -255,7 +255,7 @@ void plAvLadderMod::EmitCommand(const plKey receiver)
|
|||||||
plSceneObject *seekObj = GetTarget();
|
plSceneObject *seekObj = GetTarget();
|
||||||
plKey seekKey = seekObj->GetKey(); // this modifier's target is the seek object
|
plKey seekKey = seekObj->GetKey(); // this modifier's target is the seek object
|
||||||
|
|
||||||
char *mountName, *dismountName, *traverseName;
|
const char *mountName, *dismountName, *traverseName;
|
||||||
|
|
||||||
if(fGoingUp)
|
if(fGoingUp)
|
||||||
{
|
{
|
||||||
|
@ -104,7 +104,7 @@ void plAvTaskSeek::IInitDefaults()
|
|||||||
fSeekObject = nil;
|
fSeekObject = nil;
|
||||||
fMovingTarget = false;
|
fMovingTarget = false;
|
||||||
fAlign = kAlignHandle;
|
fAlign = kAlignHandle;
|
||||||
fAnimName = nil;
|
fAnimName = "";
|
||||||
fPosGoalHit = false;
|
fPosGoalHit = false;
|
||||||
fRotGoalHit = false;
|
fRotGoalHit = false;
|
||||||
fStillPositioning = true;
|
fStillPositioning = true;
|
||||||
@ -171,7 +171,7 @@ plAvTaskSeek::plAvTaskSeek(plKey target)
|
|||||||
|
|
||||||
// plAvTaskSeek -------------------------------------------------------------------------------------------
|
// plAvTaskSeek -------------------------------------------------------------------------------------------
|
||||||
// -------------
|
// -------------
|
||||||
plAvTaskSeek::plAvTaskSeek(plKey target, plAvAlignment align, const char *animName, bool moving)
|
plAvTaskSeek::plAvTaskSeek(plKey target, plAvAlignment align, const plString& animName, bool moving)
|
||||||
{
|
{
|
||||||
IInitDefaults();
|
IInitDefaults();
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
plAvTaskSeek();
|
plAvTaskSeek();
|
||||||
plAvTaskSeek(plKey target);
|
plAvTaskSeek(plKey target);
|
||||||
plAvTaskSeek(plAvSeekMsg *msg);
|
plAvTaskSeek(plAvSeekMsg *msg);
|
||||||
plAvTaskSeek(plKey target, plAvAlignment align, const char *animName, bool moving);
|
plAvTaskSeek(plKey target, plAvAlignment align, const plString& animName, bool moving);
|
||||||
|
|
||||||
void SetTarget(plKey target);
|
void SetTarget(plKey target);
|
||||||
void SetTarget(hsPoint3 &pos, hsPoint3 &lookAt);
|
void SetTarget(hsPoint3 &pos, hsPoint3 &lookAt);
|
||||||
@ -153,7 +153,7 @@ protected:
|
|||||||
// for example, you can say "find a good start point so that you can play this animation
|
// for example, you can say "find a good start point so that you can play this animation
|
||||||
// and have your handle wind up here" i.e: aligntype = "kAlignHandleAnimEnd"
|
// and have your handle wind up here" i.e: aligntype = "kAlignHandleAnimEnd"
|
||||||
plAvAlignment fAlign; // how to line up with the seek point
|
plAvAlignment fAlign; // how to line up with the seek point
|
||||||
const char * fAnimName; // an (optional) anim to use to line up our target
|
plString fAnimName; // an (optional) anim to use to line up our target
|
||||||
// so you can say "seek to a place where your hand
|
// so you can say "seek to a place where your hand
|
||||||
// will be here after you play animation foo"
|
// will be here after you play animation foo"
|
||||||
|
|
||||||
@ -187,4 +187,4 @@ protected:
|
|||||||
plKey fNotifyFinishedKey; // Send a message to this key when we're done.
|
plKey fNotifyFinishedKey; // Send a message to this key when we're done.
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -632,10 +632,11 @@ void plClothingOutfit::IAddItem(plClothingItem *item)
|
|||||||
|
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
if (soundEffect = plArmatureEffectFootSound::ConvertNoRef(mgr->GetEffect(i)))
|
soundEffect = plArmatureEffectFootSound::ConvertNoRef(mgr->GetEffect(i));
|
||||||
|
if (soundEffect)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soundEffect)
|
if (soundEffect)
|
||||||
{
|
{
|
||||||
if (!strcmp(item->fName, "03_MLFoot04_01") || !strcmp(item->fName, "03_FLFoot04_01"))
|
if (!strcmp(item->fName, "03_MLFoot04_01") || !strcmp(item->fName, "03_FLFoot04_01"))
|
||||||
@ -1533,7 +1534,7 @@ plClothingLayout *plClothingMgr::GetLayout(char *name)
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
plClothingElement *plClothingMgr::FindElementByName(char *name)
|
plClothingElement *plClothingMgr::FindElementByName(const char *name)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < fElements.GetCount(); i++)
|
for (i = 0; i < fElements.GetCount(); i++)
|
||||||
|
@ -259,7 +259,7 @@ public:
|
|||||||
GETINTERFACE_ANY( plClothingMgr, hsKeyedObject );
|
GETINTERFACE_ANY( plClothingMgr, hsKeyedObject );
|
||||||
|
|
||||||
plClothingLayout *GetLayout(char *name);
|
plClothingLayout *GetLayout(char *name);
|
||||||
plClothingElement *FindElementByName(char *name);
|
plClothingElement *FindElementByName(const char *name);
|
||||||
|
|
||||||
|
|
||||||
// Functions that just relate to the clothing you have permission to wear (closet)
|
// Functions that just relate to the clothing you have permission to wear (closet)
|
||||||
|
@ -169,7 +169,7 @@ plAvSeekTask::plAvSeekTask()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CTOR target, align, animName
|
// CTOR target, align, animName
|
||||||
plAvSeekTask::plAvSeekTask(plKey target, plAvAlignment align, const char *animName)
|
plAvSeekTask::plAvSeekTask(plKey target, plAvAlignment align, const plString& animName)
|
||||||
: fAlign(align),
|
: fAlign(align),
|
||||||
fDuration(0.25),
|
fDuration(0.25),
|
||||||
fTarget(target),
|
fTarget(target),
|
||||||
@ -178,19 +178,17 @@ plAvSeekTask::plAvSeekTask(plKey target, plAvAlignment align, const char *animNa
|
|||||||
fPhysicalAtStart(false),
|
fPhysicalAtStart(false),
|
||||||
fCleanup(false)
|
fCleanup(false)
|
||||||
{
|
{
|
||||||
fAnimName = hsStrcpy(animName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CTOR target
|
// CTOR target
|
||||||
plAvSeekTask::plAvSeekTask(plKey target)
|
plAvSeekTask::plAvSeekTask(plKey target)
|
||||||
: fAnimName(nil),
|
: fAlign(kAlignHandle),
|
||||||
fAlign(kAlignHandle),
|
fDuration(0.25),
|
||||||
fDuration(0.25),
|
fTarget(target),
|
||||||
fTarget(target),
|
fAnimInstance(nil),
|
||||||
fAnimInstance(nil),
|
fTargetTime(0),
|
||||||
fTargetTime(0),
|
fPhysicalAtStart(false),
|
||||||
fPhysicalAtStart(false),
|
fCleanup(false)
|
||||||
fCleanup(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ public:
|
|||||||
plAvSeekTask(plKey target);
|
plAvSeekTask(plKey target);
|
||||||
/** Constructor form for calculated seek points: uses aligment type and (optionally) animation
|
/** Constructor form for calculated seek points: uses aligment type and (optionally) animation
|
||||||
The animation is used if we're trying to align some future pose with a seek target. */
|
The animation is used if we're trying to align some future pose with a seek target. */
|
||||||
plAvSeekTask(plKey target, plAvAlignment alignType, const char *animName);
|
plAvSeekTask(plKey target, plAvAlignment alignType, const plString& animName);
|
||||||
|
|
||||||
// task protocol
|
// task protocol
|
||||||
virtual bool Start(plArmatureMod *avatar, plArmatureBrain *brain, double time, float elapsed);
|
virtual bool Start(plArmatureMod *avatar, plArmatureBrain *brain, double time, float elapsed);
|
||||||
@ -146,7 +146,7 @@ public:
|
|||||||
// *** implement reader and writer if needed for network propagation
|
// *** implement reader and writer if needed for network propagation
|
||||||
protected:
|
protected:
|
||||||
// -- specification members --
|
// -- specification members --
|
||||||
char * fAnimName; // the animation we're using, if any;
|
plString fAnimName; // the animation we're using, if any;
|
||||||
plAvAlignment fAlign; // how to line up with the seek point
|
plAvAlignment fAlign; // how to line up with the seek point
|
||||||
double fDuration; // the time we want the task to take
|
double fDuration; // the time we want the task to take
|
||||||
plKey fTarget; // the thing we're seeking towards
|
plKey fTarget; // the thing we're seeking towards
|
||||||
|
@ -127,7 +127,7 @@ public:
|
|||||||
class plClothingLayout
|
class plClothingLayout
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
plClothingLayout(char *name, uint32_t origWidth) { fName = hsStrcpy(name); fOrigWidth = origWidth; }
|
plClothingLayout(const char *name, uint32_t origWidth) { fName = hsStrcpy(name); fOrigWidth = origWidth; }
|
||||||
~plClothingLayout() { delete [] fName; }
|
~plClothingLayout() { delete [] fName; }
|
||||||
|
|
||||||
char *fName;
|
char *fName;
|
||||||
|
@ -227,7 +227,8 @@ bool plCoopCoordinator::MsgReceive(plMessage *msg)
|
|||||||
fGuestLinked = true;
|
fGuestLinked = true;
|
||||||
IAdvanceParticipant(true); // advance the host
|
IAdvanceParticipant(true); // advance the host
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,6 @@ void plMultistageBehMod::IDeleteStageVec()
|
|||||||
|
|
||||||
bool plMultistageBehMod::MsgReceive(plMessage* msg)
|
bool plMultistageBehMod::MsgReceive(plMessage* msg)
|
||||||
{
|
{
|
||||||
plMultistageModMsg *multiMsg = nil;
|
|
||||||
plNotifyMsg* notifyMsg = plNotifyMsg::ConvertNoRef(msg);
|
plNotifyMsg* notifyMsg = plNotifyMsg::ConvertNoRef(msg);
|
||||||
if (notifyMsg)
|
if (notifyMsg)
|
||||||
{
|
{
|
||||||
@ -187,8 +186,10 @@ bool plMultistageBehMod::MsgReceive(plMessage* msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (multiMsg = plMultistageModMsg::ConvertNoRef(msg))
|
|
||||||
|
plMultistageModMsg *multiMsg = plMultistageModMsg::ConvertNoRef(msg);
|
||||||
|
if (multiMsg)
|
||||||
{
|
{
|
||||||
if (multiMsg->GetCommand(plMultistageModMsg::kSetLoopCount))
|
if (multiMsg->GetCommand(plMultistageModMsg::kSetLoopCount))
|
||||||
{
|
{
|
||||||
@ -196,9 +197,8 @@ bool plMultistageBehMod::MsgReceive(plMessage* msg)
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return plSingleModifier::MsgReceive(msg);
|
return plSingleModifier::MsgReceive(msg);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void plMultistageBehMod::Read(hsStream *stream, hsResMgr *mgr)
|
void plMultistageBehMod::Read(hsStream *stream, hsResMgr *mgr)
|
||||||
|
@ -220,8 +220,8 @@ void plSittingModifier::Trigger(const plArmatureMod *avMod, plNotifyMsg *enterNo
|
|||||||
// send the SEEK message
|
// send the SEEK message
|
||||||
|
|
||||||
|
|
||||||
char *animName = nil; // this will be the name of our sit animation, which we
|
const char *animName = nil; // this will be the name of our sit animation, which we
|
||||||
// need to know so we can seek properly.
|
// need to know so we can seek properly.
|
||||||
|
|
||||||
plAvBrainGeneric *brain = IBuildSitBrain(avModKey, seekKey, &animName, enterNotify, exitNotify);
|
plAvBrainGeneric *brain = IBuildSitBrain(avModKey, seekKey, &animName, enterNotify, exitNotify);
|
||||||
if(brain)
|
if(brain)
|
||||||
@ -298,7 +298,7 @@ bool IIsClosestAnim(const char *animName, hsMatrix44 &sitGoal, float &closestDis
|
|||||||
// IBuildSitBrain ---------------------------------------------------------------------
|
// IBuildSitBrain ---------------------------------------------------------------------
|
||||||
// ----------------
|
// ----------------
|
||||||
plAvBrainGeneric *plSittingModifier::IBuildSitBrain(plKey avModKey, plKey seekKey,
|
plAvBrainGeneric *plSittingModifier::IBuildSitBrain(plKey avModKey, plKey seekKey,
|
||||||
char **pAnimName, plNotifyMsg *enterNotify, plNotifyMsg *exitNotify)
|
const char **pAnimName, plNotifyMsg *enterNotify, plNotifyMsg *exitNotify)
|
||||||
{
|
{
|
||||||
plArmatureMod *avatar = plArmatureMod::ConvertNoRef(avModKey->ObjectIsLoaded());
|
plArmatureMod *avatar = plArmatureMod::ConvertNoRef(avModKey->ObjectIsLoaded());
|
||||||
plSceneObject *seekObj = plSceneObject::ConvertNoRef(seekKey->ObjectIsLoaded());
|
plSceneObject *seekObj = plSceneObject::ConvertNoRef(seekKey->ObjectIsLoaded());
|
||||||
@ -308,8 +308,8 @@ plAvBrainGeneric *plSittingModifier::IBuildSitBrain(plKey avModKey, plKey seekKe
|
|||||||
float closestDist = 0.0f;
|
float closestDist = 0.0f;
|
||||||
uint8_t closestApproach = 0;
|
uint8_t closestApproach = 0;
|
||||||
hsPoint3 curPosition = avatar->GetTarget(0)->GetLocalToWorld().GetTranslate();
|
hsPoint3 curPosition = avatar->GetTarget(0)->GetLocalToWorld().GetTranslate();
|
||||||
char * sitAnimName = nil;
|
const char* sitAnimName = nil;
|
||||||
char * standAnimName = "StandUpFront"; // always prefer to stand facing front
|
const char* standAnimName = "StandUpFront"; // always prefer to stand facing front
|
||||||
|
|
||||||
bool frontClear = fMiscFlags & kApproachFront;
|
bool frontClear = fMiscFlags & kApproachFront;
|
||||||
plAvBrainGeneric *brain = nil;
|
plAvBrainGeneric *brain = nil;
|
||||||
@ -353,7 +353,11 @@ plAvBrainGeneric *plSittingModifier::IBuildSitBrain(plKey avModKey, plKey seekKe
|
|||||||
brain->AddStage(sitStage);
|
brain->AddStage(sitStage);
|
||||||
brain->AddStage(idleStage);
|
brain->AddStage(idleStage);
|
||||||
brain->AddStage(standStage);
|
brain->AddStage(standStage);
|
||||||
*pAnimName = sitAnimName;
|
#if HS_BUILD_FOR_WIN32
|
||||||
|
*pAnimName = _strdup(sitAnimName);
|
||||||
|
#else
|
||||||
|
*pAnimName = strdup(sitAnimName);
|
||||||
|
#endif
|
||||||
|
|
||||||
brain->SetType(plAvBrainGeneric::kSit);
|
brain->SetType(plAvBrainGeneric::kSit);
|
||||||
brain->SetRecipient(GetKey());
|
brain->SetRecipient(GetKey());
|
||||||
|
@ -110,7 +110,7 @@ protected:
|
|||||||
|
|
||||||
/** Figure out which approach we should use to the sit target, and add the relevant
|
/** Figure out which approach we should use to the sit target, and add the relevant
|
||||||
stages to the brain. */
|
stages to the brain. */
|
||||||
plAvBrainGeneric * IBuildSitBrain(plKey avModKey, plKey seekKey,char **pAnimName, plNotifyMsg *enterNotify, plNotifyMsg *exitNotify);
|
plAvBrainGeneric * IBuildSitBrain(plKey avModKey, plKey seekKey, const char **pAnimName, plNotifyMsg *enterNotify, plNotifyMsg *exitNotify);
|
||||||
|
|
||||||
/** Unused. */
|
/** Unused. */
|
||||||
virtual bool IEval(double secs, float del, uint32_t dirty) { return true; }
|
virtual bool IEval(double secs, float del, uint32_t dirty) { return true; }
|
||||||
|
@ -249,7 +249,7 @@ plAvSeekMsg::plAvSeekMsg()
|
|||||||
// CTOR(sender, receiver, seekKey, time)
|
// CTOR(sender, receiver, seekKey, time)
|
||||||
plAvSeekMsg::plAvSeekMsg(const plKey& sender, const plKey& receiver,
|
plAvSeekMsg::plAvSeekMsg(const plKey& sender, const plKey& receiver,
|
||||||
const plKey &seekKey, float duration, bool smartSeek,
|
const plKey &seekKey, float duration, bool smartSeek,
|
||||||
plAvAlignment alignType, char *animName, bool noSeek,
|
plAvAlignment alignType, const plString& animName, bool noSeek,
|
||||||
uint8_t flags, plKey finishKey)
|
uint8_t flags, plKey finishKey)
|
||||||
: plAvTaskMsg(sender, receiver),
|
: plAvTaskMsg(sender, receiver),
|
||||||
fSeekPoint(seekKey),
|
fSeekPoint(seekKey),
|
||||||
@ -359,7 +359,7 @@ plAvOneShotMsg::plAvOneShotMsg()
|
|||||||
plAvOneShotMsg::plAvOneShotMsg(const plKey &sender, const plKey& receiver,
|
plAvOneShotMsg::plAvOneShotMsg(const plKey &sender, const plKey& receiver,
|
||||||
const plKey& seekKey, float duration, bool smartSeek,
|
const plKey& seekKey, float duration, bool smartSeek,
|
||||||
const plString &animName, bool drivable, bool reversible)
|
const plString &animName, bool drivable, bool reversible)
|
||||||
: plAvSeekMsg(sender, receiver, seekKey, duration, smartSeek), fAnimName(animName),
|
: plAvSeekMsg(sender, receiver, seekKey, duration, smartSeek, kAlignHandle, animName),
|
||||||
fDrivable(drivable), fReversible(reversible), fCallbacks(nil)
|
fDrivable(drivable), fReversible(reversible), fCallbacks(nil)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ public:
|
|||||||
// tors
|
// tors
|
||||||
plAvSeekMsg();
|
plAvSeekMsg();
|
||||||
plAvSeekMsg(const plKey& sender, const plKey& receiver, const plKey &seekKey, float duration, bool smartSeek,
|
plAvSeekMsg(const plKey& sender, const plKey& receiver, const plKey &seekKey, float duration, bool smartSeek,
|
||||||
plAvAlignment align = kAlignHandle, char *animName = nil, bool noSeek = false,
|
plAvAlignment align = kAlignHandle, const plString& animName = "", bool noSeek = false,
|
||||||
uint8_t flags = kSeekFlagForce3rdPersonOnStart, plKey finishKey = nil);
|
uint8_t flags = kSeekFlagForce3rdPersonOnStart, plKey finishKey = nil);
|
||||||
|
|
||||||
// plasma protocol
|
// plasma protocol
|
||||||
@ -212,7 +212,7 @@ public:
|
|||||||
float fDuration; // take this much time to do the move (only if smartSeek is false)
|
float fDuration; // take this much time to do the move (only if smartSeek is false)
|
||||||
bool fSmartSeek; // seek by walking rather than floating
|
bool fSmartSeek; // seek by walking rather than floating
|
||||||
bool fNoSeek;
|
bool fNoSeek;
|
||||||
char *fAnimName;
|
plString fAnimName;
|
||||||
plAvAlignment fAlignType;
|
plAvAlignment fAlignType;
|
||||||
uint8_t fFlags;
|
uint8_t fFlags;
|
||||||
plKey fFinishKey;
|
plKey fFinishKey;
|
||||||
@ -257,7 +257,6 @@ public:
|
|||||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||||
|
|
||||||
// public members
|
// public members
|
||||||
plString fAnimName; // the name of the animation we're going to use
|
|
||||||
bool fDrivable; // are we animated by time or by mouse movement?
|
bool fDrivable; // are we animated by time or by mouse movement?
|
||||||
bool fReversible; // can we play backwards?
|
bool fReversible; // can we play backwards?
|
||||||
plOneShotCallbacks *fCallbacks; // Callbacks given to us by a one-shot modifier
|
plOneShotCallbacks *fCallbacks; // Callbacks given to us by a one-shot modifier
|
||||||
|
Reference in New Issue
Block a user