diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-01-06 06:46:54 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-01-06 06:46:54 +0300 |
commit | 2e6d57618232b8b4ce8e5afe84fd278041cbbbfe (patch) | |
tree | c0f05e6b59aada420dd600f1138e9149b97d9e9d /source/gameengine/GameLogic/SCA_PythonController.cpp | |
parent | ef520a8cc9e863aa234be0ee60d1038e7ec8fc44 (diff) |
Sorry to break the cvs-closed status, so if you really need to make a new 2.40 build, just disable the game engine if it doesn't compile for a platform. Again, sorry if this breaks non-windows platforms, but I hope people help to get this amazing fix working for all platforms. Armature-fixing contribution from Snailrose. Also lots of cool things from Snailrose and Lagan.
Armatures are back
Split screen
Double sided lightning
Ambient lighting
Alpha test
Material IPO support (one per object atm)
Blender materials
GLSL shaders - Python access
Up to three texture samplers from the material panel ( 2D & Cube map )
Python access to a second set of uv coordinates
See http://www.elysiun.com/forum/viewtopic.php?t=58057
Diffstat (limited to 'source/gameengine/GameLogic/SCA_PythonController.cpp')
-rw-r--r-- | source/gameengine/GameLogic/SCA_PythonController.cpp | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 01afd16e963..a5360d99a8b 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -144,8 +144,7 @@ PyObject* SCA_PythonController::sPyGetCurrentController(PyObject* self, #if 0 static char* sPyAddActiveActuator__doc__; #endif - - + PyObject* SCA_PythonController::sPyAddActiveActuator( PyObject* self, @@ -156,18 +155,27 @@ PyObject* SCA_PythonController::sPyAddActiveActuator( PyObject* ob1; int activate; if (!PyArg_ParseTuple(args, "Oi", &ob1,&activate)) - { return NULL; - - } + // for safety, todo: only allow for registered actuators (pointertable) // we don't want to crash gameengine/blender by python scripts + std::vector<SCA_IActuator*> lacts = m_sCurrentController->GetLinkedActuators(); - CValue* ac = (CValue*)ob1; - CValue* boolval = new CBoolValue(activate!=0); - m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)ac,boolval); - boolval->Release(); - + std::vector<SCA_IActuator*>::iterator it; + bool found = false; + CValue* act = (CValue*)ob1; + + for(it = lacts.begin(); it!= lacts.end(); it++) { + if( static_cast<SCA_IActuator*>(act) == (*it) ) { + found=true; + break; + } + } + if(found){ + CValue* boolval = new CBoolValue(activate!=0); + m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)act,boolval); + boolval->Release(); + } Py_INCREF(Py_None); return Py_None; } @@ -268,12 +276,24 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) ); PyDict_Clear(excdict); Py_DECREF(excdict);*/ - + +// FIXME:: still happining, will try to fix. snailrose... + PyObject *excdict= PyDict_Copy(m_pythondictionary); + PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, + excdict, + excdict + ); + PyDict_Clear(excdict); + Py_DECREF(excdict); + + +#if 0 PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, m_pythondictionary, m_pythondictionary ); - +#endif + if (resultobj) { Py_DECREF(resultobj); |