Browse Source

plOneShotMod => plString

Michael Hansen 11 years ago
parent
commit
71c9771cfb
  1. 22
      Sources/Plasma/PubUtilLib/plAvatar/plOneShotMod.cpp
  2. 9
      Sources/Plasma/PubUtilLib/plAvatar/plOneShotMod.h

22
Sources/Plasma/PubUtilLib/plAvatar/plOneShotMod.cpp

@ -61,37 +61,36 @@ plOneShotMod::plOneShotMod()
fReversable(false), fReversable(false),
fSeekDuration(1.0f), fSeekDuration(1.0f),
fSmartSeek(false), fSmartSeek(false),
fAnimName(nil),
fNoSeek(false) fNoSeek(false)
{ {
// this constructor is called from the loader. // this constructor is called from the loader.
} }
// CTOR(char *) // CTOR(char *)
plOneShotMod::plOneShotMod(const char *animName, plOneShotMod::plOneShotMod(const plString &animName,
bool drivable, bool drivable,
bool reversable, bool reversable,
float seekDuration, float seekDuration,
bool smartSeek, bool smartSeek,
bool noSeek) bool noSeek)
: fDrivable(drivable), : fAnimName(animName),
fDrivable(drivable),
fReversable(reversable), fReversable(reversable),
fSeekDuration(seekDuration), fSeekDuration(seekDuration),
fSmartSeek((float)smartSeek), fSmartSeek((float)smartSeek),
fNoSeek(noSeek) fNoSeek(noSeek)
{ {
fAnimName = hsStrcpy(animName);
} }
// INIT // INIT
void plOneShotMod::Init(const char *animName, void plOneShotMod::Init(const plString &animName,
bool drivable, bool drivable,
bool reversable, bool reversable,
float seekDuration, float seekDuration,
bool smartSeek, bool smartSeek,
bool noSeek) bool noSeek)
{ {
fAnimName = hsStrcpy(animName); fAnimName = animName;
fDrivable = drivable; fDrivable = drivable;
fReversable = reversable; fReversable = reversable;
fSeekDuration = seekDuration; fSeekDuration = seekDuration;
@ -99,15 +98,6 @@ void plOneShotMod::Init(const char *animName,
fNoSeek = noSeek; fNoSeek = noSeek;
} }
// DTOR()
plOneShotMod::~plOneShotMod()
{
if(fAnimName) {
delete[] fAnimName;
fAnimName = nil;
}
}
// MSGRECEIVE // MSGRECEIVE
bool plOneShotMod::MsgReceive(plMessage* msg) bool plOneShotMod::MsgReceive(plMessage* msg)
@ -164,7 +154,7 @@ void plOneShotMod::Read(hsStream *stream, hsResMgr *mgr)
plMultiModifier::Read(stream, mgr); plMultiModifier::Read(stream, mgr);
// read in the name of the animation itself // read in the name of the animation itself
fAnimName = stream->ReadSafeString(); fAnimName = stream->ReadSafeString_TEMP();
fSeekDuration = stream->ReadLEScalar(); fSeekDuration = stream->ReadLEScalar();
fDrivable = stream->ReadBool(); fDrivable = stream->ReadBool();
fReversable = stream->ReadBool(); fReversable = stream->ReadBool();

9
Sources/Plasma/PubUtilLib/plAvatar/plOneShotMod.h

@ -56,7 +56,7 @@ class plOneShotMod : public plMultiModifier
{ {
protected: protected:
virtual bool IEval(double secs, float del, uint32_t dirty) {return true;} virtual bool IEval(double secs, float del, uint32_t dirty) {return true;}
char * fAnimName; // the name of the animation associated with this one-shot plString fAnimName; // the name of the animation associated with this one-shot
bool fDrivable; // whether the user can control the position of the animation bool fDrivable; // whether the user can control the position of the animation
bool fReversable; // whether the user can back up the animation (fDrivable must be true as well) bool fReversable; // whether the user can back up the animation (fDrivable must be true as well)
float fSeekDuration; // how long to take to get to the seek point (??? should this be speed instead?) float fSeekDuration; // how long to take to get to the seek point (??? should this be speed instead?)
@ -64,10 +64,11 @@ protected:
bool fNoSeek; bool fNoSeek;
public: public:
plOneShotMod(); plOneShotMod();
plOneShotMod(const char *animName, bool drivable, bool reversable, float seekDuration, bool smartSeek,bool noSeek = false); plOneShotMod(const plString &animName, bool drivable, bool reversable,
virtual ~plOneShotMod(); float seekDuration, bool smartSeek, bool noSeek = false);
void Init(const char *animName, bool drivable, bool reversable, float seekDuration, bool smartSeek, bool noSeek = false); void Init(const plString &animName, bool drivable, bool reversable,
float seekDuration, bool smartSeek, bool noSeek = false);
CLASSNAME_REGISTER( plOneShotMod ); CLASSNAME_REGISTER( plOneShotMod );
GETINTERFACE_ANY( plOneShotMod, plMultiModifier ); GETINTERFACE_ANY( plOneShotMod, plMultiModifier );

Loading…
Cancel
Save