Browse Source

plCloneSpawnModifier template name => plString

Michael Hansen 11 years ago
parent
commit
611b9a09c2
  1. 16
      Sources/Plasma/PubUtilLib/plModifier/plCloneSpawnModifier.cpp
  2. 5
      Sources/Plasma/PubUtilLib/plModifier/plCloneSpawnModifier.h

16
Sources/Plasma/PubUtilLib/plModifier/plCloneSpawnModifier.cpp

@ -53,19 +53,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plNodeRefMsg.h" #include "pnMessage/plNodeRefMsg.h"
#include "plMessage/plLoadCloneMsg.h" #include "plMessage/plLoadCloneMsg.h"
plCloneSpawnModifier::plCloneSpawnModifier() : fTemplateName(nil), fExportTime(false) plCloneSpawnModifier::plCloneSpawnModifier() : fExportTime(false)
{ {
} }
plCloneSpawnModifier::~plCloneSpawnModifier()
{
delete [] fTemplateName;
}
void plCloneSpawnModifier::Read(hsStream *s, hsResMgr *mgr) void plCloneSpawnModifier::Read(hsStream *s, hsResMgr *mgr)
{ {
delete [] fTemplateName; fTemplateName = s->ReadSafeString_TEMP();
fTemplateName = s->ReadSafeString();
plSingleModifier::Read(s, mgr); plSingleModifier::Read(s, mgr);
} }
@ -75,12 +69,6 @@ void plCloneSpawnModifier::Write(hsStream *s, hsResMgr *mgr)
plSingleModifier::Write(s, mgr); plSingleModifier::Write(s, mgr);
} }
void plCloneSpawnModifier::SetTemplateName(const char *templateName)
{
delete [] fTemplateName;
fTemplateName = hsStrcpy(templateName);
}
void plCloneSpawnModifier::SetTarget(plSceneObject* so) void plCloneSpawnModifier::SetTarget(plSceneObject* so)
{ {
fTarget = so; fTarget = so;

5
Sources/Plasma/PubUtilLib/plModifier/plCloneSpawnModifier.h

@ -47,14 +47,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class plCloneSpawnModifier : public plSingleModifier class plCloneSpawnModifier : public plSingleModifier
{ {
protected: protected:
char* fTemplateName; plString fTemplateName;
bool fExportTime; bool fExportTime;
virtual bool IEval(double secs, float del, uint32_t dirty) { return true; } virtual bool IEval(double secs, float del, uint32_t dirty) { return true; }
public: public:
plCloneSpawnModifier(); plCloneSpawnModifier();
~plCloneSpawnModifier();
CLASSNAME_REGISTER(plCloneSpawnModifier); CLASSNAME_REGISTER(plCloneSpawnModifier);
GETINTERFACE_ANY(plCloneSpawnModifier, plSingleModifier); GETINTERFACE_ANY(plCloneSpawnModifier, plSingleModifier);
@ -64,7 +63,7 @@ public:
virtual void SetTarget(plSceneObject* so); virtual void SetTarget(plSceneObject* so);
void SetTemplateName(const char *templateName); void SetTemplateName(const plString &templateName) { fTemplateName = templateName; }
// Set this to true at export time so the clone mod won't try to make a // Set this to true at export time so the clone mod won't try to make a
// clone when it's attached // clone when it's attached

Loading…
Cancel
Save