mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Fix string usage that was broken from enabling the Max plugin build
This commit is contained in:
@ -47,8 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
plAnimCmdMsg::~plAnimCmdMsg()
|
||||
{
|
||||
ClearCmd();
|
||||
delete [] fAnimName;
|
||||
delete [] fLoopName;
|
||||
}
|
||||
|
||||
|
||||
@ -58,24 +56,22 @@ void plAnimCmdMsg::ClearCmd()
|
||||
fCmd.Clear();
|
||||
}
|
||||
|
||||
void plAnimCmdMsg::SetAnimName(const char *name)
|
||||
void plAnimCmdMsg::SetAnimName(const plString &name)
|
||||
{
|
||||
delete [] fAnimName;
|
||||
fAnimName = hsStrcpy(name);
|
||||
fAnimName = name;
|
||||
}
|
||||
|
||||
const char *plAnimCmdMsg::GetAnimName()
|
||||
plString plAnimCmdMsg::GetAnimName()
|
||||
{
|
||||
return fAnimName;
|
||||
}
|
||||
|
||||
void plAnimCmdMsg::SetLoopName(const char *name)
|
||||
void plAnimCmdMsg::SetLoopName(const plString &name)
|
||||
{
|
||||
delete [] fLoopName;
|
||||
fLoopName = hsStrcpy(name);
|
||||
fLoopName = name;
|
||||
}
|
||||
|
||||
const char *plAnimCmdMsg::GetLoopName()
|
||||
plString plAnimCmdMsg::GetLoopName()
|
||||
{
|
||||
return fLoopName;
|
||||
}
|
||||
@ -110,8 +106,8 @@ void plAnimCmdMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
stream->ReadLE(&fSpeedChangeRate);
|
||||
stream->ReadLE(&fTime);
|
||||
|
||||
fAnimName = stream->ReadSafeString();
|
||||
fLoopName = stream->ReadSafeString();
|
||||
fAnimName = stream->ReadSafeString_TEMP();
|
||||
fLoopName = stream->ReadSafeString_TEMP();
|
||||
}
|
||||
|
||||
void plAnimCmdMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
@ -136,16 +132,14 @@ void plAnimCmdMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
plAGCmdMsg::~plAGCmdMsg()
|
||||
{
|
||||
ClearCmd();
|
||||
delete [] fAnimName;
|
||||
}
|
||||
|
||||
void plAGCmdMsg::SetAnimName(const char *name)
|
||||
void plAGCmdMsg::SetAnimName(const plString &name)
|
||||
{
|
||||
delete [] fAnimName;
|
||||
fAnimName = hsStrcpy(name);
|
||||
fAnimName = name;
|
||||
}
|
||||
|
||||
const char *plAGCmdMsg::GetAnimName()
|
||||
plString plAGCmdMsg::GetAnimName()
|
||||
{
|
||||
return fAnimName;
|
||||
}
|
||||
@ -160,7 +154,7 @@ void plAGCmdMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
stream->ReadLE(&fAmp);
|
||||
stream->ReadLE(&fAmpRate);
|
||||
|
||||
fAnimName = stream->ReadSafeString();
|
||||
fAnimName = stream->ReadSafeString_TEMP();
|
||||
}
|
||||
|
||||
void plAGCmdMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
@ -178,17 +172,12 @@ void plAGCmdMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
plAGDetachCallbackMsg::~plAGDetachCallbackMsg()
|
||||
void plAGDetachCallbackMsg::SetAnimName(const plString &name)
|
||||
{
|
||||
delete [] fAnimName;
|
||||
fAnimName = name;
|
||||
}
|
||||
|
||||
void plAGDetachCallbackMsg::SetAnimName(const char *name)
|
||||
{
|
||||
fAnimName = hsStrcpy(name);
|
||||
}
|
||||
|
||||
char *plAGDetachCallbackMsg::GetAnimName()
|
||||
plString plAGDetachCallbackMsg::GetAnimName()
|
||||
{
|
||||
return fAnimName;
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "hsBitVector.h"
|
||||
#include "hsTemplates.h"
|
||||
#include "hsGeometry3.h"
|
||||
#include "plString.h"
|
||||
#include "plInterp/plAnimEaseTypes.h"
|
||||
#include "plInterp/plAnimTimeConvert.h"
|
||||
|
||||
@ -55,11 +56,11 @@ class plAGAnimInstance;
|
||||
class plAnimCmdMsg : public plMessageWithCallbacks
|
||||
{
|
||||
protected:
|
||||
char *fAnimName;
|
||||
char *fLoopName;
|
||||
plString fAnimName;
|
||||
plString fLoopName;
|
||||
|
||||
private:
|
||||
void IInit() { fBegin=fEnd=fLoopBegin=fLoopEnd=fSpeed=fSpeedChangeRate=fTime=0; fAnimName=fLoopName=nil;}
|
||||
void IInit() { fBegin=fEnd=fLoopBegin=fLoopEnd=fSpeed=fSpeedChangeRate=fTime=0; fAnimName=fLoopName=plString::Null;}
|
||||
public:
|
||||
plAnimCmdMsg()
|
||||
: plMessageWithCallbacks(nil, nil, nil) { IInit(); }
|
||||
@ -110,12 +111,16 @@ public:
|
||||
hsBool Cmd(int n) const { return fCmd.IsBitSet(n); }
|
||||
void SetCmd(int n) { fCmd.SetBit(n); }
|
||||
void ClearCmd();
|
||||
void SetAnimName(const char *name);
|
||||
const char *GetAnimName();
|
||||
void SetAnimName(const plString &name);
|
||||
plString GetAnimName();
|
||||
hsBool CmdChangesAnimTime(); // Will this command cause an update to the current anim time?
|
||||
|
||||
void SetLoopName(const char *name);
|
||||
const char *GetLoopName();
|
||||
// TEMP plString REVISIT
|
||||
// Because I'm TOO LAZY to keep converting all these calls to SetAnimName
|
||||
void SetAnimName(const char *name) { SetAnimName(_TEMP_CONVERT_FROM_LITERAL(name)); }
|
||||
|
||||
void SetLoopName(const plString &name);
|
||||
plString GetLoopName();
|
||||
|
||||
float fBegin;
|
||||
float fEnd;
|
||||
@ -136,11 +141,11 @@ public:
|
||||
class plAGCmdMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
char *fAnimName;
|
||||
plString fAnimName;
|
||||
|
||||
private:
|
||||
void IInit() { fBlend = fAmp = 0;
|
||||
fAnimName=nil;}
|
||||
fAnimName=plString::Null;}
|
||||
public:
|
||||
plAGCmdMsg()
|
||||
: plMessage(nil, nil, nil) { IInit(); }
|
||||
@ -165,8 +170,8 @@ public:
|
||||
hsBool Cmd(int n) const { return fCmd.IsBitSet(n); }
|
||||
void SetCmd(int n) { fCmd.SetBit(n); }
|
||||
void ClearCmd() { fCmd.Clear(); }
|
||||
void SetAnimName(const char *name);
|
||||
const char *GetAnimName();
|
||||
void SetAnimName(const plString &name);
|
||||
plString GetAnimName();
|
||||
|
||||
float fBlend;
|
||||
float fBlendRate;
|
||||
@ -199,13 +204,12 @@ public:
|
||||
class plAGDetachCallbackMsg : public plEventCallbackMsg
|
||||
{
|
||||
protected:
|
||||
char *fAnimName;
|
||||
plString fAnimName;
|
||||
|
||||
public:
|
||||
plAGDetachCallbackMsg() : plEventCallbackMsg(), fAnimName(nil) {}
|
||||
plAGDetachCallbackMsg() : plEventCallbackMsg() {}
|
||||
plAGDetachCallbackMsg(plKey receiver, CallbackEvent e, int idx=0, float t=0, int16_t repeats=-1, uint16_t user=0) :
|
||||
plEventCallbackMsg(receiver, e, idx, t, repeats, user), fAnimName(nil) {}
|
||||
virtual ~plAGDetachCallbackMsg();
|
||||
plEventCallbackMsg(receiver, e, idx, t, repeats, user) {}
|
||||
|
||||
CLASSNAME_REGISTER( plAGDetachCallbackMsg );
|
||||
GETINTERFACE_ANY( plAGDetachCallbackMsg, plEventCallbackMsg );
|
||||
@ -214,8 +218,8 @@ public:
|
||||
void Read(hsStream* stream, hsResMgr* mgr) {}
|
||||
void Write(hsStream* stream, hsResMgr* mgr) {}
|
||||
|
||||
void SetAnimName(const char *name);
|
||||
char *GetAnimName();
|
||||
void SetAnimName(const plString &name);
|
||||
plString GetAnimName();
|
||||
};
|
||||
|
||||
|
||||
|
@ -351,18 +351,17 @@ void plAvTaskSeekDoneMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
|
||||
// CTOR()
|
||||
plAvOneShotMsg::plAvOneShotMsg()
|
||||
: plAvSeekMsg(), fAnimName(nil), fDrivable(false), fReversible(false), fCallbacks(nil)
|
||||
: plAvSeekMsg(), fDrivable(false), fReversible(false), fCallbacks(nil)
|
||||
{
|
||||
}
|
||||
|
||||
// CTOR(sender, receiver, seekKey, time)
|
||||
plAvOneShotMsg::plAvOneShotMsg(const plKey &sender, const plKey& receiver,
|
||||
const plKey& seekKey, float duration, hsBool smartSeek,
|
||||
const char *animName, hsBool drivable, hsBool reversible)
|
||||
: plAvSeekMsg(sender, receiver, seekKey, duration, smartSeek),
|
||||
const plString &animName, hsBool drivable, hsBool reversible)
|
||||
: plAvSeekMsg(sender, receiver, seekKey, duration, smartSeek), fAnimName(animName),
|
||||
fDrivable(drivable), fReversible(reversible), fCallbacks(nil)
|
||||
{
|
||||
fAnimName = hsStrcpy(animName);
|
||||
}
|
||||
|
||||
// DTOR
|
||||
@ -370,8 +369,6 @@ plAvOneShotMsg::~plAvOneShotMsg()
|
||||
{
|
||||
hsRefCnt_SafeUnRef(fCallbacks);
|
||||
fCallbacks = nil;
|
||||
|
||||
delete[] fAnimName;
|
||||
}
|
||||
|
||||
// READ
|
||||
@ -379,8 +376,7 @@ void plAvOneShotMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvSeekMsg::Read(stream, mgr);
|
||||
|
||||
delete [] fAnimName;
|
||||
fAnimName = stream->ReadSafeString();
|
||||
fAnimName = stream->ReadSafeString_TEMP();
|
||||
fDrivable = stream->ReadBool();
|
||||
fReversible = stream->ReadBool();
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ public:
|
||||
virtual ~plAvOneShotMsg();
|
||||
plAvOneShotMsg(const plKey &sender, const plKey& receiver,
|
||||
const plKey& seekKey, float duration, hsBool fSmartSeek,
|
||||
const char *animName, hsBool drivable, hsBool reversible);
|
||||
const plString &animName, hsBool drivable, hsBool reversible);
|
||||
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plAvOneShotMsg );
|
||||
@ -257,7 +257,7 @@ public:
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
// public members
|
||||
char * fAnimName; // the name of the animation we're going to use
|
||||
plString fAnimName; // the name of the animation we're going to use
|
||||
hsBool fDrivable; // are we animated by time or by mouse movement?
|
||||
hsBool fReversible; // can we play backwards?
|
||||
plOneShotCallbacks *fCallbacks; // Callbacks given to us by a one-shot modifier
|
||||
|
@ -50,15 +50,12 @@ plOneShotCallbacks::plOneShotCallbacks()
|
||||
|
||||
plOneShotCallbacks::~plOneShotCallbacks()
|
||||
{
|
||||
int size = fCallbacks.size();
|
||||
for (int i = 0; i < size; i++)
|
||||
delete [] fCallbacks[i].fMarker;
|
||||
fCallbacks.clear();
|
||||
}
|
||||
|
||||
void plOneShotCallbacks::AddCallback(const char *marker, plKey &receiver, int16_t user)
|
||||
void plOneShotCallbacks::AddCallback(const plString &marker, plKey &receiver, int16_t user)
|
||||
{
|
||||
fCallbacks.push_back(plOneShotCallback(hsStrcpy(marker), receiver, user));
|
||||
fCallbacks.push_back(plOneShotCallback(marker, receiver, user));
|
||||
}
|
||||
|
||||
int plOneShotCallbacks::GetNumCallbacks()
|
||||
@ -77,7 +74,7 @@ void plOneShotCallbacks::Read(hsStream* stream, hsResMgr* mgr)
|
||||
fCallbacks.reserve(size);
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
char *marker = stream->ReadSafeString();
|
||||
plString marker = stream->ReadSafeString_TEMP();
|
||||
plKey receiver = mgr->ReadKey(stream);
|
||||
int16_t user = stream->ReadLE16();
|
||||
|
||||
|
@ -59,10 +59,10 @@ public:
|
||||
class plOneShotCallback
|
||||
{
|
||||
public:
|
||||
plOneShotCallback(char *marker, plKey &receiver, int16_t user) :
|
||||
plOneShotCallback(const plString &marker, plKey &receiver, int16_t user) :
|
||||
fMarker(marker), fReceiver(receiver) , fUser(user) {}
|
||||
|
||||
char *fMarker;
|
||||
plString fMarker;
|
||||
plKey fReceiver;
|
||||
int16_t fUser;
|
||||
};
|
||||
@ -74,7 +74,7 @@ public:
|
||||
plOneShotCallbacks();
|
||||
~plOneShotCallbacks();
|
||||
|
||||
void AddCallback(const char *marker, plKey &receiver, int16_t user=0);
|
||||
void AddCallback(const plString &marker, plKey &receiver, int16_t user=0);
|
||||
int GetNumCallbacks();
|
||||
plOneShotCallback& GetCallback(int i);
|
||||
|
||||
|
Reference in New Issue
Block a user