Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp13
-rw-r--r--source/gameengine/BlenderRoutines/CMakeLists.txt1
-rw-r--r--source/gameengine/BlenderRoutines/Makefile2
-rw-r--r--source/gameengine/Converter/BL_ArmatureChannel.cpp24
-rw-r--r--source/gameengine/Converter/BL_ArmatureConstraint.cpp4
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.cpp6
-rw-r--r--source/gameengine/Converter/CMakeLists.txt1
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp3
-rw-r--r--source/gameengine/Converter/KX_ConvertControllers.cpp8
-rw-r--r--source/gameengine/Converter/Makefile2
-rw-r--r--source/gameengine/Expressions/CMakeLists.txt1
-rw-r--r--source/gameengine/Expressions/Makefile2
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp4
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h3
-rw-r--r--source/gameengine/GameLogic/CMakeLists.txt1
-rw-r--r--source/gameengine/GameLogic/Joystick/Makefile2
-rw-r--r--source/gameengine/GameLogic/Makefile2
-rw-r--r--source/gameengine/GameLogic/SCA_ISensor.cpp17
-rw-r--r--source/gameengine/GameLogic/SCA_ISensor.h15
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickSensor.cpp1
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.cpp70
-rw-r--r--source/gameengine/GamePlayer/Makefile2
-rw-r--r--source/gameengine/GamePlayer/common/CMakeLists.txt1
-rw-r--r--source/gameengine/GamePlayer/common/Makefile2
-rw-r--r--source/gameengine/GamePlayer/common/unix/Makefile2
-rw-r--r--source/gameengine/GamePlayer/common/windows/Makefile2
-rw-r--r--source/gameengine/GamePlayer/ghost/CMakeLists.txt1
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp4
-rw-r--r--source/gameengine/GamePlayer/ghost/Makefile2
-rw-r--r--source/gameengine/Ketsji/CMakeLists.txt1
-rw-r--r--source/gameengine/Ketsji/KXNetwork/CMakeLists.txt1
-rw-r--r--source/gameengine/Ketsji/KXNetwork/Makefile2
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.cpp39
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.h8
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp14
-rw-r--r--source/gameengine/Ketsji/KX_Camera.h2
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintWrapper.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintWrapper.h2
-rw-r--r--source/gameengine/Ketsji/KX_Dome.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp43
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h1
-rw-r--r--source/gameengine/Ketsji/KX_Light.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_PolyProxy.cpp161
-rw-r--r--source/gameengine/Ketsji/KX_PolyProxy.h10
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp78
-rw-r--r--source/gameengine/Ketsji/KX_PythonSeq.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp3
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.cpp223
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.h4
-rw-r--r--source/gameengine/Ketsji/KX_VertexProxy.cpp454
-rw-r--r--source/gameengine/Ketsji/KX_VertexProxy.h31
-rw-r--r--source/gameengine/Ketsji/Makefile6
-rw-r--r--source/gameengine/Makefile2
-rw-r--r--source/gameengine/Network/CMakeLists.txt1
-rw-r--r--source/gameengine/Network/LoopBackNetwork/CMakeLists.txt1
-rw-r--r--source/gameengine/Network/LoopBackNetwork/Makefile2
-rw-r--r--source/gameengine/Network/Makefile2
-rw-r--r--source/gameengine/Network/NG_NetworkScene.cpp2
-rw-r--r--source/gameengine/Network/TerraplayNetwork/Makefile2
-rw-r--r--source/gameengine/Physics/Bullet/CMakeLists.txt1
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp2
-rw-r--r--source/gameengine/Physics/Bullet/Makefile2
-rw-r--r--source/gameengine/Physics/Dummy/CMakeLists.txt1
-rw-r--r--source/gameengine/Physics/Dummy/Makefile2
-rw-r--r--source/gameengine/Physics/Makefile2
-rw-r--r--source/gameengine/Physics/common/CMakeLists.txt1
-rw-r--r--source/gameengine/Physics/common/Makefile2
-rw-r--r--source/gameengine/PyDoc/SConscript34
-rw-r--r--source/gameengine/PyDoc/bge.logic.rst62
-rw-r--r--source/gameengine/PyDoc/bge.render.rst4
-rw-r--r--source/gameengine/PyDoc/bge.types.rst4
-rw-r--r--source/gameengine/Rasterizer/CMakeLists.txt1
-rw-r--r--source/gameengine/Rasterizer/Makefile2
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt1
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile2
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp4
-rw-r--r--source/gameengine/SceneGraph/CMakeLists.txt1
-rw-r--r--source/gameengine/SceneGraph/Makefile2
-rw-r--r--source/gameengine/VideoTexture/CMakeLists.txt1
-rw-r--r--source/gameengine/VideoTexture/Makefile2
82 files changed, 790 insertions, 656 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index f5b43fa6809..20f3b782d33 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -388,9 +388,16 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
ketsjiengine->InitDome(scene->gm.dome.res, scene->gm.dome.mode, scene->gm.dome.angle, scene->gm.dome.resbuf, scene->gm.dome.tilt, scene->gm.dome.warptext);
// initialize 3D Audio Settings
- AUD_set3DSetting(AUD_3DS_SPEED_OF_SOUND, scene->audio.speed_of_sound);
- AUD_set3DSetting(AUD_3DS_DOPPLER_FACTOR, scene->audio.doppler_factor);
- AUD_set3DSetting(AUD_3DS_DISTANCE_MODEL, scene->audio.distance_model);
+//BMESH_TODO merge issue!
+// AUD_setSpeedOfSound(scene->audio.speed_of_sound);
+// AUD_setDopplerFactor(scene->audio.doppler_factor);
+// AUD_setDistanceModel(AUD_DistanceModel(scene->audio.distance_model));
+
+ // from see blender.c:
+ // FIXME: this version patching should really be part of the file-reading code,
+ // but we still get too many unrelated data-corruption crashes otherwise...
+ if (blenderdata->versionfile < 250)
+ do_versions_ipos_to_animato(blenderdata);
if (sceneconverter)
{
diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt
index 625ad006e0c..57d28561647 100644
--- a/source/gameengine/BlenderRoutines/CMakeLists.txt
+++ b/source/gameengine/BlenderRoutines/CMakeLists.txt
@@ -50,4 +50,3 @@ ELSE(WITH_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)
diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile
index 4a437aff97d..3d0f5344c74 100644
--- a/source/gameengine/BlenderRoutines/Makefile
+++ b/source/gameengine/BlenderRoutines/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Converter/BL_ArmatureChannel.cpp b/source/gameengine/Converter/BL_ArmatureChannel.cpp
index c0b422042f9..6045de60001 100644
--- a/source/gameengine/Converter/BL_ArmatureChannel.cpp
+++ b/source/gameengine/Converter/BL_ArmatureChannel.cpp
@@ -108,19 +108,19 @@ PyAttributeDef BL_ArmatureChannel::Attributes[] = {
/* attributes directly taken from bPoseChannel */
PyAttributeDef BL_ArmatureChannel::AttributesPtr[] = {
KX_PYATTRIBUTE_CHAR_RO("name",bPoseChannel,name),
- KX_PYATTRIBUTE_FLAG_RO("has_ik",bPoseChannel,flag, POSE_CHAIN),
+ KX_PYATTRIBUTE_FLAG_RO("is_in_ik_chain",bPoseChannel,flag, POSE_CHAIN),
KX_PYATTRIBUTE_FLAG_NEGATIVE_RO("ik_dof_x",bPoseChannel,ikflag, BONE_IK_NO_XDOF),
KX_PYATTRIBUTE_FLAG_NEGATIVE_RO("ik_dof_y",bPoseChannel,ikflag, BONE_IK_NO_YDOF),
KX_PYATTRIBUTE_FLAG_NEGATIVE_RO("ik_dof_z",bPoseChannel,ikflag, BONE_IK_NO_ZDOF),
- KX_PYATTRIBUTE_FLAG_RO("ik_limit_x",bPoseChannel,ikflag, BONE_IK_XLIMIT),
- KX_PYATTRIBUTE_FLAG_RO("ik_limit_y",bPoseChannel,ikflag, BONE_IK_YLIMIT),
- KX_PYATTRIBUTE_FLAG_RO("ik_limit_z",bPoseChannel,ikflag, BONE_IK_ZLIMIT),
- KX_PYATTRIBUTE_FLAG_RO("ik_rot_control",bPoseChannel,ikflag, BONE_IK_ROTCTL),
- KX_PYATTRIBUTE_FLAG_RO("ik_lin_control",bPoseChannel,ikflag, BONE_IK_LINCTL),
+ KX_PYATTRIBUTE_FLAG_RO("use_ik_limit_x",bPoseChannel,ikflag, BONE_IK_XLIMIT),
+ KX_PYATTRIBUTE_FLAG_RO("use_ik_limit_y",bPoseChannel,ikflag, BONE_IK_YLIMIT),
+ KX_PYATTRIBUTE_FLAG_RO("use_ik_limit_z",bPoseChannel,ikflag, BONE_IK_ZLIMIT),
+ KX_PYATTRIBUTE_FLAG_RO("use_ik_rotation_control",bPoseChannel,ikflag, BONE_IK_ROTCTL),
+ KX_PYATTRIBUTE_FLAG_RO("use_ik_linear_control",bPoseChannel,ikflag, BONE_IK_LINCTL),
KX_PYATTRIBUTE_FLOAT_VECTOR_RW("location",-FLT_MAX,FLT_MAX,bPoseChannel,loc,3),
KX_PYATTRIBUTE_FLOAT_VECTOR_RW("scale",-FLT_MAX,FLT_MAX,bPoseChannel,size,3),
KX_PYATTRIBUTE_FLOAT_VECTOR_RW("rotation_quaternion",-1.0f,1.0f,bPoseChannel,quat,4),
- KX_PYATTRIBUTE_FLOAT_VECTOR_RW("rotaion_euler",-10.f,10.f,bPoseChannel,eul,3),
+ KX_PYATTRIBUTE_FLOAT_VECTOR_RW("rotation_euler",-10.f,10.f,bPoseChannel,eul,3),
KX_PYATTRIBUTE_SHORT_RW("rotation_mode",0,ROT_MODE_MAX-1,false,bPoseChannel,rotmode),
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("channel_matrix",bPoseChannel,chan_mat,4),
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("pose_matrix",bPoseChannel,pose_mat,4),
@@ -136,8 +136,8 @@ PyAttributeDef BL_ArmatureChannel::AttributesPtr[] = {
KX_PYATTRIBUTE_FLOAT_RO("ik_stiffness_y",bPoseChannel,stiffness[1]),
KX_PYATTRIBUTE_FLOAT_RO("ik_stiffness_z",bPoseChannel,stiffness[2]),
KX_PYATTRIBUTE_FLOAT_RO("ik_stretch",bPoseChannel,ikstretch),
- KX_PYATTRIBUTE_FLOAT_RW("ik_rot_weight",0,1.0f,bPoseChannel,ikrotweight),
- KX_PYATTRIBUTE_FLOAT_RW("ik_lin_weight",0,1.0f,bPoseChannel,iklinweight),
+ KX_PYATTRIBUTE_FLOAT_RW("ik_rotation_weight",0,1.0f,bPoseChannel,ikrotweight),
+ KX_PYATTRIBUTE_FLOAT_RW("ik_linear_weight",0,1.0f,bPoseChannel,iklinweight),
KX_PYATTRIBUTE_RW_FUNCTION("joint_rotation",BL_ArmatureChannel,py_attr_get_joint_rotation,py_attr_set_joint_rotation),
{ NULL } //Sentinel
};
@@ -432,13 +432,13 @@ PyAttributeDef BL_ArmatureBone::AttributesPtr[] = {
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("arm_mat",Bone,arm_mat,4),
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("bone_mat",Bone,bone_mat,4),
KX_PYATTRIBUTE_RO_FUNCTION("parent",BL_ArmatureBone,py_bone_get_parent),
- KX_PYATTRIBUTE_RO_FUNCTION("children",BL_ArmatureBone,py_bone_get_parent),
+ KX_PYATTRIBUTE_RO_FUNCTION("children",BL_ArmatureBone,py_bone_get_children),
{ NULL } //Sentinel
};
PyObject *BL_ArmatureBone::py_bone_get_parent(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
{
- Bone* bone = reinterpret_cast<Bone*>BGE_PROXY_PTR(self);
+ Bone* bone = reinterpret_cast<Bone*>(self);
if (bone->parent) {
// create a proxy unconnected to any GE object
return NewProxyPlus_Ext(NULL,&Type,bone->parent,false);
@@ -448,7 +448,7 @@ PyObject *BL_ArmatureBone::py_bone_get_parent(void *self, const struct KX_PYATTR
PyObject *BL_ArmatureBone::py_bone_get_children(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
{
- Bone* bone = reinterpret_cast<Bone*>BGE_PROXY_PTR(self);
+ Bone* bone = reinterpret_cast<Bone*>(self);
Bone* child;
int count = 0;
for (child=(Bone*)bone->childbase.first; child; child=(Bone*)child->next)
diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.cpp b/source/gameengine/Converter/BL_ArmatureConstraint.cpp
index 582d8454ba7..b520250ac5d 100644
--- a/source/gameengine/Converter/BL_ArmatureConstraint.cpp
+++ b/source/gameengine/Converter/BL_ArmatureConstraint.cpp
@@ -267,8 +267,8 @@ PyAttributeDef BL_ArmatureConstraint::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("name",BL_ArmatureConstraint,py_attr_getattr),
KX_PYATTRIBUTE_RW_FUNCTION("enforce",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr),
KX_PYATTRIBUTE_RW_FUNCTION("headtail",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr),
- KX_PYATTRIBUTE_RO_FUNCTION("lin_error",BL_ArmatureConstraint,py_attr_getattr),
- KX_PYATTRIBUTE_RO_FUNCTION("rot_error",BL_ArmatureConstraint,py_attr_getattr),
+ KX_PYATTRIBUTE_RO_FUNCTION("error_location",BL_ArmatureConstraint,py_attr_getattr),
+ KX_PYATTRIBUTE_RO_FUNCTION("error_rotation",BL_ArmatureConstraint,py_attr_getattr),
KX_PYATTRIBUTE_RW_FUNCTION("target",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr),
KX_PYATTRIBUTE_RW_FUNCTION("subtarget",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr),
KX_PYATTRIBUTE_RW_FUNCTION("active",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr),
diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp
index 1da07b73dec..5d05dfcff52 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.cpp
+++ b/source/gameengine/Converter/BL_ArmatureObject.cpp
@@ -30,6 +30,7 @@
#include "BL_ArmatureObject.h"
#include "BL_ActionActuator.h"
#include "KX_BlenderSceneConverter.h"
+#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
@@ -113,6 +114,11 @@ void game_copy_pose(bPose **dst, bPose *src, int copy_constraint) {
pchan->constraints.first = NULL;
pchan->constraints.last = NULL;
}
+
+ // fails to link, props are not used in the BGE yet.
+ /* if(pchan->prop)
+ pchan->prop= IDP_CopyProperty(pchan->prop); */
+ pchan->prop= NULL;
}
BLI_ghash_free(ghash, NULL, NULL);
diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt
index 26689be644f..97c367dd1f1 100644
--- a/source/gameengine/Converter/CMakeLists.txt
+++ b/source/gameengine/Converter/CMakeLists.txt
@@ -70,4 +70,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(bf_converter "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_converter', sources, Split(incs), [], libtype=['game','player'], priority=[5,70] )
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index 0575c55846b..b4ddc4f9e54 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -100,6 +100,7 @@ extern "C"
extern "C" {
#include "BKE_context.h"
#include "BLO_readfile.h"
+ #include "BKE_idcode.h"
#include "BKE_report.h"
#include "DNA_space_types.h"
#include "DNA_windowmanager_types.h" /* report api */
@@ -938,7 +939,7 @@ bool KX_BlenderSceneConverter::LinkBlendFile(const char *path, char *group, KX_S
Main *main_tmp= NULL; /* created only for linking, then freed */
LinkNode *names = NULL;
BlendHandle *bpy_openlib = NULL; /* ptr to the open .blend file */
- int idcode= BLO_idcode_from_name(group);
+ int idcode= BKE_idcode_from_name(group);
short flag= 0; /* dont need any special options */
ReportList reports;
static char err_local[255];
diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp
index 858db6d76a1..a6b62ecb7b0 100644
--- a/source/gameengine/Converter/KX_ConvertControllers.cpp
+++ b/source/gameengine/Converter/KX_ConvertControllers.cpp
@@ -176,11 +176,11 @@ void BL_ConvertControllers(
/* let the controller print any warnings here when importing */
pyctrl->SetScriptText(STR_String(pycont->module));
pyctrl->SetScriptName(pycont->module); /* will be something like module.func so using it as the name is OK */
- }
- if(pycont->flag & CONT_PY_DEBUG) {
- printf("\nDebuging \"%s\", module for object %s\n\texpect worse performance.\n", pycont->module, blenderobject->id.name+2);
- pyctrl->SetDebug(true);
+ if(pycont->flag & CONT_PY_DEBUG) {
+ printf("\nDebuging \"%s\", module for object %s\n\texpect worse performance.\n", pycont->module, blenderobject->id.name+2);
+ pyctrl->SetDebug(true);
+ }
}
#endif // DISABLE_PYTHON
diff --git a/source/gameengine/Converter/Makefile b/source/gameengine/Converter/Makefile
index b6da47930d3..142841b2b36 100644
--- a/source/gameengine/Converter/Makefile
+++ b/source/gameengine/Converter/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt
index 41f771e12bd..85b5daa3b4a 100644
--- a/source/gameengine/Expressions/CMakeLists.txt
+++ b/source/gameengine/Expressions/CMakeLists.txt
@@ -43,4 +43,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(bf_expressions "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['game','player'], priority = [45,125] )
diff --git a/source/gameengine/Expressions/Makefile b/source/gameengine/Expressions/Makefile
index 09512c3ae87..892a8c2b246 100644
--- a/source/gameengine/Expressions/Makefile
+++ b/source/gameengine/Expressions/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index dbfa4a36ec6..32bf4ba95c4 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -166,7 +166,7 @@ PyObject * PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObjec
return NULL;
}
- /* use base_type rather then Py_TYPE(base) because we could alredy be subtyped */
+ /* use base_type rather then Py_TYPE(base) because we could already be subtyped */
if(!PyType_IsSubtype(type, base_type)) {
PyErr_Format(PyExc_TypeError, "can't subclass blender game type <%s> from <%s> because it is not a subclass", base_type->tp_name, type->tp_name);
return NULL;
@@ -278,7 +278,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
// the attribute has no field correspondance, handover processing to function.
if (attrdef->m_getFunction == NULL)
return NULL;
- return (*attrdef->m_getFunction)(ref, attrdef);
+ return (*attrdef->m_getFunction)(ptr, attrdef);
}
ptr += attrdef->m_offset;
if (attrdef->m_length > 1)
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index 7afa85c8c31..625549a272e 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -319,9 +319,6 @@ typedef struct KX_PYATTRIBUTE_DEF {
} m_typeCheck;
} PyAttributeDef;
-#define KX_PYATTRIBUTE_DUMMY(name) \
- { name, KX_PYATTRIBUTE_TYPE_DUMMY, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, false, 0, 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL, NULL, NULL} }
-
#define KX_PYATTRIBUTE_BOOL_RW(name,object,field) \
{ name, KX_PYATTRIBUTE_TYPE_BOOL, KX_PYATTRIBUTE_RW, 0, 1, 0.f, 0.f, false, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {&((object *)0)->field, NULL, NULL, NULL, NULL, NULL, NULL} }
#define KX_PYATTRIBUTE_BOOL_RW_CHECK(name,object,field,function) \
diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt
index 3ffba14ec95..93183dafeee 100644
--- a/source/gameengine/GameLogic/CMakeLists.txt
+++ b/source/gameengine/GameLogic/CMakeLists.txt
@@ -49,4 +49,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(bf_logic "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_logic', sources, Split(incs), [], libtype=['game','player'], priority=[30, 110] )
diff --git a/source/gameengine/GameLogic/Joystick/Makefile b/source/gameengine/GameLogic/Joystick/Makefile
index 02def1cec62..5ab297824dd 100644
--- a/source/gameengine/GameLogic/Joystick/Makefile
+++ b/source/gameengine/GameLogic/Joystick/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GameLogic/Makefile b/source/gameengine/GameLogic/Makefile
index ba1e1c25ee7..9c8bd73cdc0 100644
--- a/source/gameengine/GameLogic/Makefile
+++ b/source/gameengine/GameLogic/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp
index bff02326c9c..fada69848b2 100644
--- a/source/gameengine/GameLogic/SCA_ISensor.cpp
+++ b/source/gameengine/GameLogic/SCA_ISensor.cpp
@@ -357,9 +357,8 @@ PyAttributeDef SCA_ISensor::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("triggered", SCA_ISensor, pyattr_get_triggered),
KX_PYATTRIBUTE_RO_FUNCTION("positive", SCA_ISensor, pyattr_get_positive),
KX_PYATTRIBUTE_RO_FUNCTION("status", SCA_ISensor, pyattr_get_status),
- //KX_PYATTRIBUTE_TODO("links"),
- //KX_PYATTRIBUTE_TODO("posTicks"),
- //KX_PYATTRIBUTE_TODO("negTicks"),
+ KX_PYATTRIBUTE_RO_FUNCTION("pos_ticks", SCA_ISensor, pyattr_get_posTicks),
+ KX_PYATTRIBUTE_RO_FUNCTION("neg_ticks", SCA_ISensor, pyattr_get_negTicks),
{ NULL } //Sentinel
};
@@ -401,6 +400,18 @@ PyObject* SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF
return PyLong_FromSsize_t(status);
}
+PyObject* SCA_ISensor::pyattr_get_posTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
+ return PyLong_FromLong(self->GetPosTicks());
+}
+
+PyObject* SCA_ISensor::pyattr_get_negTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
+ return PyLong_FromLong(self->GetNegTicks());
+}
+
int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h
index 42d06d856b6..2d3a3ef08a0 100644
--- a/source/gameengine/GameLogic/SCA_ISensor.h
+++ b/source/gameengine/GameLogic/SCA_ISensor.h
@@ -167,6 +167,18 @@ public:
return m_prev_state;
}
+ /** get the number of ticks since the last positive pulse */
+ int GetPosTicks()
+ {
+ return m_pos_ticks;
+ }
+
+ /** get the number of ticks since the last negative pulse */
+ int GetNegTicks()
+ {
+ return m_neg_ticks;
+ }
+
/** Resume sensing. */
void Resume();
@@ -185,6 +197,9 @@ public:
static PyObject* pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_posTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_negTicks(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);
diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
index 5ab42ae7608..29a6a73b865 100644
--- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
@@ -290,7 +290,6 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("numButtons", SCA_JoystickSensor, pyattr_get_num_buttons),
KX_PYATTRIBUTE_RO_FUNCTION("numHats", SCA_JoystickSensor, pyattr_get_num_hats),
KX_PYATTRIBUTE_RO_FUNCTION("connected", SCA_JoystickSensor, pyattr_get_connected),
- //KX_PYATTRIBUTE_TODO("events"),
{ NULL } //Sentinel
};
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp
index 45d3be01bbb..1f05846abe4 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonController.cpp
@@ -178,7 +178,7 @@ PyObject* SCA_PythonController::sPyGetCurrentController(PyObject *self)
{
if(m_sCurrentController==NULL)
{
- PyErr_SetString(PyExc_SystemError, "GameLogic.getCurrentController(), this function is being run outside the python controllers context, or blenders internal state is corrupt.");
+ PyErr_SetString(PyExc_SystemError, "bge.logic.getCurrentController(), this function is being run outside the python controllers context, or blenders internal state is corrupt.");
return NULL;
}
return m_sCurrentController->GetProxy();
@@ -264,7 +264,7 @@ void SCA_PythonController::ErrorPrint(const char *error_msg)
/* Added in 2.48a, the last_traceback can reference Objects for example, increasing
* their user count. Not to mention holding references to wrapped data.
* This is especially bad when the PyObject for the wrapped data is free'd, after blender
- * has alredy dealocated the pointer */
+ * has already dealocated the pointer */
PySys_SetObject( (char *)"last_traceback", NULL);
PyErr_Clear(); /* just to be sure */
}
@@ -295,49 +295,47 @@ bool SCA_PythonController::Import()
{
//printf("py module modified '%s'\n", m_scriptName.Ptr());
m_bModified= false;
-
+
/* incase we re-import */
Py_XDECREF(m_function);
m_function= NULL;
- vector<STR_String> py_function_path = m_scriptText.Explode('.');
-
- if(py_function_path.size() < 2) {
+ STR_String mod_path_str= m_scriptText; /* just for storage, use C style string access */
+ char *mod_path= mod_path_str.Ptr();
+ char *function_string;
+
+ function_string= strrchr(mod_path, '.');
+
+ if(function_string == NULL) {
printf("Python module name formatting error \"%s\":\n\texpected \"SomeModule.Func\", got \"%s\"\n", GetName().Ptr(), m_scriptText.Ptr());
return false;
}
-
- PyObject *mod = PyImport_ImportModule((char *)py_function_path[0].Ptr());
- /* Dont reload yet, do this within the loop so packages reload too */
-
- if(mod==NULL) {
- ErrorPrint("Python module not found");
+
+ *function_string= '\0';
+ function_string++;
+
+ // Import the module and print an error if it's not found
+ PyObject *mod = PyImport_ImportModule(mod_path);
+
+ if (mod == NULL) {
+ ErrorPrint("Python module can't be imported");
return false;
}
- /* 'mod' will be DECREF'd as 'base'
- * 'm_function' will be left holding a reference that the controller owns */
-
- PyObject *base= mod;
-
- for(unsigned int i=1; i < py_function_path.size(); i++) {
- if(m_debug && PyModule_Check(base)) { /* base could be a class */
- Py_DECREF(base); /* getting a new one so dont hold a ref to the old one */
- base= PyImport_ReloadModule(base);
- if (base==NULL) {
- m_function= NULL;
- break;
- }
- }
-
- m_function = PyObject_GetAttrString(base, py_function_path[i].Ptr());
- Py_DECREF(base);
- base = m_function; /* for the next loop if there is on */
-
- if(m_function==NULL) {
- break;
- }
+
+ if(m_debug)
+ mod = PyImport_ReloadModule(mod);
+
+ if (mod == NULL) {
+ ErrorPrint("Python module can't be reloaded");
+ return false;
}
-
+
+ // Get the function object
+ m_function = PyObject_GetAttrString(mod, function_string);
+
+ // DECREF the module as we don't need it anymore
+ Py_DECREF(mod);
+
if(m_function==NULL) {
if(PyErr_Occurred())
ErrorPrint("Python controller found the module but could not access the function");
@@ -452,7 +450,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
/* Added in 2.48a, the last_traceback can reference Objects for example, increasing
* their user count. Not to mention holding references to wrapped data.
* This is especially bad when the PyObject for the wrapped data is free'd, after blender
- * has alredy dealocated the pointer */
+ * has already dealocated the pointer */
PySys_SetObject( (char *)"last_traceback", NULL);
PyErr_Clear(); /* just to be sure */
}
diff --git a/source/gameengine/GamePlayer/Makefile b/source/gameengine/GamePlayer/Makefile
index c4f78f23117..30a13f26503 100644
--- a/source/gameengine/GamePlayer/Makefile
+++ b/source/gameengine/GamePlayer/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt
index 418b77357a4..08a4aa50a00 100644
--- a/source/gameengine/GamePlayer/common/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/common/CMakeLists.txt
@@ -74,4 +74,3 @@ SET(INC
ADD_DEFINITIONS(-DGLEW_STATIC)
BLENDERLIB_NOLIST(gp_common "${SRC}" "${INC}")
-#env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype='player', priority=5, compileflags=cflags)
diff --git a/source/gameengine/GamePlayer/common/Makefile b/source/gameengine/GamePlayer/common/Makefile
index e1b07a226f6..e28cacb826a 100644
--- a/source/gameengine/GamePlayer/common/Makefile
+++ b/source/gameengine/GamePlayer/common/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GamePlayer/common/unix/Makefile b/source/gameengine/GamePlayer/common/unix/Makefile
index c86f61b45d8..db29a087b28 100644
--- a/source/gameengine/GamePlayer/common/unix/Makefile
+++ b/source/gameengine/GamePlayer/common/unix/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GamePlayer/common/windows/Makefile b/source/gameengine/GamePlayer/common/windows/Makefile
index 3f1deb05f3a..200f84dd3e6 100644
--- a/source/gameengine/GamePlayer/common/windows/Makefile
+++ b/source/gameengine/GamePlayer/common/windows/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
index 848c2f73f06..8164878762c 100644
--- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
@@ -73,4 +73,3 @@ IF(WITH_FFMPEG)
ENDIF(WITH_FFMPEG)
BLENDERLIB_NOLIST(gp_ghost "${SRC}" "${INC}")
-#env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = [], libtype='player',priority=0, compileflags=cflags)
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index b7ed8666325..8f03408b841 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -557,7 +557,7 @@ int main(int argc, char** argv)
#if 0
// future stuff
- else if(!strcmp(argv[i], "stencil")
+ else if(!strcmp(argv[i], "use_stencil")
stereomode = RAS_STEREO_STENCIL;
#endif
@@ -660,7 +660,7 @@ int main(int argc, char** argv)
system->getMainDisplayDimensions(fullScreenWidth, fullScreenHeight);
// process first batch of events. If the user
// drops a file on top off the blenderplayer icon, we
- // recieve an event with the filename
+ // receive an event with the filename
system->processEvents(0);
diff --git a/source/gameengine/GamePlayer/ghost/Makefile b/source/gameengine/GamePlayer/ghost/Makefile
index a7fcf46b695..b2fcd2ac1ff 100644
--- a/source/gameengine/GamePlayer/ghost/Makefile
+++ b/source/gameengine/GamePlayer/ghost/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt
index c4af701f87b..d8f6e3164ec 100644
--- a/source/gameengine/Ketsji/CMakeLists.txt
+++ b/source/gameengine/Ketsji/CMakeLists.txt
@@ -80,4 +80,3 @@ IF(WITH_FFMPEG)
ENDIF(WITH_FFMPEG)
BLENDERLIB(bf_ketsji "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_ketsji', sources, Split(incs), [], libtype=['game','player'], priority=[25, 72], compileflags = cflags )
diff --git a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt
index 40079f3f83e..ce3d8fa22fc 100644
--- a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt
+++ b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt
@@ -45,4 +45,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(kx_network "${SRC}" "${INC}")
-#env.BlenderLib ( 'kx_network', Split(sources), Split(incs), defines=[],libtype=['game2', 'player'], priority=[5, 155] )
diff --git a/source/gameengine/Ketsji/KXNetwork/Makefile b/source/gameengine/Ketsji/KXNetwork/Makefile
index 365ed8fc9c3..aebbd7921cb 100644
--- a/source/gameengine/Ketsji/KXNetwork/Makefile
+++ b/source/gameengine/Ketsji/KXNetwork/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
index 2ef7e55429f..f697942c6ee 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
@@ -794,9 +794,9 @@ PyMethodDef KX_BlenderMaterial::Methods[] =
};
PyAttributeDef KX_BlenderMaterial::Attributes[] = {
- //KX_PYATTRIBUTE_TODO("shader"),
- //KX_PYATTRIBUTE_TODO("materialIndex"),
- //KX_PYATTRIBUTE_TODO("blending"),
+ KX_PYATTRIBUTE_RO_FUNCTION("shader", KX_BlenderMaterial, pyattr_get_shader),
+ KX_PYATTRIBUTE_RO_FUNCTION("material_index", KX_BlenderMaterial, pyattr_get_materialIndex),
+ KX_PYATTRIBUTE_RW_FUNCTION("blend_type", KX_BlenderMaterial, pyattr_get_blending, pyattr_set_blending),
{ NULL } //Sentinel
};
@@ -822,6 +822,37 @@ PyTypeObject KX_BlenderMaterial::Type = {
py_base_new
};
+PyObject* KX_BlenderMaterial::pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
+ return self->PygetShader(NULL, NULL);
+}
+
+PyObject* KX_BlenderMaterial::pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
+ return PyLong_FromSsize_t(self->GetMaterialIndex());
+}
+
+PyObject* KX_BlenderMaterial::pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
+ unsigned int* bfunc = self->getBlendFunc();
+ return Py_BuildValue("(ll)", (long int)bfunc[0], (long int)bfunc[1]);
+}
+
+int KX_BlenderMaterial::pyattr_set_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
+ PyObject* obj = self->PysetBlending(value, NULL);
+ if(obj)
+ {
+ Py_DECREF(obj);
+ return 0;
+ }
+ return -1;
+}
+
KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
{
if( !GLEW_ARB_fragment_shader) {
@@ -908,7 +939,7 @@ static unsigned int GL_array[11] = {
GL_SRC_ALPHA_SATURATE
};
-KX_PYMETHODDEF_DOC( KX_BlenderMaterial, setBlending , "setBlending( GameLogic.src, GameLogic.dest)")
+KX_PYMETHODDEF_DOC( KX_BlenderMaterial, setBlending , "setBlending( bge.logic.src, bge.logic.dest)")
{
unsigned int b[2];
if(PyArg_ParseTuple(args, "ii:setBlending", &b[0], &b[1]))
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h
index 5bf62ff6b7c..239e334f68a 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.h
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h
@@ -79,6 +79,9 @@ public:
Image * getImage (unsigned int idx) {
return (idx < MAXTEX && mMaterial) ? mMaterial->img[idx] : NULL;
}
+ unsigned int* getBlendFunc() {
+ return mBlendFunc;
+ }
// for ipos
void UpdateIPO(
MT_Vector4 rgba, MT_Vector3 specrgb,
@@ -99,6 +102,11 @@ public:
// --------------------------------
virtual PyObject* py_repr(void) { return PyUnicode_FromString(mMaterial->matname.ReadPtr()); }
+ static PyObject* pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static int pyattr_set_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+
KX_PYMETHOD_DOC( KX_BlenderMaterial, getShader );
KX_PYMETHOD_DOC( KX_BlenderMaterial, getMaterialIndex );
KX_PYMETHOD_DOC( KX_BlenderMaterial, getTexture );
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index 82786456589..2402baf92ac 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -553,8 +553,8 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, sphereInsideFrustum,
"\tcenter = the center of the sphere (in world coordinates.)\n"
"\tradius = the radius of the sphere\n\n"
"\tExample:\n"
-"\timport GameLogic\n\n"
-"\tco = GameLogic.getCurrentController()\n"
+"\timport bge.logic\n\n"
+"\tco = bge.logic.getCurrentController()\n"
"\tcam = co.GetOwner()\n\n"
"\t# A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0]\n"
"\tif (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE):\n"
@@ -586,8 +586,8 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, boxInsideFrustum,
"\tinside/outside/intersects this camera's viewing frustum.\n\n"
"\tbox = a list of the eight (8) corners of the box (in world coordinates.)\n\n"
"\tExample:\n"
-"\timport GameLogic\n\n"
-"\tco = GameLogic.getCurrentController()\n"
+"\timport bge.logic\n\n"
+"\tco = bge.logic.getCurrentController()\n"
"\tcam = co.GetOwner()\n\n"
"\tbox = []\n"
"\tbox.append([-1.0, -1.0, -1.0])\n"
@@ -630,8 +630,8 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, pointInsideFrustum,
"\treturns 1 if the given point is inside this camera's viewing frustum.\n\n"
"\tpoint = The point to test (in world coordinates.)\n\n"
"\tExample:\n"
-"\timport GameLogic\n\n"
-"\tco = GameLogic.getCurrentController()\n"
+"\timport bge.logic\n\n"
+"\tco = bge.logic.getCurrentController()\n"
"\tcam = co.GetOwner()\n\n"
"\t# Test point [0.0, 0.0, 0.0]"
"\tif (cam.pointInsideFrustum([0.0, 0.0, 0.0])):\n"
@@ -740,7 +740,7 @@ int KX_Camera::pyattr_set_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *at
KX_Camera* self= static_cast<KX_Camera*>(self_v);
float param = PyFloat_AsDouble(value);
if (param == -1) {
- PyErr_SetString(PyExc_AttributeError, "camera.scale = float: KX_Camera, expected a float greater then zero");
+ PyErr_SetString(PyExc_AttributeError, "camera.ortho_scale = float: KX_Camera, expected a float greater then zero");
return PY_SET_ATTR_FAIL;
}
diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h
index 406ee1d0764..ad2460d34ef 100644
--- a/source/gameengine/Ketsji/KX_Camera.h
+++ b/source/gameengine/Ketsji/KX_Camera.h
@@ -51,7 +51,7 @@ class KX_Camera : public KX_GameObject
Py_Header;
protected:
friend class KX_Scene;
- /** Camera parameters (clips distances, focal lenght). These
+ /** Camera parameters (clips distances, focal length). These
* params are closely tied to Blender. In the gameengine, only the
* projection and modelview matrices are relevant. There's a
* conversion being done in the engine class. Why is it stored
diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
index 8af6e63f343..b1baa5fe9e1 100644
--- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
@@ -110,8 +110,14 @@ PyMethodDef KX_ConstraintWrapper::Methods[] = {
};
PyAttributeDef KX_ConstraintWrapper::Attributes[] = {
- //KX_PYATTRIBUTE_TODO("constraintId"),
+ KX_PYATTRIBUTE_RO_FUNCTION("constraint_id", KX_ConstraintWrapper, pyattr_get_constraintId),
{ NULL } //Sentinel
};
+PyObject* KX_ConstraintWrapper::pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_ConstraintWrapper* self= static_cast<KX_ConstraintWrapper*>(self_v);
+ return self->PyGetConstraintId();
+}
+
#endif // DISABLE_PYTHON
diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h
index 530ecf16fed..db9543c23ae 100644
--- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h
+++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h
@@ -44,6 +44,8 @@ public:
KX_PYMETHOD_NOARGS(KX_ConstraintWrapper,GetConstraintId);
KX_PYMETHOD(KX_ConstraintWrapper,SetParam);
KX_PYMETHOD(KX_ConstraintWrapper,GetParam);
+
+ static PyObject* pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
#endif
private:
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp
index b62593b7911..94258088e9f 100644
--- a/source/gameengine/Ketsji/KX_Dome.cpp
+++ b/source/gameengine/Ketsji/KX_Dome.cpp
@@ -754,7 +754,7 @@ So I came out with this formula:
verts_height = tan((rad_ang/2) - (MT_PI/2))*sqrt(2.0);
Here we take half the sphere(rad_ang/2) and subtract a quarter of it (MT_PI/2)
-Therefore we have the lenght in radians of the dome/sphere over the horizon.
+Therefore we have the length in radians of the dome/sphere over the horizon.
Once we take the tangent of that angle, you have the verts coordinate corresponding to the verts on the side faces.
Then we need to multiply it by sqrt(2.0) to get the coordinate of the verts on the diagonal of the original cube.
*/
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index ecfacb8f9bb..e44aac2699c 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -846,7 +846,7 @@ void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis, float fac)
{
case 0: //x axis
ori.setValue(orimat[0][2], orimat[1][2], orimat[2][2]); //pivot axis
- if (MT_abs(vect.dot(ori)) > 1.0-3.0*MT_EPSILON) //is the vector paralell to the pivot?
+ if (MT_abs(vect.dot(ori)) > 1.0-3.0*MT_EPSILON) //is the vector parallel to the pivot?
ori.setValue(orimat[0][1], orimat[1][1], orimat[2][1]); //change the pivot!
if (fac == 1.0) {
x = vect;
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index 71cd8b36045..3fdd0864a02 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -235,7 +235,7 @@ void KX_KetsjiEngine::SetRasterizer(RAS_IRasterizer* rasterizer)
#ifndef DISABLE_PYTHON
/*
- * At the moment the GameLogic module is imported into 'pythondictionary' after this function is called.
+ * At the moment the bge.logic 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.
*/
void KX_KetsjiEngine::SetPyNamespace(PyObject* pythondictionary)
@@ -966,44 +966,17 @@ void KX_KetsjiEngine::DoSound(KX_Scene* scene)
KX_Camera* cam = scene->GetActiveCamera();
if (!cam)
return;
- MT_Point3 listenerposition = cam->NodeGetWorldPosition();
- MT_Vector3 listenervelocity = cam->GetLinearVelocity();
- MT_Matrix3x3 listenerorientation = cam->NodeGetWorldOrientation();
- {
- AUD_3DData data;
- float f;
-
- listenerorientation.getValue3x3(data.orientation);
- listenerposition.getValue(data.position);
- listenervelocity.getValue(data.velocity);
-
- f = data.position[1];
- data.position[1] = data.position[2];
- data.position[2] = -f;
-
- f = data.velocity[1];
- data.velocity[1] = data.velocity[2];
- data.velocity[2] = -f;
+ float f[4];
- f = data.orientation[1];
- data.orientation[1] = data.orientation[2];
- data.orientation[2] = -f;
+ cam->NodeGetWorldPosition().getValue(f);
+// AUD_setListenerLocation(f);
- f = data.orientation[3];
- data.orientation[3] = -data.orientation[6];
- data.orientation[6] = f;
+ cam->GetLinearVelocity().getValue(f);
+ //AUD_setListenerVelocity(f);
- f = data.orientation[4];
- data.orientation[4] = -data.orientation[8];
- data.orientation[8] = -f;
-
- f = data.orientation[5];
- data.orientation[5] = data.orientation[7];
- data.orientation[7] = f;
-
- AUD_updateListener(&data);
- }
+ cam->NodeGetWorldOrientation().getRotation().getValue(f);
+ //AUD_setListenerOrientation(f);
}
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index 0a461a8b63e..f52ec8192cc 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -71,6 +71,7 @@ private:
class KX_ISceneConverter* m_sceneconverter;
class NG_NetworkDeviceInterface* m_networkdevice;
#ifndef DISABLE_PYTHON
+ /* borrowed from sys.modules["__main__"], dont manage ref's */
PyObject* m_pythondictionary;
#endif
class SCA_IInputDevice* m_keyboarddevice;
diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp
index 6ef4b873ead..ac20b4f2f56 100644
--- a/source/gameengine/Ketsji/KX_Light.cpp
+++ b/source/gameengine/Ketsji/KX_Light.cpp
@@ -66,7 +66,7 @@ KX_LightObject::~KX_LightObject()
if((lamp = GetGPULamp())) {
float obmat[4][4] = {{0}};
- GPU_lamp_update(lamp, 0, obmat);
+ GPU_lamp_update(lamp, 0, 0, obmat);
}
m_rendertools->RemoveLight(&m_lightobj);
@@ -199,7 +199,7 @@ void KX_LightObject::Update()
for(int j=0; j<4; j++, dobmat++)
obmat[i][j] = (float)*dobmat;
- GPU_lamp_update(lamp, m_lightobj.m_layer, obmat);
+ GPU_lamp_update(lamp, m_lightobj.m_layer, 0, obmat);
GPU_lamp_update_colors(lamp, m_lightobj.m_red, m_lightobj.m_green,
m_lightobj.m_blue, m_lightobj.m_energy);
}
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp
index 837c79c77b3..9395e57e68b 100644
--- a/source/gameengine/Ketsji/KX_PolyProxy.cpp
+++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp
@@ -72,90 +72,19 @@ PyMethodDef KX_PolyProxy::Methods[] = {
};
PyAttributeDef KX_PolyProxy::Attributes[] = {
- /* All dummy's so they come up in a dir() */
- //KX_PYATTRIBUTE_TODO("DummyProps"),
- KX_PYATTRIBUTE_DUMMY("matname"),
- KX_PYATTRIBUTE_DUMMY("texture"),
- KX_PYATTRIBUTE_DUMMY("material"),
- KX_PYATTRIBUTE_DUMMY("matid"),
- KX_PYATTRIBUTE_DUMMY("v1"),
- KX_PYATTRIBUTE_DUMMY("v2"),
- KX_PYATTRIBUTE_DUMMY("v3"),
- KX_PYATTRIBUTE_DUMMY("v4"),
- KX_PYATTRIBUTE_DUMMY("visible"),
- KX_PYATTRIBUTE_DUMMY("collide"),
+ KX_PYATTRIBUTE_RO_FUNCTION("material_name", KX_PolyProxy, pyattr_get_material_name),
+ KX_PYATTRIBUTE_RO_FUNCTION("texture_name", KX_PolyProxy, pyattr_get_texture_name),
+ KX_PYATTRIBUTE_RO_FUNCTION("material", KX_PolyProxy, pyattr_get_material),
+ KX_PYATTRIBUTE_RO_FUNCTION("material_id", KX_PolyProxy, pyattr_get_material_id),
+ KX_PYATTRIBUTE_RO_FUNCTION("v1", KX_PolyProxy, pyattr_get_v1),
+ KX_PYATTRIBUTE_RO_FUNCTION("v2", KX_PolyProxy, pyattr_get_v2),
+ KX_PYATTRIBUTE_RO_FUNCTION("v3", KX_PolyProxy, pyattr_get_v3),
+ KX_PYATTRIBUTE_RO_FUNCTION("v4", KX_PolyProxy, pyattr_get_v4),
+ KX_PYATTRIBUTE_RO_FUNCTION("visible", KX_PolyProxy, pyattr_get_visible),
+ KX_PYATTRIBUTE_RO_FUNCTION("collide", KX_PolyProxy, pyattr_get_collide),
{ NULL } //Sentinel
};
-#if 0
-PyObject* KX_PolyProxy::py_getattro(PyObject *attr)
-{
- char *attr_str= _PyUnicode_AsString(attr);
- if (!strcmp(attr_str, "matname"))
- {
- return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName());
- }
- if (!strcmp(attr_str, "texture"))
- {
- return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName());
- }
- if (!strcmp(attr_str, "material"))
- {
- RAS_IPolyMaterial *polymat = m_polygon->GetMaterial()->GetPolyMaterial();
- if(polymat->GetFlag() & RAS_BLENDERMAT)
- {
- KX_BlenderMaterial* mat = static_cast<KX_BlenderMaterial*>(polymat);
- return mat->GetProxy();
- }
- else
- {
- KX_PolygonMaterial* mat = static_cast<KX_PolygonMaterial*>(polymat);
- return mat->GetProxy();
- }
- }
- if (!strcmp(attr_str, "matid"))
- {
- // we'll have to scan through the material bucket of the mes and compare with
- // the one of the polygon
- RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial();
- unsigned int matid;
- for (matid=0; matid<(unsigned int)m_mesh->NumMaterials(); matid++)
- {
- RAS_MeshMaterial* meshMat = m_mesh->GetMeshMaterial(matid);
- if (meshMat->m_bucket == polyBucket)
- // found it
- break;
- }
- return PyLong_FromSsize_t(matid);
- }
- if (!strcmp(attr_str, "v1"))
- {
- return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, 0));
- }
- if (!strcmp(attr_str, "v2"))
- {
- return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, 1));
- }
- if (!strcmp(attr_str, "v3"))
- {
- return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, 2));
- }
- if (!strcmp(attr_str, "v4"))
- {
- return PyLong_FromSsize_t(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffsetAbs(m_mesh, 3):0));
- }
- if (!strcmp(attr_str, "visible"))
- {
- return PyLong_FromSsize_t(m_polygon->IsVisible());
- }
- if (!strcmp(attr_str, "collide"))
- {
- return PyLong_FromSsize_t(m_polygon->IsCollider());
- }
- // py_getattro_up(CValue); // XXX -- todo, make all these attributes
-}
-#endif
-
KX_PolyProxy::KX_PolyProxy(const RAS_MeshObject*mesh, RAS_Polygon* polygon)
: m_polygon(polygon),
m_mesh((RAS_MeshObject*)mesh)
@@ -179,7 +108,75 @@ CValue* KX_PolyProxy::GetReplica() { return NULL;}
// stuff for python integration
-KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialIndex,
+PyObject* KX_PolyProxy::pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PygetMaterialName();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PygetTextureName();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PygetMaterial();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PygetMaterialIndex();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+
+ return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 0));
+}
+
+PyObject* KX_PolyProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+
+ return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 1));
+}
+
+PyObject* KX_PolyProxy::pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+
+ return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 2));
+}
+
+PyObject* KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+
+ if (3 < self->m_polygon->VertexCount())
+ {
+ return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 3));
+ }
+ return PyLong_FromSsize_t(0);
+}
+
+PyObject* KX_PolyProxy::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PyisVisible();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PyisCollider();
+}
+
+KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialIndex,
"getMaterialIndex() : return the material index of the polygon in the mesh\n")
{
RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial();
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h
index 97d89b37435..3e669630e30 100644
--- a/source/gameengine/Ketsji/KX_PolyProxy.h
+++ b/source/gameengine/Ketsji/KX_PolyProxy.h
@@ -54,6 +54,16 @@ public:
// stuff for python integration
+ static PyObject* pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialIndex)
KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getNumVertex)
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
index dacc74f139f..63204b16e8b 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
@@ -233,7 +233,7 @@ PyAttributeDef KX_PolygonMaterial::Attributes[] = {
KX_PYATTRIBUTE_FLOAT_RW("shininess", 0.0f, 1000.0f, KX_PolygonMaterial, m_shininess),
KX_PYATTRIBUTE_FLOAT_RW("specularity", 0.0f, 1000.0f, KX_PolygonMaterial, m_specularity),
- KX_PYATTRIBUTE_RW_FUNCTION("diffuse", KX_PolygonMaterial, pyattr_get_texture, pyattr_set_diffuse),
+ KX_PYATTRIBUTE_RW_FUNCTION("diffuse", KX_PolygonMaterial, pyattr_get_diffuse, pyattr_set_diffuse),
KX_PYATTRIBUTE_RW_FUNCTION("specular",KX_PolygonMaterial, pyattr_get_specular, pyattr_set_specular),
KX_PYATTRIBUTE_RO_FUNCTION("tface", KX_PolygonMaterial, pyattr_get_tface), /* How the heck is this even useful??? - Campbell */
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 7327b9c08ff..4f14400e7e5 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -45,6 +45,10 @@ extern "C" {
#include "marshal.h" /* python header for loading/saving dicts */
}
+
+#define WITH_PYTHON
+//#include "AUD_PyInit.h"
+
#endif
#include "KX_PythonInit.h"
@@ -118,7 +122,7 @@ extern "C" {
#include "KX_BlenderSceneConverter.h"
#include "KX_MeshProxy.h" /* for creating a new library of mesh objects */
extern "C" {
- #include "BLO_readfile.h"
+ #include "BKE_idcode.h"
}
#include "NG_NetworkScene.h" //Needed for sendMessage()
@@ -262,8 +266,8 @@ static PyObject* gPyRestartGame(PyObject*)
}
static char gPySaveGlobalDict_doc[] =
-"saveGlobalDict()\n\
-Saves GameLogic.globalDict to a file";
+ "saveGlobalDict()\n"
+ "Saves bge.logic.globalDict to a file";
static PyObject* gPySaveGlobalDict(PyObject*)
{
@@ -299,8 +303,8 @@ static PyObject* gPySaveGlobalDict(PyObject*)
}
static char gPyLoadGlobalDict_doc[] =
-"LoadGlobalDict()\n\
-Loads GameLogic.globalDict from a file";
+ "LoadGlobalDict()\n"
+ "Loads bge.logic.globalDict from a file";
static PyObject* gPyLoadGlobalDict(PyObject*)
{
@@ -375,15 +379,6 @@ static PyObject* gPyGetSpectrum(PyObject*)
return resultlist;
}
-
-static PyObject* gPyStopDSP(PyObject*, PyObject* args)
-{
- PyErr_SetString(PyExc_RuntimeError, "no audio device available");
- return NULL;
-
- Py_RETURN_NONE;
-}
-
static PyObject* gPySetLogicTicRate(PyObject*, PyObject* args)
{
float ticrate;
@@ -666,7 +661,7 @@ static PyObject *gLibNew(PyObject*, PyObject* args)
return NULL;
}
- idcode= BLO_idcode_from_name(group);
+ idcode= BKE_idcode_from_name(group);
if(idcode==0) {
PyErr_Format(PyExc_ValueError, "invalid group given \"%s\"", group);
return NULL;
@@ -752,7 +747,6 @@ static struct PyMethodDef game_methods[] = {
{"getRandomFloat",(PyCFunction) gPyGetRandomFloat, METH_NOARGS, (const char *)gPyGetRandomFloat_doc},
{"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"},
{"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (const char *)"get audio spectrum"},
- {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (const char *)"stop using the audio dsp (for performance reasons)"},
{"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (const char *)"Gets the max number of logic frame per render frame"},
{"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (const char *)"Sets the max number of logic frame per render frame"},
{"getMaxPhysicsFrame", (PyCFunction) gPyGetMaxPhysicsFrame, METH_NOARGS, (const char *)"Gets the max number of physics frame per render frame"},
@@ -935,7 +929,6 @@ static PyObject* gPyDisableMist(PyObject*)
Py_RETURN_NONE;
}
-
static PyObject* gPySetMistStart(PyObject*, PyObject* args)
{
@@ -1232,7 +1225,7 @@ static struct PyMethodDef rasterizer_methods[] = {
// Initialization function for the module (*must* be called initGameLogic)
static char GameLogic_module_documentation[] =
-"This is the Python API for the game engine of GameLogic"
+"This is the Python API for the game engine of bge.logic"
;
static char Rasterizer_module_documentation[] =
@@ -1313,7 +1306,6 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_PROPSENSOR_EXPRESSION, SCA_PropertySensor::KX_PROPSENSOR_EXPRESSION);
/* 3. Constraint actuator */
- /* XXX, TODO NXBGE, move constants names from KX_ACT_CONSTRAINT_foo to KX_CONSTRAINTACT_foo */
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCY);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCZ);
@@ -1329,18 +1321,18 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIY);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIZ);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHPX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPX);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPY);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHPZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPZ);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNX);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNY);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHNZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNZ);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_NORMAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_NORMAL);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_MATERIAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_MATERIAL);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_PERMANENT, KX_ConstraintActuator::KX_ACT_CONSTRAINT_PERMANENT);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_DISTANCE, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DISTANCE);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_LOCAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCAL);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_DOROTFH, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DOROTFH);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHPX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPX);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHPZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPZ);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNX);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHNZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNZ);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_NORMAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_NORMAL);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_MATERIAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_MATERIAL);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_PERMANENT, KX_ConstraintActuator::KX_ACT_CONSTRAINT_PERMANENT);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DISTANCE, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DISTANCE);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCAL);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DOROTFH, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DOROTFH);
/* 4. Ipo actuator, simple part */
KX_MACRO_addTypesToDict(d, KX_IPOACT_PLAY, KX_IpoActuator::KX_ACT_IPO_PLAY);
@@ -1582,7 +1574,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
// Check for errors
if (PyErr_Occurred())
{
- Py_FatalError("can't initialize module GameLogic");
+ Py_FatalError("can't initialize module bge.logic");
}
return m;
@@ -1912,9 +1904,8 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
first_time = false;
PyObjectPlus::ClearDeprecationWarning();
-
- PyObject* moduleobj = PyImport_AddModule("__main__");
- return PyModule_GetDict(moduleobj);
+
+ return bpy_namespace_dict_new(NULL);
}
void exitGamePlayerPythonScripting()
@@ -1949,9 +1940,8 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev
initPySysObjects(maggie);
PyObjectPlus::NullDeprecationWarning();
-
- PyObject* moduleobj = PyImport_AddModule("__main__");
- return PyModule_GetDict(moduleobj);
+
+ return bpy_namespace_dict_new(NULL);
}
void exitGamePythonScripting()
@@ -1981,7 +1971,6 @@ void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main *
PyDict_SetItemString(PyModule_GetDict(*gameLogic), "globalDict", pyGlobalDict); // Same as importing the module.
*gameLogic_keys = PyDict_Keys(PyModule_GetDict(*gameLogic));
- PyDict_SetItemString(dictionaryobject, "GameLogic", *gameLogic); // Same as importing the module.
initGameKeys();
initPythonConstraintBinding();
@@ -1989,10 +1978,11 @@ void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main *
initGeometry();
initBGL();
initBLF();
+// AUD_initPython();
initVideoTexture();
/* could be done a lot more nicely, but for now a quick way to get bge.* working */
- PyRun_SimpleString("__import__('sys').modules['bge']=[mod for mod in (type(__builtins__)('bge'), ) if mod.__dict__.update({'logic':__import__('GameLogic'), 'render':__import__('Rasterizer'), 'events':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')}) is None][0]");
+ PyRun_SimpleString("sys = __import__('sys');mod = sys.modules['bge'] = type(sys)('bge');mod.__dict__.update({'logic':__import__('GameLogic'), 'render':__import__('Rasterizer'), 'events':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')});import bge");
}
static struct PyModuleDef Rasterizer_module_def = {
@@ -2340,15 +2330,15 @@ int saveGamePythonConfig( char **marshal_buffer)
memcpy(*marshal_buffer, marshal_cstring, marshal_length);
Py_DECREF(pyGlobalDictMarshal);
} else {
- printf("Error, GameLogic.globalDict could not be marshal'd\n");
+ printf("Error, bge.logic.globalDict could not be marshal'd\n");
}
} else {
- printf("Error, GameLogic.globalDict was removed\n");
+ printf("Error, bge.logic.globalDict was removed\n");
}
Py_DECREF(gameLogic);
} else {
PyErr_Clear();
- printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n");
+ printf("Error, bge.logic failed to import bge.logic.globalDict will be lost\n");
}
return marshal_length;
}
@@ -2380,7 +2370,7 @@ int loadGamePythonConfig(char *marshal_buffer, int marshal_length)
}
} else {
PyErr_Clear();
- printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n");
+ printf("Error, bge.logic failed to import bge.logic.globalDict will be lost\n");
}
}
return 0;
diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp
index 8ffd58a781b..5c87fe2e757 100644
--- a/source/gameengine/Ketsji/KX_PythonSeq.cpp
+++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp
@@ -351,7 +351,7 @@ static PyObject *KX_PythonSeq_getIter(KX_PythonSeq *self)
return NULL;
}
- /* create a new iterator if were alredy using this one */
+ /* create a new iterator if were already using this one */
if (self->iter == -1) {
self->iter = 0;
Py_INCREF(self);
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 99bec8159b4..d0d27700166 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -68,7 +68,6 @@
#include "SG_Tree.h"
#include "DNA_group_types.h"
#include "DNA_scene_types.h"
-#include "BKE_anim.h"
#include "KX_SG_NodeRelationships.h"
@@ -2134,7 +2133,7 @@ PyAttributeDef KX_Scene::Attributes[] = {
KX_PYATTRIBUTE_RW_FUNCTION("pre_draw", KX_Scene, pyattr_get_drawing_callback_pre, pyattr_set_drawing_callback_pre),
KX_PYATTRIBUTE_RW_FUNCTION("post_draw", KX_Scene, pyattr_get_drawing_callback_post, pyattr_set_drawing_callback_post),
KX_PYATTRIBUTE_BOOL_RO("suspended", KX_Scene, m_suspend),
- KX_PYATTRIBUTE_BOOL_RO("activity_culling", KX_Scene, m_activity_culling),
+ KX_PYATTRIBUTE_BOOL_RO("use_activity_culling", KX_Scene, m_activity_culling),
KX_PYATTRIBUTE_FLOAT_RW("activity_culling_radius", 0.5f, FLT_MAX, KX_Scene, m_activity_box_radius),
KX_PYATTRIBUTE_BOOL_RO("dbvt_culling", KX_Scene, m_dbvt_culling),
{ NULL } //Sentinel
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp
index 7f9b090d680..5199e9cc8c3 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp
@@ -31,6 +31,7 @@
*/
#include "KX_SoundActuator.h"
+#include "AUD_C-API.h"
#include "KX_GameObject.h"
#include "KX_PyMath.h" // needed for PyObjectFrom()
#include <iostream>
@@ -62,36 +63,33 @@ KX_SoundActuator::KX_SoundActuator(SCA_IObject* gameobj,
KX_SoundActuator::~KX_SoundActuator()
{
if(m_handle)
- AUD_stop(m_handle);
+ ;//AUD_(m_handle);
}
void KX_SoundActuator::play()
{
if(m_handle)
- AUD_stop(m_handle);
+ ;//AUD_(m_handle);
if(!m_sound)
return;
// this is the sound that will be played and not deleted afterwards
AUD_Sound* sound = m_sound;
- // this sounds are for temporary stacked sounds, will be deleted if not NULL
+ // this sound is for temporary stacked sounds, will be deleted if not NULL
AUD_Sound* sound2 = NULL;
- AUD_Sound* sound3 = NULL;
+
+ bool loop = false;
switch (m_type)
{
case KX_SOUNDACT_LOOPBIDIRECTIONAL:
case KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP:
- // create a ping pong sound on sound2 stacked on the orignal sound
- sound2 = AUD_pingpongSound(sound);
- // create a loop sound on sound3 stacked on the pingpong sound and let that one play (save it to sound)
- sound = sound3 = AUD_loopSound(sound2);
- break;
+ sound = sound2 = AUD_pingpongSound(sound);
+ // fall through
case KX_SOUNDACT_LOOPEND:
case KX_SOUNDACT_LOOPSTOP:
- // create a loop sound on sound2 stacked on the pingpong sound and let that one play (save it to sound)
- sound = sound2 = AUD_loopSound(sound);
+ loop = true;
break;
case KX_SOUNDACT_PLAYSTOP:
case KX_SOUNDACT_PLAYEND:
@@ -102,30 +100,29 @@ void KX_SoundActuator::play()
if(m_is3d)
{
// sound shall be played 3D
- m_handle = AUD_play3D(sound, 0);
-
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_MAX_GAIN, m_3d.max_gain);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_MIN_GAIN, m_3d.min_gain);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_REFERENCE_DISTANCE, m_3d.reference_distance);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_MAX_DISTANCE, m_3d.max_distance);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_ROLLOFF_FACTOR, m_3d.rolloff_factor);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_CONE_INNER_ANGLE, m_3d.cone_inner_angle);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_CONE_OUTER_ANGLE, m_3d.cone_outer_angle);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_CONE_OUTER_GAIN, m_3d.cone_outer_gain);
+ // m_handle = AUD_play(sound, 0);
+
+/* XXX ;//AUD_setRelative(m_handle, false);
+ ;//AUD_setVolumeMaximum(m_handle, m_3d.max_gain);
+ ;//AUD_setVolumeMinimum(m_handle, m_3d.min_gain);
+ ;//AUD_setDistanceReference(m_handle, m_3d.reference_distance);
+ ;//AUD_setDistanceMaximum(m_handle, m_3d.max_distance);
+ ;//AUD_setAttenuation(m_handle, m_3d.rolloff_factor);
+ ;//AUD_setConeAngleInner(m_handle, m_3d.cone_inner_angle);
+ ;//AUD_setConeAngleOuter(m_handle, m_3d.cone_outer_angle);
+ ;//AUD_setConeVolumeOuter(m_handle, m_3d.cone_outer_gain); */
}
else
m_handle = AUD_play(sound, 0);
- AUD_setSoundPitch(m_handle, m_pitch);
- AUD_setSoundVolume(m_handle, m_volume);
+ //if(loop)
+ //AUD_setLoop(m_handle, -1);
+ //AUD_setSoundPitch(m_handle, m_pitch);
+ //AUD_setSoundVolume(m_handle, m_volume);
m_isplaying = true;
- // now we unload the pingpong and loop sounds, as we don't need them anymore
- // the started sound will continue playing like it was created, don't worry!
- if(sound3)
- AUD_unload(sound3);
- if(sound2)
- AUD_unload(sound2);
+// if(sound2)
+ // ;//AUD_unload(sound2);
}
CValue* KX_SoundActuator::GetReplica()
@@ -171,7 +168,7 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
case KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP:
{
// stop immediately
- AUD_stop(m_handle);
+ ;//AUD_(m_handle);
break;
}
case KX_SOUNDACT_PLAYEND:
@@ -183,7 +180,7 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
case KX_SOUNDACT_LOOPBIDIRECTIONAL:
{
// stop the looping so that the sound stops when it finished
- AUD_setLoop(m_handle, 0, -1);
+ ;//AUD_setLoop(m_handle, 0);
break;
}
default:
@@ -215,39 +212,15 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
{
if(m_is3d)
{
- AUD_3DData data;
- float f;
- ((KX_GameObject*)this->GetParent())->NodeGetWorldPosition().getValue(data.position);
- ((KX_GameObject*)this->GetParent())->GetLinearVelocity().getValue(data.velocity);
- ((KX_GameObject*)this->GetParent())->NodeGetWorldOrientation().getValue3x3(data.orientation);
-
- /*
- * The 3D data from blender has to be transformed for OpenAL:
- * - In blender z is up and y is forwards
- * - In OpenAL y is up and z is backwards
- * We have to do that for all 5 vectors.
- */
- f = data.position[1];
- data.position[1] = data.position[2];
- data.position[2] = -f;
-
- f = data.velocity[1];
- data.velocity[1] = data.velocity[2];
- data.velocity[2] = -f;
-
- f = data.orientation[1];
- data.orientation[1] = data.orientation[2];
- data.orientation[2] = -f;
-
- f = data.orientation[4];
- data.orientation[4] = data.orientation[5];
- data.orientation[5] = -f;
-
- f = data.orientation[7];
- data.orientation[7] = data.orientation[8];
- data.orientation[8] = -f;
-
- AUD_update3DSource(m_handle, &data);
+ KX_GameObject* obj = (KX_GameObject*)this->GetParent();
+ float f[4];
+
+ obj->NodeGetWorldPosition().getValue(f);
+ ;//AUD_setSourceLocation(m_handle, f);
+ obj->GetLinearVelocity().getValue(f);
+ ;//AUD_setSourceVelocity(m_handle, f);
+ obj->NodeGetWorldOrientation().getRotation().getValue(f);
+ ;//AUD_setSourceOrientation(m_handle, f);
}
result = true;
}
@@ -300,19 +273,18 @@ PyMethodDef KX_SoundActuator::Methods[] = {
PyAttributeDef KX_SoundActuator::Attributes[] = {
KX_PYATTRIBUTE_BOOL_RO("is3D", KX_SoundActuator, m_is3d),
- KX_PYATTRIBUTE_RW_FUNCTION("maxGain3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("minGain3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("referenceDistance3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("maxDistance3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("rolloffFactor3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("coneInnerAngle3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("coneOuterAngle3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("coneOuterGain3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
-
+ KX_PYATTRIBUTE_RW_FUNCTION("volume_maximum", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("volume_minimum", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("distance_reference", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("distance_maximum", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("attenuation", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("cone_angle_inner", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("cone_angle_outer", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("cone_volume_outer", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+
KX_PYATTRIBUTE_RW_FUNCTION("time", KX_SoundActuator, pyattr_get_audposition, pyattr_set_audposition),
KX_PYATTRIBUTE_RW_FUNCTION("volume", KX_SoundActuator, pyattr_get_gain, pyattr_set_gain),
KX_PYATTRIBUTE_RW_FUNCTION("pitch", KX_SoundActuator, pyattr_get_pitch, pyattr_set_pitch),
- KX_PYATTRIBUTE_RW_FUNCTION("rollOffFactor", KX_SoundActuator, pyattr_get_rollOffFactor, pyattr_set_rollOffFactor),
KX_PYATTRIBUTE_ENUM_RW("mode",KX_SoundActuator::KX_SOUNDACT_NODEF+1,KX_SoundActuator::KX_SOUNDACT_MAX-1,false,KX_SoundActuator,m_type),
{ NULL } //Sentinel
};
@@ -327,7 +299,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, startSound,
case AUD_STATUS_PLAYING:
break;
case AUD_STATUS_PAUSED:
- AUD_resume(m_handle);
+ ;//AUD_resume(m_handle);
break;
default:
play();
@@ -339,7 +311,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, pauseSound,
"pauseSound()\n"
"\tPauses the sound.\n")
{
- AUD_pause(m_handle);
+ ;//AUD_pause(m_handle);
Py_RETURN_NONE;
}
@@ -347,7 +319,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, stopSound,
"stopSound()\n"
"\tStops the sound.\n")
{
- AUD_stop(m_handle);
+ ;//AUD_(m_handle);
Py_RETURN_NONE;
}
@@ -358,28 +330,28 @@ PyObject* KX_SoundActuator::pyattr_get_3d_property(void *self, const struct KX_P
const char* prop = attrdef->m_name;
float result_value = 0.0;
- if(!strcmp(prop, "maxGain3D")) {
+ if(!strcmp(prop, "volume_maximum")) {
result_value = actuator->m_3d.max_gain;
- } else if (!strcmp(prop, "minGain3D")) {
+ } else if (!strcmp(prop, "volume_minimum")) {
result_value = actuator->m_3d.min_gain;
- } else if (!strcmp(prop, "referenceDistance3D")) {
+ } else if (!strcmp(prop, "distance_reference")) {
result_value = actuator->m_3d.reference_distance;
- } else if (!strcmp(prop, "maxDistance3D")) {
+ } else if (!strcmp(prop, "distance_maximum")) {
result_value = actuator->m_3d.max_distance;
- } else if (!strcmp(prop, "rolloffFactor3D")) {
+ } else if (!strcmp(prop, "attenuation")) {
result_value = actuator->m_3d.rolloff_factor;
- } else if (!strcmp(prop, "coneInnerAngle3D")) {
+ } else if (!strcmp(prop, "cone_angle_inner")) {
result_value = actuator->m_3d.cone_inner_angle;
- } else if (!strcmp(prop, "coneOuterAngle3D")) {
+ } else if (!strcmp(prop, "cone_angle_outer")) {
result_value = actuator->m_3d.cone_outer_angle;
- } else if (!strcmp(prop, "coneOuterGain3D")) {
+ } else if (!strcmp(prop, "cone_volume_outer")) {
result_value = actuator->m_3d.cone_outer_gain;
} else {
@@ -423,66 +395,63 @@ PyObject* KX_SoundActuator::pyattr_get_pitch(void *self, const struct KX_PYATTRI
return result;
}
-PyObject* KX_SoundActuator::pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- float rollofffactor = actuator->m_3d.rolloff_factor;
- PyObject* result = PyFloat_FromDouble(rollofffactor);
-
- return result;
-}
-
int KX_SoundActuator::pyattr_set_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
{
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
const char* prop = attrdef->m_name;
float prop_value = 0.0;
- AUD_3DSourceSetting setting = AUD_3DSS_NONE;
if (!PyArg_Parse(value, "f", &prop_value))
return PY_SET_ATTR_FAIL;
- // update the internal value
- if(!strcmp(prop, "maxGain3D")) {
+ // if sound is working and 3D, set the new setting
+ if(!actuator->m_is3d)
+ return PY_SET_ATTR_FAIL;
+
+ if(!strcmp(prop, "volume_maximum")) {
actuator->m_3d.max_gain = prop_value;
- setting = AUD_3DSS_MAX_GAIN;
+ if(actuator->m_handle)
+ ;//AUD_setVolumeMaximum(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "minGain3D")) {
+ } else if (!strcmp(prop, "volume_minimum")) {
actuator->m_3d.min_gain = prop_value;
- setting = AUD_3DSS_MIN_GAIN;
+ if(actuator->m_handle)
+ ;//AUD_setVolumeMinimum(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "referenceDistance3D")) {
+ } else if (!strcmp(prop, "distance_reference")) {
actuator->m_3d.reference_distance = prop_value;
- setting = AUD_3DSS_REFERENCE_DISTANCE;
+ if(actuator->m_handle)
+ ;//AUD_setDistanceReference(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "maxDistance3D")) {
+ } else if (!strcmp(prop, "distance_maximum")) {
actuator->m_3d.max_distance = prop_value;
- setting = AUD_3DSS_MAX_DISTANCE;
+ if(actuator->m_handle)
+ ;//AUD_setDistanceMaximum(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "rolloffFactor3D")) {
+ } else if (!strcmp(prop, "attenuation")) {
actuator->m_3d.rolloff_factor = prop_value;
- setting = AUD_3DSS_ROLLOFF_FACTOR;
+ if(actuator->m_handle)
+ ;//AUD_setAttenuation(actuator->m_handle, prop_value);
- } else if (!!strcmp(prop, "coneInnerAngle3D")) {
+ } else if (!!strcmp(prop, "cone_angle_inner")) {
actuator->m_3d.cone_inner_angle = prop_value;
- setting = AUD_3DSS_CONE_INNER_ANGLE;
+ if(actuator->m_handle)
+ ;//AUD_setConeAngleInner(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "coneOuterAngle3D")) {
+ } else if (!strcmp(prop, "cone_angle_outer")) {
actuator->m_3d.cone_outer_angle = prop_value;
- setting = AUD_3DSS_CONE_OUTER_ANGLE;
+ if(actuator->m_handle)
+ ;//AUD_setConeAngleOuter(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "coneOuterGain3D")) {
+ } else if (!strcmp(prop, "cone_volume_outer")) {
actuator->m_3d.cone_outer_gain = prop_value;
- setting = AUD_3DSS_CONE_OUTER_GAIN;
+ if(actuator->m_handle)
+ ;//AUD_setConeVolumeOuter(actuator->m_handle, prop_value);
} else {
return PY_SET_ATTR_FAIL;
- }
+ }
- // if sound is working and 3D, set the new setting
- if(actuator->m_handle && actuator->m_is3d && setting != AUD_3DSS_NONE)
- AUD_set3DSourceSetting(actuator->m_handle, setting, prop_value);
-
return PY_SET_ATTR_SUCCESS;
}
@@ -495,7 +464,7 @@ int KX_SoundActuator::pyattr_set_audposition(void *self, const struct KX_PYATTRI
return PY_SET_ATTR_FAIL;
if(actuator->m_handle)
- AUD_seek(actuator->m_handle, position);
+ ;//AUD_seek(actuator->m_handle, position);
return PY_SET_ATTR_SUCCESS;
}
@@ -508,7 +477,7 @@ int KX_SoundActuator::pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DE
actuator->m_volume = gain;
if(actuator->m_handle)
- AUD_setSoundVolume(actuator->m_handle, gain);
+ ;//AUD_setSoundVolume(actuator->m_handle, gain);
return PY_SET_ATTR_SUCCESS;
}
@@ -522,21 +491,7 @@ int KX_SoundActuator::pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_D
actuator->m_pitch = pitch;
if(actuator->m_handle)
- AUD_setSoundPitch(actuator->m_handle, pitch);
-
- return PY_SET_ATTR_SUCCESS;
-}
-
-int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- float rollofffactor = 1.0;
- if (!PyArg_Parse(value, "f", &rollofffactor))
- return PY_SET_ATTR_FAIL;
-
- actuator->m_3d.rolloff_factor = rollofffactor;
- if(actuator->m_handle)
- AUD_set3DSourceSetting(actuator->m_handle, AUD_3DSS_ROLLOFF_FACTOR, rollofffactor);
+ ;//AUD_setSoundPitch(actuator->m_handle, pitch);
return PY_SET_ATTR_SUCCESS;
}
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h
index 1eaea276191..c15fc9d4861 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.h
+++ b/source/gameengine/Ketsji/KX_SoundActuator.h
@@ -58,7 +58,7 @@ class KX_SoundActuator : public SCA_IActuator
float m_pitch;
bool m_is3d;
KX_3DSoundSettings m_3d;
- AUD_Handle* m_handle;
+ void* m_handle;
void play();
@@ -107,14 +107,12 @@ public:
static int pyattr_set_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
- static int pyattr_set_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static PyObject* pyattr_get_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
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
diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp
index 652bf5eafed..09630ad2851 100644
--- a/source/gameengine/Ketsji/KX_VertexProxy.cpp
+++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp
@@ -73,247 +73,359 @@ PyMethodDef KX_VertexProxy::Methods[] = {
};
PyAttributeDef KX_VertexProxy::Attributes[] = {
- //KX_PYATTRIBUTE_TODO("DummyProps"),
+ KX_PYATTRIBUTE_RW_FUNCTION("x", KX_VertexProxy, pyattr_get_x, pyattr_set_x),
+ KX_PYATTRIBUTE_RW_FUNCTION("y", KX_VertexProxy, pyattr_get_y, pyattr_set_y),
+ KX_PYATTRIBUTE_RW_FUNCTION("z", KX_VertexProxy, pyattr_get_z, pyattr_set_z),
- KX_PYATTRIBUTE_DUMMY("x"),
- KX_PYATTRIBUTE_DUMMY("y"),
- KX_PYATTRIBUTE_DUMMY("z"),
+ KX_PYATTRIBUTE_RW_FUNCTION("r", KX_VertexProxy, pyattr_get_r, pyattr_set_r),
+ KX_PYATTRIBUTE_RW_FUNCTION("g", KX_VertexProxy, pyattr_get_g, pyattr_set_g),
+ KX_PYATTRIBUTE_RW_FUNCTION("b", KX_VertexProxy, pyattr_get_b, pyattr_set_b),
+ KX_PYATTRIBUTE_RW_FUNCTION("a", KX_VertexProxy, pyattr_get_a, pyattr_set_a),
- KX_PYATTRIBUTE_DUMMY("r"),
- KX_PYATTRIBUTE_DUMMY("g"),
- KX_PYATTRIBUTE_DUMMY("b"),
- KX_PYATTRIBUTE_DUMMY("a"),
+ KX_PYATTRIBUTE_RW_FUNCTION("u", KX_VertexProxy, pyattr_get_u, pyattr_set_u),
+ KX_PYATTRIBUTE_RW_FUNCTION("v", KX_VertexProxy, pyattr_get_v, pyattr_set_v),
- KX_PYATTRIBUTE_DUMMY("u"),
- KX_PYATTRIBUTE_DUMMY("v"),
+ KX_PYATTRIBUTE_RW_FUNCTION("u2", KX_VertexProxy, pyattr_get_u2, pyattr_set_u2),
+ KX_PYATTRIBUTE_RW_FUNCTION("v2", KX_VertexProxy, pyattr_get_v2, pyattr_set_v2),
- KX_PYATTRIBUTE_DUMMY("u2"),
- KX_PYATTRIBUTE_DUMMY("v2"),
+ KX_PYATTRIBUTE_RW_FUNCTION("XYZ", KX_VertexProxy, pyattr_get_XYZ, pyattr_set_XYZ),
+ KX_PYATTRIBUTE_RW_FUNCTION("UV", KX_VertexProxy, pyattr_get_UV, pyattr_set_UV),
- KX_PYATTRIBUTE_DUMMY("XYZ"),
- KX_PYATTRIBUTE_DUMMY("UV"),
-
- KX_PYATTRIBUTE_DUMMY("color"),
- KX_PYATTRIBUTE_DUMMY("colour"),
-
- KX_PYATTRIBUTE_DUMMY("normal"),
+ KX_PYATTRIBUTE_RW_FUNCTION("color", KX_VertexProxy, pyattr_get_color, pyattr_set_color),
+ KX_PYATTRIBUTE_RW_FUNCTION("normal", KX_VertexProxy, pyattr_get_normal, pyattr_set_normal),
{ NULL } //Sentinel
};
-#if 0
-PyObject*
-KX_VertexProxy::py_getattro(PyObject *attr)
-{
- char *attr_str= _PyUnicode_AsString(attr);
- if (attr_str[1]=='\0') { // Group single letters
- // pos
- if (attr_str[0]=='x')
- return PyFloat_FromDouble(m_vertex->getXYZ()[0]);
- if (attr_str[0]=='y')
- return PyFloat_FromDouble(m_vertex->getXYZ()[1]);
- if (attr_str[0]=='z')
- return PyFloat_FromDouble(m_vertex->getXYZ()[2]);
-
- // Col
- if (attr_str[0]=='r')
- return PyFloat_FromDouble(m_vertex->getRGBA()[0]/255.0);
- if (attr_str[0]=='g')
- return PyFloat_FromDouble(m_vertex->getRGBA()[1]/255.0);
- if (attr_str[0]=='b')
- return PyFloat_FromDouble(m_vertex->getRGBA()[2]/255.0);
- if (attr_str[0]=='a')
- return PyFloat_FromDouble(m_vertex->getRGBA()[3]/255.0);
-
- // UV
- if (attr_str[0]=='u')
- return PyFloat_FromDouble(m_vertex->getUV1()[0]);
- if (attr_str[0]=='v')
- return PyFloat_FromDouble(m_vertex->getUV1()[1]);
- }
-
-
- if (!strcmp(attr_str, "XYZ"))
- return PyObjectFrom(MT_Vector3(m_vertex->getXYZ()));
-
- if (!strcmp(attr_str, "UV"))
- return PyObjectFrom(MT_Point2(m_vertex->getUV1()));
-
- if (!strcmp(attr_str, "color") || !strcmp(attr_str, "colour"))
- {
- const unsigned char *colp = m_vertex->getRGBA();
- MT_Vector4 color(colp[0], colp[1], colp[2], colp[3]);
- color /= 255.0;
- return PyObjectFrom(color);
- }
+PyObject* KX_VertexProxy::pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getXYZ()[0]);
+}
- if (!strcmp(attr_str, "normal"))
- {
- return PyObjectFrom(MT_Vector3(m_vertex->getNormal()));
- }
+PyObject* KX_VertexProxy::pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getXYZ()[1]);
+}
- py_getattro_up(CValue);
+PyObject* KX_VertexProxy::pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getXYZ()[2]);
}
-#endif
+PyObject* KX_VertexProxy::pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getRGBA()[0]/255.0);
+}
-#if 0
-int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue)
+PyObject* KX_VertexProxy::pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- char *attr_str= _PyUnicode_AsString(attr);
- if (PySequence_Check(pyvalue))
- {
- if (!strcmp(attr_str, "XYZ"))
- {
- MT_Point3 vec;
- if (PyVecTo(pyvalue, vec))
- {
- m_vertex->SetXYZ(vec);
- m_mesh->SetMeshModified(true);
- return PY_SET_ATTR_SUCCESS;
- }
- return PY_SET_ATTR_FAIL;
- }
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getRGBA()[1]/255.0);
+}
- if (!strcmp(attr_str, "UV"))
- {
- MT_Point2 vec;
- if (PyVecTo(pyvalue, vec))
- {
- m_vertex->SetUV(vec);
- m_mesh->SetMeshModified(true);
- return PY_SET_ATTR_SUCCESS;
- }
- return PY_SET_ATTR_FAIL;
- }
+PyObject* KX_VertexProxy::pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getRGBA()[2]/255.0);
+}
- if (!strcmp(attr_str, "color") || !strcmp(attr_str, "colour"))
- {
- MT_Vector4 vec;
- if (PyVecTo(pyvalue, vec))
- {
- m_vertex->SetRGBA(vec);
- m_mesh->SetMeshModified(true);
- return PY_SET_ATTR_SUCCESS;
- }
- return PY_SET_ATTR_FAIL;
- }
+PyObject* KX_VertexProxy::pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getRGBA()[3]/255.0);
+}
- if (!strcmp(attr_str, "normal"))
- {
- MT_Vector3 vec;
- if (PyVecTo(pyvalue, vec))
- {
- m_vertex->SetNormal(vec);
- m_mesh->SetMeshModified(true);
- return PY_SET_ATTR_SUCCESS;
- }
- return PY_SET_ATTR_FAIL;
- }
- }
-
- if (PyFloat_Check(pyvalue))
- {
- float val = PyFloat_AsDouble(pyvalue);
- // pos
- MT_Point3 pos(m_vertex->getXYZ());
- if (!strcmp(attr_str, "x"))
+PyObject* KX_VertexProxy::pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getUV1()[0]);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getUV1()[1]);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getUV2()[0]);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getUV2()[1]);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyObjectFrom(MT_Vector3(self->m_vertex->getXYZ()));
+}
+
+PyObject* KX_VertexProxy::pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyObjectFrom(MT_Point2(self->m_vertex->getUV1()));
+}
+
+PyObject* KX_VertexProxy::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ const unsigned char *colp = self->m_vertex->getRGBA();
+ MT_Vector4 color(colp[0], colp[1], colp[2], colp[3]);
+ color /= 255.0;
+ return PyObjectFrom(color);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyObjectFrom(MT_Vector3(self->m_vertex->getNormal()));
+}
+
+int KX_VertexProxy::pyattr_set_x(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point3 pos(self->m_vertex->getXYZ());
pos.x() = val;
- m_vertex->SetXYZ(pos);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetXYZ(pos);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- if (!strcmp(attr_str, "y"))
+int KX_VertexProxy::pyattr_set_y(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point3 pos(self->m_vertex->getXYZ());
pos.y() = val;
- m_vertex->SetXYZ(pos);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetXYZ(pos);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- if (!strcmp(attr_str, "z"))
+int KX_VertexProxy::pyattr_set_z(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point3 pos(self->m_vertex->getXYZ());
pos.z() = val;
- m_vertex->SetXYZ(pos);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetXYZ(pos);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- // uv
- MT_Point2 uv = m_vertex->getUV1();
- if (!strcmp(attr_str, "u"))
+int KX_VertexProxy::pyattr_set_u(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point2 uv = self->m_vertex->getUV1();
uv[0] = val;
- m_vertex->SetUV(uv);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetUV(uv);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- if (!strcmp(attr_str, "v"))
+int KX_VertexProxy::pyattr_set_v(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point2 uv = self->m_vertex->getUV1();
uv[1] = val;
- m_vertex->SetUV(uv);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetUV(uv);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- // uv
- MT_Point2 uv2 = m_vertex->getUV2();
- if (!strcmp(attr_str, "u2"))
+int KX_VertexProxy::pyattr_set_u2(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point2 uv = self->m_vertex->getUV2();
uv[0] = val;
- m_vertex->SetUV2(uv);
- m_mesh->SetMeshModified(true);
- return 0;
+ self->m_vertex->SetUV2(uv);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- if (!strcmp(attr_str, "v2"))
+int KX_VertexProxy::pyattr_set_v2(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point2 uv = self->m_vertex->getUV2();
uv[1] = val;
- m_vertex->SetUV2(uv);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetUV2(uv);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- // col
- unsigned int icol = *((const unsigned int *)m_vertex->getRGBA());
- unsigned char *cp = (unsigned char*) &icol;
- val *= 255.0;
- if (!strcmp(attr_str, "r"))
+int KX_VertexProxy::pyattr_set_r(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ unsigned int icol = *((const unsigned int *)self->m_vertex->getRGBA());
+ unsigned char *cp = (unsigned char*) &icol;
+ val *= 255.0;
cp[0] = (unsigned char) val;
- m_vertex->SetRGBA(icol);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetRGBA(icol);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
- if (!strcmp(attr_str, "g"))
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_g(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ unsigned int icol = *((const unsigned int *)self->m_vertex->getRGBA());
+ unsigned char *cp = (unsigned char*) &icol;
+ val *= 255.0;
cp[1] = (unsigned char) val;
- m_vertex->SetRGBA(icol);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetRGBA(icol);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
- if (!strcmp(attr_str, "b"))
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_b(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ unsigned int icol = *((const unsigned int *)self->m_vertex->getRGBA());
+ unsigned char *cp = (unsigned char*) &icol;
+ val *= 255.0;
cp[2] = (unsigned char) val;
- m_vertex->SetRGBA(icol);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetRGBA(icol);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
- if (!strcmp(attr_str, "a"))
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_a(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ unsigned int icol = *((const unsigned int *)self->m_vertex->getRGBA());
+ unsigned char *cp = (unsigned char*) &icol;
+ val *= 255.0;
cp[3] = (unsigned char) val;
- m_vertex->SetRGBA(icol);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetRGBA(icol);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
- }
+ return PY_SET_ATTR_FAIL;
+}
- return CValue::py_setattro(attr, pyvalue);
+int KX_VertexProxy::pyattr_set_XYZ(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PySequence_Check(value))
+ {
+ MT_Point3 vec;
+ if (PyVecTo(value, vec))
+ {
+ self->m_vertex->SetXYZ(vec);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
+ }
+ }
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_UV(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PySequence_Check(value))
+ {
+ MT_Point2 vec;
+ if (PyVecTo(value, vec))
+ {
+ self->m_vertex->SetUV(vec);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
+ }
+ }
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_color(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PySequence_Check(value))
+ {
+ MT_Vector4 vec;
+ if (PyVecTo(value, vec))
+ {
+ self->m_vertex->SetRGBA(vec);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
+ }
+ }
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_normal(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PySequence_Check(value))
+ {
+ MT_Vector3 vec;
+ if (PyVecTo(value, vec))
+ {
+ self->m_vertex->SetNormal(vec);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
+ }
+ }
+ return PY_SET_ATTR_FAIL;
}
-#endif
KX_VertexProxy::KX_VertexProxy(KX_MeshProxy*mesh, RAS_TexVert* vertex)
: m_vertex(vertex),
diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h
index 08fe0e7e2f8..b39d3ecb7d4 100644
--- a/source/gameengine/Ketsji/KX_VertexProxy.h
+++ b/source/gameengine/Ketsji/KX_VertexProxy.h
@@ -56,6 +56,37 @@ public:
// stuff for python integration
+ static PyObject* pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static int pyattr_set_x(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_y(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_z(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_u(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_v(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_u2(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_v2(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_r(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_g(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_b(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_a(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_XYZ(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_UV(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_color(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_normal(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+
KX_PYMETHOD_NOARGS(KX_VertexProxy,GetXYZ);
KX_PYMETHOD_O(KX_VertexProxy,SetXYZ);
KX_PYMETHOD_NOARGS(KX_VertexProxy,GetUV);
diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile
index 4ecd23fc1a2..79c8626d295 100644
--- a/source/gameengine/Ketsji/Makefile
+++ b/source/gameengine/Ketsji/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
@@ -65,6 +65,10 @@ CPPFLAGS += -I../../blender/imbuf
CPPFLAGS += -I../../blender/gpu
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+ifeq ($(WITH_FFMPEG), true)
+ CPPFLAGS += -DWITH_FFMPEG
+endif
+
###########################
SOURCEDIR = source/gameengine/Ketsji
diff --git a/source/gameengine/Makefile b/source/gameengine/Makefile
index bcb4b9098e7..0fdac2acce2 100644
--- a/source/gameengine/Makefile
+++ b/source/gameengine/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Network/CMakeLists.txt b/source/gameengine/Network/CMakeLists.txt
index 2478715e0ab..795e63b47c3 100644
--- a/source/gameengine/Network/CMakeLists.txt
+++ b/source/gameengine/Network/CMakeLists.txt
@@ -34,4 +34,3 @@ SET(INC
)
BLENDERLIB(bf_ngnetwork "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['game2', 'player'], priority=[15, 160] )
diff --git a/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt b/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt
index 6b43a1561a1..e7c34f5a2a0 100644
--- a/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt
+++ b/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt
@@ -34,4 +34,3 @@ SET(INC
)
BLENDERLIB(bf_loopbacknetwork "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['game2', 'player'], priority=[25, 165] )
diff --git a/source/gameengine/Network/LoopBackNetwork/Makefile b/source/gameengine/Network/LoopBackNetwork/Makefile
index 690fd644094..236c28b0f23 100644
--- a/source/gameengine/Network/LoopBackNetwork/Makefile
+++ b/source/gameengine/Network/LoopBackNetwork/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Network/Makefile b/source/gameengine/Network/Makefile
index c6b22276113..99a047c8b95 100644
--- a/source/gameengine/Network/Makefile
+++ b/source/gameengine/Network/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Network/NG_NetworkScene.cpp b/source/gameengine/Network/NG_NetworkScene.cpp
index 355ebe5c475..976ce0d367e 100644
--- a/source/gameengine/Network/NG_NetworkScene.cpp
+++ b/source/gameengine/Network/NG_NetworkScene.cpp
@@ -187,7 +187,7 @@ vector<NG_NetworkMessage*> NG_NetworkScene::FindMessages(
if (!notfound)
notfound = (subject.IsEmpty() ? notfound : m_messagesBySubject[subject] == NULL);
if (notfound) {
- // it's definately NOT in the scene, so stop looking
+ // it's definitely NOT in the scene, so stop looking
} else { // narrow phase
// possibly it's there, but maybe not (false hit)
if (to.IsEmpty()) {
diff --git a/source/gameengine/Network/TerraplayNetwork/Makefile b/source/gameengine/Network/TerraplayNetwork/Makefile
index d987263d433..d5a4c86740b 100644
--- a/source/gameengine/Network/TerraplayNetwork/Makefile
+++ b/source/gameengine/Network/TerraplayNetwork/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt
index 11a535b35c8..95888967b78 100644
--- a/source/gameengine/Physics/Bullet/CMakeLists.txt
+++ b/source/gameengine/Physics/Bullet/CMakeLists.txt
@@ -47,4 +47,3 @@ SET(INC
)
BLENDERLIB(bf_bullet "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['game','player'], priority=[15,90] )
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index a7412a9631a..dc8d31936ec 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -507,7 +507,7 @@ bool CcdPhysicsController::DeleteControllerShape( )
bool CcdPhysicsController::ReplaceControllerShape(btCollisionShape *newShape)
{
- /* Note, deleting the previous collision shape must be done alredy */
+ /* Note, deleting the previous collision shape must be done already */
/* if (m_collisionShape) DeleteControllerShape(); */
m_object->setCollisionShape(newShape);
diff --git a/source/gameengine/Physics/Bullet/Makefile b/source/gameengine/Physics/Bullet/Makefile
index 433d1df3d2f..0514565534d 100644
--- a/source/gameengine/Physics/Bullet/Makefile
+++ b/source/gameengine/Physics/Bullet/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Physics/Dummy/CMakeLists.txt b/source/gameengine/Physics/Dummy/CMakeLists.txt
index cb7a467dde9..18330392cd7 100644
--- a/source/gameengine/Physics/Dummy/CMakeLists.txt
+++ b/source/gameengine/Physics/Dummy/CMakeLists.txt
@@ -32,4 +32,3 @@ SET(INC
)
BLENDERLIB(bf_dummy "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['game','player'], priority=[10,100] )
diff --git a/source/gameengine/Physics/Dummy/Makefile b/source/gameengine/Physics/Dummy/Makefile
index 0e36266ae09..9a600a0365f 100644
--- a/source/gameengine/Physics/Dummy/Makefile
+++ b/source/gameengine/Physics/Dummy/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Physics/Makefile b/source/gameengine/Physics/Makefile
index da0d4cafd2e..f5f914c2ac2 100644
--- a/source/gameengine/Physics/Makefile
+++ b/source/gameengine/Physics/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Physics/common/CMakeLists.txt b/source/gameengine/Physics/common/CMakeLists.txt
index 3618725c2bf..0f8f59f3b78 100644
--- a/source/gameengine/Physics/common/CMakeLists.txt
+++ b/source/gameengine/Physics/common/CMakeLists.txt
@@ -33,4 +33,3 @@ SET(INC
)
BLENDERLIB(bf_common "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_common', Split(sources), Split(incs), [], libtype=['game', 'game2','player'], priority=[20, 35, 95] )
diff --git a/source/gameengine/Physics/common/Makefile b/source/gameengine/Physics/common/Makefile
index f87da383520..369699e1b90 100644
--- a/source/gameengine/Physics/common/Makefile
+++ b/source/gameengine/Physics/common/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/PyDoc/SConscript b/source/gameengine/PyDoc/SConscript
deleted file mode 100644
index dabe004ae6a..00000000000
--- a/source/gameengine/PyDoc/SConscript
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/python
-Import ('env')
-import os
-
-if env['WITH_BF_FHS']:
- BLENDERPATH = os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION'])
-else:
- BLENDERPATH = env['BF_INSTALLDIR']
-
-from optparse import OptionParser
-import epydoc
-from epydoc.docbuilder import build_doc_index
-from epydoc import cli
-names = env.Glob("source/gameengine/PyDoc/*.py")
-docindex = build_doc_index(names)
-optvalues = cli.OPTION_DEFAULTS
-optvalues["verbose"] = 1
-optvalues["quiet"] = 0
-optvalues["include_source_code"] = 0
-optvalues["inheritance"] = "included"
-optvalues["show_private"] = 0
-optvalues["target"] = os.path.join(BLENDERPATH, 'doc')
-optvalues["url"] = "http://www.blender.org"
-optvalues["top"] = "Game Engine API"
-optvalues["name"] = "Blender"
-optvalues["noprivate"] = 1
-optvalues["noframes"] = 1
-optvalues["names"] = names
-optparser = OptionParser()
-optparser.set_defaults(**optvalues)
-(options, args) = optparser.parse_args([])
-print "Writing Game Engine epydocs to \"%s\"" % optvalues["target"]
-cli.write_html(docindex, options)
-
diff --git a/source/gameengine/PyDoc/bge.logic.rst b/source/gameengine/PyDoc/bge.logic.rst
index 84b480e2ab9..a10733569f3 100644
--- a/source/gameengine/PyDoc/bge.logic.rst
+++ b/source/gameengine/PyDoc/bge.logic.rst
@@ -158,6 +158,48 @@ General functions
Saves bge.logic.globalDict to a file.
+.. function:: startGame(blend)
+
+ Loads the blend file.
+
+ :arg blend: The name of the blend file
+ :type blend: string
+
+.. function:: endGame()
+
+ Ends the current game.
+
+.. function:: restartGame()
+
+ Restarts the current game by reloading the .blend file (the last saved version, not what is currently running).
+
+.. function:: LibLoad(blend, type)
+
+ Converts the all of the datablocks of the given type from the given blend.
+
+ :arg blend: The path to the blend file
+ :type blend: string
+ :arg type: The datablock type (currently only "Scene" and "Mesh" are supported)
+ :type type: string
+
+.. function:: LibNew(name, type, data)
+
+ Uses existing datablock data and loads in as a new library.
+
+ :arg name: A unique library name used for removal later
+ :type name: string
+ :arg type: The datablock type (currently only "Mesh" is supported)
+ :type type: string
+ :arg data: A list of names of the datablocks to load
+ :type data: list of strings
+
+.. function:: LibFree(name)
+
+ Frees a library, removing all objects and meshes from the currently active scenes.
+
+ :arg name: The name of the library to free (the name used in LibNew)
+ :type name: string
+
.. function:: addScene(name, overlay=1)
Loads a scene into the game engine.
@@ -202,24 +244,24 @@ General functions
.. function:: getMaxLogicFrame()
- Gets the maximum number of logic frame per render frame.
+ Gets the maximum number of logic frames per render frame.
- :return: The maximum number of logic frame per render frame
+ :return: The maximum number of logic frames per render frame
:rtype: integer
.. function:: setMaxLogicFrame(maxlogic)
- Sets the maximum number of logic frame that are executed per render frame.
+ Sets the maximum number of logic frames that are executed per render frame.
This does not affect the physic system that still runs at full frame rate.
- :arg maxlogic: The new maximum number of logic frame per render frame. Valid values: 1..5
+ :arg maxlogic: The new maximum number of logic frames per render frame. Valid values: 1..5
:type maxlogic: integer
.. function:: getMaxPhysicsFrame()
- Gets the maximum number of physics frame per render frame.
+ Gets the maximum number of physics frames per render frame.
- :return: The maximum number of physics frame per render frame
+ :return: The maximum number of physics frames per render frame
:rtype: integer
.. function:: setMaxPhysicsFrame(maxphysics)
@@ -270,14 +312,6 @@ General functions
.. warning: Not implimented yet
-.. function:: saveGlobalDict()
-
- Saves bge.logic.globalDict to a file.
-
-.. function:: loadGlobalDict()
-
- Loads bge.logic.globalDict from a file.
-
*****************
Utility functions
*****************
diff --git a/source/gameengine/PyDoc/bge.render.rst b/source/gameengine/PyDoc/bge.render.rst
index cea84f3b506..9f17455601b 100644
--- a/source/gameengine/PyDoc/bge.render.rst
+++ b/source/gameengine/PyDoc/bge.render.rst
@@ -230,7 +230,7 @@ Functions
.. function:: enableMotionBlur(factor)
- Enable the motion blue effect.
+ Enable the motion blur effect.
:arg factor: the ammount of motion blur to display.
:type factor: float [0.0 - 1.0]
@@ -238,5 +238,5 @@ Functions
.. function:: disableMotionBlur()
- Disable the motion blue effect.
+ Disable the motion blur effect.
diff --git a/source/gameengine/PyDoc/bge.types.rst b/source/gameengine/PyDoc/bge.types.rst
index e0ace6ad85b..028b4fa72f3 100644
--- a/source/gameengine/PyDoc/bge.types.rst
+++ b/source/gameengine/PyDoc/bge.types.rst
@@ -4927,7 +4927,7 @@ Game Engine bge.types Module
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
- .. attribute:: rotation
+ .. attribute:: rotation_quaternion
rotation of the bone relative to its parent expressed as a quaternion, read-write.
@@ -4941,7 +4941,7 @@ Game Engine bge.types Module
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
- .. attribute:: euler_rotation
+ .. attribute:: rotation_euler
rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt
index 096b1583e3e..d718bf3e507 100644
--- a/source/gameengine/Rasterizer/CMakeLists.txt
+++ b/source/gameengine/Rasterizer/CMakeLists.txt
@@ -43,4 +43,3 @@ SET(INC
ADD_DEFINITIONS(-DGLEW_STATIC)
BLENDERLIB(bf_rasterizer "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['game','player'], priority=[35,115], compileflags = cflags )
diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile
index c877e423a71..d800a02b181 100644
--- a/source/gameengine/Rasterizer/Makefile
+++ b/source/gameengine/Rasterizer/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
index 5d6f61ebfa1..cc48952dc20 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
@@ -44,4 +44,3 @@ SET(INC
ADD_DEFINITIONS(-DGLEW_STATIC)
BLENDERLIB(bf_oglrasterizer "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['game','player'], priority=[40, 120] )
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
index aedbc2705f0..357bdf9d99b 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
index 087b5d052c3..622ba852934 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
@@ -91,8 +91,8 @@ void RAS_VAOpenGLRasterizer::SetDrawingMode(int drawingmode)
void RAS_VAOpenGLRasterizer::Exit()
{
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
diff --git a/source/gameengine/SceneGraph/CMakeLists.txt b/source/gameengine/SceneGraph/CMakeLists.txt
index 3242ec57d94..a73130531c0 100644
--- a/source/gameengine/SceneGraph/CMakeLists.txt
+++ b/source/gameengine/SceneGraph/CMakeLists.txt
@@ -32,4 +32,3 @@ SET(INC
)
BLENDERLIB(bf_scenegraph "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['game','player'], priority=[50,130] )
diff --git a/source/gameengine/SceneGraph/Makefile b/source/gameengine/SceneGraph/Makefile
index acec1b729e8..8a797ae5a0e 100644
--- a/source/gameengine/SceneGraph/Makefile
+++ b/source/gameengine/SceneGraph/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt
index eaee00753ff..3af514ca0de 100644
--- a/source/gameengine/VideoTexture/CMakeLists.txt
+++ b/source/gameengine/VideoTexture/CMakeLists.txt
@@ -64,4 +64,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(bf_videotex "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_videotex', sources, Split(incs), [], libtype=['game','player'], priority=[25, 72], compileflags = cflags )
diff --git a/source/gameengine/VideoTexture/Makefile b/source/gameengine/VideoTexture/Makefile
index 1cb147860cd..af3417eef02 100644
--- a/source/gameengine/VideoTexture/Makefile
+++ b/source/gameengine/VideoTexture/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.