mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Convert SDL (mostly) to plStrings
This commit is contained in:
@ -2300,16 +2300,14 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
|
||||
plSDLNotificationMsg* sn = plSDLNotificationMsg::ConvertNoRef(msg);
|
||||
if (sn)
|
||||
{
|
||||
const char* tag = sn->fHintString.c_str();
|
||||
if (tag == nil)
|
||||
tag = "";
|
||||
plString tag = sn->fHintString;
|
||||
// yes... then call it
|
||||
plProfile_BeginTiming(PythonUpdate);
|
||||
PyObject* retVal = PyObject_CallMethod(
|
||||
fPyFunctionInstances[kfunc_SDLNotify],
|
||||
(char*)fFunctionNames[kfunc_SDLNotify],
|
||||
"ssls", sn->fVar->GetName(), sn->fSDLName.c_str(),
|
||||
sn->fPlayerID, tag);
|
||||
"ssls", sn->fVar->GetName().c_str(), sn->fSDLName.c_str(),
|
||||
sn->fPlayerID, tag.c_str());
|
||||
if ( retVal == nil )
|
||||
{
|
||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||
|
@ -81,7 +81,7 @@ plPythonSDLModifier::plPythonSDLModifier(plPythonFileMod* owner) : fOwner(owner)
|
||||
{
|
||||
plVarDescriptor* var = desc->GetVar(i);
|
||||
|
||||
const char* name = var->GetName();
|
||||
plString name = var->GetName();
|
||||
int count = var->GetCount();
|
||||
|
||||
fMap[name] = SDLObj(nil, count, false);
|
||||
@ -99,15 +99,14 @@ plPythonSDLModifier::~plPythonSDLModifier()
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* plPythonSDLModifier::GetItem(const char* key)
|
||||
PyObject* plPythonSDLModifier::GetItem(const plString& key)
|
||||
{
|
||||
SDLMap::iterator it = fMap.find(key);
|
||||
|
||||
if (it == fMap.end())
|
||||
{
|
||||
char errmsg[256];
|
||||
sprintf(errmsg,"SDL key %s not found",key);
|
||||
PyErr_SetString(PyExc_KeyError, errmsg);
|
||||
plString errmsg = plString::Format("SDL key %s not found", key.c_str());
|
||||
PyErr_SetString(PyExc_KeyError, errmsg.c_str());
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
|
||||
@ -119,7 +118,7 @@ PyObject* plPythonSDLModifier::GetItem(const char* key)
|
||||
return val;
|
||||
}
|
||||
|
||||
void plPythonSDLModifier::ISetItem(const char* key, PyObject* value)
|
||||
void plPythonSDLModifier::ISetItem(const plString& key, PyObject* value)
|
||||
{
|
||||
if (!value || !PyTuple_Check(value))
|
||||
{
|
||||
@ -149,19 +148,19 @@ void plPythonSDLModifier::ISetItem(const char* key, PyObject* value)
|
||||
oldObj.obj = value;
|
||||
}
|
||||
|
||||
void plPythonSDLModifier::SendToClients(const char* key)
|
||||
void plPythonSDLModifier::SendToClients(const plString& key)
|
||||
{
|
||||
SDLMap::iterator it = fMap.find(key);
|
||||
if (it != fMap.end())
|
||||
it->second.sendToClients = true;
|
||||
}
|
||||
|
||||
void plPythonSDLModifier::SetNotify(pyKey& selfkey, const char* key, float tolerance)
|
||||
void plPythonSDLModifier::SetNotify(pyKey& selfkey, const plString& key, float tolerance)
|
||||
{
|
||||
AddNotifyForVar(selfkey.getKey(), key, tolerance);
|
||||
}
|
||||
|
||||
void plPythonSDLModifier::SetItem(const char* key, PyObject* value)
|
||||
void plPythonSDLModifier::SetItem(const plString& key, PyObject* value)
|
||||
{
|
||||
ISetItem(key, value);
|
||||
IDirtySynchState(key);
|
||||
@ -169,7 +168,7 @@ void plPythonSDLModifier::SetItem(const char* key, PyObject* value)
|
||||
|
||||
void plPythonSDLModifier::SetItemFromSDLVar(plSimpleStateVariable* var)
|
||||
{
|
||||
const char* name = var->GetName();
|
||||
plString name = var->GetName();
|
||||
|
||||
// Get the SDL value in Python format
|
||||
PyObject* pyVar = ISDLVarToPython(var);
|
||||
@ -180,12 +179,12 @@ void plPythonSDLModifier::SetItemFromSDLVar(plSimpleStateVariable* var)
|
||||
}
|
||||
|
||||
|
||||
void plPythonSDLModifier::SetDefault(const char* key, PyObject* value)
|
||||
void plPythonSDLModifier::SetDefault(const plString& key, PyObject* value)
|
||||
{
|
||||
ISetItem(key, value);
|
||||
}
|
||||
|
||||
void plPythonSDLModifier::SetItemIdx(const char* key, int idx, PyObject* value, bool sendImmediate)
|
||||
void plPythonSDLModifier::SetItemIdx(const plString& key, int idx, PyObject* value, bool sendImmediate)
|
||||
{
|
||||
if (!value)
|
||||
{
|
||||
@ -269,7 +268,7 @@ const char* plPythonSDLModifier::GetSDLName() const
|
||||
return fOwner->fPythonFile;
|
||||
}
|
||||
|
||||
void plPythonSDLModifier::SetFlags(const char* name, bool sendImmediate, bool skipOwnershipCheck)
|
||||
void plPythonSDLModifier::SetFlags(const plString& name, bool sendImmediate, bool skipOwnershipCheck)
|
||||
{
|
||||
SDLMap::iterator it = fMap.find(name);
|
||||
if (it != fMap.end())
|
||||
@ -279,7 +278,7 @@ void plPythonSDLModifier::SetFlags(const char* name, bool sendImmediate, bool sk
|
||||
}
|
||||
}
|
||||
|
||||
void plPythonSDLModifier::SetTagString(const char* name, const char* tag)
|
||||
void plPythonSDLModifier::SetTagString(const plString& name, const plString& tag)
|
||||
{
|
||||
SDLMap::iterator it = fMap.find(name);
|
||||
if (it != fMap.end())
|
||||
@ -297,7 +296,7 @@ void plPythonSDLModifier::ISetCurrentStateFrom(const plStateDataRecord* srcState
|
||||
{
|
||||
plSimpleStateVariable* var = vars[i];
|
||||
|
||||
const char* name = var->GetName();
|
||||
plString name = var->GetName();
|
||||
|
||||
// Get the SDL value in Python format
|
||||
PyObject* pyVar = ISDLVarToPython(var);
|
||||
@ -334,11 +333,11 @@ void plPythonSDLModifier::IPutCurrentStateIn(plStateDataRecord* dstState)
|
||||
SDLMap::iterator it = fMap.begin();
|
||||
for (; it != fMap.end(); it++)
|
||||
{
|
||||
IPythonVarToSDL(dstState, it->first.c_str());
|
||||
IPythonVarToSDL(dstState, it->first);
|
||||
}
|
||||
}
|
||||
|
||||
void plPythonSDLModifier::IDirtySynchState(const char* name, bool sendImmediate)
|
||||
void plPythonSDLModifier::IDirtySynchState(const plString& name, bool sendImmediate)
|
||||
{
|
||||
SDLMap::iterator it = fMap.find(name);
|
||||
if (it != fMap.end())
|
||||
@ -358,7 +357,7 @@ void plPythonSDLModifier::IDirtySynchState(const char* name, bool sendImmediate)
|
||||
}
|
||||
|
||||
bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int varIdx, int type, PyObject* pyVar,
|
||||
const char* hintstring)
|
||||
const plString& hintstring)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@ -370,7 +369,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
{
|
||||
int v = PyInt_AsLong(pyVar);
|
||||
var->Set(v, varIdx);
|
||||
if (hintstring)
|
||||
if (!hintstring.IsNull())
|
||||
var->GetNotificationInfo().SetHintString(hintstring);
|
||||
return true;
|
||||
}
|
||||
@ -378,7 +377,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
{
|
||||
int v = (int)PyLong_AsLong(pyVar);
|
||||
var->Set(v, varIdx);
|
||||
if (hintstring)
|
||||
if (!hintstring.IsNull())
|
||||
var->GetNotificationInfo().SetHintString(hintstring);
|
||||
return true;
|
||||
}
|
||||
@ -387,7 +386,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
{
|
||||
int v = (int)PyFloat_AsDouble(pyVar);
|
||||
var->Set(v, varIdx);
|
||||
if (hintstring)
|
||||
if (!hintstring.IsNull())
|
||||
var->GetNotificationInfo().SetHintString(hintstring);
|
||||
return true;
|
||||
}
|
||||
@ -398,7 +397,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
{
|
||||
float v = (float)PyFloat_AsDouble(pyVar);
|
||||
var->Set(v, varIdx);
|
||||
if (hintstring)
|
||||
if (!hintstring.IsNull())
|
||||
var->GetNotificationInfo().SetHintString(hintstring);
|
||||
return true;
|
||||
}
|
||||
@ -407,7 +406,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
{
|
||||
float v = (float)PyInt_AsLong(pyVar);
|
||||
var->Set(v, varIdx);
|
||||
if (hintstring)
|
||||
if (!hintstring.IsNull())
|
||||
var->GetNotificationInfo().SetHintString(hintstring);
|
||||
return true;
|
||||
}
|
||||
@ -418,7 +417,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
{
|
||||
char* v = PyString_AsString(pyVar);
|
||||
var->Set(v, varIdx);
|
||||
if (hintstring)
|
||||
if (!hintstring.IsNull())
|
||||
var->GetNotificationInfo().SetHintString(hintstring);
|
||||
}
|
||||
break;
|
||||
@ -428,7 +427,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
pyKey* key = PythonInterface::GetpyKeyFromPython(pyVar);
|
||||
if ( key )
|
||||
var->Set(key->getKey(),varIdx);
|
||||
if (hintstring)
|
||||
if (!hintstring.IsNull())
|
||||
var->GetNotificationInfo().SetHintString(hintstring);
|
||||
}
|
||||
break;
|
||||
@ -438,7 +437,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
{
|
||||
double v = PyFloat_AsDouble(pyVar);
|
||||
var->Set(v, varIdx);
|
||||
if (hintstring)
|
||||
if (!hintstring.IsNull())
|
||||
var->GetNotificationInfo().SetHintString(hintstring);
|
||||
return true;
|
||||
}
|
||||
@ -446,7 +445,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
{
|
||||
double v = (double)PyInt_AsLong(pyVar);
|
||||
var->Set(v, varIdx);
|
||||
if (hintstring)
|
||||
if (!hintstring.IsNull())
|
||||
var->GetNotificationInfo().SetHintString(hintstring);
|
||||
return true;
|
||||
}
|
||||
@ -462,7 +461,7 @@ bool plPythonSDLModifier::IPythonVarIdxToSDL(plSimpleStateVariable* var, int var
|
||||
return false;
|
||||
}
|
||||
|
||||
void plPythonSDLModifier::IPythonVarToSDL(plStateDataRecord* state, const char* name)
|
||||
void plPythonSDLModifier::IPythonVarToSDL(plStateDataRecord* state, const plString& name)
|
||||
{
|
||||
plSimpleStateVariable* var = state->FindVar(name);
|
||||
PyObject* pyVar = nil;
|
||||
@ -482,7 +481,7 @@ void plPythonSDLModifier::IPythonVarToSDL(plStateDataRecord* state, const char*
|
||||
{
|
||||
PyObject* pyVarItem = PyTuple_GetItem(pyVar, i);
|
||||
if (pyVarItem)
|
||||
IPythonVarIdxToSDL(var, i, type, pyVarItem,it->second.hintString.c_str());
|
||||
IPythonVarIdxToSDL(var, i, type, pyVarItem,it->second.hintString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,11 +70,11 @@ protected:
|
||||
bool sendToClients;
|
||||
bool skipLocalCheck;
|
||||
bool sendImmediate;
|
||||
std::string hintString;
|
||||
plString hintString;
|
||||
SDLObj() : obj(nil), size(-1), sendToClients(false) {}
|
||||
SDLObj(PyObject* obj, int size, bool sendToClients) : obj(obj), size(size), sendToClients(sendToClients) {}
|
||||
};
|
||||
typedef std::map<std::string, SDLObj> SDLMap;
|
||||
typedef std::map<plString, SDLObj> SDLMap;
|
||||
SDLMap fMap;
|
||||
plPythonFileMod* fOwner;
|
||||
|
||||
@ -83,11 +83,11 @@ protected:
|
||||
PyObject* ISDLVarToPython(plSimpleStateVariable* var);
|
||||
PyObject* ISDLVarIdxToPython(plSimpleStateVariable* var, int type, int idx);
|
||||
|
||||
void IPythonVarToSDL(plStateDataRecord* state, const char* name);
|
||||
bool IPythonVarIdxToSDL(plSimpleStateVariable* var, int varIdx, int type, PyObject* pyVar, const char* hintstring);
|
||||
void IPythonVarToSDL(plStateDataRecord* state, const plString& name);
|
||||
bool IPythonVarIdxToSDL(plSimpleStateVariable* var, int varIdx, int type, PyObject* pyVar, const plString& hintstring);
|
||||
|
||||
void ISetItem(const char* key, PyObject* value);
|
||||
void IDirtySynchState(const char* name, bool sendImmediate = false);
|
||||
void ISetItem(const plString& key, PyObject* value);
|
||||
void IDirtySynchState(const plString& name, bool sendImmediate = false);
|
||||
|
||||
void IPutCurrentStateIn(plStateDataRecord* dstState);
|
||||
void ISetCurrentStateFrom(const plStateDataRecord* srcState);
|
||||
@ -106,15 +106,15 @@ public:
|
||||
static const plPythonSDLModifier* FindAgeSDL();
|
||||
static plKey FindAgeSDLTarget();
|
||||
|
||||
void SetDefault(const char* key, PyObject* value);
|
||||
void SendToClients(const char* key);
|
||||
void SetNotify(pyKey& selfkey, const char* key, float tolerance);
|
||||
void SetDefault(const plString& key, PyObject* value);
|
||||
void SendToClients(const plString& key);
|
||||
void SetNotify(pyKey& selfkey, const plString& key, float tolerance);
|
||||
|
||||
PyObject* GetItem(const char* key);
|
||||
void SetItem(const char* key, PyObject* value);
|
||||
void SetItemIdx(const char* key, int idx, PyObject* value, bool sendImmediate = false);
|
||||
void SetFlags(const char* name, bool sendImmediate, bool skipOwnershipCheck);
|
||||
void SetTagString(const char* name, const char* tag);
|
||||
PyObject* GetItem(const plString& key);
|
||||
void SetItem(const plString& key, PyObject* value);
|
||||
void SetItemIdx(const plString& key, int idx, PyObject* value, bool sendImmediate = false);
|
||||
void SetFlags(const plString& name, bool sendImmediate, bool skipOwnershipCheck);
|
||||
void SetTagString(const plString& name, const plString& tag);
|
||||
};
|
||||
|
||||
// A wrapper for plPythonSDLModifier that Python uses
|
||||
|
@ -67,7 +67,7 @@ plStateDataRecord * pySDLStateDataRecord::GetRec() const
|
||||
return fRec;
|
||||
}
|
||||
|
||||
PyObject * pySDLStateDataRecord::FindVar( const char * name ) const
|
||||
PyObject * pySDLStateDataRecord::FindVar( const plString & name ) const
|
||||
{
|
||||
if ( !fRec )
|
||||
PYTHON_RETURN_NONE;
|
||||
@ -79,17 +79,17 @@ PyObject * pySDLStateDataRecord::FindVar( const char * name ) const
|
||||
return pySimpleStateVariable::New( var );
|
||||
}
|
||||
|
||||
const char *pySDLStateDataRecord::GetName() const
|
||||
plString pySDLStateDataRecord::GetName() const
|
||||
{
|
||||
if (!fRec)
|
||||
return nil;
|
||||
return "";
|
||||
const plStateDescriptor *stateDesc = fRec->GetDescriptor();
|
||||
return stateDesc->GetName();
|
||||
}
|
||||
|
||||
std::vector<std::string> pySDLStateDataRecord::GetVarList()
|
||||
std::vector<plString> pySDLStateDataRecord::GetVarList()
|
||||
{
|
||||
std::vector<std::string> retVal;
|
||||
std::vector<plString> retVal;
|
||||
if (!fRec)
|
||||
return retVal;
|
||||
const plStateDescriptor *stateDesc = fRec->GetDescriptor();
|
||||
@ -225,16 +225,15 @@ bool pySimpleStateVariable::GetBool( int idx ) const
|
||||
return v;
|
||||
}
|
||||
|
||||
const char * pySimpleStateVariable::GetString( int idx ) const
|
||||
plString pySimpleStateVariable::GetString( int idx ) const
|
||||
{
|
||||
fString = "";
|
||||
if ( fVar )
|
||||
{
|
||||
char v[256];
|
||||
if ( fVar->Get( v, idx ) )
|
||||
fString = v;
|
||||
return plString::FromUtf8(v);
|
||||
}
|
||||
return fString.c_str();
|
||||
return "";
|
||||
}
|
||||
|
||||
plKey pySimpleStateVariable::GetKey( int idx ) const
|
||||
@ -253,18 +252,18 @@ int pySimpleStateVariable::GetType() const
|
||||
return varDesc->GetType();
|
||||
}
|
||||
|
||||
const char *pySimpleStateVariable::GetDisplayOptions() const
|
||||
plString pySimpleStateVariable::GetDisplayOptions() const
|
||||
{
|
||||
if (!fVar)
|
||||
return nil;
|
||||
return "";
|
||||
plVarDescriptor *varDesc = fVar->GetVarDescriptor();
|
||||
return varDesc->GetDisplayOptions();
|
||||
}
|
||||
|
||||
const char *pySimpleStateVariable::GetDefault() const
|
||||
plString pySimpleStateVariable::GetDefault() const
|
||||
{
|
||||
if (!fVar)
|
||||
return nil;
|
||||
return "";
|
||||
plVarDescriptor *varDesc = fVar->GetVarDescriptor();
|
||||
return varDesc->GetDefault();
|
||||
}
|
||||
@ -272,7 +271,7 @@ const char *pySimpleStateVariable::GetDefault() const
|
||||
bool pySimpleStateVariable::IsInternal() const
|
||||
{
|
||||
if (!fVar)
|
||||
return nil;
|
||||
return false;
|
||||
plVarDescriptor *varDesc = fVar->GetVarDescriptor();
|
||||
return varDesc->IsInternal();
|
||||
}
|
||||
@ -280,7 +279,7 @@ bool pySimpleStateVariable::IsInternal() const
|
||||
bool pySimpleStateVariable::IsAlwaysNew() const
|
||||
{
|
||||
if (!fVar)
|
||||
return nil;
|
||||
return false;
|
||||
plVarDescriptor *varDesc = fVar->GetVarDescriptor();
|
||||
return varDesc->IsAlwaysNew();
|
||||
}
|
||||
|
@ -90,9 +90,9 @@ public:
|
||||
plStateDataRecord * GetRec() const;
|
||||
|
||||
/////////////////////
|
||||
PyObject * FindVar( const char * name ) const; // returns pySimpleStateVariable
|
||||
const char *GetName() const;
|
||||
std::vector<std::string> GetVarList();
|
||||
PyObject * FindVar( const plString & name ) const; // returns pySimpleStateVariable
|
||||
plString GetName() const;
|
||||
std::vector<plString> GetVarList();
|
||||
void SetFromDefaults(bool timeStampNow);
|
||||
};
|
||||
|
||||
@ -101,7 +101,6 @@ class pySimpleStateVariable
|
||||
{
|
||||
private:
|
||||
plSimpleStateVariable * fVar;
|
||||
mutable std::string fString; // for GetString()
|
||||
|
||||
protected:
|
||||
pySimpleStateVariable();
|
||||
@ -133,12 +132,12 @@ public:
|
||||
float GetFloat( int idx=0 ) const;
|
||||
double GetDouble( int idx=0 ) const;
|
||||
bool GetBool( int idx=0 ) const;
|
||||
const char * GetString( int idx=0 ) const;
|
||||
plString GetString( int idx=0 ) const;
|
||||
plKey GetKey( int idx=0 ) const;
|
||||
|
||||
int GetType() const;
|
||||
const char *GetDisplayOptions() const;
|
||||
const char *GetDefault() const;
|
||||
plString GetDisplayOptions() const;
|
||||
plString GetDefault() const;
|
||||
bool IsAlwaysNew() const;
|
||||
bool IsInternal() const;
|
||||
|
||||
|
@ -104,12 +104,12 @@ PYTHON_METHOD_DEFINITION(ptSDLStateDataRecord, findVar, args)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSDLStateDataRecord, getName)
|
||||
{
|
||||
return PyString_FromString(self->fThis->GetName());
|
||||
return PyString_FromString(self->fThis->GetName().c_str());
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSDLStateDataRecord, getVarList)
|
||||
{
|
||||
std::vector<std::string> vars = self->fThis->GetVarList();
|
||||
std::vector<plString> vars = self->fThis->GetVarList();
|
||||
PyObject* varList = PyList_New(vars.size());
|
||||
for (int i = 0; i < vars.size(); i++)
|
||||
PyList_SetItem(varList, i, PyString_FromString(vars[i].c_str()));
|
||||
@ -219,12 +219,13 @@ PYTHON_METHOD_DEFINITION(ptSimpleStateVariable, setBool, args)
|
||||
PYTHON_RETURN_BOOL(self->fThis->SetBool(val != 0, idx));
|
||||
}
|
||||
|
||||
#define PyString_FromPlString(x) PyString_FromString((x).c_str())
|
||||
STATEVAR_GET(getByte, GetByte, PyInt_FromLong)
|
||||
STATEVAR_GET(getShort, GetShort, PyInt_FromLong)
|
||||
STATEVAR_GET(getInt, GetInt, PyInt_FromLong)
|
||||
STATEVAR_GET(getFloat, GetFloat, PyFloat_FromDouble)
|
||||
STATEVAR_GET(getDouble, GetDouble, PyFloat_FromDouble)
|
||||
STATEVAR_GET(getString, GetString, PyString_FromString)
|
||||
STATEVAR_GET(getString, GetString, PyString_FromPlString)
|
||||
STATEVAR_GET(getKey, GetKey, pyKey::New)
|
||||
|
||||
// getBool is special cause of the way python represents booleans
|
||||
@ -246,12 +247,12 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptSimpleStateVariable, getType)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSimpleStateVariable, getDisplayOptions)
|
||||
{
|
||||
return PyString_FromString(self->fThis->GetDisplayOptions());
|
||||
return PyString_FromString(self->fThis->GetDisplayOptions().c_str());
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSimpleStateVariable, getDefault)
|
||||
{
|
||||
return PyString_FromString(self->fThis->GetDefault());
|
||||
return PyString_FromString(self->fThis->GetDefault().c_str());
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSimpleStateVariable, isAlwaysNew)
|
||||
|
@ -74,11 +74,11 @@ public:
|
||||
|
||||
plSpawnPointInfo & SpawnPoint() { return fInfo; }
|
||||
void SetTitle( const char * v ) { fInfo.SetTitle( v ); }
|
||||
const char * GetTitle() const { return fInfo.GetTitle(); }
|
||||
plString GetTitle() const { return fInfo.GetTitle(); }
|
||||
void SetName( const char * v ) { fInfo.SetName( v ); }
|
||||
const char * GetName() const { return fInfo.GetName(); }
|
||||
plString GetName() const { return fInfo.GetName(); }
|
||||
void SetCameraStack(const char * v ) { fInfo.SetCameraStack( v ); }
|
||||
const char * GetCameraStack() const { return fInfo.GetCameraStack(); }
|
||||
plString GetCameraStack() const { return fInfo.GetCameraStack(); }
|
||||
|
||||
static PyObject* GetDefaultSpawnPoint();
|
||||
};
|
||||
@ -105,11 +105,11 @@ public:
|
||||
|
||||
plSpawnPointInfo & SpawnPoint() { return fInfo; }
|
||||
void SetTitle( const char * v ) { fInfo.SetTitle( v ); }
|
||||
const char * GetTitle() const { return fInfo.GetTitle(); }
|
||||
plString GetTitle() const { return fInfo.GetTitle(); }
|
||||
void SetName( const char * v ) { fInfo.SetName( v ); }
|
||||
const char * GetName() const { return fInfo.GetName(); }
|
||||
plString GetName() const { return fInfo.GetName(); }
|
||||
void SetCameraStack(const char * v ) { fInfo.SetCameraStack( v ); }
|
||||
const char * GetCameraStack() const { return fInfo.GetCameraStack(); }
|
||||
plString GetCameraStack() const { return fInfo.GetCameraStack(); }
|
||||
};
|
||||
|
||||
#endif // pySpawnPointInfo_h_inc
|
||||
|
@ -78,7 +78,7 @@ PYTHON_INIT_DEFINITION(ptSpawnPointInfo, args, keywords)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSpawnPointInfo, getTitle)
|
||||
{
|
||||
return PyString_FromString(self->fThis->GetTitle());
|
||||
return PyString_FromString(self->fThis->GetTitle().c_str());
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptSpawnPointInfo, setTitle, args)
|
||||
@ -95,7 +95,7 @@ PYTHON_METHOD_DEFINITION(ptSpawnPointInfo, setTitle, args)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSpawnPointInfo, getName)
|
||||
{
|
||||
return PyString_FromString(self->fThis->GetName());
|
||||
return PyString_FromString(self->fThis->GetName().c_str());
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptSpawnPointInfo, setName, args)
|
||||
@ -112,7 +112,7 @@ PYTHON_METHOD_DEFINITION(ptSpawnPointInfo, setName, args)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSpawnPointInfo, getCameraStack)
|
||||
{
|
||||
return PyString_FromString(self->fThis->GetCameraStack());
|
||||
return PyString_FromString(self->fThis->GetCameraStack().c_str());
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptSpawnPointInfo, setCameraStack, args)
|
||||
@ -191,7 +191,7 @@ PYTHON_NO_INIT_DEFINITION(ptSpawnPointInfoRef)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSpawnPointInfoRef, getTitle)
|
||||
{
|
||||
return PyString_FromString(self->fThis->GetTitle());
|
||||
return PyString_FromString(self->fThis->GetTitle().c_str());
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptSpawnPointInfoRef, setTitle, args)
|
||||
@ -208,7 +208,7 @@ PYTHON_METHOD_DEFINITION(ptSpawnPointInfoRef, setTitle, args)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSpawnPointInfoRef, getName)
|
||||
{
|
||||
return PyString_FromString(self->fThis->GetName());
|
||||
return PyString_FromString(self->fThis->GetName().c_str());
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptSpawnPointInfoRef, setName, args)
|
||||
@ -225,7 +225,7 @@ PYTHON_METHOD_DEFINITION(ptSpawnPointInfoRef, setName, args)
|
||||
|
||||
PYTHON_METHOD_DEFINITION_NOARGS(ptSpawnPointInfoRef, getCameraStack)
|
||||
{
|
||||
return PyString_FromString(self->fThis->GetCameraStack());
|
||||
return PyString_FromString(self->fThis->GetCameraStack().c_str());
|
||||
}
|
||||
|
||||
PYTHON_METHOD_DEFINITION(ptSpawnPointInfoRef, setCameraStack, args)
|
||||
|
@ -166,7 +166,7 @@ void pyVaultAgeLinkNode::RemoveSpawnPointRef( pySpawnPointInfoRef & point )
|
||||
access.RemoveSpawnPoint(point.GetName());
|
||||
}
|
||||
|
||||
void pyVaultAgeLinkNode::RemoveSpawnPointByName( const char * spawnPtName )
|
||||
void pyVaultAgeLinkNode::RemoveSpawnPointByName( const plString & spawnPtName )
|
||||
{
|
||||
if (!fNode)
|
||||
return;
|
||||
@ -175,7 +175,7 @@ void pyVaultAgeLinkNode::RemoveSpawnPointByName( const char * spawnPtName )
|
||||
access.RemoveSpawnPoint(spawnPtName);
|
||||
}
|
||||
|
||||
bool pyVaultAgeLinkNode::HasSpawnPoint( const char * spawnPtName ) const
|
||||
bool pyVaultAgeLinkNode::HasSpawnPoint( const plString & spawnPtName ) const
|
||||
{
|
||||
if (!fNode)
|
||||
return false;
|
||||
|
@ -100,8 +100,8 @@ public:
|
||||
void AddSpawnPointRef( pySpawnPointInfoRef & point ); // will only add if not there already.
|
||||
void RemoveSpawnPoint( pySpawnPointInfo & point );
|
||||
void RemoveSpawnPointRef( pySpawnPointInfoRef & point );
|
||||
void RemoveSpawnPointByName( const char * spawnPtName );
|
||||
bool HasSpawnPoint( const char * spawnPtName ) const;
|
||||
void RemoveSpawnPointByName( const plString & spawnPtName );
|
||||
bool HasSpawnPoint( const plString & spawnPtName ) const;
|
||||
PyObject * GetSpawnPoints() const; // returns list of pySpawnPointInfo
|
||||
|
||||
PyObject * AsAgeLinkStruct() const; // returns pyAgeLinkStruct
|
||||
|
Reference in New Issue
Block a user