1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Convert SDL (mostly) to plStrings

This commit is contained in:
2012-11-18 16:49:39 -08:00
parent 188171235e
commit 49dfb4e546
45 changed files with 456 additions and 488 deletions

View File

@ -42,15 +42,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plSDLModifierMsg.h"
#include "plSDL/plSDL.h" // ugh.
plSDLModifierMsg::plSDLModifierMsg(const char* sdlName, Action a) :
fSDLName(nil),
plSDLModifierMsg::plSDLModifierMsg(const plString& sdlName, Action a) :
fSDLName(sdlName),
fAction(a),
fState(nil),
fPlayerID(0),
fManageStateMem(false),
fFlags(0)
{
SetSDLName(sdlName);
SetBCastFlag(plMessage::kPropagateToModifiers);
}
@ -58,5 +57,4 @@ plSDLModifierMsg::~plSDLModifierMsg()
{
if ( fManageStateMem )
delete fState;
delete [] fSDLName;
}

View File

@ -63,7 +63,7 @@ public:
};
protected:
char* fSDLName; // the state descriptor name (ie. "physical")
plString fSDLName; // the state descriptor name (ie. "physical")
Action fAction;
plStateDataRecord* fState; // for recving state
bool fManageStateMem; // delete fState?
@ -71,7 +71,7 @@ protected:
uint32_t fFlags;
public:
plSDLModifierMsg(const char* sdlName=nil, Action a=kActionNone);
plSDLModifierMsg(const plString& sdlName="", Action a=kActionNone);
~plSDLModifierMsg();
CLASSNAME_REGISTER( plSDLModifierMsg );
@ -86,8 +86,8 @@ public:
plStateDataRecord* GetState(bool unManageState=false) { if ( unManageState ) fManageStateMem=false; return fState; }
void SetState(plStateDataRecord* s, bool manageState) { fState=s; fManageStateMem=manageState; }
const char* GetSDLName() const { return fSDLName; }
void SetSDLName(const char* s) { delete [] fSDLName; fSDLName=hsStrcpy(s); }
plString GetSDLName() const { return fSDLName; }
void SetSDLName(const plString& s) { fSDLName=s; }
uint32_t GetPlayerID() const { return fPlayerID; }
void SetPlayerID(uint32_t p) { fPlayerID=p; }

View File

@ -50,9 +50,9 @@ class plSDLNotificationMsg : public plMessage
public:
float fDelta; // change threshold
const plSimpleStateVariable* fVar;
std::string fSDLName; // name of state descriptor
plString fSDLName; // name of state descriptor
int fPlayerID; // pid of the player who changed the data
std::string fHintString; // hint from the player who changed the data
plString fHintString; // hint from the player who changed the data
plSDLNotificationMsg() : fDelta(0), fVar(nil), fPlayerID(0) {}
~plSDLNotificationMsg() { }