svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender.git] / source / gameengine / GameLogic / SCA_XORController.cpp
index d9e41c2b27e3e41601bc4cacb2e3cc2206382fff..c0916224fe6e6ea9b4ceeb1a9387955ab3a60e69 100644 (file)
 /* Native functions                                                          */
 /* ------------------------------------------------------------------------- */
 
-SCA_XORController::SCA_XORController(SCA_IObject* gameobj,
-                                                                        PyTypeObject* T)
+SCA_XORController::SCA_XORController(SCA_IObject* gameobj)
        :
-       SCA_IController(gameobj,T)
+       SCA_IController(gameobj)
 {
 }
 
@@ -66,7 +65,7 @@ void SCA_XORController::Trigger(SCA_LogicManager* logicmgr)
        !(is==m_linkedsensors.end());is++)
        {
                SCA_ISensor* sensor = *is;
-               if (sensor->IsPositiveTrigger())
+               if (sensor->GetState())
                {
                        if (sensorresult == true)
                        {
@@ -77,19 +76,12 @@ void SCA_XORController::Trigger(SCA_LogicManager* logicmgr)
                }
        }
        
-       CValue* newevent = new CBoolValue(sensorresult);
-
        for (vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin();
        !(i==m_linkedactuators.end());i++)
        {
-               SCA_IActuator* actua = *i;//m_linkedactuators.at(i);
-               logicmgr->AddActiveActuator(actua,newevent);
+               SCA_IActuator* actua = *i;
+               logicmgr->AddActiveActuator(actua,sensorresult);
        }
-
-       // every actuator that needs the event, has a it's own reference to it now so
-       // release it (so to be clear: if there is no actuator, it's deleted right now)
-       newevent->Release();
-
 }
 
 
@@ -127,19 +119,15 @@ PyTypeObject SCA_XORController::Type = {
        0,
        0,
        py_base_repr,
-       0,0,0,0,0,0,
-       py_base_getattro,
-       py_base_setattro,
        0,0,0,0,0,0,0,0,0,
-       Methods
-};
-
-PyParentObject SCA_XORController::Parents[] = {
-       &SCA_XORController::Type,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
        &SCA_IController::Type,
-       &SCA_ILogicBrick::Type,
-       &CValue::Type,
-       NULL
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef SCA_XORController::Methods[] = {
@@ -150,12 +138,4 @@ PyAttributeDef SCA_XORController::Attributes[] = {
        { NULL }        //Sentinel
 };
 
-PyObject* SCA_XORController::py_getattro(PyObject *attr) {
-       py_getattro_up(SCA_IController);
-}
-
-PyObject* SCA_XORController::py_getattro_dict() {
-       py_getattro_dict_up(SCA_IController);
-}
-
 /* eof */