diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-16 17:05:15 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-16 17:05:15 +0400 |
commit | 2fd6e728513f46e1f313667dfcf6b3d6e09cad39 (patch) | |
tree | 97306352111268430c9c5bcd75c1638be098cc0d /source/gameengine/GameLogic | |
parent | 9827bf0cd7c94273e147caae6bb254cf70aed221 (diff) |
Changed Python _getattr/_setattr methods to use const STR_String& instead of char* - makes using these methods much nicer.
Diffstat (limited to 'source/gameengine/GameLogic')
27 files changed, 30 insertions, 30 deletions
diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index 4064bb6c840..0daba011c71 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -140,7 +140,7 @@ PyMethodDef SCA_ANDController::Methods[] = { {NULL,NULL} //Sentinel }; -PyObject* SCA_ANDController::_getattr(char* attr) { +PyObject* SCA_ANDController::_getattr(const STR_String& attr) { _getattr_up(SCA_IController); } diff --git a/source/gameengine/GameLogic/SCA_ANDController.h b/source/gameengine/GameLogic/SCA_ANDController.h index f3064e931f2..d32bfd2aa48 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.h +++ b/source/gameengine/GameLogic/SCA_ANDController.h @@ -51,7 +51,7 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); }; diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index 1ca8545b062..a0bb7311eb9 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -135,7 +135,7 @@ PyMethodDef SCA_AlwaysSensor::Methods[] = { {NULL,NULL} //Sentinel }; -PyObject* SCA_AlwaysSensor::_getattr(char* attr) { +PyObject* SCA_AlwaysSensor::_getattr(const STR_String& attr) { _getattr_up(SCA_ISensor); } diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.h b/source/gameengine/GameLogic/SCA_AlwaysSensor.h index 03568bf1578..456516fa989 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.h +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.h @@ -53,7 +53,7 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); }; diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h index a92f7e2e088..e77f2b9938b 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.h +++ b/source/gameengine/GameLogic/SCA_ExpressionController.h @@ -56,7 +56,7 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ -// virtual PyObject* _getattr(char *attr); +// virtual PyObject* _getattr(const STR_String& attr); }; diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 38fc75d7ad9..422f6d9cf0d 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -254,7 +254,7 @@ PyMethodDef SCA_ILogicBrick::Methods[] = { PyObject* -SCA_ILogicBrick::_getattr(char* attr) +SCA_ILogicBrick::_getattr(const STR_String& attr) { _getattr_up(CValue); } diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index 04d4da7c8ce..5199f66f409 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -78,7 +78,7 @@ public: virtual bool LessComparedTo(SCA_ILogicBrick* other); - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); static class SCA_LogicManager* m_sCurrentLogicManager; diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 47a81f35896..bd356f07cb9 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -360,7 +360,7 @@ PyMethodDef SCA_IObject::Methods[] = { -PyObject* SCA_IObject::_getattr(char* attr) { +PyObject* SCA_IObject::_getattr(const STR_String& attr) { _getattr_up(CValue); } diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index f1409871de8..b1bb013abea 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -114,7 +114,7 @@ public: const class MT_Point3& ConvertPythonVectorArg(PyObject* args); // here come the python forwarded methods - PyObject* _getattr(char* attr); + virtual PyObject* _getattr(const STR_String& attr); }; diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 613a44b09f3..43dd6bef83e 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -165,7 +165,7 @@ PyMethodDef SCA_ISensor::Methods[] = { PyObject* -SCA_ISensor::_getattr(char* attr) +SCA_ISensor::_getattr(const STR_String& attr) { _getattr_up(SCA_ILogicBrick); } diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index c0804cc757e..fb2dca97d06 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -46,7 +46,7 @@ class SCA_ISensor : public SCA_ILogicBrick class SCA_EventManager* m_eventmgr; bool m_triggered; - /* Pulse positive pulses? */ + /** Pulse positive pulses? */ bool m_pos_pulsemode; /** Pulse negative pulses? */ @@ -61,7 +61,7 @@ class SCA_ISensor : public SCA_ILogicBrick /** Number of ticks since the last negative pulse. */ int m_neg_ticks; - /* invert the output signal*/ + /** invert the output signal*/ bool m_invert; /** Sensor must ignore updates? */ @@ -77,7 +77,7 @@ public: ~SCA_ISensor(); virtual void ReParent(SCA_IObject* parent); - /* Because we want sensors to share some behaviour, the Activate has */ + /** Because we want sensors to share some behaviour, the Activate has */ /* an implementation on this level. It requires an evaluate on the lower */ /* level of individual sensors. Mapping the old activate()s is easy. */ /* The IsPosTrig() also has to change, to keep things consistent. */ @@ -85,7 +85,7 @@ public: virtual bool Evaluate(CValue* event) = 0; virtual bool IsPositiveTrigger(); - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); virtual CValue* GetReplica()=0; /** Set parameters for the pulsing behaviour. diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index d31e2ae9200..1eee83ad3d6 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -670,7 +670,7 @@ PyMethodDef SCA_KeyboardSensor::Methods[] = { }; PyObject* -SCA_KeyboardSensor::_getattr(char* attr) +SCA_KeyboardSensor::_getattr(const STR_String& attr) { _getattr_up(SCA_ISensor); } diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 2badc799206..f4a3d7e47b5 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -127,7 +127,7 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); PyObject* PySetAllMode(PyObject* self, diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 08cf68ba332..fda641cfc96 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -254,7 +254,7 @@ PyMethodDef SCA_MouseSensor::Methods[] = { {NULL,NULL} //Sentinel }; -PyObject* SCA_MouseSensor::_getattr(char* attr) { +PyObject* SCA_MouseSensor::_getattr(const STR_String& attr) { _getattr_up(SCA_ISensor); } diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index 9b8043a1f15..e8a0d0db78b 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -110,7 +110,7 @@ class SCA_MouseSensor : public SCA_ISensor /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); /* read x-coordinate */ KX_PYMETHOD_DOC(SCA_MouseSensor,GetXPosition); diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 773b66be637..29f62b4e6a7 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -132,7 +132,7 @@ PyMethodDef SCA_ORController::Methods[] = { {NULL,NULL} //Sentinel }; -PyObject* SCA_ORController::_getattr(char* attr) { +PyObject* SCA_ORController::_getattr(const STR_String& attr) { _getattr_up(SCA_IController); } diff --git a/source/gameengine/GameLogic/SCA_ORController.h b/source/gameengine/GameLogic/SCA_ORController.h index e88beb22492..d8b844d9063 100644 --- a/source/gameengine/GameLogic/SCA_ORController.h +++ b/source/gameengine/GameLogic/SCA_ORController.h @@ -52,7 +52,7 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); }; #endif //__KX_ORCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index e4820e00f70..c416d8e1dd5 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -219,7 +219,7 @@ PyMethodDef SCA_PropertyActuator::Methods[] = { {NULL,NULL} //Sentinel }; -PyObject* SCA_PropertyActuator::_getattr(char* attr) { +PyObject* SCA_PropertyActuator::_getattr(const STR_String& attr) { _getattr_up(SCA_IActuator); } diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index 5f7fcf9e87f..2fdf1a62559 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -102,7 +102,7 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); // python wrapped methods KX_PYMETHOD_DOC(SCA_PropertyActuator,SetProperty); diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 448de107381..6f98b777d8c 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -318,7 +318,7 @@ PyMethodDef SCA_PropertySensor::Methods[] = { {NULL,NULL} //Sentinel }; -PyObject* SCA_PropertySensor::_getattr(char* attr) { +PyObject* SCA_PropertySensor::_getattr(const STR_String& attr) { _getattr_up(SCA_ISensor); /* implicit return! */ } diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index 37f4138c6fc..0ebcacdb21a 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -90,7 +90,7 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); /* 1. getType */ KX_PYMETHOD_DOC(SCA_PropertySensor,GetType); diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index a96e17e67d2..e21916e060e 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -274,7 +274,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) -PyObject* SCA_PythonController::_getattr(char* attr) +PyObject* SCA_PythonController::_getattr(const STR_String& attr) { _getattr_up(SCA_IController); } diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index f19fcac72f3..574bf35be7e 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -72,7 +72,7 @@ class SCA_PythonController : public SCA_IController static PyObject* sPyAddActiveActuator(PyObject* self, PyObject* args, PyObject* kwds); - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); KX_PYMETHOD_DOC(SCA_PythonController,GetSensors); KX_PYMETHOD_DOC(SCA_PythonController,GetSensor); diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index 4347e5cef67..4bc0e2539f0 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -360,7 +360,7 @@ PyMethodDef SCA_RandomActuator::Methods[] = { {NULL,NULL} //Sentinel }; -PyObject* SCA_RandomActuator::_getattr(char* attr) { +PyObject* SCA_RandomActuator::_getattr(const STR_String& attr) { _getattr_up(SCA_IActuator); } diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h index 9045dad078c..1048790c9b6 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.h +++ b/source/gameengine/GameLogic/SCA_RandomActuator.h @@ -99,7 +99,7 @@ class SCA_RandomActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); /* 1. setSeed */ KX_PYMETHOD_DOC(SCA_RandomActuator,SetSeed); diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 12f3e0bf5ed..f747504a697 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -153,7 +153,7 @@ PyMethodDef SCA_RandomSensor::Methods[] = { {NULL,NULL} //Sentinel }; -PyObject* SCA_RandomSensor::_getattr(char* attr) { +PyObject* SCA_RandomSensor::_getattr(const STR_String& attr) { _getattr_up(SCA_ISensor); } diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index 41f7f453556..1a3c0402e31 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -61,7 +61,7 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* _getattr(char *attr); + virtual PyObject* _getattr(const STR_String& attr); /* 1. setSeed */ KX_PYMETHOD_DOC(SCA_RandomSensor,SetSeed); |