Browse Source

plOneShotMod => plString

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

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

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

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

@ -56,7 +56,7 @@ class plOneShotMod : public plMultiModifier
{
protected:
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 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?)
@ -64,10 +64,11 @@ protected:
bool fNoSeek;
public:
plOneShotMod();
plOneShotMod(const char *animName, bool drivable, bool reversable, float seekDuration, bool smartSeek,bool noSeek = false);
virtual ~plOneShotMod();
void Init(const char *animName, bool drivable, bool reversable, float seekDuration, bool smartSeek, bool noSeek = false);
plOneShotMod(const plString &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 );
GETINTERFACE_ANY( plOneShotMod, plMultiModifier );

Loading…
Cancel
Save