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/Converter')
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp2
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp22
-rw-r--r--source/gameengine/Converter/CMakeLists.txt69
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp4
-rw-r--r--source/gameengine/Converter/KX_ConvertActuators.cpp12
5 files changed, 68 insertions, 41 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index c00e7ec7e29..7e353d590bb 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -405,7 +405,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
// 2.5x - could also do this but looks too high level, constraints use this, it works ok.
// Object workob; /* evaluate using workob */
-// what_does_obaction((Scene *)obj->GetScene(), obj->GetArmatureObject(), &workob, m_pose, m_action, NULL, m_localtime);
+// what_does_obaction(obj->GetArmatureObject(), &workob, m_pose, m_action, NULL, m_localtime);
}
// done getting the pose from the action
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 1d90d97f824..c331b878178 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -145,9 +145,11 @@ extern "C" {
#include "BKE_customdata.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_DerivedMesh.h"
+#include "BKE_material.h" /* give_current_material */
+
+extern Material defmaterial; /* material.c */
}
-#include "BKE_material.h" /* give_current_material */
/* end of blender include block */
#include "KX_BlenderInputDevice.h"
@@ -462,7 +464,9 @@ bool ConvertMaterial(
}
}
}
- material->flag[i] |= (mat->ipo!=0)?HASIPO:0;
+#if 0 /* this flag isnt used anymore */
+ material->flag[i] |= (BKE_animdata_from_id(mat->id) != NULL) ? HASIPO : 0;
+#endif
/// --------------------------------
// mapping methods
material->mapping[i].mapping |= ( mttmp->texco & TEXCO_REFL )?USEREFL:0;
@@ -837,6 +841,11 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
else
ma = mesh->mat ? mesh->mat[mface->mat_nr]:NULL;
+ /* ckeck for texface since texface _only_ is used as a fallback */
+ if(ma == NULL && tface == NULL) {
+ ma= &defmaterial;
+ }
+
{
bool visible = true;
bool twoside = false;
@@ -1969,8 +1978,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
frame_type = RAS_FrameSettings::e_frame_scale;
}
- aspect_width = blenderscene->gm.xsch;
- aspect_height = blenderscene->gm.ysch;
+ aspect_width = blenderscene->r.xsch*blenderscene->r.xasp;
+ aspect_height = blenderscene->r.ysch*blenderscene->r.yasp;
}
RAS_FrameSettings frame_settings(
@@ -2600,6 +2609,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
bConstraint *curcon;
conlist = get_active_constraints2(blenderobject);
+ if((gameobj->GetLayer()&activeLayerBitInfo)==0)
+ continue;
+
if (conlist) {
for (curcon = (bConstraint *)conlist->first; curcon; curcon=(bConstraint *)curcon->next) {
if (curcon->type==CONSTRAINT_TYPE_RIGIDBODYJOINT){
@@ -2613,7 +2625,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
if (dat->tar)
{
KX_GameObject *gotar=getGameOb(dat->tar->id.name+2,sumolist);
- if (gotar && gotar->GetPhysicsController())
+ if (gotar && ((gotar->GetLayer()&activeLayerBitInfo)!=0) && gotar->GetPhysicsController())
physctr2 = (PHY_IPhysicsController*) gotar->GetPhysicsController()->GetUserData();
}
diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt
index bdd0769e0a3..45a7701d404 100644
--- a/source/gameengine/Converter/CMakeLists.txt
+++ b/source/gameengine/Converter/CMakeLists.txt
@@ -26,37 +26,39 @@
set(INC
.
- ../../../intern/string
- ../../../intern/guardedalloc
+ ../BlenderRoutines
+ ../Expressions
+ ../GameLogic
+ ../Ketsji
+ ../Ketsji/KXNetwork
+ ../Network
+ ../Network/LoopBackNetwork
+ ../Physics/Bullet
+ ../Physics/Dummy
+ ../Physics/common
+ ../Rasterizer
+ ../Rasterizer/RAS_OpenGLRasterizer
+ ../Rasterizer/RAS_OpenGLRasterizer
+ ../SceneGraph
+ ../../blender
+ ../../blender/blenkernel
+ ../../blender/blenlib
+ ../../blender/blenloader
+ ../../blender/gpu
+ ../../blender/ikplugin
+ ../../blender/imbuf
+ ../../blender/makesdna
+ ../../blender/makesrna
+ ../../blender/windowmanager
+ ../../../extern/bullet2/src
../../../intern/container
- ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
- ../../../intern/audaspace/intern
- ../../../source/gameengine/Converter
- ../../../source/gameengine/BlenderRoutines
- ../../../source/blender/imbuf
+ ../../../intern/guardedalloc
../../../intern/moto/include
- ../../../source/gameengine/Ketsji
- ../../../source/gameengine/Ketsji/KXNetwork
- ../../../source/blender/blenlib
- ../../../source/blender/blenkernel
- ../../../source/blender/windowmanager
- ../../../source/blender
- ../../../source/blender/makesdna
- ../../../source/blender/makesrna
- ../../../source/gameengine/Rasterizer
- ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
- ../../../source/gameengine/GameLogic
- ../../../source/gameengine/Expressions
- ../../../source/gameengine/Network
- ../../../source/gameengine/SceneGraph
- ../../../source/gameengine/Physics/common
- ../../../source/gameengine/Physics/Bullet
- ../../../source/gameengine/Physics/Dummy
- ../../../source/gameengine/Network/LoopBackNetwork
- ../../../source/blender/blenloader
- ../../../source/blender/gpu
- ../../../source/blender/ikplugin
- ../../../extern/bullet2/src
+ ../../../intern/string
+)
+
+set(INC_SYS
+
)
set(SRC
@@ -109,4 +111,11 @@ if(WITH_BULLET)
add_definitions(-DUSE_BULLET)
endif()
-blender_add_lib(ge_converter "${SRC}" "${INC}")
+if(WITH_AUDASPACE)
+ list(APPEND INC
+ ../../../intern/audaspace/intern
+ )
+ add_definitions(-DWITH_AUDASPACE)
+endif()
+
+blender_add_lib(ge_converter "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index 684ed0b06f9..58089cc4b2d 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -994,7 +994,7 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
int i=0;
LinkNode *n= names;
while(n) {
- BLO_library_append_named_part(C, main_tmp, &bpy_openlib, (char *)n->link, idcode, 0);
+ BLO_library_append_named_part(main_tmp, &bpy_openlib, (char *)n->link, idcode);
n= (LinkNode *)n->next;
i++;
}
@@ -1012,7 +1012,7 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
int i=0;
LinkNode *n= names;
while(n) {
- BLO_library_append_named_part(C, main_tmp, &bpy_openlib, (char *)n->link, ID_AC, 0);
+ BLO_library_append_named_part(main_tmp, &bpy_openlib, (char *)n->link, ID_AC);
n= (LinkNode *)n->next;
i++;
}
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp
index 01516a24182..51e0449a32e 100644
--- a/source/gameengine/Converter/KX_ConvertActuators.cpp
+++ b/source/gameengine/Converter/KX_ConvertActuators.cpp
@@ -43,7 +43,11 @@
#include "KX_BlenderSceneConverter.h"
#include "KX_ConvertActuators.h"
-#include "AUD_C-API.h"
+
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
+
// Actuators
//SCA logiclibrary native logicbricks
#include "SCA_PropertyActuator.h"
@@ -77,6 +81,7 @@
/* This little block needed for linking to Blender... */
#include "BKE_text.h"
#include "BLI_blenlib.h"
+#include "BLI_math_base.h"
#define FILE_MAX 240 // repeated here to avoid dependency from BKE_utildefines.h
@@ -286,7 +291,8 @@ void BL_ConvertActuators(char* maggiename,
camact->height,
camact->min,
camact->max,
- camact->axis=='x');
+ camact->axis=='x',
+ camact->damping);
baseact = tmpcamact;
}
break;
@@ -397,7 +403,7 @@ void BL_ConvertActuators(char* maggiename,
new KX_SoundActuator(gameobj,
snd_sound,
soundact->volume,
- (float)(exp((soundact->pitch / 12.0) * log(2.0))),
+ (float)(exp((soundact->pitch / 12.0) * M_LN2)),
is3d,
settings,
soundActuatorType);