option to build the BGE without python, uses existing python check (cmake and scons)
authorCampbell Barton <ideasman42@gmail.com>
Tue, 29 Sep 2009 21:42:40 +0000 (21:42 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 29 Sep 2009 21:42:40 +0000 (21:42 +0000)
when python is disabled videotextures are not built.

171 files changed:
source/blender/editors/interface/SConscript
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/BlenderRoutines/CMakeLists.txt
source/gameengine/BlenderRoutines/SConscript
source/gameengine/CMakeLists.txt
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ActionActuator.h
source/gameengine/Converter/BL_ArmatureActuator.cpp
source/gameengine/Converter/BL_ArmatureActuator.h
source/gameengine/Converter/BL_ArmatureChannel.cpp
source/gameengine/Converter/BL_ArmatureChannel.h
source/gameengine/Converter/BL_ArmatureConstraint.cpp
source/gameengine/Converter/BL_ArmatureConstraint.h
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_ArmatureObject.h
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_BlenderDataConversion.h
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Converter/BL_ShapeActionActuator.h
source/gameengine/Converter/CMakeLists.txt
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.h
source/gameengine/Converter/KX_ConvertControllers.cpp
source/gameengine/Converter/KX_ConvertControllers.h
source/gameengine/Converter/KX_ConvertProperties.cpp
source/gameengine/Converter/KX_ConvertSensors.cpp
source/gameengine/Converter/SConscript
source/gameengine/Expressions/BoolValue.cpp
source/gameengine/Expressions/BoolValue.h
source/gameengine/Expressions/CMakeLists.txt
source/gameengine/Expressions/FloatValue.cpp
source/gameengine/Expressions/FloatValue.h
source/gameengine/Expressions/IntValue.cpp
source/gameengine/Expressions/IntValue.h
source/gameengine/Expressions/KX_Python.h
source/gameengine/Expressions/ListValue.cpp
source/gameengine/Expressions/ListValue.h
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/Expressions/SConscript
source/gameengine/Expressions/StringValue.h
source/gameengine/Expressions/Value.cpp
source/gameengine/Expressions/Value.h
source/gameengine/GameLogic/CMakeLists.txt
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
source/gameengine/GameLogic/SCA_ANDController.cpp
source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
source/gameengine/GameLogic/SCA_ActuatorSensor.h
source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
source/gameengine/GameLogic/SCA_DelaySensor.cpp
source/gameengine/GameLogic/SCA_ExpressionController.cpp
source/gameengine/GameLogic/SCA_IActuator.cpp
source/gameengine/GameLogic/SCA_IController.cpp
source/gameengine/GameLogic/SCA_IController.h
source/gameengine/GameLogic/SCA_ILogicBrick.cpp
source/gameengine/GameLogic/SCA_ILogicBrick.h
source/gameengine/GameLogic/SCA_IObject.cpp
source/gameengine/GameLogic/SCA_IObject.h
source/gameengine/GameLogic/SCA_ISensor.cpp
source/gameengine/GameLogic/SCA_ISensor.h
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.h
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.h
source/gameengine/GameLogic/SCA_LogicManager.cpp
source/gameengine/GameLogic/SCA_MouseSensor.cpp
source/gameengine/GameLogic/SCA_MouseSensor.h
source/gameengine/GameLogic/SCA_NANDController.cpp
source/gameengine/GameLogic/SCA_NORController.cpp
source/gameengine/GameLogic/SCA_ORController.cpp
source/gameengine/GameLogic/SCA_PropertyActuator.cpp
source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/GameLogic/SCA_PropertySensor.h
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GameLogic/SCA_PythonController.h
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GameLogic/SCA_RandomActuator.h
source/gameengine/GameLogic/SCA_RandomSensor.cpp
source/gameengine/GameLogic/SCA_RandomSensor.h
source/gameengine/GameLogic/SCA_XNORController.cpp
source/gameengine/GameLogic/SCA_XORController.cpp
source/gameengine/GameLogic/SConscript
source/gameengine/GamePlayer/common/SConscript
source/gameengine/GamePlayer/ghost/SConscript
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/BL_Shader.h
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KXNetwork/CMakeLists.txt
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h
source/gameengine/Ketsji/KXNetwork/SConscript
source/gameengine/Ketsji/KX_ArmatureSensor.cpp
source/gameengine/Ketsji/KX_ArmatureSensor.h
source/gameengine/Ketsji/KX_BlenderMaterial.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.h
source/gameengine/Ketsji/KX_Camera.cpp
source/gameengine/Ketsji/KX_Camera.h
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_CameraActuator.h
source/gameengine/Ketsji/KX_ConstraintActuator.cpp
source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
source/gameengine/Ketsji/KX_ConstraintWrapper.h
source/gameengine/Ketsji/KX_Dome.cpp
source/gameengine/Ketsji/KX_GameActuator.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Ketsji/KX_ISceneConverter.h
source/gameengine/Ketsji/KX_IpoActuator.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.h
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_Light.h
source/gameengine/Ketsji/KX_MeshProxy.cpp
source/gameengine/Ketsji/KX_MeshProxy.h
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.h
source/gameengine/Ketsji/KX_NearSensor.cpp
source/gameengine/Ketsji/KX_NearSensor.h
source/gameengine/Ketsji/KX_ObjectActuator.cpp
source/gameengine/Ketsji/KX_ObjectActuator.h
source/gameengine/Ketsji/KX_ParentActuator.cpp
source/gameengine/Ketsji/KX_ParentActuator.h
source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h
source/gameengine/Ketsji/KX_PolyProxy.cpp
source/gameengine/Ketsji/KX_PolyProxy.h
source/gameengine/Ketsji/KX_PolygonMaterial.cpp
source/gameengine/Ketsji/KX_PolygonMaterial.h
source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
source/gameengine/Ketsji/KX_PyConstraintBinding.h
source/gameengine/Ketsji/KX_PyMath.cpp
source/gameengine/Ketsji/KX_PyMath.h
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_PythonInit.h
source/gameengine/Ketsji/KX_PythonInitTypes.cpp
source/gameengine/Ketsji/KX_PythonInitTypes.h
source/gameengine/Ketsji/KX_PythonSeq.cpp
source/gameengine/Ketsji/KX_PythonSeq.h
source/gameengine/Ketsji/KX_RadarSensor.cpp
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_RaySensor.h
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_SceneActuator.h
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Ketsji/KX_SoundActuator.h
source/gameengine/Ketsji/KX_StateActuator.cpp
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Ketsji/KX_TouchSensor.h
source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/Ketsji/KX_TrackToActuator.h
source/gameengine/Ketsji/KX_VehicleWrapper.cpp
source/gameengine/Ketsji/KX_VehicleWrapper.h
source/gameengine/Ketsji/KX_VertexProxy.cpp
source/gameengine/Ketsji/KX_VertexProxy.h
source/gameengine/Ketsji/KX_VisibilityActuator.cpp
source/gameengine/Ketsji/SConscript
source/gameengine/Physics/Bullet/SConscript
source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
source/gameengine/Rasterizer/SConscript
source/gameengine/SConscript
source/gameengine/VideoTexture/CMakeLists.txt
source/gameengine/VideoTexture/SConscript

index e44de5410f16696613630c6951987da2d3e40047..bca0350d4fc63d26c85e21922388872f13bf9aa4 100644 (file)
@@ -16,4 +16,7 @@ defs = []
 if env['WITH_BF_INTERNATIONAL']:
     defs.append('INTERNATIONAL')
 
-env.BlenderLib ( 'bf_editors_interface', sources, Split(incs), Split(defs), libtype=['core'], priority=[110] )
+if not env['WITH_BF_PYTHON']:
+       defs.append('DISABLE_PYTHON')
+       
+env.BlenderLib ( 'bf_editors_interface', sources, Split(incs), defs, libtype=['core'], priority=[110] )
index 1ede16f017e58f6a0817da58d132f1fa3b383e59..5b825899739ea3028e003ec4e6608338278e777f 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <signal.h>
 #include <stdlib.h>
+#include <stdio.h>
 
 #ifdef WIN32
 // don't show stl-warnings
@@ -137,6 +138,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
 
        BLI_strncpy(pathname, blenderdata->name, sizeof(pathname));
        BLI_strncpy(oldsce, G.sce, sizeof(oldsce));
+#ifndef DISABLE_PYTHON
        resetGamePythonPath(); // need this so running a second time wont use an old blendfiles path
        setGamePythonPath(G.sce);
 
@@ -145,6 +147,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
        PyGILState_STATE gilstate = PyGILState_Ensure();
        
        PyObject *pyGlobalDict = PyDict_New(); /* python utility storage, spans blend file loading */
+#endif
        
        bgl::InitExtensions(true);
 
@@ -206,8 +209,9 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
                ketsjiengine->SetUseFixedTime(usefixed);
                ketsjiengine->SetTimingDisplay(frameRate, profile, properties);
 
+#ifndef DISABLE_PYTHON
                CValue::SetDeprecationWarnings(nodepwarnings);
-
+#endif
 
                //lock frame and camera enabled - storing global values
                int tmp_lay= scene->lay;
@@ -288,7 +292,9 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
                                if(blenderdata) {
                                        BLI_strncpy(G.sce, blenderdata->name, sizeof(G.sce));
                                        BLI_strncpy(pathname, blenderdata->name, sizeof(pathname));
+#ifndef DISABLE_PYTHON
                                        setGamePythonPath(G.sce);
+#endif
                                }
                        }
                        // else forget it, we can't find it
@@ -365,7 +371,8 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
                                networkdevice,
                                startscenename,
                                blscene);
-                       
+
+#ifndef DISABLE_PYTHON
                        // some python things
                        PyObject* dictionaryobject = initGamePythonScripting("Ketsji", psl_Lowest, blenderdata);
                        ketsjiengine->SetPythonDictionary(dictionaryobject);
@@ -383,6 +390,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
 #ifdef WITH_FFMPEG
                        initVideoTexture();
 #endif
+#endif // DISABLE_PYTHON
 
                        //initialize Dome Settings
                        if(blscene->gm.stereoflag == STEREO_DOME)
@@ -398,7 +406,9 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
                                // convert and add scene
                                sceneconverter->ConvertScene(
                                        startscene,
+#ifndef DISABLE_PYTHON
                                        dictionaryobject,
+#endif
                                        rendertools,
                                        canvas);
                                ketsjiengine->AddScene(startscene);
@@ -468,7 +478,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
 
 
                                // when exiting the mainloop
-                               
+#ifndef DISABLE_PYTHON
                                // Clears the dictionary by hand:
                                // This prevents, extra references to global variables
                                // inside the GameLogic dictionary when the python interpreter is finalized.
@@ -488,9 +498,11 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
                                }
                                Py_DECREF(gameLogic_keys_new);
                                gameLogic_keys_new = NULL;
-                               
+#endif
                                ketsjiengine->StopEngine();
+#ifndef DISABLE_PYTHON
                                exitGamePythonScripting();
+#endif
                                networkdevice->Disconnect();
                        }
                        if (sceneconverter)
@@ -498,9 +510,11 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
                                delete sceneconverter;
                                sceneconverter = NULL;
                        }
-                       
+
+#ifndef DISABLE_PYTHON
                        Py_DECREF(gameLogic_keys);
                        gameLogic_keys = NULL;
+#endif
                }
                //lock frame and camera enabled - restoring global values
                if (v3d->scenelock==0){
@@ -555,14 +569,17 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
        
        } while (exitrequested == KX_EXIT_REQUEST_RESTART_GAME || exitrequested == KX_EXIT_REQUEST_START_OTHER_GAME);
        
-       Py_DECREF(pyGlobalDict);
-       
        if (bfd) BLO_blendfiledata_free(bfd);
 
        BLI_strncpy(G.sce, oldsce, sizeof(G.sce));
 
+#ifndef DISABLE_PYTHON
+       Py_DECREF(pyGlobalDict);
+
        // Release Python's GIL
        PyGILState_Release(gilstate);
+#endif
+
 }
 
 extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
@@ -581,9 +598,11 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
 
        BLI_strncpy(pathname, blenderdata->name, sizeof(pathname));
 
+#ifndef DISABLE_PYTHON
        // Acquire Python's GIL (global interpreter lock)
        // so we can safely run Python code and API calls
        PyGILState_STATE gilstate = PyGILState_Ensure();
+#endif
 
        bgl::InitExtensions(true);
 
@@ -680,6 +699,7 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
                                startscenename,
                                blscene);
 
+#ifndef DISABLE_PYTHON
                        // some python things
                        PyObject* dictionaryobject = initGamePythonScripting("Ketsji", psl_Lowest, blenderdata);
                        ketsjiengine->SetPythonDictionary(dictionaryobject);
@@ -694,13 +714,16 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
 #ifdef WITH_FFMPEG
                        initVideoTexture();
 #endif
+#endif // DISABLE_PYTHON
 
                        if (sceneconverter)
                        {
                                // convert and add scene
                                sceneconverter->ConvertScene(
                                        startscene,
+#ifndef DISABLE_PYTHON
                                        dictionaryobject,
+#endif
                                        rendertools,
                                        canvas);
                                ketsjiengine->AddScene(startscene);
@@ -778,6 +801,8 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
 
        } while (exitrequested == KX_EXIT_REQUEST_RESTART_GAME || exitrequested == KX_EXIT_REQUEST_START_OTHER_GAME);
 
+#ifndef DISABLE_PYTHON
        // Release Python's GIL
        PyGILState_Release(gilstate);
+#endif
 }
index ce85c1185b0ebdcfa4f1c9a429527253537920f9..f2d6528d797404267d6d4819278aacf3fcd4cb94 100644 (file)
@@ -35,12 +35,17 @@ SET(INC
        ../../../source/blender/gpu
        ../../../extern/bullet2/src
        ../../../extern/glew/include
-       ${PYTHON_INC}
 )
 
 IF(WITH_FFMPEG)
        ADD_DEFINITIONS(-DWITH_FFMPEG)
 ENDIF(WITH_FFMPEG)
 
+IF(WITH_PYTHON)
+       SET(INC ${INC} ${PYTHON_INC})
+ELSE(WITH_PYTHON)
+       ADD_DEFINITIONS(-DDISABLE_PYTHON)
+ENDIF(WITH_PYTHON)
+
 BLENDERLIB(bf_blroutines "${SRC}" "${INC}")
 #env.BlenderLib ( 'bf_bloutines', sources, Split(incs), [], libtype=['game', 'game2', 'player'], priority=[0, 0, 55] , compileflags=cxxflags)
index 1e8ff3c48e8269cc08cf5418b75a0073cb10278b..f076612e23138b4343fdb052b52bd86d9126bcba 100644 (file)
@@ -25,7 +25,11 @@ incs += ' #source/blender/windowmanager'
 if env['WITH_BF_FFMPEG']:
     defs.append('WITH_FFMPEG')
 
-incs += ' ' + env['BF_PYTHON_INC']
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
+
 incs += ' ' + env['BF_BULLET_INC']
 incs += ' ' + env['BF_OPENGL_INC']
 
index 5a1887bd6c3eafeda59e4dbff5360a33da6997dc..518e6a2bd582c8bc14e432ef125f6a2c74349819 100644 (file)
@@ -38,7 +38,10 @@ ADD_SUBDIRECTORY(Rasterizer)
 ADD_SUBDIRECTORY(Rasterizer/RAS_OpenGLRasterizer)
 ADD_SUBDIRECTORY(SceneGraph)
 ADD_SUBDIRECTORY(Physics/Bullet)
-ADD_SUBDIRECTORY(VideoTexture)
+
+IF(WITH_PYTHON)
+       ADD_SUBDIRECTORY(VideoTexture)
+ENDIF(WITH_PYTHON)
 
 IF(WITH_PLAYER)
        ADD_SUBDIRECTORY(GamePlayer)
index 2f0e3e9fa65efc0ea4026b87db2fa578286fc7e7..6f3036d8e09dfd611f298a247cfdb4b985d83674 100644 (file)
@@ -432,6 +432,8 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
        return keepgoing;
 };
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -675,3 +677,5 @@ PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA
        
        return ret;
 }
+
+#endif // DISABLE_PYTHON
index 2e0e38b4cc3414288a5977581930652540d368d1..3f3cd5f496d8ab98efb71df35de171e270fa6297 100644 (file)
@@ -84,6 +84,8 @@ public:
        bAction*        GetAction() { return m_action; }
        void            SetAction(bAction* act) { m_action= act; }
 
+#ifndef DISABLE_PYTHON
+
        KX_PYMETHOD_O(BL_ActionActuator,GetChannel);
        KX_PYMETHOD_DOC(BL_ActionActuator,setChannel);
 
@@ -129,6 +131,7 @@ public:
                                return 1;
                }
        }
+#endif // DISABLE_PYTHON
        
 protected:
 
index 741f1cf0553d5da763a9690e2430bf0b31a83e26..a018f0f938d4dfa01d744d7c80243bcc47dce8ed 100644 (file)
@@ -175,6 +175,8 @@ bool BL_ArmatureActuator::Update(double curtime, bool frame)
        return result;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python Integration Hooks                                                                     */
 /* ------------------------------------------------------------------------- */
@@ -261,5 +263,5 @@ PyObject* BL_ArmatureActuator::pyattr_get_constraint(void *self, const struct KX
                return constraint->GetProxy();
 }
 
-
+#endif // DISABLE_PYTHON
 
index 5a7752b816969e9e9d8da105466263bdb1687e5d..e7e12bc2e4ebe290ad4c254f54d7bfc62bf53dc0 100644 (file)
@@ -66,11 +66,15 @@ public:
        virtual bool Update(double curtime, bool frame);
        virtual void ReParent(SCA_IObject* parent);
        
+#ifndef DISABLE_PYTHON
+
        /* These are used to get and set m_target */
        static PyObject* pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
 
+#endif // DISABLE_PYTHON
+
 private:
        // identify the constraint that this actuator controls
        void FindConstraint();
index 2f21d4f2978eed26096b9544399b5d43438a97aa..9a9161b080f81d931a3b309d3d1cbd03125f50ad 100644 (file)
@@ -37,6 +37,8 @@
 #include "BLI_arithb.h"
 #include "BLI_string.h"
 
+#ifndef DISABLE_PYTHON
+
 PyTypeObject BL_ArmatureChannel::Type = {
        PyVarObject_HEAD_INIT(NULL, 0)
        "BL_ArmatureChannel",
@@ -74,6 +76,8 @@ PyObject *BL_ArmatureChannel::NewProxy(bool py_owns)
        return NewProxyPlus_Ext(this, &Type, m_posechannel, py_owns);
 }
 
+#endif // DISABLE_PYTHON
+
 BL_ArmatureChannel::BL_ArmatureChannel(
        BL_ArmatureObject *armature, 
        bPoseChannel *posechannel)
@@ -85,6 +89,8 @@ BL_ArmatureChannel::~BL_ArmatureChannel()
 {
 }
 
+#ifndef DISABLE_PYTHON
+
 // PYTHON
 
 PyMethodDef BL_ArmatureChannel::Methods[] = {
@@ -459,3 +465,5 @@ PyObject *BL_ArmatureBone::py_bone_get_children(void *self, const struct KX_PYAT
 
        return childrenlist;
 }
+
+#endif // DISABLE_PYTHON
index 0f0f5a062e0f6a1c2949098f358b7655d763391d..64b03835d8376360a69f339ad962d89dfbca6021 100644 (file)
@@ -57,14 +57,15 @@ public:
                                                struct bPoseChannel *posechannel);
        virtual ~BL_ArmatureChannel();
 
+#ifndef DISABLE_PYTHON
+       // Python access
        virtual PyObject* py_repr(void);
 
-       // Python access
        static PyObject* py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
        static PyObject* py_attr_get_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static int py_attr_set_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
-
+#endif // DISABLE_PYTHON
 };
 
 /* this is a factory class to access bBone data field in the GE.
@@ -80,9 +81,12 @@ private:
        virtual ~BL_ArmatureBone() {}
 
 public:
+
+#ifndef DISABLE_PYTHON
        static PyObject *py_bone_repr(PyObject *self);
        static PyObject *py_bone_get_parent(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject *py_bone_get_children(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
+#endif
 
 };
 
index 15e1261148374bccb9db44ebd391d344162671a8..42581b63ec48fe6098df8954186cf38c6f7798d4 100644 (file)
@@ -37,6 +37,8 @@
 #include "BLI_arithb.h"
 #include "BLI_string.h"
 
+#ifndef DISABLE_PYTHON
+
 PyTypeObject BL_ArmatureConstraint::Type = {
        PyVarObject_HEAD_INIT(NULL, 0)
        "BL_ArmatureConstraint",
@@ -64,6 +66,8 @@ PyObject* BL_ArmatureConstraint::py_repr(void)
        return PyUnicode_FromString(m_name);
 }
 
+#endif // DISABLE_PYTHON
+
 BL_ArmatureConstraint::BL_ArmatureConstraint(
        BL_ArmatureObject *armature, 
        bPoseChannel *posechannel,
@@ -237,6 +241,8 @@ void BL_ArmatureConstraint::SetSubtarget(KX_GameObject* subtarget)
 
 }
 
+#ifndef DISABLE_PYTHON
+
 // PYTHON
 
 PyMethodDef BL_ArmatureConstraint::Methods[] = {
@@ -445,3 +451,4 @@ int BL_ArmatureConstraint::py_attr_setattr(void *self_v, const struct KX_PYATTRI
        return PY_SET_ATTR_FAIL;
 }
 
+#endif // DISABLE_PYTHON
index f10849ea05bc23b62bc6259b904529693d9fccd6..2a202dfe62e827474344667802d0c0282acc58e6 100644 (file)
@@ -73,9 +73,6 @@ public:
                                                KX_GameObject* subtarget);
        virtual ~BL_ArmatureConstraint();
 
-
-       virtual PyObject* py_repr(void);
-
        BL_ArmatureConstraint* GetReplica() const;
        void ReParent(BL_ArmatureObject* armature);
        void Relink(GEN_Map<GEN_HashedPtr, void*> *map);
@@ -107,10 +104,14 @@ public:
        void SetTarget(KX_GameObject* target);
        void SetSubtarget(KX_GameObject* subtarget);
 
+#ifndef DISABLE_PYTHON
+
        // Python access
+       virtual PyObject* py_repr(void);
+
        static PyObject* py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
-
+#endif // DISABLE_PYTHON
 };
 
 #endif //__BL_ARMATURECONSTRAINT
index 54c1e8fc718279e0540ff3b52aec3e099f4110c6..a6066adc03e2ba610b29ca5786eb7524a4648635 100644 (file)
@@ -590,6 +590,8 @@ float BL_ArmatureObject::GetBoneLength(Bone* bone) const
        return (float)(MT_Point3(bone->head) - MT_Point3(bone->tail)).length();
 }
 
+#ifndef DISABLE_PYTHON
+
 // PYTHON
 
 PyTypeObject BL_ArmatureObject::Type = {
@@ -654,3 +656,5 @@ KX_PYMETHODDEF_DOC_NOARGS(BL_ArmatureObject, update,
        SetActiveAction(NULL, 0, KX_GetActiveEngine()->GetFrameTime());
        Py_RETURN_NONE;
 }
+
+#endif // DISABLE_PYTHON
index 8e3d5734b735107fae16b14df58f165407639ec8..b7ef38468bbaa77624590ad18857785b73706de6 100644 (file)
@@ -108,11 +108,15 @@ public:
 
        virtual int GetGameObjectType() { return OBJ_ARMATURE; }
 
+#ifndef DISABLE_PYTHON
+
        // PYTHON
        static PyObject* pyattr_get_constraints(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject* pyattr_get_channels(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        KX_PYMETHOD_DOC_NOARGS(BL_ArmatureObject, update);
 
+#endif // DISABLE_PYTHON
+
 protected:
        /* list element: BL_ArmatureConstraint. Use SG_DListHead to have automatic list replication */
        SG_DListHead<BL_ArmatureConstraint>      m_controlledConstraints;
index 52fb13bd41c825a0a05b64d255ba49702571632b..8310294a73aa555b0ba9910890787d76d77021b2 100644 (file)
@@ -1897,7 +1897,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
                                                          KX_Scene* kxscene,
                                                          KX_KetsjiEngine* ketsjiEngine,
                                                          e_PhysicsEngine       physics_engine,
+#ifndef DISABLE_PYTHON
                                                          PyObject* pythondictionary,
+#endif
                                                          RAS_IRenderTools* rendertools,
                                                          RAS_ICanvas* canvas,
                                                          KX_BlenderSceneConverter* converter,
@@ -2653,7 +2655,11 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
                struct Object* blenderobj = gameobj->GetBlenderObject();
                int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0;
                bool isInActiveLayer = (blenderobj->lay & layerMask)!=0;
-               BL_ConvertControllers(blenderobj,gameobj,logicmgr,pythondictionary,layerMask,isInActiveLayer,converter);
+               BL_ConvertControllers(blenderobj,gameobj,logicmgr,
+#ifndef DISABLE_PYTHON
+                               pythondictionary,
+#endif
+                               layerMask,isInActiveLayer,converter);
        }
        for ( i=0;i<logicbrick_conversionlist->GetCount();i++)
        {
index b8f9d1ec4e6b954e298f22f01dbe4c9886e787d3..96ef7d5bc7767a641581e39cc8640ebeabfd00c2 100644 (file)
@@ -40,7 +40,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
                                                          class KX_Scene* kxscene,
                                                          class KX_KetsjiEngine* ketsjiEngine,
                                                          e_PhysicsEngine       physics_engine,
+#ifndef DISABLE_PYTHON
                                                          PyObject* pythondictionary,
+#endif
                                                          class RAS_IRenderTools* rendertools,
                                                          class RAS_ICanvas* canvas, 
                                                          class KX_BlenderSceneConverter* sceneconverter, 
index 81ce9ff6154420468e4b1c352a65707b9b9dddf7..0af6556f28547887079f3f4cf60351f110f49178 100644 (file)
@@ -412,6 +412,8 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
        return keepgoing;
 };
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -492,3 +494,5 @@ int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE
        return PY_SET_ATTR_SUCCESS;
 
 }
+
+#endif // DISABLE_PYTHON
index 80157630e27cf324f00067b5374e9fa9449116e1..efb1293a5ebe0bb1f3dc85c090146515e775dc55 100644 (file)
@@ -82,6 +82,8 @@ public:
        bAction*        GetAction() { return m_action; }
        void            SetAction(bAction* act) { m_action= act; }
 
+#ifndef DISABLE_PYTHON
+
        static PyObject*        pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int                      pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
 
@@ -123,6 +125,8 @@ public:
 
        }
 
+#endif // DISABLE_PYTHON
+
 protected:
 
        void SetStartTime(float curtime);
index d617934ec01d0b3a0cde6c06474df0c00a7add6b..f9af2c236292e33d16fa869ac69c9d9de51cc134 100644 (file)
@@ -61,8 +61,13 @@ SET(INC
        ../../../source/blender/gpu
        ../../../source/blender/ikplugin
        ../../../extern/bullet2/src
-       ${PYTHON_INC}
 )
 
+IF(WITH_PYTHON)
+       SET(INC ${INC} ${PYTHON_INC})
+ELSE(WITH_PYTHON)
+       ADD_DEFINITIONS(-DDISABLE_PYTHON)
+ENDIF(WITH_PYTHON)
+
 BLENDERLIB(bf_converter "${SRC}" "${INC}")
 #env.BlenderLib ( 'bf_converter', sources, Split(incs), [], libtype=['game','player'], priority=[5,70] )
index 151564391f307a3efd6bd609be51af3f39dd794a..f0f5e1d4f4121a9f7e2ffbec65f4ec4cf13142e8 100644 (file)
@@ -243,7 +243,9 @@ struct      BlenderDebugDraw : public btIDebugDraw
 #endif
 
 void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene,
+#ifndef DISABLE_PYTHON
                                                                                        PyObject* dictobj,
+#endif
                                                                                        class RAS_IRenderTools* rendertools,
                                                                                        class RAS_ICanvas* canvas)
 {
@@ -328,7 +330,9 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene,
                destinationscene,
                m_ketsjiEngine,
                physics_engine,
+#ifndef DISABLE_PYTHON
                dictobj,
+#endif
                rendertools,
                canvas,
                this,
index bb87a21a683f1381eaf0427b47148c40b42efb11..fa066aac27e849cab9725c2a6ce1d8382626bf95 100644 (file)
@@ -89,7 +89,9 @@ public:
         */
        virtual void    ConvertScene(
                                                class KX_Scene* destinationscene,
+#ifndef DISABLE_PYTHON
                                                PyObject* dictobj,
+#endif
                                                class RAS_IRenderTools* rendertools,
                                                class RAS_ICanvas* canvas
                                        );
index 85ab8e4f8b8d7e59c877f0ccbaabd4d0c39df1fc..1cb15c932ac45b3d18733605d308a0885110235e 100644 (file)
@@ -91,8 +91,10 @@ LinkControllerToActuators(
 void BL_ConvertControllers(
        struct Object* blenderobject,
        class KX_GameObject* gameobj,
-       SCA_LogicManager* logicmgr, 
+       SCA_LogicManager* logicmgr,
+#ifndef DISABLE_PYTHON
        PyObject* pythondictionary,
+#endif
        int activeLayerBitInfo,
        bool isInActiveLayer,
        KX_BlenderSceneConverter* converter
@@ -159,6 +161,8 @@ void BL_ConvertControllers(
                                SCA_PythonController* pyctrl = new SCA_PythonController(gameobj, pycont->mode);
                                gamecontroller = pyctrl;
                                
+#ifndef DISABLE_PYTHON
+
                                pyctrl->SetDictionary(pythondictionary);
                                
                                if(pycont->mode==SCA_PythonController::SCA_PYEXEC_SCRIPT) {
@@ -187,6 +191,8 @@ void BL_ConvertControllers(
                                        pyctrl->SetDebug(true);
                                }
                                
+#endif // DISABLE_PYTHON
+
                                break;
                        }
                        default:
@@ -211,7 +217,8 @@ void BL_ConvertControllers(
                        gameobj->AddController(gamecontroller);
                        
                        converter->RegisterGameController(gamecontroller, bcontr);
-                       
+
+#ifndef DISABLE_PYTHON
                        if (bcontr->type==CONT_PYTHON) {
                                SCA_PythonController *pyctrl= static_cast<SCA_PythonController*>(gamecontroller);
                                /* not strictly needed but gives syntax errors early on and
@@ -226,7 +233,8 @@ void BL_ConvertControllers(
                                        // pyctrl->Import();
                                }
                        }
-                       
+#endif // DISABLE_PYTHON
+
                        //done with gamecontroller
                        gamecontroller->Release();
                }
index d340778290c67ad9e48b6cc5138fdeede458e1c1..3895ed2c87366a4826c61a893b5986803a14590e 100644 (file)
 void BL_ConvertControllers(
        struct Object* blenderobject,
        class KX_GameObject* gameobj,
-       class SCA_LogicManager* logicmgr, 
+       class SCA_LogicManager* logicmgr,
+#ifndef DISABLE_PYTHON
        PyObject* pythondictionary,
+#endif
        int activeLayerBitInfo,
        bool isInActiveLayer, 
        class KX_BlenderSceneConverter* converter
index 1c22d2a0600ec80df88e7206f39ba1f7531108c2..7ecdb6c5db65ef008527d9241656bee78e4e6b06 100644 (file)
@@ -130,7 +130,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan
                        propval->Release();
                }
                
-               
+#ifndef DISABLE_PYTHON
                /* Warn if we double up on attributes, this isnt quite right since it wont find inherited attributes however there arnt many */
                for(PyAttributeDef *attrdef = KX_GameObject::Attributes; attrdef->m_name; attrdef++) {
                        if(strcmp(prop->name, attrdef->m_name)==0) {
@@ -145,6 +145,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan
                        }
                }
                /* end warning check */
+#endif // DISABLE_PYTHON
 
                prop = prop->next;
        }
index 99a2ec3ca64ace4ff50901809fdc7466e410fafc..692cc91f340c18c0c0c0c05c9e8f12f12e292588 100644 (file)
@@ -28,6 +28,7 @@
  * Conversion of Blender data blocks to KX sensor system
  */
 
+#include <stdio.h>
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 8a5eb8a341cbdf27edf248f09cdee5a9d9e08566..616c205732cde44e71b9dbe4a1a54deeec237e4c 100644 (file)
@@ -21,11 +21,15 @@ incs += ' #source/blender/windowmanager'
 incs += ' #source/blender/makesrna'
 incs += ' #source/blender/ikplugin'
 
-incs += ' ' + env['BF_PYTHON_INC']
 incs += ' ' + env['BF_BULLET_INC']
 
 if env['BF_DEBUG']:
        if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc', 'win64-vc'):
                defs.append('_DEBUG')
+               
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
 
 env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core','player'], priority=[305,40], cxx_compileflags=env['BGE_CXXFLAGS'])
index 6779c2ea7807ff30fec7b7c40bb9623f26119e7d..62e43da335b2dc2aeaf159e5e381fd81bcf1c0fb 100644 (file)
@@ -205,9 +205,9 @@ CValue* CBoolValue::GetReplica()
        return replica;
 }
 
-
-
+#ifndef DISABLE_PYTHON
 PyObject* CBoolValue::ConvertValueToPython()
 {
        return PyBool_FromLong(m_bool != 0);
 }
+#endif // DISABLE_PYTHON
index 4d0103ec1ddc469f3451092f2e2815ed5927d2e9..baec6bdee69d2ea0f0a278f37fb35a96ebd677c0 100644 (file)
@@ -45,7 +45,9 @@ public:
        
        void                            Configure(CValue* menuvalue);
        virtual CValue*         GetReplica();
+#ifndef DISABLE_PYTHON
        virtual PyObject*       ConvertValueToPython();
+#endif
 
 private:
        bool                            m_bool;
index ec3738d1fe88e74538338a126adca51d6e2e4ab3..db7d12f313d4d29d9216714bc0c0ea4305e7ee43 100644 (file)
@@ -34,8 +34,13 @@ SET(INC
        ../../../intern/moto/include
        ../../../source/gameengine/SceneGraph
        ../../../source/blender/blenloader
-       ${PYTHON_INC}
 )
 
+IF(WITH_PYTHON)
+       SET(INC ${INC} ${PYTHON_INC})
+ELSE(WITH_PYTHON)
+       ADD_DEFINITIONS(-DDISABLE_PYTHON)
+ENDIF(WITH_PYTHON)
+
 BLENDERLIB(bf_expressions "${SRC}" "${INC}")
 #env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['game','player'], priority = [45,125] )
index 4de685a82c19d07e13f7c943aab40b2e146105dc..b1ac0e1ea9a86e0815707f07ea3db85b44fb048e 100644 (file)
@@ -314,9 +314,9 @@ CValue* CFloatValue::GetReplica()
 }
 
 
-
+#ifndef DISABLE_PYTHON
 PyObject* CFloatValue::ConvertValueToPython()
 {
        return PyFloat_FromDouble(m_float);
 }
-
+#endif // DISABLE_PYTHON
index 442f0eb6cf803db1c0310f95b994a3bb7a0d09ae..f1469734a1fb02412e8387fc72091eaf157c357f 100644 (file)
@@ -36,7 +36,9 @@ public:
        virtual CValue* GetReplica();
        virtual CValue* Calc(VALUE_OPERATOR op, CValue *val);
        virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val);
+#ifndef DISABLE_PYTHON
        virtual PyObject*       ConvertValueToPython();
+#endif
 
 protected:
        float m_float;
index b782de4bef6685139f3a812cf45f9990536f35eb..badba8ead639e702346fcd48d78d07edc5918f58 100644 (file)
@@ -326,7 +326,7 @@ void CIntValue::SetValue(CValue* newval)
 }
 
 
-
+#ifndef DISABLE_PYTHON
 PyObject* CIntValue::ConvertValueToPython()
 {
        if((m_int > INT_MIN) && (m_int < INT_MAX))
@@ -334,3 +334,4 @@ PyObject* CIntValue::ConvertValueToPython()
        else
                return PyLong_FromLongLong(m_int);
 }
+#endif // DISABLE_PYTHON
index 0513026c4cf661fbad4155d182b2d8f24a32903b..26150674c93361126d9e49153627673fad4e8316 100644 (file)
@@ -47,7 +47,10 @@ public:
        void                    Configure(CValue* menuvalue);
        void                    AddConfigurationData(CValue* menuvalue);
        virtual CValue* GetReplica();
+
+#ifndef DISABLE_PYTHON
        virtual PyObject*       ConvertValueToPython();
+#endif
 
 protected:
        virtual                 ~CIntValue();
index f41accec730f53da000c97c21d322dd48ebf163d..ecbd1b9b6b01ea713ad7c041c97e2221349fb502 100644 (file)
 #undef _POSIX_C_SOURCE
 #endif
 
-
+#ifndef DISABLE_PYTHON
 #include "Python.h"
 
 #define USE_MATHUTILS // Blender 2.5x api will use mathutils, for a while we might want to test without it
 
+#endif
+
 #ifdef __FreeBSD__
 #include <osreldate.h>
 #if __FreeBSD_version > 500039
index 002674450d1e8fe6d076c305e8a6c4cfec1a5eaa..6e47ed913db2376af90d9a6db9e6991a14861e2e 100644 (file)
@@ -14,6 +14,8 @@
  *
  */
 
+#include <stdio.h>
+
 #include "ListValue.h"
 #include "StringValue.h"
 #include "VoidValue.h"
 #include <config.h>
 #endif
 
-#if  ((PY_MAJOR_VERSION == 2) &&(PY_MINOR_VERSION < 5))
-#define Py_ssize_t int
-#endif
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CListValue::CListValue()
+: CPropValue()
+{
+       m_bReleaseContents=true;
+}
+
+
+
+CListValue::~CListValue()
+{
+
+       if (m_bReleaseContents) {
+               for (unsigned int i=0;i<m_pValueArray.size();i++) {
+                       m_pValueArray[i]->Release();
+               }
+       }
+}
+
+
+static STR_String gstrListRep=STR_String("List");
+
+const STR_String & CListValue::GetText()
+{
+       gstrListRep = "[";
+       STR_String commastr = "";
+
+       for (int i=0;i<GetCount();i++)
+       {
+               gstrListRep += commastr;
+               gstrListRep += GetValue(i)->GetText();
+               commastr = ",";
+       }
+       gstrListRep += "]";
+
+       return gstrListRep;
+}
+
+
+
+CValue* CListValue::GetReplica() {
+       CListValue* replica = new CListValue(*this);
+
+       replica->ProcessReplica();
+
+       replica->m_bReleaseContents=true; // for copy, complete array is copied for now...
+       // copy all values
+       int numelements = m_pValueArray.size();
+       unsigned int i=0;
+       replica->m_pValueArray.resize(numelements);
+       for (i=0;i<m_pValueArray.size();i++)
+               replica->m_pValueArray[i] = m_pValueArray[i]->GetReplica();
+
+
+       return replica;
+};
+
+
+
+void CListValue::SetValue(int i, CValue *val)
+{
+       assertd(i < m_pValueArray.size());
+       m_pValueArray[i]=val;
+}
+
+
+
+void CListValue::Resize(int num)
+{
+       m_pValueArray.resize(num);
+}
+
+
+
+void CListValue::Remove(int i)
+{
+       assertd(i<m_pValueArray.size());
+       m_pValueArray.erase(m_pValueArray.begin()+i);
+}
+
+
+
+void CListValue::ReleaseAndRemoveAll()
+{
+       for (unsigned int i=0;i<m_pValueArray.size();i++)
+               m_pValueArray[i]->Release();
+       m_pValueArray.clear();//.Clear();
+}
+
+
+
+CValue* CListValue::FindValue(const STR_String & name)
+{
+       for (int i=0; i < GetCount(); i++)
+               if (GetValue(i)->GetName() == name)
+                       return GetValue(i);
+
+       return NULL;
+}
+
+CValue* CListValue::FindValue(const char * name)
+{
+       for (int i=0; i < GetCount(); i++)
+               if (GetValue(i)->GetName() == name)
+                       return GetValue(i);
+
+       return NULL;
+}
+
+bool CListValue::SearchValue(CValue *val)
+{
+       for (int i=0;i<GetCount();i++)
+               if (val == GetValue(i))
+                       return true;
+       return false;
+}
+
+
+
+void CListValue::SetReleaseOnDestruct(bool bReleaseContents)
+{
+       m_bReleaseContents = bReleaseContents;
+}
+
+
+
+bool CListValue::RemoveValue(CValue *val)
+{
+       bool result=false;
+
+       for (int i=GetCount()-1;i>=0;i--)
+               if (val == GetValue(i))
+               {
+                       Remove(i);
+                       result=true;
+               }
+       return result;
+}
+
+
+
+void CListValue::MergeList(CListValue *otherlist)
+{
+
+       int numelements = this->GetCount();
+       int numotherelements = otherlist->GetCount();
+
+
+       Resize(numelements+numotherelements);
+
+       for (int i=0;i<numotherelements;i++)
+       {
+               SetValue(i+numelements,otherlist->GetValue(i)->AddRef());
+       }
+}
+
+bool CListValue::CheckEqual(CValue* first,CValue* second)
+{
+       bool result = false;
+
+       CValue* eqval =  ((CValue*)first)->Calc(VALUE_EQL_OPERATOR,(CValue*)second);
+
+       if (eqval==NULL)
+               return false;
+       const STR_String& text = eqval->GetText();
+       if (&text==&CBoolValue::sTrueString)
+       {
+               result = true;
+       }
+       eqval->Release();
+       return result;
+
+}
+
+
+/* ---------------------------------------------------------------------
+ * Some stuff taken from the header
+ * --------------------------------------------------------------------- */
+CValue* CListValue::Calc(VALUE_OPERATOR op,CValue *val)
+{
+       //assert(false); // todo: implement me!
+       static int error_printed =  0;
+       if (error_printed==0) {
+               fprintf(stderr, "CValueList::Calc not yet implimented\n");
+               error_printed = 1;
+       }
+       return NULL;
+}
+
+CValue* CListValue::CalcFinal(VALUE_DATA_TYPE dtype,
+                                                         VALUE_OPERATOR op,
+                                                         CValue* val)
+{
+       //assert(false); // todo: implement me!
+       static int error_printed =  0;
+       if (error_printed==0) {
+               fprintf(stderr, "CValueList::CalcFinal not yet implimented\n");
+               error_printed = 1;
+       }
+       return NULL;
+}
+
+
+
+void CListValue::Add(CValue* value)
+{
+       m_pValueArray.push_back(value);
+}
+
+
+
+double CListValue::GetNumber()
+{
+       return -1;
+}
+
+
+
+void CListValue::SetModified(bool bModified)
+{
+       CValue::SetModified(bModified);
+       int numels = GetCount();
+
+       for (int i=0;i<numels;i++)
+               GetValue(i)->SetModified(bModified);
+}
+
+
+
+bool CListValue::IsModified()
+{
+       bool bmod = CValue::IsModified(); //normal own flag
+       int numels = GetCount();
+
+       for (int i=0;i<numels;i++)
+               bmod = bmod || GetValue(i)->IsModified();
+
+       return bmod;
+}
+
+#ifndef DISABLE_PYTHON
+
+/* --------------------------------------------------------------------- */
+/* Python interface ---------------------------------------------------- */
+/* --------------------------------------------------------------------- */
 
 Py_ssize_t listvalue_bufferlen(PyObject* self)
 {
@@ -297,13 +545,13 @@ PyMethodDef CListValue::Methods[] = {
        {"reverse", (PyCFunction)CListValue::sPyreverse,METH_NOARGS},
        {"index", (PyCFunction)CListValue::sPyindex,METH_O},
        {"count", (PyCFunction)CListValue::sPycount,METH_O},
-       
+
        /* Dict style access */
        {"get", (PyCFunction)CListValue::sPyget,METH_VARARGS},
-       
+
        /* Own cvalue funcs */
        {"from_id", (PyCFunction)CListValue::sPyfrom_id,METH_O},
-       
+
        {NULL,NULL} //Sentinel
 };
 
@@ -311,213 +559,29 @@ PyAttributeDef CListValue::Attributes[] = {
        { NULL }        //Sentinel
 };
 
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CListValue::CListValue()
-: CPropValue()
-{
-       m_bReleaseContents=true;        
-}
-
-
-
-CListValue::~CListValue()
-{
-
-       if (m_bReleaseContents) {
-               for (unsigned int i=0;i<m_pValueArray.size();i++) {
-                       m_pValueArray[i]->Release();
-               }
-       }
-}
-
-
-static STR_String gstrListRep=STR_String("List");
-
-const STR_String & CListValue::GetText()
-{
-       gstrListRep = "[";
-       STR_String commastr = "";
-
-       for (int i=0;i<GetCount();i++)
-       {
-               gstrListRep += commastr;
-               gstrListRep += GetValue(i)->GetText();
-               commastr = ",";
-       }
-       gstrListRep += "]";
-
-       return gstrListRep;
-}
-
-
-
-CValue* CListValue::GetReplica() { 
-       CListValue* replica = new CListValue(*this);
-
-       replica->ProcessReplica();
-
-       replica->m_bReleaseContents=true; // for copy, complete array is copied for now...
-       // copy all values
-       int numelements = m_pValueArray.size();
-       unsigned int i=0;
-       replica->m_pValueArray.resize(numelements);
-       for (i=0;i<m_pValueArray.size();i++)
-               replica->m_pValueArray[i] = m_pValueArray[i]->GetReplica();
-
-
-       return replica;
-};
-
-
-
-void CListValue::SetValue(int i, CValue *val)
-{
-       assertd(i < m_pValueArray.size());
-       m_pValueArray[i]=val;
-}
-
-
-
-void CListValue::Resize(int num)
-{
-       m_pValueArray.resize(num);
-}
-
-
-
-void CListValue::Remove(int i)
-{
-       assertd(i<m_pValueArray.size());
-       m_pValueArray.erase(m_pValueArray.begin()+i);
-}
-
-
-
-void CListValue::ReleaseAndRemoveAll()
-{
-       for (unsigned int i=0;i<m_pValueArray.size();i++)
-               m_pValueArray[i]->Release();
-       m_pValueArray.clear();//.Clear();
-}
-
-
-
-CValue* CListValue::FindValue(const STR_String & name)
-{
-       for (int i=0; i < GetCount(); i++)
-               if (GetValue(i)->GetName() == name)
-                       return GetValue(i);
-       
-       return NULL;
-}
-
-CValue* CListValue::FindValue(const char * name)
-{
-       for (int i=0; i < GetCount(); i++)
-               if (GetValue(i)->GetName() == name)
-                       return GetValue(i);
-       
-       return NULL;
-}
-
-bool CListValue::SearchValue(CValue *val)
-{
-       for (int i=0;i<GetCount();i++)
-               if (val == GetValue(i))
-                       return true;
-       return false;
-}
-
-
-
-void CListValue::SetReleaseOnDestruct(bool bReleaseContents)
-{
-       m_bReleaseContents = bReleaseContents;
-}
-
-
-
-bool CListValue::RemoveValue(CValue *val)
-{
-       bool result=false;
-
-       for (int i=GetCount()-1;i>=0;i--)
-               if (val == GetValue(i))
-               {
-                       Remove(i);
-                       result=true;
-               }
-       return result;
-}
-
-
-
-void CListValue::MergeList(CListValue *otherlist)
-{
-
-       int numelements = this->GetCount();
-       int numotherelements = otherlist->GetCount();
-
-
-       Resize(numelements+numotherelements);
-
-       for (int i=0;i<numotherelements;i++)
-       {
-               SetValue(i+numelements,otherlist->GetValue(i)->AddRef());
-       }
-}
-
-
 PyObject* CListValue::Pyappend(PyObject* value)
 {
        CValue* objval = ConvertPythonToValue(value, "CList.append(i): CValueList, ");
 
        if (!objval) /* ConvertPythonToValue sets the error */
                return NULL;
-       
+
        if (!BGE_PROXY_PYOWNS(m_proxy)) {
                PyErr_SetString(PyExc_TypeError, "CList.append(i): this CValueList is used internally for the game engine and can't be modified");
                return NULL;
        }
-       
+
        Add(objval);
-       
+
        Py_RETURN_NONE;
 }
 
-
-
 PyObject* CListValue::Pyreverse()
 {
        std::reverse(m_pValueArray.begin(),m_pValueArray.end());
        Py_RETURN_NONE;
 }
 
-
-
-bool CListValue::CheckEqual(CValue* first,CValue* second)
-{
-       bool result = false;
-       
-       CValue* eqval =  ((CValue*)first)->Calc(VALUE_EQL_OPERATOR,(CValue*)second);
-       
-       if (eqval==NULL)
-               return false;
-       const STR_String& text = eqval->GetText();
-       if (&text==&CBoolValue::sTrueString)
-       {
-               result = true;
-       }
-       eqval->Release();
-       return result;
-
-}
-
-
-
 PyObject* CListValue::Pyindex(PyObject *value)
 {
        PyObject* result = NULL;
@@ -542,7 +606,7 @@ PyObject* CListValue::Pyindex(PyObject *value)
                PyErr_SetString(PyExc_ValueError, "CList.index(x): x not in CListValue");
        }
        return result;
-       
+
 }
 
 
@@ -552,7 +616,7 @@ PyObject* CListValue::Pycount(PyObject* value)
        int numfound = 0;
 
        CValue* checkobj = ConvertPythonToValue(value, ""); /* error ignored */
-       
+
        if (checkobj==NULL) { /* in this case just return that there are no items in the list */
                PyErr_Clear();
                return PyLong_FromSsize_t(0);
@@ -580,9 +644,9 @@ PyObject* CListValue::Pyget(PyObject *args)
 
        if (!PyArg_ParseTuple(args, "s|O:get", &key, &def))
                return NULL;
-       
+
        CValue *item = FindValue((const char *)key);
-       if (item) {     
+       if (item) {
                PyObject* pyobj = item->ConvertValueToPython();
                if (pyobj)
                        return pyobj;
@@ -597,7 +661,7 @@ PyObject* CListValue::Pyget(PyObject *args)
 PyObject* CListValue::Pyfrom_id(PyObject* value)
 {
        uintptr_t id= (uintptr_t)PyLong_AsVoidPtr(value);
-       
+
        if (PyErr_Occurred())
                return NULL;
 
@@ -608,72 +672,8 @@ PyObject* CListValue::Pyfrom_id(PyObject* value)
                        return GetValue(i)->GetProxy();
        }
        PyErr_SetString(PyExc_IndexError, "from_id(#): id not found in CValueList");
-       return NULL;    
-
-}
-
-
-/* --------------------------------------------------------------------- 
- * Some stuff taken from the header
- * --------------------------------------------------------------------- */
-CValue* CListValue::Calc(VALUE_OPERATOR op,CValue *val) 
-{
-       //assert(false); // todo: implement me!
-       static int error_printed =  0;
-       if (error_printed==0) {
-               fprintf(stderr, "CValueList::Calc not yet implimented\n");
-               error_printed = 1;
-       }
        return NULL;
-}
-
-CValue* CListValue::CalcFinal(VALUE_DATA_TYPE dtype,
-                                                         VALUE_OPERATOR op, 
-                                                         CValue* val) 
-{
-       //assert(false); // todo: implement me!
-       static int error_printed =  0;
-       if (error_printed==0) {
-               fprintf(stderr, "CValueList::CalcFinal not yet implimented\n");
-               error_printed = 1;
-       }
-       return NULL;
-}
-
-
-
-void CListValue::Add(CValue* value)
-{
-       m_pValueArray.push_back(value);
-}
 
-
-
-double CListValue::GetNumber()
-{
-       return -1;
 }
 
-
-
-void CListValue::SetModified(bool bModified)
-{      
-       CValue::SetModified(bModified);
-       int numels = GetCount();
-
-       for (int i=0;i<numels;i++)
-               GetValue(i)->SetModified(bModified);
-}
-
-
-
-bool CListValue::IsModified()
-{
-       bool bmod = CValue::IsModified(); //normal own flag
-       int numels = GetCount();
-
-       for (int i=0;i<numels;i++)
-               bmod = bmod || GetValue(i)->IsModified();
-
-       return bmod;
-}
+#endif // DISABLE_PYTHON
index 2dc458e0148314e591db8fcffb6533b1d04924c7..8f3b9dcda0bb6a5b4f93b9695ac8f28b8ea5abfe 100644 (file)
@@ -60,6 +60,7 @@ public:
 
        bool CheckEqual(CValue* first,CValue* second);
 
+#ifndef DISABLE_PYTHON
        virtual PyObject* py_repr(void) {
                PyObject *py_proxy= this->GetProxy();
                PyObject *py_list= PySequence_List(py_proxy);
@@ -75,7 +76,7 @@ public:
        KX_PYMETHOD_O(CListValue,count);
        KX_PYMETHOD_VARARGS(CListValue,get);
        KX_PYMETHOD_O(CListValue,from_id);
-
+#endif
        
 private:
 
index 7adbf5ac651b535be441161f78098996a5f2afa3..54a33b76efd1c0363ae2220556466e60e5be19c6 100644 (file)
@@ -30,8 +30,6 @@
 #include <config.h>
 #endif
 
-#ifndef NO_EXP_PYTHON_EMBEDDING
-
 /*------------------------------
  * PyObjectPlus cpp
  *
 #include "STR_String.h"
 #include "MT_Vector3.h"
 #include "MEM_guardedalloc.h"
+
+PyObjectPlus::~PyObjectPlus()
+{
+#ifndef DISABLE_PYTHON
+       if(m_proxy) {
+               BGE_PROXY_REF(m_proxy)= NULL;
+               Py_DECREF(m_proxy);                     /* Remove own reference, python may still have 1 */
+       }
+//     assert(ob_refcnt==0);
+#endif
+}
+
+PyObjectPlus::PyObjectPlus() : SG_QList()                              // constructor
+{
+#ifndef DISABLE_PYTHON
+       m_proxy= NULL;
+#endif
+};
+
+void PyObjectPlus::ProcessReplica()
+{
+#ifndef DISABLE_PYTHON
+       /* Clear the proxy, will be created again if needed with GetProxy()
+        * otherwise the PyObject will point to the wrong reference */
+       m_proxy= NULL;
+#endif
+}
+
+/* Sometimes we might want to manually invalidate a BGE type even if
+ * it hasnt been released by the BGE, say for example when an object
+ * is removed from a scene, accessing it may cause problems.
+ *
+ * In this case the current proxy is made invalid, disowned,
+ * and will raise an error on access. However if python can get access
+ * to this class again it will make a new proxy and work as expected.
+ */
+void PyObjectPlus::InvalidateProxy()           // check typename of each parent
+{
+#ifndef DISABLE_PYTHON
+       if(m_proxy) {
+               BGE_PROXY_REF(m_proxy)=NULL;
+               Py_DECREF(m_proxy);
+               m_proxy= NULL;
+       }
+#endif
+}
+
+
+#ifndef DISABLE_PYTHON
+
 /*------------------------------
  * PyObjectPlus Type           -- Every class, even the abstract one should have a Type
 ------------------------------*/
@@ -78,17 +126,6 @@ PyTypeObject PyObjectPlus::Type = {
        NULL // no subtype
 };
 
-
-PyObjectPlus::~PyObjectPlus()
-{
-       if(m_proxy) {
-               BGE_PROXY_REF(m_proxy)= NULL;
-               Py_DECREF(m_proxy);                     /* Remove own reference, python may still have 1 */
-       }
-//     assert(ob_refcnt==0);
-}
-
-
 PyObject *PyObjectPlus::py_base_repr(PyObject *self)                   // This should be the entry in Type.
 {
        PyObjectPlus *self_plus= BGE_PROXY_REF(self);
@@ -202,11 +239,6 @@ void PyObjectPlus::py_base_dealloc(PyObject *self)                         // python wrapper
 #endif
 };
 
-PyObjectPlus::PyObjectPlus() : SG_QList()                              // constructor
-{
-       m_proxy= NULL;
-};
-
 /*------------------------------
  * PyObjectPlus Methods        -- Every class, even the abstract one should have a Methods
 ------------------------------*/
@@ -1067,30 +1099,6 @@ PyObject *PyObjectPlus::py_repr(void)
        return NULL;
 }
 
-void PyObjectPlus::ProcessReplica()
-{
-       /* Clear the proxy, will be created again if needed with GetProxy()
-        * otherwise the PyObject will point to the wrong reference */
-       m_proxy= NULL;
-}
-
-/* Sometimes we might want to manually invalidate a BGE type even if
- * it hasnt been released by the BGE, say for example when an object
- * is removed from a scene, accessing it may cause problems.
- * 
- * In this case the current proxy is made invalid, disowned,
- * and will raise an error on access. However if python can get access
- * to this class again it will make a new proxy and work as expected.
- */
-void PyObjectPlus::InvalidateProxy()           // check typename of each parent
-{
-       if(m_proxy) { 
-               BGE_PROXY_REF(m_proxy)=NULL;
-               Py_DECREF(m_proxy);
-               m_proxy= NULL;
-       }
-}
-
 PyObject *PyObjectPlus::GetProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, void *ptr)
 {
        if (self->m_proxy==NULL)
@@ -1220,5 +1228,4 @@ void                      PyObjectPlus::SetDeprecationWarningFirst(WarnLink* wlink) {m_base_wlink_f
 void                   PyObjectPlus::SetDeprecationWarningLinkLast(WarnLink* wlink) {m_base_wlink_last= wlink;}
 void                   PyObjectPlus::NullDeprecationWarning() {m_base_wlink_first= m_base_wlink_last= NULL;}
 
-#endif //NO_EXP_PYTHON_EMBEDDING
-
+#endif // DISABLE_PYTHON
index 237f01f5a3a32a8c313c5430d34a0e9e7bc5a32c..971f92969125a76e2234a4a23d6fd20f942dd648 100644 (file)
@@ -27,8 +27,6 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef NO_EXP_PYTHON_EMBEDDING
-
 #ifndef _adr_py_lib_h_                         // only process once,
 #define _adr_py_lib_h_                         // even if multiply included
 
@@ -45,6 +43,7 @@
  * Python defines
 ------------------------------*/
 
+#ifndef DISABLE_PYTHON
 #ifdef USE_MATHUTILS
 extern "C" {
 #include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */
@@ -463,6 +462,20 @@ typedef struct KX_PYATTRIBUTE_DEF {
 ------------------------------*/
 typedef PyTypeObject * PyParentObject;                         // Define the PyParent Object
 
+#else // DISABLE_PYTHON
+
+#define Py_Header \
+ public: \
+
+
+#define Py_HeaderPtr \
+ public: \
+
+
+#endif
+
+
+
 // By making SG_QList the ultimate parent for PyObjectPlus objects, it
 // allows to put them in 2 different dynamic lists at the same time
 // The use of these links is interesting because they free of memory allocation
@@ -480,11 +493,12 @@ class PyObjectPlus : public SG_QList
        
 public:
        PyObjectPlus();
-
-       PyObject *m_proxy; /* actually a PyObjectPlus_Proxy */
        
        virtual ~PyObjectPlus();                                        // destructor
        
+#ifndef DISABLE_PYTHON
+       PyObject *m_proxy; /* actually a PyObjectPlus_Proxy */
+
        /* These static functions are referenced by ALL PyObjectPlus_Proxy types
         * they take the C++ reference from the PyObjectPlus_Proxy and call
         * its own virtual py_repr, py_base_dealloc ,etc. functions.
@@ -514,16 +528,6 @@ public:
                                        (assume object destructor takes care of it) */
        static PyObject *NewProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, void *ptr, bool py_owns);
 
-       void    InvalidateProxy();
-       
-       /**
-        * Makes sure any internal data owned by this class is deep copied.
-        */
-       virtual void ProcessReplica();
-       
-       
-       static bool                     m_ignore_deprecation_warnings;
-       
        static  WarnLink*               GetDeprecationWarningLinkFirst(void);
        static  WarnLink*               GetDeprecationWarningLinkLast(void);
        static  void                    SetDeprecationWarningFirst(WarnLink* wlink);
@@ -536,12 +540,20 @@ public:
        static void                     ShowDeprecationWarning_func(const char* method,const char* prop);
        static void                     ClearDeprecationWarning();
        
-};
+#endif
 
+       void    InvalidateProxy();
 
-PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict);
+       /**
+        * Makes sure any internal data owned by this class is deep copied.
+        */
+       virtual void ProcessReplica();
 
-#endif //  _adr_py_lib_h_
+       static bool                     m_ignore_deprecation_warnings;
+};
 
-#endif //NO_EXP_PYTHON_EMBEDDING
+#ifndef DISABLE_PYTHON
+PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict);
+#endif
 
+#endif //  _adr_py_lib_h_
index 26cafb004b2291252959e79464de08c3db559f74..94af9dcfec8baa318c7a082c9b92cdd31079733c 100644 (file)
@@ -4,6 +4,12 @@ Import ('env')
 sources = env.Glob('*.cpp')
 
 incs ='. #source/kernel/gen_system #intern/guardedalloc #intern/string #intern/moto/include #source/gameengine/SceneGraph #source/blender/blenloader'
-incs += ' ' + env['BF_PYTHON_INC']
 
-env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core','player'], priority = [360,80], cxx_compileflags=env['BGE_CXXFLAGS'])
+defs = []
+
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
+
+env.BlenderLib ( 'bf_expressions', sources, Split(incs), defs, libtype=['core','player'], priority = [360,80], cxx_compileflags=env['BGE_CXXFLAGS'])
index 069eb8d9c24670b953cfc5341cea9e5321e46aeb..a23bb4ec3e2c52a6fa93ee82c33f89902fbcfcd2 100644 (file)
@@ -39,9 +39,11 @@ public:
        virtual CValue*         CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val);
        virtual void            SetValue(CValue* newval) {      m_strString = newval->GetText(); SetModified(true);     };
        virtual CValue*         GetReplica();
+#ifndef DISABLE_PYTHON
        virtual PyObject*       ConvertValueToPython() {
                return PyUnicode_FromString(m_strString.Ptr());
        }
+#endif // DISABLE_PYTHON
 
 private:
        // data member
index 130317d77e2d32eba5c5c3e20e964bec4bef2210..6d2dfe2a6e32a4289472ff0016c9833ecbd09c67 100644 (file)
@@ -33,7 +33,7 @@
 
 double CValue::m_sZeroVec[3] = {0.0,0.0,0.0};
 
-#ifndef NO_EXP_PYTHON_EMBEDDING
+#ifndef DISABLE_PYTHON
 
 PyTypeObject CValue::Type = {
        PyVarObject_HEAD_INIT(NULL, 0)
@@ -64,6 +64,8 @@ PyTypeObject CValue::Type = {
 PyMethodDef CValue::Methods[] = {
        {NULL,NULL} //Sentinel
 };
+#endif // DISABLE_PYTHON
+
 
 /*#define CVALUE_DEBUG*/
 #ifdef CVALUE_DEBUG
@@ -90,10 +92,6 @@ std::vector<SmartCValueRef> gRefList;
 
 CValue::CValue()
                : PyObjectPlus(),
-#else
-CValue::CValue()
-: 
-#endif //NO_EXP_PYTHON_EMBEDDING
        
 m_pNamedPropertyArray(NULL),
 m_refcount(1)
@@ -526,8 +524,7 @@ CValue*     CValue::FindIdentifier(const STR_String& identifiername)
        return result;
 }
 
-
-#ifndef NO_EXP_PYTHON_EMBEDDING
+#ifndef DISABLE_PYTHON
 
 PyAttributeDef CValue::Attributes[] = {
        KX_PYATTRIBUTE_RO_FUNCTION("name",      CValue, pyattr_get_name),
@@ -618,7 +615,8 @@ PyObject*   CValue::ConvertKeysToPython( void )
        return pylist;
 }
 
-#endif //NO_EXP_PYTHON_EMBEDDING
+#endif // DISABLE_PYTHON
+
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////
index 7d4adcdb64f67b431e9406586ec99212823efdc4..f639ae5af78e3e39af26e0901d09a79dbf3cfb78 100644 (file)
@@ -197,19 +197,14 @@ public:
 
 
 
-#ifndef NO_EXP_PYTHON_EMBEDDING
 #include "PyObjectPlus.h"
+#ifndef DISABLE_PYTHON
 #include "object.h"
+#endif
 class CValue  : public PyObjectPlus
-#else
-class CValue  
-#endif //NO_EXP_PYTHON_EMBEDDING
-
 
 {
-#ifndef NO_EXP_PYTHON_EMBEDDING
 Py_Header;
-#endif //NO_EXP_PYTHON_EMBEDDING
 public:
        enum AllocationTYPE {
                STACKVALUE              = 0,
@@ -224,9 +219,9 @@ public:
 
 
        // Construction / Destruction
-#ifndef NO_EXP_PYTHON_EMBEDDING
-
        CValue();
+
+#ifndef DISABLE_PYTHON
        //static PyObject*      PyMake(PyObject*,PyObject*);
        virtual PyObject *py_repr(void)
        {
@@ -242,10 +237,7 @@ public:
        static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
        
        virtual PyObject* ConvertKeysToPython( void );
-
-#else
-       CValue();
-#endif //NO_EXP_PYTHON_EMBEDDING
+#endif // DISABLE_PYTHON
 
        
        
@@ -416,12 +408,8 @@ public:                                                                                                                                                                                                    \
 class CPropValue : public CValue
 {
 public:
-#ifndef NO_EXP_PYTHON_EMBEDDING        
        CPropValue() :
          CValue(),
-#else
-       CPropValue() :
-#endif //NO_EXP_PYTHON_EMBEDDING
                m_strNewName()
 
        {
index 601585f79d62540ff608bb1fba44c9c653118e5c..819af4b56f8a7f06c0082c5cac594d15ee19dfdd 100644 (file)
@@ -34,7 +34,6 @@ SET(INC
        ../../../source/gameengine/SceneGraph
        ../../../intern/moto/include
        ../../../source/gameengine/Rasterizer
-       ${PYTHON_INC}
 )
 
 IF(WITH_SDL)
@@ -43,5 +42,11 @@ ELSE(WITH_SDL)
        ADD_DEFINITIONS(-DDISABLE_SDL)
 ENDIF(WITH_SDL)
 
+IF(WITH_PYTHON)
+       SET(INC ${INC} ${PYTHON_INC})
+ELSE(WITH_PYTHON)
+       ADD_DEFINITIONS(-DDISABLE_PYTHON)
+ENDIF(WITH_PYTHON)
+
 BLENDERLIB(bf_logic "${SRC}" "${INC}")
 #env.BlenderLib ( 'bf_logic', sources, Split(incs), [], libtype=['game','player'], priority=[30, 110] )
index 9b04e263350cee16574cad9e2fd6c606364d55c1..bd1e5fa7105d5a37e3b41ea81ccc641bca71f1b6 100644 (file)
@@ -99,12 +99,12 @@ void SCA_2DFilterActuator::SetShaderText(const char *text)
        m_shaderText = text;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
 
-
-
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_2DFilterActuator::Type = {
        PyVarObject_HEAD_INIT(NULL, 0)
@@ -141,3 +141,5 @@ PyAttributeDef SCA_2DFilterActuator::Attributes[] = {
        KX_PYATTRIBUTE_FLOAT_RW("value", 0.0, 100.0, SCA_2DFilterActuator, m_float_arg),
        { NULL }        //Sentinel
 };
+
+#endif
index ac9e238bd64262e0b45e7f951805c0bc352a15d3..21380caf6a0f1243e3177d77648d18a1f4e4d844 100644 (file)
@@ -91,7 +91,7 @@ CValue* SCA_ANDController::GetReplica()
        return replica;
 }
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -127,5 +127,5 @@ PyMethodDef SCA_ANDController::Methods[] = {
 PyAttributeDef SCA_ANDController::Attributes[] = {
        { NULL }        //Sentinel
 };
-
+#endif // DISABLE_PYTHON
 /* eof */
index 428362a0a24cb5dac37411e7234f00f1e622ec37..c5ba95e2c2cad76e1b2de848fbc939cb6dbf4453 100644 (file)
@@ -114,6 +114,7 @@ void SCA_ActuatorSensor::Update()
        }
 }
 
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -163,4 +164,6 @@ int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*)
        return 1;
 }
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index 1a09514850044657fdb46c71aa6a552ff8811c46..299684fc955827b1c2d577f824ff1b6683ae870b 100644 (file)
@@ -56,11 +56,15 @@ public:
        virtual void    ReParent(SCA_IObject* parent);
        void Update();
 
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
-       
+
        static int CheckActuator(void *self, const PyAttributeDef*);
+       
+#endif // DISABLE_PYTHON
 };
 
 #endif
index 35b035f646606de13b550b35b1cdd56629bd6dcf..898d0f4bb3483d2081566e3e8982f3e5e7ba5a5d 100644 (file)
@@ -98,6 +98,8 @@ bool SCA_AlwaysSensor::Evaluate()
        return result;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -133,4 +135,6 @@ PyAttributeDef SCA_AlwaysSensor::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif
+
 /* eof */
index 0f67ddd56a58b368372bc011a39a551bdfca641d..2c2b588abd360f30e443c9512178539a5edcac58 100644 (file)
@@ -124,6 +124,8 @@ bool SCA_DelaySensor::Evaluate()
        return trigger;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -162,4 +164,6 @@ PyAttributeDef SCA_DelaySensor::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index 609693004748279f4ea15358635465536a847a81..91135079fe616a30bcc1c56301a247d170de7271 100644 (file)
@@ -36,6 +36,8 @@
 #include "InputParser.h"
 #include "MT_Transform.h" // for fuzzyZero
 
+#include <stdio.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
index 0338213b3cff7046b95a7b3ea86eee8542175402..13deed12dd162d5f40e5eeb27ab2e2979ce90ac7 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include "SCA_IActuator.h"
+#include <stdio.h>
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 7cfd2adc1d0fb66f81d74d1362d5c4faf7f9a059..65c9c4d0f5730b30a83289bf5ddbdd26f129dde0 100644 (file)
@@ -33,6 +33,8 @@
 #include "PyObjectPlus.h"
 #include "../Ketsji/KX_PythonSeq.h" /* not nice, only need for KX_PythonSeq_CreatePyObject */
 
+#include <stdio.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -196,6 +198,8 @@ void SCA_IController::ApplyState(unsigned int state)
        }
 }
 
+#ifndef DISABLE_PYTHON
+
 /* Python api */
 
 PyTypeObject SCA_IController::Type = {
@@ -247,3 +251,4 @@ PyObject* SCA_IController::pyattr_get_actuators(void *self_v, const KX_PYATTRIBU
 {
        return KX_PythonSeq_CreatePyObject((static_cast<SCA_IController*>(self_v))->m_proxy, KX_PYGENSEQ_CONT_TYPE_ACTUATORS);  
 }
+#endif // DISABLE_PYTHON
index 202921c69860448928f6be441e174198976785d8..485141216610505d9bd9d580d54e5f3cee60e7a1 100644 (file)
@@ -98,10 +98,12 @@ public:
                }
        }
        
+
+#ifndef DISABLE_PYTHON
        static PyObject*        pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
-
+#endif // DISABLE_PYTHON
 };
 
 #endif
index f679d0ee4874f30ba7d6bc7bfbdaf9e66ae1e1f9..6502fc6de41925248c958692894dcd9f6fa73c50 100644 (file)
@@ -173,6 +173,7 @@ CValue* SCA_ILogicBrick::GetEvent()
 
 
 
+#ifndef DISABLE_PYTHON
 
 /* python stuff */
 
@@ -255,3 +256,5 @@ PyObject* SCA_ILogicBrick::BoolToPyArg(bool boolarg)
 {
        return PyLong_FromSsize_t(boolarg? KX_TRUE: KX_FALSE);  
 }
+
+#endif // DISABLE_PYTHON
index ac533335f0b349fccf4c73265b2f6af5d4b62ccd..11885f988f39b354ec064581e10bbaf62754719d 100644 (file)
@@ -125,6 +125,7 @@ public:
        static class SCA_LogicManager*  m_sCurrentLogicManager;
 
 
+#ifndef DISABLE_PYTHON
        // python methods
        
        static PyObject*        pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
@@ -147,8 +148,9 @@ protected:
 
        /** Convert a a c++ value to KX_TRUE, KX_FALSE in Python. */
        PyObject* BoolToPyArg(bool);
-
        
+#endif // DISABLE_PYTHON
+
 };
 
 #endif
index fbf66b64d08c233bb490c3635f7997184de104a2..e63b616cab0855a63de4c16fa13a4cd5a8a10f3c 100644 (file)
@@ -307,7 +307,7 @@ void SCA_IObject::SetState(unsigned int state)
        }
 }
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -345,3 +345,5 @@ PyMethodDef SCA_IObject::Methods[] = {
 PyAttributeDef SCA_IObject::Attributes[] = {
        { NULL }        //Sentinel
 };
+
+#endif // DISABLE_PYTHON
index 64ea0a76af170af2fc1ac3351bc5b9265ac5b669..60335f8fe01dd479787373e335eb273e21635833 100644 (file)
@@ -41,7 +41,9 @@ class SCA_ISensor;
 class SCA_IController;
 class SCA_IActuator;
 
+#ifndef DISABLE_PYTHON
 template<class T> T PyVecTo(PyObject*);
+#endif
 
 typedef std::vector<SCA_ISensor *>       SCA_SensorList;
 typedef std::vector<SCA_IController *>   SCA_ControllerList;
index 497a5d1095a04e7b1c0e8c3dd569921a3a24ef38..877563e316184ce4017d4ec64eb7744e1a25af5b 100644 (file)
@@ -35,6 +35,8 @@
 // needed for IsTriggered()
 #include "SCA_PythonController.h"
 
+#include <stdio.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -288,6 +290,9 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr)
                }
        } 
 }
+
+#ifndef DISABLE_PYTHON
+
 /* ----------------------------------------------- */
 /* Python Functions                                                       */
 /* ----------------------------------------------- */
@@ -379,5 +384,6 @@ int SCA_ISensor::pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrde
                self->m_level = false;
        return 0;
 }
+#endif // DISABLE_PYTHON
 
 /* eof */
index 742b05bd88b3df20e190a8822bcbae6bddc4be1b..fce5f340be13b7addea3115be0b0979cccb61bd0 100644 (file)
@@ -171,6 +171,7 @@ public:
        bool IsNoLink() const 
                { return !m_links; }
 
+#ifndef DISABLE_PYTHON
        /* Python functions: */
        KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,reset);
        
@@ -178,6 +179,7 @@ public:
        static PyObject*        pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int          pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int          pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+#endif // DISABLE_PYTHON
 };
 
 #endif //__SCA_ISENSOR
index 4936b38035217c481bdaef59ae8f436d01b6ee0d..9ac64b7f31ee13b5416328b1c0e17fa6a7d2338f 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "PyObjectPlus.h"
 
+#include <stdio.h>
 #include <iostream>
 
 
@@ -244,6 +245,7 @@ bool SCA_JoystickSensor::isValid(SCA_JoystickSensor::KX_JOYSENSORMODE m)
        return res;
 }
 
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                                                                             */
@@ -413,3 +415,5 @@ PyObject* SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTR
        SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
        return PyBool_FromLong( joy ? joy->Connected() : 0 );
 }
+
+#endif
index b793c591ac1ade80af0cffeb64383b9460bb732b..49ca58ee14f4c7010f5599514f3c7c528bdbd993 100644 (file)
@@ -117,6 +117,8 @@ public:
                return m_joyindex;
        }
 
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -155,6 +157,8 @@ public:
                return 0;
        }
        
+#endif // DISABLE_PYTHON
+
 };
 
 #endif
index d2e3871fec25632a757c66414cf830244567c19f..dcad65e6459aea3f9840dcf8021234fe4341ee06 100644 (file)
@@ -403,6 +403,7 @@ void SCA_KeyboardSensor::LogKeystrokes(void)
        }
 }
 
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python Functions                                                   */
@@ -495,6 +496,7 @@ PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBU
        return resultlist;
 }
 
+#endif // DISABLE_PYTHON
 
 /* Accessed from python */
 
index d7e0f301a9dceb810eba905db65d754692402ae4..0ce08b3e40826c379bf1706c4f9c73f11f1a2072 100644 (file)
@@ -103,6 +103,7 @@ public:
        virtual bool IsPositiveTrigger();
        bool    TriggerOnAllKeys();
 
+#ifndef DISABLE_PYTHON
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -113,6 +114,7 @@ public:
        KX_PYMETHOD_DOC_O(SCA_KeyboardSensor,getKeyStatus);
        
        static PyObject*        pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+#endif
 };
 
 
index b782c6dfb93a567c6b1f5e0430a64170f0eca065..d93f2e70e360fb83ba9de807a95412f76716d724 100644 (file)
@@ -305,6 +305,9 @@ void SCA_LogicManager::EndFrame()
 void SCA_LogicManager::AddTriggeredController(SCA_IController* controller, SCA_ISensor* sensor)
 {
        controller->Activate(m_triggeredControllerSet);
+
+#ifndef DISABLE_PYTHON
+
        // so that the controller knows which sensor has activited it
        // only needed for python controller
        // Note that this is safe even if the controller is subclassed.
@@ -313,6 +316,7 @@ void SCA_LogicManager::AddTriggeredController(SCA_IController* controller, SCA_I
                SCA_PythonController* pythonController = (SCA_PythonController*)controller;
                pythonController->AddTriggeredSensor(sensor);
        }
+#endif
 }
 
 SCA_EventManager* SCA_LogicManager::FindEventManager(int eventmgrtype)
index 9d32682eaa97fdf50780d9d1d995347b111eface..466b8f7e741e300d60d3499ddb53b84a542d85f7 100644 (file)
@@ -57,7 +57,7 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr,
        m_mousemode   = mousemode;
        m_triggermode = true;
 
-       UpdateHotkey(this, NULL);
+       UpdateHotkey(this);
        Init();
 }
 
@@ -72,7 +72,7 @@ SCA_MouseSensor::~SCA_MouseSensor()
     /* Nothing to be done here. */
 }
 
-int SCA_MouseSensor::UpdateHotkey(void *self, const PyAttributeDef*)
+void SCA_MouseSensor::UpdateHotkey(void *self)
 {
        // gosh, this function is so damn stupid
        // its here because of a design mistake in the mouse sensor, it should only
@@ -100,9 +100,6 @@ int SCA_MouseSensor::UpdateHotkey(void *self, const PyAttributeDef*)
        default:
                ; /* ignore, no hotkey */
        }
-       // return value is used in py_setattro(), 
-       // 0=attribute checked ok (see Attributes array definition)
-       return 0;
 }
 
 CValue* SCA_MouseSensor::GetReplica()
@@ -239,6 +236,8 @@ bool SCA_MouseSensor::isValid(SCA_MouseSensor::KX_MOUSESENSORMODE m)
        return ((m > KX_MOUSESENSORMODE_NODEF) && (m < KX_MOUSESENSORMODE_MAX));
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -296,10 +295,20 @@ PyMethodDef SCA_MouseSensor::Methods[] = {
        {NULL,NULL} //Sentinel
 };
 
+int SCA_MouseSensor::UpdateHotkeyPy(void *self, const PyAttributeDef*)
+{
+       UpdateHotkey(self);
+       // return value is used in py_setattro(),
+       // 0=attribute checked ok (see Attributes array definition)
+       return 0;
+}
+
 PyAttributeDef SCA_MouseSensor::Attributes[] = {
-       KX_PYATTRIBUTE_SHORT_RW_CHECK("mode",KX_MOUSESENSORMODE_NODEF,KX_MOUSESENSORMODE_MAX-1,true,SCA_MouseSensor,m_mousemode,UpdateHotkey),
+       KX_PYATTRIBUTE_SHORT_RW_CHECK("mode",KX_MOUSESENSORMODE_NODEF,KX_MOUSESENSORMODE_MAX-1,true,SCA_MouseSensor,m_mousemode,UpdateHotkeyPy),
        KX_PYATTRIBUTE_SHORT_LIST_RO("position",SCA_MouseSensor,m_x,2),
        { NULL }        //Sentinel
 };
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index a679e6054282e90a2a73388f1eba0cb3754fc21b..25b3a6c2e6e5425580f623004cd608422d318fb6 100644 (file)
@@ -86,8 +86,6 @@ class SCA_MouseSensor : public SCA_ISensor
 
        bool isValid(KX_MOUSESENSORMODE);
        
-       static int UpdateHotkey(void *self, const PyAttributeDef*);
-       
        SCA_MouseSensor(class SCA_MouseManager* keybdmgr,
                                        int startx,int starty,
                                   short int mousemode,
@@ -102,14 +100,20 @@ class SCA_MouseSensor : public SCA_ISensor
        SCA_IInputDevice::KX_EnumInputs GetHotKey();
        void setX(short x);
        void setY(short y);
-       
+
+       static void UpdateHotkey(void *self);
+
+
+#ifndef DISABLE_PYTHON
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
        
+       static int UpdateHotkeyPy(void *self, const PyAttributeDef *);
+
        // get button status
        KX_PYMETHOD_DOC_O(SCA_MouseSensor,getButtonStatus);
-
+#endif
 };
 
 #endif //__KX_MOUSESENSOR
index c971c06fadd35e92bd8d50fabec6844f6297ca9c..99c74e6d7372e1437ce20d8b5fa15317850e823a 100644 (file)
@@ -91,7 +91,7 @@ CValue* SCA_NANDController::GetReplica()
        return replica;
 }
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -128,4 +128,6 @@ PyAttributeDef SCA_NANDController::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif
+
 /* eof */
index 7a8b09e4bec5694e11e338c5ece143a77142e91b..a84453de977515bbf081d18fc6719deda79d9654 100644 (file)
@@ -91,7 +91,7 @@ CValue* SCA_NORController::GetReplica()
        return replica;
 }
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -128,4 +128,6 @@ PyAttributeDef SCA_NORController::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index 12e2f610986c10bc70b0ea508872d9f100abd1f1..0f750eedf772c1941d6d91d0b56cc3f5dca7b207 100644 (file)
@@ -87,6 +87,8 @@ void SCA_ORController::Trigger(SCA_LogicManager* logicmgr)
        }
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -122,4 +124,6 @@ PyAttributeDef SCA_ORController::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index 2a3e600a65375b783eaec531e79ac19a1df9d3b6..2b480a8e8cb35ac6a95bf713dd5a67098bea4770 100644 (file)
@@ -221,6 +221,7 @@ void SCA_PropertyActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map)
        }
 }
 
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -260,4 +261,6 @@ PyAttributeDef SCA_PropertyActuator::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif
+
 /* eof */
index 9c09c8410fbd8326f70767e36bf617f4c59f8371..40c5ac687f61adf7fde406f78e7709890f409eef 100644 (file)
@@ -290,16 +290,18 @@ CValue* SCA_PropertySensor::FindIdentifier(const STR_String& identifiername)
        return  GetParent()->FindIdentifier(identifiername);
 }
 
+#ifndef DISABLE_PYTHON
+
+/* ------------------------------------------------------------------------- */
+/* Python functions                                                          */
+/* ------------------------------------------------------------------------- */
+
 int SCA_PropertySensor::validValueForProperty(void *self, const PyAttributeDef*)
 {
        /*  There is no type checking at this moment, unfortunately...           */
        return 0;
 }
 
-/* ------------------------------------------------------------------------- */
-/* Python functions                                                          */
-/* ------------------------------------------------------------------------- */
-
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_PropertySensor::Type = {
        PyVarObject_HEAD_INIT(NULL, 0)
@@ -334,4 +336,6 @@ PyAttributeDef SCA_PropertySensor::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index a5bbfc8438bea32582ee6d19651697f7a79114e6..cd8a67131480837ea2ddd9a2c817f5e49fa7b625 100644 (file)
@@ -84,6 +84,8 @@ public:
        virtual bool    IsPositiveTrigger();
        virtual CValue*         FindIdentifier(const STR_String& identifiername);
 
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -92,6 +94,8 @@ public:
         * Test whether this is a sensible value (type check)
         */
        static int validValueForProperty(void* self, const PyAttributeDef*);
+
+#endif
 };
 
 #endif
index ecaa8c508dbb1bf25864aa59a2c68b82c91f6bec..3a70d1485dcee7343ed9ae9d23f7236159c1aa9c 100644 (file)
 #include "SCA_ISensor.h"
 #include "SCA_IActuator.h"
 #include "PyObjectPlus.h"
+
+#ifndef DISABLE_PYTHON
 #include "compile.h"
 #include "eval.h"
+#endif // DISABLE_PYTHON
+
 #include <algorithm>
 
 
@@ -49,13 +53,18 @@ SCA_PythonController* SCA_PythonController::m_sCurrentController = NULL;
 
 SCA_PythonController::SCA_PythonController(SCA_IObject* gameobj, int mode)
        : SCA_IController(gameobj),
+#ifndef DISABLE_PYTHON
        m_bytecode(NULL),
        m_function(NULL),
+#endif
        m_function_argc(0),
        m_bModified(true),
        m_debug(false),
-       m_mode(mode),
-       m_pythondictionary(NULL)
+       m_mode(mode)
+#ifndef DISABLE_PYTHON
+       , m_pythondictionary(NULL)
+#endif
+
 {
        
 }
@@ -78,6 +87,8 @@ int                   SCA_PythonController::Release()
 
 SCA_PythonController::~SCA_PythonController()
 {
+
+#ifndef DISABLE_PYTHON
        //printf("released python byte script\n");
        
        Py_XDECREF(m_bytecode);
@@ -88,6 +99,7 @@ SCA_PythonController::~SCA_PythonController()
                PyDict_Clear(m_pythondictionary);
                Py_DECREF(m_pythondictionary);
        }
+#endif
 }
 
 
@@ -95,7 +107,8 @@ SCA_PythonController::~SCA_PythonController()
 CValue* SCA_PythonController::GetReplica()
 {
        SCA_PythonController* replica = new SCA_PythonController(*this);
-       
+
+#ifndef DISABLE_PYTHON
        /* why is this needed at all??? - m_bytecode is NULL'd below so this doesnt make sense
         * but removing it crashes blender (with YoFrankie). so leave in for now - Campbell */
        Py_XINCREF(replica->m_bytecode);
@@ -113,6 +126,7 @@ CValue* SCA_PythonController::GetReplica()
        if (m_pythondictionary)
                Py_INCREF(replica->m_pythondictionary);
        */
+#endif
        
        // this will copy properties and so on...
        replica->ProcessReplica();
@@ -136,7 +150,7 @@ void SCA_PythonController::SetScriptName(const STR_String& name)
 }
 
 
-
+#ifndef DISABLE_PYTHON
 void SCA_PythonController::SetDictionary(PyObject*     pythondictionary)
 {
        if (m_pythondictionary)
@@ -151,6 +165,7 @@ void SCA_PythonController::SetDictionary(PyObject*  pythondictionary)
        PyDict_SetItemString(m_pythondictionary, "__file__", PyUnicode_FromString(m_scriptName.Ptr()));
        
 }
+#endif
 
 int SCA_PythonController::IsTriggered(class SCA_ISensor* sensor)
 {
@@ -160,6 +175,8 @@ int SCA_PythonController::IsTriggered(class SCA_ISensor* sensor)
        return 0;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */
 PyObject* SCA_PythonController::sPyGetCurrentController(PyObject *self)
 {
@@ -360,6 +377,7 @@ bool SCA_PythonController::Import()
        return true;
 }
 
+
 void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
 {
        m_sCurrentController = this;
@@ -514,5 +532,13 @@ int SCA_PythonController::pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_D
        return PY_SET_ATTR_SUCCESS;
 }
 
+#else // DISABLE_PYTHON
+
+void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
+{
+       /* intentionally blank */
+}
+
+#endif // DISABLE_PYTHON
 
 /* eof */
index 9311b3f355e4e1f40f8cab4240184a620dc84ed8..f6a1064b77df9d96c9ae20a0b5e7c5953f0c24ef 100644 (file)
@@ -42,8 +42,10 @@ class SCA_IObject;
 class SCA_PythonController : public SCA_IController
 {
        Py_Header;
+#ifndef DISABLE_PYTHON
        struct _object *                m_bytecode; /* SCA_PYEXEC_SCRIPT only */
        PyObject*                               m_function; /* SCA_PYEXEC_MODULE only */
+#endif
        int                                             m_function_argc;
        bool                                    m_bModified;
        bool                                    m_debug;        /* use with SCA_PYEXEC_MODULE for reloading every logic run */
@@ -53,9 +55,10 @@ class SCA_PythonController : public SCA_IController
  protected:
        STR_String                              m_scriptText;
        STR_String                              m_scriptName;
+#ifndef DISABLE_PYTHON
        PyObject*                               m_pythondictionary;     /* for SCA_PYEXEC_SCRIPT only */
        PyObject*                               m_pythonfunction;       /* for SCA_PYEXEC_MODULE only */
+#endif
        std::vector<class SCA_ISensor*>         m_triggeredSensors;
  
  public:
@@ -80,7 +83,9 @@ class SCA_PythonController : public SCA_IController
   
        void    SetScriptText(const STR_String& text);
        void    SetScriptName(const STR_String& name);
+#ifndef DISABLE_PYTHON
        void    SetDictionary(PyObject* pythondictionary);
+#endif
        void    SetDebug(bool debug) { m_debug = debug; }
        void    AddTriggeredSensor(class SCA_ISensor* sensor)
                { m_triggeredSensors.push_back(sensor); }
@@ -89,7 +94,7 @@ class SCA_PythonController : public SCA_IController
        bool    Import();
        void    ErrorPrint(const char *error_msg);
        
-
+#ifndef DISABLE_PYTHON
        static const char* sPyGetCurrentController__doc__;
        static PyObject* sPyGetCurrentController(PyObject* self);
        static const char* sPyAddActiveActuator__doc__;
@@ -106,8 +111,7 @@ class SCA_PythonController : public SCA_IController
        
        static PyObject*        pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int                      pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
-       
-
+#endif
 };
 
 #endif //KX_PYTHONCONTROLLER_H
index 8f9482b782662da324ef66ee2eae3da7c4233573..fa85bdd768e31d3720f6e730d387a5f3c5ac14df 100644 (file)
@@ -309,6 +309,8 @@ void SCA_RandomActuator::enforceConstraints() {
        }
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -546,5 +548,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setFloatNegativeExponential,
        enforceConstraints();
        Py_RETURN_NONE;
 }
-       
+
+#endif
+
 /* eof */
index f84c44b43c9fc7079fe82e990812871c1111655a..2eb9b8d5d1498b32819999c5884354492da353c9 100644 (file)
@@ -91,6 +91,8 @@ class SCA_RandomActuator : public SCA_IActuator
        
        virtual CValue* GetReplica();
        virtual void ProcessReplica();
+
+#ifndef DISABLE_PYTHON
        
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
@@ -109,6 +111,9 @@ class SCA_RandomActuator : public SCA_IActuator
        KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setFloatUniform);
        KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setFloatNormal);
        KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setFloatNegativeExponential);
+
+#endif // DISABLE_PYTHON
+
 }; /* end of class KX_EditObjectActuator : public SCA_PropertyActuator */
 
 #endif
index 890875e61c63babae6a0e670b8bb803965caaafc..922e44b1c1dcbdc17fbeb51b45ab9064b3eefe76 100644 (file)
@@ -124,6 +124,8 @@ bool SCA_RandomSensor::Evaluate()
        return evaluateResult;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -178,4 +180,6 @@ int SCA_RandomSensor::pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *at
        return PY_SET_ATTR_SUCCESS;
 }
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index f93cf57370e49e7077f5534b32274c55662de6a1..8126824c3dd9e46c11cc1d923a5a0a27752c5263 100644 (file)
@@ -56,13 +56,15 @@ public:
        virtual bool IsPositiveTrigger();
        virtual void Init();
 
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
        
        static PyObject*        pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int                      pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
-
+#endif
 };
 
 #endif //__KX_RANDOMSENSOR
index 17350feb98b7b14bc5c032c314778571f2c798c7..e726a49347cb7212ccc81d7002e0fe6b3e95d765 100644 (file)
@@ -95,7 +95,7 @@ CValue* SCA_XNORController::GetReplica()
        return replica;
 }
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -132,4 +132,6 @@ PyAttributeDef SCA_XNORController::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index a6a7cc258970ae2e7c6f54a693b88d4267abd96e..71cc4374e952a1d97c79f5d8e3492b9e7b50195d 100644 (file)
@@ -95,7 +95,7 @@ CValue* SCA_XORController::GetReplica()
        return replica;
 }
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -131,5 +131,6 @@ PyMethodDef SCA_XORController::Methods[] = {
 PyAttributeDef SCA_XORController::Attributes[] = {
        { NULL }        //Sentinel
 };
+#endif // DISABLE_PYTHON
 
 /* eof */
index 1530c71c7f384ede90dbfaa35fa5f71437e8713d..3840754ed06685e0638f8b801fe108af86271b34 100644 (file)
@@ -7,9 +7,6 @@ incs = '. #/source/kernel/gen_system #/intern/string'
 incs += ' #/source/gameengine/Expressions #/intern/moto/include'
 incs += ' #/source/gameengine/Rasterizer #/source/gameengine/SceneGraph'
 
-incs += ' ' + env['BF_PYTHON_INC']
-
-
 defs = []
 
 if env['WITH_BF_SDL']:
@@ -17,6 +14,11 @@ if env['WITH_BF_SDL']:
 else:
        defs.append('DISABLE_SDL')
 
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
+
 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
        if env['BF_DEBUG']:
                defs.append('_DEBUG')
index dd5a48c2b557298f0d73eb20d5c7a169c9987198..99eda4cb5920535c8794f4d55594c1a09172f18f 100644 (file)
@@ -58,8 +58,14 @@ incs = ['.',
 #                    'unix/GPU_System.cpp']
 #   gp_common_env.Append ( CPPPATH = ['unix'])
 
-incs += Split(env['BF_PYTHON_INC'])
+defs = []
+
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
+
 incs += Split(env['BF_PNG_INC'])
 incs += Split(env['BF_ZLIB_INC'])
 
-env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype=['player'], priority=[5], cxx_compileflags=env['BGE_CXXFLAGS'])
+env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = defs, libtype=['player'], priority=[5], cxx_compileflags=env['BGE_CXXFLAGS'])
index fdd7792b72ae692bd02a0873e86a4bec7d91ff14..cfb827cf8c3b6d6ad936570bc3d9836746cf37c2 100644 (file)
@@ -40,9 +40,13 @@ incs = ['.',
         '#source/blender/gpu',
         '#extern/glew/include']
 
-incs += Split(env['BF_PYTHON_INC'])
-
 defs = []
+
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
+
 if env['WITH_BF_FFMPEG']:
     defs.append('WITH_FFMPEG')
 
index f548bcdaae1d467a40fea8d3d9db1d1d8442427b..35eb5dc124a066ce5aff9339de672ef067b49917 100644 (file)
@@ -728,6 +728,8 @@ void BL_Shader::SetUniform(int uniform, const int* val, int len)
        }
 }
 
+#ifndef DISABLE_PYTHON
+
 PyMethodDef BL_Shader::Methods[] = 
 {
        // creation
@@ -1409,4 +1411,6 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformDef, "setUniformDef(name, enum)" )
        return NULL;
 }
 
+#endif // DISABLE_PYTHON
+
 // eof
index b2610d7762afb2109687bdfdfad2c38d1767a314..ebd2e491f35cd901cd7da504b09c52c42fda55a8 100644 (file)
@@ -222,6 +222,7 @@ public:
        void SetUniform(int uniform, const int val);
 
        // Python interface
+#ifndef DISABLE_PYTHON
        virtual PyObject* py_repr(void) { return PyUnicode_FromFormat("BL_Shader\n\tvertex shader:%s\n\n\tfragment shader%s\n\n", vertProg, fragProg); }
 
        // -----------------------------------
@@ -249,6 +250,7 @@ public:
        KX_PYMETHOD_DOC( BL_Shader, setUniformDef );
        KX_PYMETHOD_DOC( BL_Shader, setAttrib );
        KX_PYMETHOD_DOC( BL_Shader, setSampler);
+#endif
 };
 
 #endif//__BL_SHADER_H__
index 01d369bc7a95db91599fdbf31734e48d12d74357..857be4bd827caaaddf05da725136d7d1fb55e659 100644 (file)
@@ -59,7 +59,6 @@ SET(INC
        ../../../source/blender/gpu
        ../../../extern/bullet2/src
        ../../../extern/glew/include
-       ${PYTHON_INC}
 )
 
 IF(WITH_SDL)
@@ -68,5 +67,11 @@ ELSE(WITH_SDL)
        ADD_DEFINITIONS(-DDISABLE_SDL)
 ENDIF(WITH_SDL)
 
+IF(WITH_PYTHON)
+       SET(INC ${INC} ${PYTHON_INC})
+ELSE(WITH_PYTHON)
+       ADD_DEFINITIONS(-DDISABLE_PYTHON)
+ENDIF(WITH_PYTHON)
+
 BLENDERLIB(bf_ketsji "${SRC}" "${INC}")
 #env.BlenderLib ( 'bf_ketsji', sources, Split(incs), [], libtype=['game','player'], priority=[25, 72], compileflags = cflags )
index b89b0dcff9f56c94d2e5e5bb3c8c28a0188dd321..1a608713c513ce4ae36b3c702c6f3f72e018935d 100644 (file)
@@ -36,8 +36,13 @@ SET(INC
        ../../../../source/gameengine/Expressions
        ../../../../source/gameengine/SceneGraph
        ../../../../source/gameengine/Network
-       ${PYTHON_INC}
 )
 
+IF(WITH_PYTHON)
+       SET(INC ${INC} ${PYTHON_INC})
+ELSE(WITH_PYTHON)
+       ADD_DEFINITIONS(-DDISABLE_PYTHON)
+ENDIF(WITH_PYTHON)
+
 BLENDERLIB(kx_network "${SRC}" "${INC}")
 #env.BlenderLib ( 'kx_network', Split(sources), Split(incs), defines=[],libtype=['game2', 'player'], priority=[5, 155] )
index 1cfab87d78b2ee38d13507902bfb6a1c792932ef..04a7f2b36039148add991d27bda893fe08bc7b5d 100644 (file)
@@ -95,6 +95,8 @@ CValue* KX_NetworkMessageActuator::GetReplica()
        return replica;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* -------------------------------------------------------------------- */
 /* Python interface --------------------------------------------------- */
 /* -------------------------------------------------------------------- */
@@ -133,3 +135,5 @@ PyAttributeDef KX_NetworkMessageActuator::Attributes[] = {
        KX_PYATTRIBUTE_STRING_RW("body", 0, 16384, false, KX_NetworkMessageActuator, m_body),
        { NULL }        //Sentinel
 };
+
+#endif // DISABLE_PYTHON
index 392e9dd9d1b66063c965edd35ba7ad3c469ebb4f..18dc416cc1bece09b01543da486e818e55e2517c 100644 (file)
@@ -158,6 +158,8 @@ bool KX_NetworkMessageSensor::IsPositiveTrigger()
        return m_IsUp;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* --------------------------------------------------------------------- */
 /* Python interface ---------------------------------------------------- */
 /* --------------------------------------------------------------------- */
@@ -216,3 +218,5 @@ PyObject* KX_NetworkMessageSensor::pyattr_get_subjects(void *self_v, const KX_PY
                return (new CListValue())->NewProxy(true);
        }
 }
+
+#endif // DISABLE_PYTHON
index d8a0651d2f1fdd0ab6cf0e7f871337021dfe4907..3a8fe760bb9ccbf5b1d0883400f738debae19f13 100644 (file)
@@ -66,6 +66,8 @@ public:
        virtual void Init();
        void EndFrame();
        
+#ifndef DISABLE_PYTHON
+
        /* ------------------------------------------------------------- */
        /* Python interface -------------------------------------------- */
        /* ------------------------------------------------------------- */
@@ -74,6 +76,8 @@ public:
        static PyObject*        pyattr_get_bodies(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);     
        static PyObject*        pyattr_get_subjects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
 
+#endif //  DISABLE_PYTHON
+
 };
 
 #endif //__KX_NETWORKMESSAGE_SENSOR_H
index 8f88511accadb95c2c57f03f25e149d6a4517367..64d00489c895a2cbb74485296173e727b92367f3 100644 (file)
@@ -7,6 +7,11 @@ incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/
 incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions'
 incs += ' #source/gameengine/Network #source/gameengine/SceneGraph'
 
-incs += ' ' + env['BF_PYTHON_INC']
+defs = []
 
-env.BlenderLib ( 'bf_network', Split(sources), Split(incs), defines=[],libtype=['core','player'], priority=[400,125], cxx_compileflags=env['BGE_CXXFLAGS'])
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
+
+env.BlenderLib ( 'bf_network', Split(sources), Split(incs), defines=defs,libtype=['core','player'], priority=[400,125], cxx_compileflags=env['BGE_CXXFLAGS'])
index 1b759bda28ed9dfbbe52defc8e4fb4a6670f4b6c..40e16744d71f51ff4812cf0931ae5f221f9c79d0 100644 (file)
@@ -153,6 +153,7 @@ bool KX_ArmatureSensor::Evaluate()
        return (reset) ? true : false;
 }
 
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -203,3 +204,5 @@ PyObject* KX_ArmatureSensor::pyattr_get_constraint(void *self, const struct KX_P
        }
        Py_RETURN_NONE;
 }
+
+#endif // DISABLE_PYTHON
index 2af002afff96ee5256d9f9d144a284971ba32105..6dc6991873a92807e13c3ed8e328bfafb6f79dcc 100644 (file)
@@ -66,11 +66,15 @@ public:
        // identify the constraint that this actuator controls
        void FindConstraint();
 
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
        static PyObject* pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
 
+#endif // DISABLE_PYTHON
+
 private:
        struct bConstraint*     m_constraint;
        STR_String              m_posechannel;
index be3d49067610ac71a3035b82982cb1ab24215e51..f5086ca89acef9d21f70a8094c2812f898761dd2 100644 (file)
@@ -777,6 +777,18 @@ void KX_BlenderMaterial::UpdateIPO(
        mMaterial->ref                  = (float)(ref);
 }
 
+void KX_BlenderMaterial::SetBlenderGLSLShader(int layer)
+{
+       if(!mBlenderShader)
+               mBlenderShader = new BL_BlenderShader(mScene, mMaterial->material, layer);
+
+       if(!mBlenderShader->Ok()) {
+               delete mBlenderShader;
+               mBlenderShader = 0;
+       }
+}
+
+#ifndef DISABLE_PYTHON
 
 PyMethodDef KX_BlenderMaterial::Methods[] = 
 {
@@ -870,18 +882,6 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
        return NULL;
 }
 
-
-void KX_BlenderMaterial::SetBlenderGLSLShader(int layer)
-{
-       if(!mBlenderShader)
-               mBlenderShader = new BL_BlenderShader(mScene, mMaterial->material, layer);
-
-       if(!mBlenderShader->Ok()) {
-               delete mBlenderShader;
-               mBlenderShader = 0;
-       }
-}
-
 KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getMaterialIndex, "getMaterialIndex()")
 {
        return PyLong_FromSsize_t( GetMaterialIndex() );
@@ -941,3 +941,4 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, setBlending , "setBlending( GameLogic.sr
        return NULL;
 }
 
+#endif // DISABLE_PYTHON
index cdbdc4bd4293d268a0aa26fff09aa94e3abcad52..0946cd320c503cba5bfc6c747f2b23080cc38166 100644 (file)
@@ -83,6 +83,7 @@ public:
                MT_Scalar ref, MT_Scalar emit, MT_Scalar alpha
        );
        
+#ifndef DISABLE_PYTHON
        // --------------------------------
        virtual PyObject* py_repr(void) { return PyUnicode_FromString(mMaterial->matname.ReadPtr()); }
 
@@ -92,6 +93,7 @@ public:
        KX_PYMETHOD_DOC( KX_BlenderMaterial, setTexture );
 
        KX_PYMETHOD_DOC( KX_BlenderMaterial, setBlending );
+#endif // DISABLE_PYTHON
 
        // --------------------------------
        // pre calculate to avoid pops/lag at startup
index 0832809772d9499bfa8d8b4d069e1ffe29ddc60b..384125119a9fba1e128377623d28f619de0cdd21 100644 (file)
@@ -481,6 +481,7 @@ int KX_Camera::GetViewportTop() const
        return m_camdata.m_viewporttop;
 }
 
+#ifndef DISABLE_PYTHON
 //----------------------------------------------------------------------------
 //Python
 
@@ -1030,4 +1031,4 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay,
 
        return NULL;
 }
-
+#endif
index bf7a39d93c898f8fd3063a4bef33e184f0140365..71c66efaa87707b7c3c0b3f6361c3d65dc5263e8 100644 (file)
 #include "IntValue.h"
 #include "RAS_CameraData.h"
 
+#ifndef DISABLE_PYTHON
 /* utility conversion function */
 bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok, const char *error_prefix);
+#endif
 
 class KX_Camera : public KX_GameObject
 {
@@ -267,6 +269,7 @@ public:
 
        virtual int GetGameObjectType() { return OBJ_CAMERA; }
 
+#ifndef DISABLE_PYTHON
        KX_PYMETHOD_DOC_VARARGS(KX_Camera, sphereInsideFrustum);
        KX_PYMETHOD_DOC_O(KX_Camera, boxInsideFrustum);
        KX_PYMETHOD_DOC_O(KX_Camera, pointInsideFrustum);
@@ -304,6 +307,7 @@ public:
        static PyObject*        pyattr_get_INSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_OUTSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_INTERSECT(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+#endif
 };
 
 #endif //__KX_CAMERA
index 99618fab8e3c1578fbd21070efd417cf8953a4a6..3b02227451c75633953cb301bf0fb30adb48f09a 100644 (file)
@@ -350,6 +350,8 @@ CValue *KX_CameraActuator::findObject(char *obName)
        return NULL;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -416,4 +418,6 @@ int KX_CameraActuator::pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF
        return PY_SET_ATTR_SUCCESS;
 }
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index e047e3724eafa7816b0e7e86e53954096fcef036..875922b36e7bbac63fd890d303467032e774d906 100644 (file)
@@ -114,6 +114,8 @@ private :
        /** Methods inherited from SCA_ILogicBrick */
        virtual void    Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map);
 
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -122,6 +124,8 @@ private :
        static PyObject*        pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int                      pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
 
+#endif // DISABLE_PYTHON
+
 };
 
 #endif //__KX_CAMERAACTUATOR
index ea0b9f4f1e2bb237e0b4fbc07a0c948a0dd26528..7bbc53211b66d1b57b33ab6903de35738f132290 100644 (file)
@@ -38,6 +38,8 @@
 #include "KX_RayCast.h"
 #include "KX_PythonInit.h" // KX_GetActiveScene
 
+#include <stdio.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -559,6 +561,8 @@ bool KX_ConstraintActuator::IsValidMode(KX_ConstraintActuator::KX_CONSTRAINTTYPE
        return res;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -618,4 +622,6 @@ int KX_ConstraintActuator::pyattr_check_direction(void *self, const struct KX_PY
        return 0;       
 }
 
+#endif
+
 /* eof */
index 54e083b48f06d3faebe7cc07ff112294185c01bb..aee7b3cc44c32b151db9f000c58ecc7a714cbc04 100644 (file)
@@ -26,7 +26,7 @@
  *
  * ***** END GPL LICENSE BLOCK *****
  */
-#include <Python.h>
+
 #include "PyObjectPlus.h"
 #include "KX_ConstraintWrapper.h"
 #include "PHY_IPhysicsEnvironment.h"
@@ -49,6 +49,8 @@ KX_ConstraintWrapper::~KX_ConstraintWrapper()
 {
 }
 
+#ifndef DISABLE_PYTHON
+
 PyObject* KX_ConstraintWrapper::PyGetConstraintId()
 {
        return PyLong_FromSsize_t(m_constraintId);
@@ -115,3 +117,5 @@ PyAttributeDef KX_ConstraintWrapper::Attributes[] = {
        //KX_PYATTRIBUTE_TODO("constraintId"),
        { NULL }        //Sentinel
 };
+
+#endif // DISABLE_PYTHON
index 74670944415e5cd90df05bb4626aea5b60a5a81f..300455aef6bd70877361385337bffcbdd80fbefe 100644 (file)
@@ -40,9 +40,11 @@ public:
        virtual ~KX_ConstraintWrapper ();
        int                     getConstraintId() { return m_constraintId;};
        
+#ifndef DISABLE_PYTHON
        KX_PYMETHOD_NOARGS(KX_ConstraintWrapper,GetConstraintId);
        KX_PYMETHOD(KX_ConstraintWrapper,SetParam);
        KX_PYMETHOD(KX_ConstraintWrapper,GetParam);
+#endif
 
 private:
        int                                     m_constraintId;
index daa31379985aa79fa5bc152a3eee01cee9bb3224..c0d7b6390771dfd73f9bfe91136baeb2d1b821f9 100644 (file)
@@ -18,13 +18,16 @@ http://www.gnu.org/copyleft/lesser.txt.
 Contributor(s): Dalai Felinto
 
 This code is originally inspired on some of the ideas and codes from Paul Bourke.
-Developed as part of a Research and Development project for SAT - La Société des arts technologiques.
+Developed as part of a Research and Development project for SAT - La Soci�t� des arts technologiques.
 -----------------------------------------------------------------------------
 */
 
 #include "KX_Dome.h"
 
+#ifndef DISABLE_PYTHON
 #include <structmember.h>
+#endif
+
 #include <float.h>
 #include <math.h>
 
@@ -558,7 +561,7 @@ void KX_Dome::CreateMeshDome180(void)
 
        m_radangle = m_angle * M_PI/180.0;//calculates the radians angle, used for flattening
 
-       //creating faces for the env mapcube 180º Dome
+       //creating faces for the env mapcube 180 Dome
        // Top Face - just a triangle
        cubetop[0].verts[0][0] = -sqrt_2 / 2.0;
        cubetop[0].verts[0][1] = 0.0;
@@ -743,7 +746,7 @@ void KX_Dome::CreateMeshDome250(void)
        m_radangle = m_angle * M_PI/180.0;//calculates the radians angle, used for flattening
 /*
 verts_height is the exactly needed height of the cube faces (not always 1.0).
-When we want some horizontal information (e.g. for horizontal 220º domes) we don't need to create and tesselate the whole cube.
+When we want some horizontal information (e.g. for horizontal 220 domes) we don't need to create and tesselate the whole cube.
 Therefore the lateral cube faces could be small, and the tesselate mesh would be completely used.
 (if we always worked with verts_height = 1.0, we would be discarding a lot of the calculated and tesselated geometry).
 
@@ -760,7 +763,7 @@ Then we need to multiply it by sqrt(2.0) to get the coordinate of the verts on t
        uv_height = uv_ratio * ((verts_height/2) + 0.5);
        uv_base = uv_ratio * (1.0 - ((verts_height/2) + 0.5));
        
-       //creating faces for the env mapcube 180º Dome
+       //creating faces for the env mapcube 180 Dome
        // Front Face - 2 triangles
        cubefront[0].verts[0][0] =-1.0;
        cubefront[0].verts[0][1] = 1.0;
@@ -1101,7 +1104,7 @@ void KX_Dome::CreateMeshPanorama(void)
 
        nfacesbottom = 2;
 
-       /* Left Back (135º) face - two triangles */
+       /* Left Back (135) face - two triangles */
 
        cubeleftback[0].verts[0][0] = 0;
        cubeleftback[0].verts[0][1] = -sqrt_2;
@@ -1223,7 +1226,7 @@ void KX_Dome::CreateMeshPanorama(void)
 
        nfacesright = 2;
        
-       /* Right Back  (-135º) face - two triangles */
+       /* Right Back  (-135) face - two triangles */
        cuberightback[0].verts[0][0] = sqrt_2;
        cuberightback[0].verts[0][1] = 0;
        cuberightback[0].verts[0][2] = -1.0;
@@ -1352,7 +1355,7 @@ void KX_Dome::FlattenDome(MT_Vector3 verts[3])
 
 void KX_Dome::FlattenPanorama(MT_Vector3 verts[3])
 {
-// it creates a full spherical panoramic (360º)
+// it creates a full spherical panoramic (360)
        int i;
        double phi;
        bool edge=false;
@@ -1445,7 +1448,7 @@ void KX_Dome::SplitFace(vector <DomeFace>& face, int *nfaces)
 void KX_Dome::CalculateFrustum(KX_Camera * cam)
 {
        /*
-       // manually creating a 90º Field of View Frustum 
+       // manually creating a 90 Field of View Frustum 
 
        the original formula:
        top = tan(fov*3.14159/360.0) * near [for fov in degrees]
@@ -1466,7 +1469,7 @@ void KX_Dome::CalculateFrustum(KX_Camera * cam)
        m_frustrum.camfar = cam->GetCameraFar();
 
 //     float top = tan(90.0*MT_PI/360.0) * m_frustrum.camnear;
-       float top = m_frustrum.camnear; // for deg = 90º, tan = 1
+       float top = m_frustrum.camnear; // for deg = 90, tan = 1
 
        m_frustrum.x1 = -top;
        m_frustrum.x2 = top;
@@ -1481,9 +1484,9 @@ void KX_Dome::CalculateFrustum(KX_Camera * cam)
 void KX_Dome::CalculateCameraOrientation()
 {
 /*
-Uses 4 cameras for angles up to 180º
-Uses 5 cameras for angles up to 250º
-Uses 6 cameras for angles up to 360º
+Uses 4 cameras for angles up to 180
+Uses 5 cameras for angles up to 250
+Uses 6 cameras for angles up to 360
 */
        int i;
        float deg45 = MT_PI / 4;
@@ -1494,22 +1497,22 @@ Uses 6 cameras for angles up to 360
                || m_mode == DOME_TRUNCATED_FRONT
                || m_mode == DOME_TRUNCATED_REAR)){
 
-               m_locRot[0] = MT_Matrix3x3( // 90º - Top
+               m_locRot[0] = MT_Matrix3x3( // 90 - Top
                                                c, -s, 0.0,
                                                0.0,0.0, -1.0,
                                                s, c, 0.0);
 
-               m_locRot[1] = MT_Matrix3x3( // 90º - Bottom
+               m_locRot[1] = MT_Matrix3x3( // 90 - Bottom
                                                -s, c, 0.0,
                                                0.0,0.0, 1.0,
                                                s, c, 0.0);
 
-               m_locRot[2] = MT_Matrix3x3( // 45º - Left
+               m_locRot[2] = MT_Matrix3x3( // 45 - Left
                                                c, 0.0, s,
                                                0, 1.0, 0.0,
                                                -s, 0.0, c);
 
-               m_locRot[3] = MT_Matrix3x3( // 45º - Right
+               m_locRot[3] = MT_Matrix3x3( // 45 - Right
                                                c, 0.0, -s,
                                                0.0, 1.0, 0.0,
                                                s, 0.0, c);
@@ -1518,32 +1521,32 @@ Uses 6 cameras for angles up to 360
                || m_mode == DOME_TRUNCATED_FRONT 
                || m_mode == DOME_TRUNCATED_REAR))){
 
-               m_locRot[0] = MT_Matrix3x3( // 90º - Top
+               m_locRot[0] = MT_Matrix3x3( // 90 - Top
                                                 1.0, 0.0, 0.0,
                                                 0.0, 0.0,-1.0,
                                                 0.0, 1.0, 0.0);
 
-               m_locRot[1] = MT_Matrix3x3( // 90º - Bottom
+               m_locRot[1] = MT_Matrix3x3( // 90 - Bottom
                                                 1.0, 0.0, 0.0,
                                                 0.0, 0.0, 1.0,
                                                 0.0,-1.0, 0.0);
 
-               m_locRot[2] = MT_Matrix3x3( // -90º - Left
+               m_locRot[2] = MT_Matrix3x3( // -90 - Left
                                                 0.0, 0.0, 1.0,
                                                 0.0, 1.0, 0.0,
                                                 -1.0, 0.0, 0.0);
 
-               m_locRot[3] = MT_Matrix3x3( // 90º - Right
+               m_locRot[3] = MT_Matrix3x3( // 90 - Right
                                                 0.0, 0.0,-1.0,
                                                 0.0, 1.0, 0.0,
                                                 1.0, 0.0, 0.0);
                                                
-               m_locRot[4] = MT_Matrix3x3( // 0º - Front
+               m_locRot[4] = MT_Matrix3x3( // 0 - Front
                                                1.0, 0.0, 0.0,
                                                0.0, 1.0, 0.0,
                                                0.0, 0.0, 1.0);
 
-               m_locRot[5] = MT_Matrix3x3( // 180º - Back - USED for ENVMAP only
+               m_locRot[5] = MT_Matrix3x3( // 180 - Back - USED for ENVMAP only
                                                -1.0, 0.0, 0.0,
                                                 0.0, 1.0, 0.0,
                                                 0.0, 0.0,-1.0);
@@ -1560,22 +1563,22 @@ Uses 6 cameras for angles up to 360
                                                0.0 ,0.0, 1.0,
                                                s, -c, 0.0);
 
-               m_locRot[2] = MT_Matrix3x3( // 45º - Left
+               m_locRot[2] = MT_Matrix3x3( // 45 - Left
                                                -s, 0.0, c,
                                                0, 1.0, 0.0,
                                                -c, 0.0, -s);
 
-               m_locRot[3] = MT_Matrix3x3( // 45º - Right
+               m_locRot[3] = MT_Matrix3x3( // 45 - Right
                                                c, 0.0, s,
                                                0, 1.0, 0.0,
                                                -s, 0.0, c);
 
-               m_locRot[4] = MT_Matrix3x3( // 135º - LeftBack
+               m_locRot[4] = MT_Matrix3x3( // 135 - LeftBack
                                                -s, 0.0, -c,
                                                0.0, 1.0, 0.0,
                                                c, 0.0, -s);
 
-               m_locRot[5] = MT_Matrix3x3( // 135º - RightBack
+               m_locRot[5] = MT_Matrix3x3( // 135 - RightBack
                                                c, 0.0, -s,
                                                0.0, 1.0, 0.0,
                                                s, 0.0, c);
@@ -1734,7 +1737,7 @@ void KX_Dome::DrawEnvMap(void)
                glVertex3f(-onebythree,-2 * onebythree, 3.0f);
        glEnd();
 
-       // domefacesId[2] => -90º (left)
+       // domefacesId[2] => -90 (left)
        glBindTexture(GL_TEXTURE_2D, domefacesId[2]);
        glBegin(GL_QUADS);
                glTexCoord2f(uv_ratio,uv_ratio);
@@ -1747,7 +1750,7 @@ void KX_Dome::DrawEnvMap(void)
                glVertex3f(-onebythree, 0.0f, 3.0f);
        glEnd();
 
-       // domefacesId[3] => 90º (right)
+       // domefacesId[3] => 90 (right)
        glBindTexture(GL_TEXTURE_2D, domefacesId[3]);
        glBegin(GL_QUADS);
                glTexCoord2f(uv_ratio,uv_ratio);
@@ -1760,7 +1763,7 @@ void KX_Dome::DrawEnvMap(void)
                glVertex3f(1.0f, 0.0f, 3.0f);
        glEnd();
 
-       // domefacesId[4] => 0º (front)
+       // domefacesId[4] => 0 (front)
        glBindTexture(GL_TEXTURE_2D, domefacesId[4]);
        glBegin(GL_QUADS);
                glTexCoord2f(uv_ratio,uv_ratio);
@@ -1773,7 +1776,7 @@ void KX_Dome::DrawEnvMap(void)
                glVertex3f(1.0f, -2 * onebythree, 3.0f);
        glEnd();
 
-       // domefacesId[5] => 180º (back)
+       // domefacesId[5] => 180 (back)
        glBindTexture(GL_TEXTURE_2D, domefacesId[5]);
        glBegin(GL_QUADS);
                glTexCoord2f(uv_ratio,uv_ratio);
@@ -1950,19 +1953,19 @@ void KX_Dome::DrawPanorama(void)
                glBindTexture(GL_TEXTURE_2D, domefacesId[1]);
                        GLDrawTriangles(cubebottom, nfacesbottom);
 
-               // domefacesId[1] => -45º (left)
+               // domefacesId[1] => -45 (left)
                glBindTexture(GL_TEXTURE_2D, domefacesId[2]);
                        GLDrawTriangles(cubeleft, nfacesleft);
 
-               // domefacesId[2] => 45º (right)
+               // domefacesId[2] => 45 (right)
                glBindTexture(GL_TEXTURE_2D, domefacesId[3]);
                        GLDrawTriangles(cuberight, nfacesright);
 
-               // domefacesId[0] => -135º (leftback)
+               // domefacesId[0] => -135 (leftback)
                glBindTexture(GL_TEXTURE_2D, domefacesId[4]);
                        GLDrawTriangles(cubeleftback, nfacesleftback);
 
-               // domefacesId[3] => 135º (rightback)
+               // domefacesId[3] => 135 (rightback)
                glBindTexture(GL_TEXTURE_2D, domefacesId[5]);
                        GLDrawTriangles(cuberightback, nfacesrightback);
        }
index 71980a3347e1753683e6d1f2f9231b42a5bdbf14..bc0f875bca62d873f1f96397ccfc6382ed283b3b 100644 (file)
@@ -36,6 +36,9 @@
 #include "KX_KetsjiEngine.h"
 #include "KX_PythonInit.h" /* for config load/saving */
 
+#include <stdio.h>
+#include <stdlib.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -125,6 +128,7 @@ bool KX_GameActuator::Update()
                }
        case KX_GAME_SAVECFG:
                {
+#ifndef DISABLE_PYTHON
                        if (m_ketsjiengine)
                        {
                                char mashal_path[512];
@@ -152,9 +156,11 @@ bool KX_GameActuator::Update()
                                        delete [] marshal_buffer;
                        }
                        break;
+#endif // DISABLE_PYTHON
                }
        case KX_GAME_LOADCFG:
                {
+#ifndef DISABLE_PYTHON
                        if (m_ketsjiengine)
                        {
                                char mashal_path[512];
@@ -189,6 +195,7 @@ bool KX_GameActuator::Update()
                                }
                        }
                        break;
+#endif // DISABLE_PYTHON
                }
        default:
                ; /* do nothing? this is an internal error !!! */
@@ -198,8 +205,7 @@ bool KX_GameActuator::Update()
 }
 
 
-
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -238,3 +244,5 @@ PyAttributeDef KX_GameActuator::Attributes[] = {
        KX_PYATTRIBUTE_INT_RW("mode", KX_GAME_NODEF+1, KX_GAME_MAX-1, true, KX_GameActuator, m_mode),
        { NULL }        //Sentinel
 };
+
+#endif // DISABLE_PYTHON
index c72958bbc46fba68fdac022a14902eaa955feabb..9bb261fcba9a9339ab3fb8d3599e6e0af3beda02 100644 (file)
@@ -104,8 +104,10 @@ KX_GameObject::KX_GameObject(
        m_pGraphicController(NULL),
        m_xray(false),
        m_pHitObject(NULL),
-       m_isDeformable(false),
-       m_attr_dict(NULL)
+       m_isDeformable(false)
+#ifndef DISABLE_PYTHON
+       , m_attr_dict(NULL)
+#endif
 {
        m_ignore_activity_culling = false;
        m_pClient_info = new KX_ClientObjectInfo(this, KX_ClientObjectInfo::ACTOR);
@@ -149,11 +151,12 @@ KX_GameObject::~KX_GameObject()
        {
                delete m_pGraphicController;
        }
-       
+#ifndef DISABLE_PYTHON
        if (m_attr_dict) {
                PyDict_Clear(m_attr_dict); /* incase of circular refs or other weired cases */
                Py_DECREF(m_attr_dict);
        }
+#endif // DISABLE_PYTHON
 }
 
 KX_GameObject* KX_GameObject::GetClientObject(KX_ClientObjectInfo* info)
@@ -342,8 +345,11 @@ void KX_GameObject::ProcessReplica()
        m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info);
        m_pClient_info->m_gameobject = this;
        m_state = 0;
+
+#ifndef DISABLE_PYTHON
        if(m_attr_dict)
                m_attr_dict= PyDict_Copy(m_attr_dict);
+#endif
                
 }
 
@@ -1201,6 +1207,28 @@ CListValue* KX_GameObject::GetChildrenRecursive()
        return list;
 }
 
+/* ---------------------------------------------------------------------
+ * Some stuff taken from the header
+ * --------------------------------------------------------------------- */
+void KX_GameObject::Relink(GEN_Map<GEN_HashedPtr, void*> *map_parameter)
+{
+       // we will relink the sensors and actuators that use object references
+       // if the object is part of the replicated hierarchy, use the new
+       // object reference instead
+       SCA_SensorList& sensorlist = GetSensors();
+       SCA_SensorList::iterator sit;
+       for (sit=sensorlist.begin(); sit != sensorlist.end(); sit++)
+       {
+               (*sit)->Relink(map_parameter);
+       }
+       SCA_ActuatorList& actuatorlist = GetActuators();
+       SCA_ActuatorList::iterator ait;
+       for (ait=actuatorlist.begin(); ait != actuatorlist.end(); ait++)
+       {
+               (*ait)->Relink(map_parameter);
+       }
+}
+
 #ifdef USE_MATHUTILS
 
 /* These require an SGNode */
@@ -1377,8 +1405,8 @@ void KX_GameObject_Mathutils_Callback_Init(void)
 
 #endif // USE_MATHUTILS
 
+#ifndef DISABLE_PYTHON
 /* ------- python stuff ---------------------------------------------------*/
-
 PyMethodDef KX_GameObject::Methods[] = {
        {"applyForce", (PyCFunction)    KX_GameObject::sPyApplyForce, METH_VARARGS},
        {"applyTorque", (PyCFunction)   KX_GameObject::sPyApplyTorque, METH_VARARGS},
@@ -1454,23 +1482,6 @@ PyAttributeDef KX_GameObject::Attributes[] = {
        {NULL} //Sentinel
 };
 
-
-/*
-bool KX_GameObject::ConvertPythonVectorArgs(PyObject* args,
-                                                                                       MT_Vector3& pos,
-                                                                                       MT_Vector3& pos2)
-{
-       PyObject* pylist;
-       PyObject* pylist2;
-       bool error = (PyArg_ParseTuple(args,"OO",&pylist,&pylist2)) != 0;
-
-       pos = ConvertPythonPylist(pylist);
-       pos2 = ConvertPythonPylist(pylist2);
-               
-       return error;
-}
-*/
-
 PyObject* KX_GameObject::PyReplaceMesh(PyObject* args)
 {
        KX_Scene *scene = KX_GetActiveScene();
@@ -2776,29 +2787,6 @@ PyObject* KX_GameObject::Pyget(PyObject *args)
        return def;
 }
 
-/* --------------------------------------------------------------------- 
- * Some stuff taken from the header
- * --------------------------------------------------------------------- */
-void KX_GameObject::Relink(GEN_Map<GEN_HashedPtr, void*> *map_parameter)       
-{
-       // we will relink the sensors and actuators that use object references
-       // if the object is part of the replicated hierarchy, use the new
-       // object reference instead
-       SCA_SensorList& sensorlist = GetSensors();
-       SCA_SensorList::iterator sit;
-       for (sit=sensorlist.begin(); sit != sensorlist.end(); sit++)
-       {
-               (*sit)->Relink(map_parameter);
-       }
-       SCA_ActuatorList& actuatorlist = GetActuators();
-       SCA_ActuatorList::iterator ait;
-       for (ait=actuatorlist.begin(); ait != actuatorlist.end(); ait++)
-       {
-               (*ait)->Relink(map_parameter);
-       }
-}
-
-
 bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok, const char *error_prefix)
 {
        if (value==NULL) {
@@ -2854,3 +2842,4 @@ bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py
        
        return false;
 }
+#endif // DISABLE_PYTHON
index 4c4eed9ca717057a80b50df297e00baeebbfd456..48ba573e01b4961dc802a20ec7bd9feb6d5a97ae 100644 (file)
@@ -60,8 +60,10 @@ class PHY_IGraphicController;
 class PHY_IPhysicsEnvironment;
 struct Object;
 
+#ifndef DISABLE_PYTHON
 /* utility conversion function */
 bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok, const char *error_prefix);
+#endif
 
 #ifdef USE_MATHUTILS
 void KX_GameObject_Mathutils_Callback_Init(void);
@@ -114,6 +116,7 @@ public:
         */
        static KX_GameObject* GetClientObject(KX_ClientObjectInfo* info);
 
+#ifndef DISABLE_PYTHON
        // Python attributes that wont convert into CValue
        // 
        // there are 2 places attributes can be stored, in the CValue,
@@ -130,6 +133,7 @@ public:
        // * when assigning a value, first see if it can be a CValue, if it can remove the "m_attr_dict" and set the CValue
        // 
        PyObject*                                                       m_attr_dict; 
+#endif
 
        virtual void    /* This function should be virtual - derived classed override it */
        Relink(
@@ -796,7 +800,8 @@ public:
        
        CListValue* GetChildren();
        CListValue* GetChildrenRecursive();
-       
+
+#ifndef DISABLE_PYTHON
        /**
         * @section Python interface functions.
         */
@@ -894,22 +899,7 @@ public:
        /* getitem/setitem */
        static PyMappingMethods Mapping;
        static PySequenceMethods        Sequence;
-       
-private :
-
-       /**     
-        * Random internal function to convert python function arguments
-        * to 2 vectors.
-        * @return true if conversion was possible.
-        */
-
-               bool                                            
-       ConvertPythonVectorArgs(
-               PyObject* args,
-               MT_Vector3& pos,
-               MT_Vector3& pos2
-       );      
-
+#endif
 };
 
 
index f098b0bebf5d7c2f40ef239cb15f14141367202d..3c3d1d700c4bce8fe9c24009fbfe593555b4d848 100644 (file)
@@ -53,7 +53,9 @@ public:
        */
        virtual void ConvertScene(
                class KX_Scene* destinationscene,
+#ifndef DISABLE_PYTHON
                PyObject* dictobj,
+#endif
                class RAS_IRenderTools* rendertools, 
                class RAS_ICanvas*  canvas)=0;
        
index d7f800fe5bd3ffa946a197ce590dda59a3037631..58769b94d9b6f3a6b28a6885e5f5671cf3d6e712 100644 (file)
@@ -404,12 +404,13 @@ int KX_IpoActuator::string2mode(char* modename) {
        return res;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
 
 
-
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_IpoActuator::Type = {
        PyVarObject_HEAD_INIT(NULL, 0)
@@ -451,4 +452,6 @@ PyAttributeDef KX_IpoActuator::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index e95676ff9d23267884c9b880ad0a4e577a8ac000..734b74b7456cfbd1a0a009f6355bae61bb430c68 100644 (file)
@@ -112,7 +112,9 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system)
        m_rendertools(NULL),
        m_sceneconverter(NULL),
        m_networkdevice(NULL),
+#ifndef DISABLE_PYTHON
        m_pythondictionary(NULL),
+#endif
        m_keyboarddevice(NULL),
        m_mousedevice(NULL),
 
@@ -231,7 +233,7 @@ void KX_KetsjiEngine::SetRasterizer(RAS_IRasterizer* rasterizer)
        m_rasterizer = rasterizer;
 }
 
-
+#ifndef DISABLE_PYTHON
 /*
  * At the moment the GameLogic module is imported into 'pythondictionary' after this function is called.
  * if this function ever changes to assign a copy, make sure the game logic module is imported into this dictionary before hand.
@@ -241,7 +243,7 @@ void KX_KetsjiEngine::SetPythonDictionary(PyObject* pythondictionary)
        MT_assert(pythondictionary);
        m_pythondictionary = pythondictionary;
 }
-
+#endif
 
 
 void KX_KetsjiEngine::SetSceneConverter(KX_ISceneConverter* sceneconverter)
@@ -604,7 +606,9 @@ else
                                m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true);
                                SG_SetActiveStage(SG_STAGE_PHYSICS1);
                                // set Python hooks for each scene
+#ifndef DISABLE_PYTHON
                                PHY_SetActiveEnvironment(scene->GetPhysicsEnvironment());
+#endif
                                KX_SetActiveScene(scene);
        
                                scene->GetPhysicsEnvironment()->endFrame();
@@ -706,7 +710,9 @@ else
                                m_suspendeddelta = scene->getSuspendedDelta();
                                
                                // set Python hooks for each scene
+#ifndef DISABLE_PYTHON
                                PHY_SetActiveEnvironment(scene->GetPhysicsEnvironment());
+#endif
                                KX_SetActiveScene(scene);
                                
                                m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
@@ -1612,7 +1618,9 @@ KX_Scene* KX_KetsjiEngine::CreateScene(const STR_String& scenename)
                                                                          scene);
 
        m_sceneconverter->ConvertScene(tmpscene,
+#ifndef DISABLE_PYTHON
                                                          m_pythondictionary,
+#endif
                                                          m_rendertools,
                                                          m_canvas);
 
index 373e8bf218c459e5e5a07bd68631e3f5b918bab5..9cfca850bf3ef9d0e9486978dec0f33294d8a8e4 100644 (file)
@@ -70,7 +70,9 @@ private:
        class RAS_IRenderTools*                         m_rendertools;
        class KX_ISceneConverter*                       m_sceneconverter;
        class NG_NetworkDeviceInterface*                m_networkdevice;
+#ifndef DISABLE_PYTHON
        PyObject*                                       m_pythondictionary;
+#endif
        class SCA_IInputDevice*                         m_keyboarddevice;
        class SCA_IInputDevice*                         m_mousedevice;
        class KX_Dome*                                          m_dome; // dome stereo mode
@@ -201,7 +203,9 @@ public:
        void                    SetCanvas(RAS_ICanvas* canvas);
        void                    SetRenderTools(RAS_IRenderTools* rendertools);
        void                    SetRasterizer(RAS_IRasterizer* rasterizer);
+#ifndef DISABLE_PYTHON
        void                    SetPythonDictionary(PyObject* pythondictionary);
+#endif
        void                    SetSceneConverter(KX_ISceneConverter* sceneconverter);
        void                    SetGame2IpoMode(bool game2ipo,int startFrame);
 
index 85c495bc2bd21d795f54cd11f342637e1f46f8f7..a0ecac178b35a603d42a41e3cd57c0a18b1124e2 100644 (file)
@@ -264,6 +264,7 @@ void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras)
        GPU_lamp_shadow_buffer_unbind(lamp);
 }
 
+#ifndef DISABLE_PYTHON
 /* ------------------------------------------------------------------------- */
 /* Python Integration Hooks                                                                     */
 /* ------------------------------------------------------------------------- */
@@ -384,3 +385,4 @@ int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attr
 
        return PY_SET_ATTR_SUCCESS;
 }
+#endif // DISABLE_PYTHON
index 0b7ccbe81abcebdf5359e297eb7af56dbbe035f6..74d8abcfeacdb645eef1227f7987d0ee475b1a49 100644 (file)
@@ -65,12 +65,14 @@ public:
        void UnbindShadowBuffer(class RAS_IRasterizer *ras);
        void Update();
 
+#ifndef DISABLE_PYTHON
        /* attributes */
        static PyObject*        pyattr_get_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int                      pyattr_set_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
        static PyObject*        pyattr_get_typeconst(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int                      pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
+#endif
 
        virtual bool IsLight(void) { return true; }
 };
index 744fdb75796c44cae6f821c028003096e2e59ce6..a4815c5bd20b786f7373c3dd2c3591ee00a8cd80 100644 (file)
@@ -26,6 +26,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
+#ifndef DISABLE_PYTHON
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -309,3 +311,5 @@ bool ConvertPythonToMesh(PyObject * value, RAS_MeshObject **object, bool py_none
        
        return false;
 }
+
+#endif // DISABLE_PYTHON
index 55684aa5ee9d7358802155dcebad393d4613c74f..12174f158f13bff5bc927e1fbf5b8025c7022b36 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __KX_MESHPROXY
 #define __KX_MESHPROXY
 
+#ifndef DISABLE_PYTHON
+
 #include "SCA_IObject.h"
 
 /* utility conversion function */
@@ -72,5 +74,7 @@ public:
        static PyObject * pyattr_get_numPolygons(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
 };
 
+#endif // DISABLE_PYTHON
+
 #endif //__KX_MESHPROXY
 
index 8abc4f6b897d3440f5779bf2b5337ebc760ba60c..2dbaf3c90815f3125ff5ad272ed29f61fe52349c 100644 (file)
@@ -340,6 +340,8 @@ const MT_Vector3& KX_MouseFocusSensor::HitNormal() const
        return m_hitNormal;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -426,7 +428,7 @@ PyObject* KX_MouseFocusSensor::pyattr_get_hit_normal(void *self_v, const KX_PYAT
        return PyObjectFrom(self->HitNormal());
 }
 
-
+#endif // DISABLE_PYTHON
 
 /* eof */
 
index 7b53557467f9049f6028693e3ade26daefdf6750..d4063ef1d164328400ba14dfd7def2eef54647b9 100644 (file)
@@ -86,6 +86,8 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
        const MT_Point3& HitPosition() const;
        const MT_Vector3& HitNormal() const;
        
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -98,6 +100,8 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
        static PyObject*        pyattr_get_hit_position(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_hit_normal(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
                
+#endif // DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        SCA_IObject*    m_hitObject;
        void*                   m_hitObject_Last; /* only use for comparison, never access */
index c6a6304cb2ca769e63132f79bfeb43246c17f5bd..9cb0faab046ac9d878775b63218cd03faf28a134 100644 (file)
@@ -245,13 +245,12 @@ bool      KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData
        return false; // was DT_CONTINUE; but this was defined in Sumo as false
 }
 
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python Functions                                                                                                                     */
 /* ------------------------------------------------------------------------- */
 
-//No methods
-
 /* ------------------------------------------------------------------------- */
 /* Python Integration Hooks                                                  */
 /* ------------------------------------------------------------------------- */
@@ -288,3 +287,5 @@ PyAttributeDef KX_NearSensor::Attributes[] = {
        KX_PYATTRIBUTE_FLOAT_RW_CHECK("resetDistance", 0, 100, KX_NearSensor, m_ResetMargin, CheckResetDistance),
        {NULL} //Sentinel
 };
+
+#endif // DISABLE_PYTHON
index 4f0247d209d9193773f1f7a95329f998678bdab3..4bc4a7d15249d8d1d6967e081a80d42fddcbf05e 100644 (file)
@@ -78,6 +78,8 @@ public:
        virtual bool    BroadPhaseSensorFilterCollision(void*obj1,void*obj2) { return false; };
        virtual sensortype GetSensorType() { return ST_NEAR; }
 
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -97,6 +99,8 @@ public:
                return 0;
        }
 
+#endif // DISABLE_PYTHON
+
 };
 
 #endif //KX_NEARSENSOR_H
index 924e4a47008c4ca5c1eaecde755d449534972659..03a80fdbc287eda4dc44406e5456442b013d14f3 100644 (file)
@@ -317,7 +317,7 @@ bool KX_ObjectActuator::isValid(KX_ObjectActuator::KX_OBJECT_ACT_VEC_TYPE type)
        return res;
 }
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -641,4 +641,6 @@ int KX_ObjectActuator::pyattr_set_reference(void *self, const struct KX_PYATTRIB
        return PY_SET_ATTR_SUCCESS;
 }
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index 7a8c7de16b120fa526d6215f4896ee8fb0487848..900408a30ab4433ebb799fc0465655e55caf8d8e 100644 (file)
@@ -157,7 +157,7 @@ public:
                }
        virtual bool Update();
 
-
+#ifndef DISABLE_PYTHON
 
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
@@ -216,6 +216,9 @@ public:
 
                return 0;
        }
+
+#endif // DISABLE_PYTHON
+
 };
 
 #endif //__KX_OBJECTACTUATOR
index a4a6b67ad10e910306c7cbd3e7beef136c8eca29..b70aa43ae9f28934f5ee6941fdd0819e31b91254 100644 (file)
@@ -134,6 +134,8 @@ bool KX_ParentActuator::Update()
        return false;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -201,4 +203,6 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE
        return PY_SET_ATTR_SUCCESS;
 }
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index f750affc8a1247d154a67839e15586fefb677ba7..501533486cfbd83bbc3e5744b35ec10071c234cd 100644 (file)
@@ -77,6 +77,8 @@ class KX_ParentActuator : public SCA_IActuator
        virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map);
        virtual bool UnlinkObject(SCA_IObject* clientobj);
        
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -85,6 +87,8 @@ class KX_ParentActuator : public SCA_IActuator
        static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
        
+#endif // DISABLE_PYTHON
+
 }; /* end of class KX_ParentActuator : public SCA_PropertyActuator */
 
 #endif
index edb190026719d5895d07086b1e042bdd6711744d..0e149783338a180deec654e07667c3d4fac0350c 100644 (file)
@@ -26,7 +26,7 @@
  *
  * ***** END GPL LICENSE BLOCK *****
  */
-#include <Python.h>
+
 #include "PyObjectPlus.h"
 
 #include "KX_PhysicsObjectWrapper.h"
@@ -50,6 +50,7 @@ KX_PhysicsObjectWrapper::~KX_PhysicsObjectWrapper()
 {
 }
 
+#ifndef DISABLE_PYTHON
 
 PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* args)
 {
@@ -141,3 +142,5 @@ PyMethodDef KX_PhysicsObjectWrapper::Methods[] = {
        {"setActive",(PyCFunction) KX_PhysicsObjectWrapper::sPySetActive, METH_VARARGS},
        {NULL,NULL} //Sentinel
 };
+
+#endif
index fa6fd1d1f2a0dd83759e5817c75236a37edc3c35..6fba1d0d95f84443b212489b4828a7f5262f13b8 100644 (file)
@@ -39,11 +39,15 @@ public:
        KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv);
        virtual ~KX_PhysicsObjectWrapper();
        
+#ifndef DISABLE_PYTHON
+
        KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetPosition);
        KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetLinearVelocity);
        KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetAngularVelocity);
        KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetActive);
 
+#endif // DISABLE_PYTHON
+
 private:
        class PHY_IPhysicsController*   m_ctrl;
        PHY_IPhysicsEnvironment* m_physenv;
index af8e0510a112f09cbbe0a918c7b1ad31ad8c1977..3a9052bd95e813197ecf48be7b3004b138ebd109 100644 (file)
@@ -26,6 +26,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
+#ifndef DISABLE_PYTHON
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -271,3 +273,5 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterial,
                return mat->GetProxy();
        }
 }
+
+#endif // DISABLE_PYTHON
index e619617d3126f6aa0a43dab498be3e35b52804f4..e7584727a77bcfda5e446defc6086869100aabf1 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __KX_POLYROXY
 #define __KX_POLYPROXY
 
+#ifndef DISABLE_PYTHON
+
 #include "SCA_IObject.h"
 
 class KX_PolyProxy     : public CValue
@@ -65,5 +67,7 @@ public:
 
 };
 
+#endif // DISABLE_PYTHON
+
 #endif //__KX_POLYPROXY
 
index 5b4322ae4cdb91ddabca1a4c65f122a6f1a9090c..54a0f51aa7c09248978a091d3812b5b612491bb1 100644 (file)
@@ -58,7 +58,9 @@ KX_PolygonMaterial::KX_PolygonMaterial()
        m_tface(NULL),
        m_mcol(NULL),
        m_material(NULL),
+#ifndef DISABLE_PYTHON
        m_pymaterial(NULL),
+#endif
        m_pass(0)
 {
 }
@@ -92,21 +94,27 @@ void KX_PolygonMaterial::Initialize(
        m_tface = tface;
        m_mcol = mcol;
        m_material = ma;
+#ifndef DISABLE_PYTHON
        m_pymaterial = 0;
+#endif
        m_pass = 0;
 }
 
 KX_PolygonMaterial::~KX_PolygonMaterial()
 {
+#ifndef DISABLE_PYTHON
        if (m_pymaterial)
        {
                Py_DECREF(m_pymaterial);
        }
+#endif // DISABLE_PYTHON
 }
 
 bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const 
 {
        bool dopass = false;
+
+#ifndef DISABLE_PYTHON
        if (m_pymaterial)
        {
                PyObject *pyRasty = PyCObject_FromVoidPtr((void*)rasty, NULL);  /* new reference */
@@ -126,6 +134,7 @@ bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingI
                }
        }
        else
+#endif // DISABLE_PYTHON
        {
                switch (m_pass++)
                {
@@ -196,6 +205,7 @@ void KX_PolygonMaterial::GetMaterialRGBAColor(unsigned char *rgba) const
                RAS_IPolyMaterial::GetMaterialRGBAColor(rgba);
 }
 
+#ifndef DISABLE_PYTHON
 
 //----------------------------------------------------------------------------
 //Python
@@ -386,3 +396,5 @@ int KX_PolygonMaterial::pyattr_set_specular(void *self_v, const KX_PYATTRIBUTE_D
        self->m_specular= vec;
        return PY_SET_ATTR_SUCCESS;
 }
+
+#endif // DISABLE_PYTHON
index dc42bd2f81bdbb37e8f6d7b93c138170972f72df..dba12acee7f018475e73f94eea615af03801c5dc 100644 (file)
@@ -57,7 +57,10 @@ private:
        MTFace*                 m_tface;
        unsigned int*   m_mcol;
        Material*               m_material;
+
+#ifndef DISABLE_PYTHON
        PyObject*               m_pymaterial;
+#endif
 
        mutable int             m_pass;
 public:
@@ -114,6 +117,7 @@ public:
        }
        virtual void GetMaterialRGBAColor(unsigned char *rgba) const;
 
+#ifndef DISABLE_PYTHON
        KX_PYMETHOD_DOC(KX_PolygonMaterial, updateTexture);
        KX_PYMETHOD_DOC(KX_PolygonMaterial, setTexture);
        KX_PYMETHOD_DOC(KX_PolygonMaterial, activate);
@@ -133,6 +137,7 @@ public:
        static int                      pyattr_set_diffuse(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
        static PyObject*        pyattr_get_specular(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);   
        static int                      pyattr_set_specular(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+#endif
 };
 
 #endif // __KX_POLYGONMATERIAL_H__
index 04cec3c910639e06fd9206b64dbf605e39721606..05513d85fc6b49715e1f12ebf23c7a3f12c1a594 100644 (file)
@@ -41,6 +41,8 @@
 #include <config.h>
 #endif
 
+#ifndef DISABLE_PYTHON
+
 // nasty glob variable to connect scripting language
 // if there is a better way (without global), please do so!
 static PHY_IPhysicsEnvironment* g_CurrentActivePhysicsEnvironment = NULL;
@@ -661,3 +663,5 @@ PHY_IPhysicsEnvironment*    PHY_GetActiveEnvironment()
        return g_CurrentActivePhysicsEnvironment;
 }
 
+#endif // DISABLE_PYTHON
+
index b898cba3796fea1a95d93d92855a7ad27f4c9bc2..7eb2fe8909c2efd758c09860d99f8820646becce 100644 (file)
 #ifndef PHY_PYTHON_CONSTRAINTBINDING
 #define PHY_PYTHON_CONSTRAINTBINDING
 
+#ifndef DISABLE_PYTHON
+
 #include <Python.h>
 
 PyObject*                              initPythonConstraintBinding();
 void   PHY_RemovePythonConstraintBinding();
 void   PHY_SetActiveEnvironment(class  PHY_IPhysicsEnvironment* env);
 PHY_IPhysicsEnvironment*       PHY_GetActiveEnvironment();
-
+#endif // DISABLE_PYTHON
 
 #endif //PHY_PYTHON_CONSTRAINTBINDING
 
index a41dab194dd224e51c6d8f14663b2ca4f82ab9a3..aef29286f4e7933728a4755447f81bf60cc93543 100644 (file)
@@ -36,6 +36,8 @@
 #pragma warning (disable : 4786)
 #endif //WIN32
 
+#ifndef DISABLE_PYTHON
+
 #include "MT_Vector3.h"
 #include "MT_Vector4.h"
 #include "MT_Matrix4x4.h"
@@ -191,3 +193,5 @@ PyObject* PyObjectFrom(const MT_Tuple2 &vec)
        return list;
 #endif
 }
+
+#endif // DISABLE_PYTHON
index 1ce8bcafbb69af481e226f0eb2fdcb6c720e9b9a..0ad91799983f86d118bdc65624112cc4176f042a 100644 (file)
@@ -42,6 +42,7 @@
 #include "KX_Python.h"
 #include "PyObjectPlus.h"
 
+#ifndef DISABLE_PYTHON
 #ifdef USE_MATHUTILS
 extern "C" {
 #include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */
@@ -237,3 +238,5 @@ PyObject* PyObjectFrom(const MT_Quaternion &qrot);
 PyObject* PyObjectFrom(const MT_Tuple4 &pos);
 
 #endif
+
+#endif // DISABLE_PYTHON
index 36126b26a5963eaf3786d638166df03b9c0d90a1..f09cdd7d72077646d489198c53ea5957837b0414 100644 (file)
 #pragma warning (disable : 4786)
 #endif //WIN32
 
+#ifndef DISABLE_PYTHON
+
 extern "C" {
        #include "bpy_internal_import.h"  /* from the blender python api, but we want to import text too! */
        #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use.
        #include "Geometry.h" // Blender.Geometry module copied here so the blenderlayer can use.
        #include "BGL.h"
+
+       #include "marshal.h" /* python header for loading/saving dicts */
 }
+#endif
 
 #include "KX_PythonInit.h"
 //python physics binding
@@ -89,17 +94,7 @@ extern "C" {
 #include "DNA_ID.h"
 #include "DNA_scene_types.h"
 
-
-#include "marshal.h" /* python header for loading/saving dicts */
-
 #include "PHY_IPhysicsEnvironment.h"
-// FIXME: Enable for access to blender python modules.  This is disabled because
-// python has dependencies on a lot of other modules and is a pain to link.
-//#define USE_BLENDER_PYTHON
-#ifdef USE_BLENDER_PYTHON
-//#include "BPY_extern.h"
-#endif 
-
 #include "BKE_main.h"
 #include "BKE_utildefines.h"
 #include "BKE_global.h"
@@ -122,15 +117,34 @@ static KX_KetsjiEngine*   gp_KetsjiEngine = NULL;
 static RAS_IRasterizer* gp_Rasterizer = NULL;
 static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = "";
 static char gp_GamePythonPathOrig[FILE_MAXDIR + FILE_MAXFILE] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save
-static PyObject *gp_OrigPythonSysPath= NULL;
-static PyObject *gp_OrigPythonSysModules= NULL;
 
+void KX_SetActiveScene(class KX_Scene* scene)
+{
+       gp_KetsjiScene = scene;
+}
+
+class KX_Scene* KX_GetActiveScene()
+{
+       return gp_KetsjiScene;
+}
+
+class KX_KetsjiEngine* KX_GetActiveEngine()
+{
+       return gp_KetsjiEngine;
+}
+
+/* why is this in python? */
 void   KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,const MT_Vector3& color)
 {
        if (gp_Rasterizer)
                gp_Rasterizer->DrawDebugLine(from,to,color);
 }
 
+#ifndef DISABLE_PYTHON
+
+static PyObject *gp_OrigPythonSysPath= NULL;
+static PyObject *gp_OrigPythonSysModules= NULL;
+
 /* Macro for building the keyboard translation */
 //#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, PyLong_FromSsize_t(SCA_IInputDevice::KX_##name))
 #define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, item=PyLong_FromSsize_t(name)); Py_DECREF(item)
@@ -1950,21 +1964,6 @@ PyObject* initBGL()
        return BGL_Init();
 }
 
-void KX_SetActiveScene(class KX_Scene* scene)
-{
-       gp_KetsjiScene = scene;
-}
-
-class KX_Scene* KX_GetActiveScene()
-{
-       return gp_KetsjiScene;
-}
-
-class KX_KetsjiEngine* KX_GetActiveEngine()
-{
-       return gp_KetsjiEngine;
-}
-
 // utility function for loading and saving the globalDict
 int saveGamePythonConfig( char **marshal_buffer)
 {
@@ -2065,3 +2064,5 @@ void resetGamePythonPath()
 {
        gp_GamePythonPathOrig[0] = '\0';
 }
+
+#endif // DISABLE_PYTHON
index 8f102d13a18abea350d42cf702f01be665a196d9..ad3cd15ab4ab75c89172ee727139d9ba723d0c01 100644 (file)
@@ -39,7 +39,7 @@ typedef enum {
 
 extern bool gUseVisibilityTemp;
 
-
+#ifndef DISABLE_PYTHON
 PyObject*      initGameLogic(class KX_KetsjiEngine *engine, class KX_Scene* ketsjiscene);
 PyObject*      initGameKeys();
 PyObject*      initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas);
@@ -57,6 +57,7 @@ void          resetGamePythonPath();
 void           pathGamePythonConfig( char *path );
 int                    saveGamePythonConfig( char **marshal_buffer);
 int                    loadGamePythonConfig(char *marshal_buffer, int marshal_length);
+#endif
 
 class KX_KetsjiEngine;
 class KX_Scene;
index c2c33918172774b828646eeb14c1802897147219..dd63163c663f79cb450c233da82e0acd86140818 100644 (file)
@@ -32,6 +32,8 @@
 #ifndef _adr_py_init_types_h_                          // only process once,
 #define _adr_py_init_types_h_                          // even if multiply included
 
+#ifndef DISABLE_PYTHON
+
 /* Only for Class::Parents */
 #include "BL_BlenderShader.h"
 #include "BL_ShapeActionActuator.h"
@@ -250,4 +252,6 @@ void initPyTypes(void)
 #endif
 }
 
+#endif // DISABLE_PYTHON
+
 #endif
index 6da79be930127612e0c3414dcefb291b137428c8..5b368d240f15d7cdfb702881517b2084487768ee 100644 (file)
@@ -30,6 +30,8 @@
 #ifndef _adr_py_init_types_h_                          // only process once,
 #define _adr_py_init_types_h_                          // even if multiply included
 
+#ifndef DISABLE_PYTHON
 void initPyTypes(void);
+#endif
 
 #endif
index f7ad7acb252d0676f4315883f5a7b33aa630b1f2..5b7e770f4e6b1035b42af2f3917f7c7ba10405e2 100644 (file)
@@ -28,6 +28,7 @@
  * Readonly sequence wrapper for lookups on logic bricks
  */
 
+#ifndef DISABLE_PYTHON
 
 #include "KX_PythonSeq.h"
 #include "KX_GameObject.h"
@@ -508,3 +509,5 @@ PyTypeObject KX_PythonSeq_Type = {
        NULL,                       /* PyObject *tp_weaklist; */
        NULL
 };
+
+#endif // DISABLE_PYTHON
index 34243aa9b9cad36ab41391a545edd787962fa9e8..22b968e9362f144429f451225a8b5588c1a768b0 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef _adr_py_seq_h_                         // only process once,
 #define _adr_py_seq_h_                         // even if multiply included
 
+#ifndef DISABLE_PYTHON
+
 #include "PyObjectPlus.h"
 
 // -------------------------
@@ -59,4 +61,6 @@ typedef struct {
 
 PyObject *KX_PythonSeq_CreatePyObject(PyObject *base, short type);
 
+#endif // DISABLE_PYTHON
+
 #endif // _adr_py_seq_h_
index eb127be804433aa2cafe8c0744b09b2f6a718686..de5c0533ad371e0471d567936632333b1a1fe9fb 100644 (file)
@@ -176,7 +176,7 @@ void KX_RadarSensor::SynchronizeTransform()
 /* Python Functions                                                                                                                     */
 /* ------------------------------------------------------------------------- */
 
-/* none */
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python Integration Hooks                                                  */
@@ -216,3 +216,4 @@ PyAttributeDef KX_RadarSensor::Attributes[] = {
        {NULL} //Sentinel
 };
 
+#endif // DISABLE_PYTHON
index 1f36945ccaafacbba671e6ea96739230189371c6..4902315fd47427ac98577ee7e9bb85bd456f5f77 100644 (file)
@@ -43,6 +43,8 @@
 #include "KX_IPhysicsController.h"
 #include "PHY_IPhysicsController.h"
 
+#include <stdio.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -311,7 +313,7 @@ bool KX_RaySensor::Evaluate()
        return result;
 }
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -366,3 +368,5 @@ PyObject* KX_RaySensor::pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_
 
        Py_RETURN_NONE;
 }
+
+#endif // DISABLE_PYTHON
index d3e92a142142a9f87ee06ab5d90410c23c8ea70e..39b447b5657c7314c22a7e85c724347bfc36e207 100644 (file)
@@ -84,10 +84,13 @@ public:
                KX_RAY_AXIS_NEG_Z
        };
        
+#ifndef DISABLE_PYTHON
 
        /* Attributes */
        static PyObject* pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        
+#endif // DISABLE_PYTHON
+
 };
 
 #endif //__KX_RAYSENSOR_H
index c1e74070d72f8288e5c24e4c38a493579e3233cc..fb96834c8366c215ffa225104394dd8f21c669d2 100644 (file)
@@ -163,6 +163,7 @@ void KX_SCA_AddObjectActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map)
        }
 }
 
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -242,6 +243,14 @@ PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, con
                return actuator->m_lastCreatedObject->GetProxy();
 }
 
+PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject()
+{
+       InstantAddObject();
+
+       Py_RETURN_NONE;
+}
+
+#endif // DISABLE_PYTHON
 
 void   KX_SCA_AddObjectActuator::InstantAddObject()
 {
@@ -277,10 +286,3 @@ void       KX_SCA_AddObjectActuator::InstantAddObject()
                replica->Release();
        }
 }
-
-PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject()
-{
-       InstantAddObject();
-
-       Py_RETURN_NONE;
-}
index 7137ba5209eabd678254eace7aaafaf6969f6e3b..4cccc406b584b5874d2e2ea6212035a10c3c1109 100644 (file)
@@ -115,12 +115,16 @@ public:
 
        void    InstantAddObject();
 
+#ifndef DISABLE_PYTHON
+
        KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,InstantAddObject);
 
        static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
        static PyObject* pyattr_get_objectLastCreated(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        
+#endif // DISABLE_PYTHON
+
 }; /* end of class KX_SCA_AddObjectActuator : public KX_EditObjectActuator */
 
 #endif
index 73c85ad07b3bedae6980539e6be1da49ee4e3737..07a0df8bf773997458d15eaa999b10b0ef5911aa 100644 (file)
@@ -41,6 +41,8 @@
 #include <config.h>
 #endif
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -79,6 +81,8 @@ PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif // DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Native functions                                                          */
 /* ------------------------------------------------------------------------- */
index e7dc71d9b274b7be633cb42c50039e5dc8c0d9a3..b37ea4d57c029f37cadce36b5869d5653d56a8a5 100644 (file)
@@ -84,7 +84,7 @@ CValue* KX_SCA_EndObjectActuator::GetReplica()
        return replica;
 };
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions : integration hooks                                      */
@@ -120,4 +120,6 @@ PyAttributeDef KX_SCA_EndObjectActuator::Attributes[] = {
        { NULL }        //Sentinel
 };
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index e118972edc8f77773ad65425ca517fbb48238f71..967bbfcdf1d053f80a4529dee61cd5b455535ea5 100644 (file)
@@ -44,6 +44,8 @@
 #include <config.h>
 #endif
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -112,6 +114,8 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh,
        Py_RETURN_NONE;
 }
 
+#endif // DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Native functions                                                          */
 /* ------------------------------------------------------------------------- */
index e5482c29aa74ca2a4bcb25a3818ac72d168e458d..47c823afa9fbe32a9c011eb0621228904897fd3b 100644 (file)
@@ -74,6 +74,8 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator
 
        void    InstantReplaceMesh();
 
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -83,6 +85,8 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator
 
        KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,instantReplaceMesh);
 
+#endif // DISABLE_PYTHON
+
 }; 
 
 #endif
index 140be3fb3db8edad7c2bbb15ebaf1bcde2c06312..94f62b5b4b60bc210b32125c8d52751f6a4e6ef2 100644 (file)
@@ -94,6 +94,8 @@
 
 #include "KX_Light.h"
 
+#include <stdio.h>
+
 void* KX_SceneReplicationFunc(SG_IObject* node,void* gameobj,void* scene)
 {
        KX_GameObject* replica = ((KX_Scene*)scene)->AddNodeReplicaObject(node,(KX_GameObject*)gameobj);
@@ -207,7 +209,9 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
 
        m_bucketmanager=new RAS_BucketManager();
        
+#ifndef DISABLE_PYTHON
        m_attr_dict = PyDict_New(); /* new ref */
+#endif
 }
 
 
@@ -256,8 +260,11 @@ KX_Scene::~KX_Scene()
        {
                delete m_bucketmanager;
        }
+
+#ifndef DISABLE_PYTHON
        PyDict_Clear(m_attr_dict);
        Py_DECREF(m_attr_dict);
+#endif
 }
 
 RAS_BucketManager* KX_Scene::GetBucketManager()
@@ -1604,6 +1611,8 @@ double KX_Scene::getSuspendedDelta()
        return m_suspendeddelta;
 }
 
+#ifndef DISABLE_PYTHON
+
 //----------------------------------------------------------------------------
 //Python
 
@@ -1867,3 +1876,5 @@ KX_PYMETHODDEF_DOC(KX_Scene, get, "")
        Py_INCREF(def);
        return def;
 }
+
+#endif // DISABLE_PYTHON
index 3e0dc303d72ebe2a93417cb5beb2be71e0bc2b5b..da72ba2ec983ec7fb146072f4a43a460af2749aa 100644 (file)
@@ -90,7 +90,10 @@ struct KX_ClientObjectInfo;
 class KX_Scene : public PyObjectPlus, public SCA_IScene
 {
        Py_Header;
+
+#ifndef DISABLE_PYTHON
        PyObject*       m_attr_dict;
+#endif
 
        struct CullingInfo {
                int m_layer;
@@ -517,6 +520,7 @@ public:
         */
        void SetNodeTree(SG_Tree* root);
 
+#ifndef DISABLE_PYTHON
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -539,6 +543,8 @@ public:
        static PyMappingMethods Mapping;
        static PySequenceMethods        Sequence;
 
+#endif
+
        /**
         * Sets the time the scene was suspended
         */ 
index c7721c480e01c26b11fe607156b6db161dea5b48..e0b6ab1a34cb1188d3969c8e9fd6ff362fdbd05c 100644 (file)
@@ -214,7 +214,7 @@ KX_Scene* KX_SceneActuator::FindScene(char * sceneName)
 }
 
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -287,4 +287,6 @@ int KX_SceneActuator::pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_
        return PY_SET_ATTR_SUCCESS;
 }
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index e979a8ce559a4ae29d49b9dac6f3ff8c0fd0ce5b..e11a94798c9ba10e1b37d22ff073317bc6397e70 100644 (file)
@@ -87,6 +87,8 @@ class KX_SceneActuator : public SCA_IActuator
 
        virtual bool Update();
        
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -94,6 +96,8 @@ class KX_SceneActuator : public SCA_IActuator
        static PyObject* pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static int pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
 
+#endif // DISABLE_PYTHON
+
 }; /* end of class KXSceneActuator */
 
 #endif
index 9d261137497f09ce39a3a61b46f89731db63ca51..c97b4618f2806a6cc4d40e8f6fc731c74578bf4f 100644 (file)
@@ -264,7 +264,7 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
 }
 
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -416,3 +416,5 @@ int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATT
 
        return PY_SET_ATTR_SUCCESS;
 }
+
+#endif // DISABLE_PYTHON
index 43198f1a253a986d9d29766884620668fd542d79..de862473aac8fdcc52a5d974a10afc4943c25d47 100644 (file)
@@ -93,6 +93,8 @@ public:
        CValue* GetReplica();
        void ProcessReplica();
 
+#ifndef DISABLE_PYTHON
+
        /* -------------------------------------------------------------------- */
        /* Python interface --------------------------------------------------- */
        /* -------------------------------------------------------------------- */
@@ -110,6 +112,9 @@ public:
        static PyObject* pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject* pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
+
+#endif // DISABLE_PYTHON
+
 };
 
 #endif //__KX_SOUNDACTUATOR
index 60812220953b0076dfddc5b2c18b2e131d08656d..21ed087a3c1bf5a68bd73470e3dc1dfa302034dd 100644 (file)
@@ -128,6 +128,7 @@ void KX_StateActuator::Activate(SG_DList& head)
        }
 }
 
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -167,3 +168,5 @@ PyAttributeDef KX_StateActuator::Attributes[] = {
        KX_PYATTRIBUTE_INT_RW("mask",0,0x3FFFFFFF,false,KX_StateActuator,m_mask),
        { NULL }        //Sentinel
 };
+
+#endif // DISABLE_PYTHON
index cde67787e2f84e8db17320bab99c3deea9c55758..2ce5b8d1496525d6f15cf8db4705e1ee93a84d97 100644 (file)
@@ -287,6 +287,7 @@ bool        KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_Coll
        return false; // was DT_CONTINUE but this was defined in sumo as false.
 }
 
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -345,5 +346,6 @@ PyObject* KX_TouchSensor::pyattr_get_object_hit_list(void *self_v, const KX_PYAT
        return self->m_colliders->GetProxy();
 }
 
+#endif
 
 /* eof */
index ad1830e05c94509b2efd9167698d2fa8c65655da..ae5b68da8450445cbab05a033b48da1bf6909142 100644 (file)
@@ -116,13 +116,16 @@ public:
 
        // todo: put some info for collision maybe
 
+#ifndef DISABLE_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
        
        static PyObject*        pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
-       
+
+#endif
        
 };
 
index ace1cf8a6f42aed2b8da8b11fae84e14b836572f..01c7244b9d0acdf525f860816b44606d6083a226 100644 (file)
@@ -421,14 +421,12 @@ bool KX_TrackToActuator::Update(double curtime, bool frame)
        return result;
 }
 
-
+#ifndef DISABLE_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
 
-
-
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject KX_TrackToActuator::Type = {
        PyVarObject_HEAD_INIT(NULL, 0)
@@ -492,4 +490,6 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT
        return PY_SET_ATTR_SUCCESS;
 }
 
+#endif // DISABLE_PYTHON
+
 /* eof */
index bbfc1d17576d9d514a52df830dab378d371fbd7b..880c3712e1fd385f0c41746612aeefbdbfcb88e2 100644 (file)
@@ -69,12 +69,16 @@ class KX_TrackToActuator : public SCA_IActuator
        virtual void Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map);
        virtual bool Update(double curtime, bool frame);
 
+#ifndef DISABLE_PYTHON
+
        /* Python part */
 
        /* These are used to get and set m_ob */
        static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
        static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
        
+#endif // DISABLE_PYTHON
+
 }; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */
 
 #endif
index 1f46cbf53be09a2240d0c3abc845fffd45e82421..4adeefe32b4eb092d38af2d6fd816374e2ac8626 100644 (file)
@@ -1,6 +1,5 @@
 
 
-#include <Python.h>
 #include "PyObjectPlus.h"
 
 #include "KX_VehicleWrapper.h"
@@ -34,6 +33,7 @@ KX_VehicleWrapper::~KX_VehicleWrapper()
        m_motionStates.clear();
 }
 
+#ifndef DISABLE_PYTHON
 
 PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* args)
 {
@@ -322,3 +322,5 @@ PyMethodDef KX_VehicleWrapper::Methods[] = {
 PyAttributeDef KX_VehicleWrapper::Attributes[] = {
        { NULL }        //Sentinel
 };
+
+#endif // DISABLE_PYTHON
index d7f2da5cd7c5ad7afed54e4932d37b63b6b8cc50..2ca06da18fc2b2875d0de5eca8f80b9636c9f932 100644 (file)
@@ -20,6 +20,7 @@ public:
        virtual ~KX_VehicleWrapper ();
        int                     getConstraintId();
        
+#ifndef DISABLE_PYTHON
        
        KX_PYMETHOD_VARARGS(KX_VehicleWrapper,AddWheel);
        KX_PYMETHOD_VARARGS(KX_VehicleWrapper,GetNumWheels);
@@ -46,7 +47,7 @@ public:
        KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetSuspensionCompression);
        
        KX_PYMETHOD_VARARGS(KX_VehicleWrapper,SetRollInfluence);
-       
+#endif // DISABLE_PYTHON
 
 private:
        PHY_IVehicle*                    m_vehicle;
index 6a47dec181b79309bd42ec58fb263e64b6283c8c..62ae502cd39a3eefdb2b67808331becb48215ca6 100644 (file)
@@ -26,6 +26,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
+#ifndef DISABLE_PYTHON
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -442,3 +444,5 @@ PyObject* KX_VertexProxy::PySetUV2(PyObject* args)
        m_mesh->SetMeshModified(true);
        Py_RETURN_NONE;
 }
+
+#endif // DISABLE_PYTHON
index 13c57e9f556d079c1aaad184486a9ef8e3a65c0e..77ca0ad853a623daddef09ea991dac15abf294c3 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __KX_VERTEXPROXY
 #define __KX_VERTEXPROXY
 
+#ifndef DISABLE_PYTHON
+
 #include "SCA_IObject.h"
 
 class KX_VertexProxy   : public CValue
@@ -69,5 +71,7 @@ public:
 
 };
 
+#endif // DISABLE_PYTHON
+
 #endif //__KX_VERTEXPROXY
 
index 5b0f6e6e9f2597eabaf743ced26e8921fb65ed45..8154c87ab42a4902e227ea0e2e6a0f0827c0d2ff 100644 (file)
@@ -83,6 +83,8 @@ KX_VisibilityActuator::Update()
        return false;
 }
 
+#ifndef DISABLE_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -122,3 +124,5 @@ PyAttributeDef KX_VisibilityActuator::Attributes[] = {
        KX_PYATTRIBUTE_BOOL_RW("useRecursion", KX_VisibilityActuator, m_recursive),
        { NULL }        //Sentinel
 };
+
+#endif // DISABLE_PYTHON
index b20da20d0e25dfc400ba3bf7cbf5db2e7272977e..69d146776db0ae8150f1aef0373cef43cea7081e 100644 (file)
@@ -20,7 +20,6 @@ incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common #sourc
 incs += ' #source/gameengine/Physics/Dummy'
 incs += ' #source/blender/misc #source/blender/blenloader #extern/glew/include #source/blender/gpu'
 
-incs += ' ' + env['BF_PYTHON_INC']
 incs += ' ' + env['BF_BULLET_INC']
 incs += ' ' + env['BF_OPENGL_INC']
 
@@ -28,6 +27,11 @@ if  env['WITH_BF_SDL']:
     incs += ' ' + env['BF_SDL_INC']
 else:
        defs.append('DISABLE_SDL')
+
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
        
 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
        if env['BF_DEBUG']:
index 49f2af1b0014ed9d07cf60eb1cfe319820243a07..976c68253516fa209a4859aef7aab9df5f7a0f5a 100644 (file)
@@ -19,6 +19,12 @@ incs += ' #source/blender/blenlib'
 incs += ' #intern/guardedalloc'
 
 incs += ' ' + env['BF_BULLET_INC']
-incs += ' ' + env['BF_PYTHON_INC']
 
-env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,50], cxx_compileflags=env['BGE_CXXFLAGS'])
+defs = []
+
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
+
+env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), defs, libtype=['core','player'], priority=[350,50], cxx_compileflags=env['BGE_CXXFLAGS'])
index 239031866ca8ba7b90feabc9636a29f51e2fac7e..75d80f4b3d59a54902d1a834c8874830acc09b85 100644 (file)
@@ -49,6 +49,8 @@
 
 #include "GL/glew.h"
 
+#include <stdio.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
index dbec2d92e31fe2d7f5b6c84c7b860fc979fbff6b..ea99fa966d818497867608d665c4ae45420c21cc 100644 (file)
@@ -5,6 +5,12 @@ sources = env.Glob('*.cpp')
 
 
 incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/gameengine/SceneGraph #source/blender/blenkernel #source/blender/makesdna'
-incs += ' ' + env['BF_PYTHON_INC']
 
-env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core','player'], priority=[350,70], cxx_compileflags=env['BGE_CXXFLAGS'])
+defs = []
+
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
+
+env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), defs, libtype=['core','player'], priority=[350,70], cxx_compileflags=env['BGE_CXXFLAGS'])
index 592b138583f62776f0e42b18a6bd96f79f637c2c..e7c9328688f86883775fe4557a91044422f85b42 100644 (file)
@@ -14,9 +14,11 @@ SConscript(['BlenderRoutines/SConscript',
             'Rasterizer/SConscript',
             'Rasterizer/RAS_OpenGLRasterizer/SConscript',
             'SceneGraph/SConscript',
-            'Physics/Bullet/SConscript',
-            'VideoTexture/SConscript'
+            'Physics/Bullet/SConscript'
             ])
 
+if env['WITH_BF_PYTHON']:
+    SConscript(['VideoTexture/SConscript'])
+
 if env['WITH_BF_PLAYER']:
     SConscript(['GamePlayer/SConscript'])
index 935c5a2c292c6118f4c37a58416144135eb05aab..d914783cff32d4ebe15d0b27ee2ac7f119844128 100644 (file)
@@ -48,7 +48,6 @@ SET(INC
        ../../../intern/moto/include
        ../../../intern/guardedalloc
        ../../../extern/glew/include
-       ${PYTHON_INC}
 )
 
 IF(WITH_FFMPEG)
@@ -57,5 +56,11 @@ IF(WITH_FFMPEG)
        ADD_DEFINITIONS(-D__STDC_CONSTANT_MACROS)
 ENDIF(WITH_FFMPEG)
 
+IF(WITH_PYTHON)
+       SET(INC ${INC} ${PYTHON_INC})
+ELSE(WITH_PYTHON)
+       ADD_DEFINITIONS(-DDISABLE_PYTHON)
+ENDIF(WITH_PYTHON)
+
 BLENDERLIB(bf_videotex "${SRC}" "${INC}")
 #env.BlenderLib ( 'bf_videotex', sources, Split(incs), [], libtype=['game','player'], priority=[25, 72], compileflags = cflags )
index dac0b6d32abcc886aa5e0597b7759faa272c531b..b6b60c593ed0b3f009c0dbef3d581177022bf955 100644 (file)
@@ -19,7 +19,10 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc','win32-mingw'):
        if env['BF_DEBUG']:
                defs.append('_DEBUG')
 
-incs += ' ' + env['BF_PYTHON_INC']
+if env['WITH_BF_PYTHON']:
+       incs += ' ' + env['BF_PYTHON_INC']
+else:
+       defs.append('DISABLE_PYTHON')
 
 if env['WITH_BF_FFMPEG']:
     defs.append('WITH_FFMPEG')