diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-10-13 15:41:41 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-10-13 15:41:41 +0400 |
commit | 5d5176095e82b34499e15d74f1fb76d56f4d9508 (patch) | |
tree | dd8c61741160804873601f6b6350661132ac1b2f /source/gameengine | |
parent | bcbf976b48762c2f25df470c6d13a124bc868a66 (diff) | |
parent | 42ac7164e30dcca565253aa265201aad497e5360 (diff) |
svn merge -r60422:60726 ^/trunk/blender
Diffstat (limited to 'source/gameengine')
5 files changed, 28 insertions, 16 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index a6b71e0bc43..bcc62a341f8 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -211,7 +211,7 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat MT_Vector3 dir = (campos - objpos).safe_normalized(); MT_Vector3 up(0,0,1.0); - KX_GameObject* gameobj = (KX_GameObject*)m_clientobject; + KX_GameObject* gameobj = (KX_GameObject *)this->m_clientobject; // get scaling of halo object MT_Vector3 size = gameobj->GetSGNode()->GetWorldScaling(); @@ -225,7 +225,7 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat } MT_Vector3 left = dir.normalized(); - dir = (up.cross(left)).normalized(); + dir = (left.cross(up)).normalized(); // we have calculated the row vectors, now we keep // local scaling into account: @@ -241,14 +241,13 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat glTranslated(objpos[0],objpos[1],objpos[2]); glMultMatrixd(maat); - } else { if (objectdrawmode & RAS_IPolyMaterial::SHADOW) { // shadow must be cast to the ground, physics system needed here! MT_Point3 frompoint(oglmatrix[12],oglmatrix[13],oglmatrix[14]); - KX_GameObject *gameobj = (KX_GameObject*)m_clientobject; + KX_GameObject *gameobj = (KX_GameObject *)this->m_clientobject; MT_Vector3 direction = MT_Vector3(0,0,-1); direction.normalize(); @@ -328,7 +327,7 @@ void KX_BlenderRenderTools::RenderText( RAS_IPolyMaterial* polymat, float v1[3], float v2[3], float v3[3], float v4[3], int glattrib) { - const STR_String& mytext = ((CValue*)m_clientobject)->GetPropertyText("Text"); + const STR_String &mytext = ((CValue *)m_clientobject)->GetPropertyText("Text"); const unsigned int flag = polymat->GetFlag(); struct MTFace* tface = 0; @@ -408,3 +407,4 @@ void KX_BlenderRenderTools::MotionBlur(RAS_IRasterizer* rasterizer) } } } + diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index dd9609968b0..b0555abbea4 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2665,7 +2665,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, case PARBONE: { // parent this to a bone - Bone *parent_bone = BKE_armature_find_bone_name( (bArmature *)(blenderchild->parent)->data, blenderchild->parsubstr); + Bone *parent_bone = BKE_armature_find_bone_name(BKE_armature_from_object(blenderchild->parent), + blenderchild->parsubstr); if (parent_bone) { KX_BoneParentRelation *bone_parent_relation = KX_BoneParentRelation::New(parent_bone); diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index e8c29d5aa4f..0d851c4f10d 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -66,9 +66,7 @@ unsigned int GPC_RenderTools::m_numgllights; GPC_RenderTools::GPC_RenderTools() { -// XXX m_font = BMF_GetFont(BMF_kHelvetica10); - - glGetIntegerv(GL_MAX_LIGHTS, (GLint*) &m_numgllights); + glGetIntegerv(GL_MAX_LIGHTS, (GLint *) &m_numgllights); if (m_numgllights < 8) m_numgllights = 8; } @@ -220,7 +218,7 @@ void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,in MT_Vector3 dir = (campos - objpos).safe_normalized(); MT_Vector3 up(0,0,1.0); - KX_GameObject* gameobj = (KX_GameObject*) this->m_clientobject; + KX_GameObject* gameobj = (KX_GameObject *)this->m_clientobject; // get scaling of halo object MT_Vector3 size = gameobj->GetSGNode()->GetWorldScaling(); @@ -256,7 +254,7 @@ void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,in { // shadow must be cast to the ground, physics system needed here! MT_Point3 frompoint(oglmatrix[12],oglmatrix[13],oglmatrix[14]); - KX_GameObject *gameobj = (KX_GameObject*) this->m_clientobject; + KX_GameObject *gameobj = (KX_GameObject *)this->m_clientobject; MT_Vector3 direction = MT_Vector3(0,0,-1); direction.normalize(); @@ -280,6 +278,12 @@ void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,in // couldn't find something to cast the shadow on... glMultMatrixd(oglmatrix); } + else + { // we found the "ground", but the cast matrix doesn't take + // scaling in consideration, so we must apply the object scale + MT_Vector3 size = gameobj->GetSGNode()->GetLocalScale(); + glScalef(size[0], size[1], size[2]); + } } else { @@ -490,7 +494,7 @@ void GPC_RenderTools::RenderText( RAS_IPolyMaterial* polymat, float v1[3], float v2[3], float v3[3], float v4[3], int glattrib) { - STR_String mytext = ((CValue*)m_clientobject)->GetPropertyText("Text"); + const STR_String &mytext = ((CValue *)m_clientobject)->GetPropertyText("Text"); const unsigned int flag = polymat->GetFlag(); struct MTFace* tface = 0; @@ -562,8 +566,7 @@ void GPC_RenderTools::MotionBlur(RAS_IRasterizer* rasterizer) glAccum(GL_LOAD, 1.0); rasterizer->SetMotionBlurState(2); } - else if (motionblurvalue>=0.0 && motionblurvalue<=1.0) - { + else if (motionblurvalue >= 0.0f && motionblurvalue <= 1.0f) { glAccum(GL_MULT, motionblurvalue); glAccum(GL_ACCUM, 1-motionblurvalue); glAccum(GL_RETURN, 1.0); diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 0b1fbf977dd..5bed4fa40b6 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -58,11 +58,15 @@ extern "C" #endif // __cplusplus #include "MEM_guardedalloc.h" #include "BLI_threads.h" +#include "BLI_mempool.h" #include "BLI_blenlib.h" + #include "DNA_scene_types.h" #include "DNA_userdef_types.h" + #include "BLO_readfile.h" #include "BLO_runtime.h" + #include "BKE_blender.h" #include "BKE_depsgraph.h" #include "BKE_global.h" @@ -74,6 +78,7 @@ extern "C" #include "BKE_modifier.h" #include "BKE_text.h" #include "BKE_sound.h" + #include "IMB_imbuf.h" int GHOST_HACK_getFirstFile(char buf[]); @@ -580,8 +585,11 @@ int main(int argc, char** argv) case 'd': i++; - G.debug |= G_DEBUG; /* std output printf's */ + G.debug |= G_DEBUG; MEM_set_memory_debug(); +#ifdef DEBUG + BLI_mempool_set_memory_debug(); +#endif break; case 'f': diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index b3a38cb4f98..e5b8159753b 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -968,7 +968,7 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, setTexture , "setTexture( index, tex)") return NULL; } -static unsigned int GL_array[11] = { +static const unsigned int GL_array[11] = { GL_ZERO, GL_ONE, GL_SRC_COLOR, |