From 6905d0d92b7f2faf0d9d26a17f495a663908ec69 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Tue, 14 Feb 2012 07:54:12 +0000 Subject: Fixing up some buggy cleanup code in BL_ShapeDeformer. This code was causing crashes and corrupting shape keys. This commit fixes the following bugs: [#30059] Shape Keys is gone in Blender if you use Add Object Actuator in BGE [#30024] Segmentation fault after addObject when using shape keys [#28683] segfault in shapekey conversion code when running a game (YF, level home) twice --- source/gameengine/Converter/BL_ShapeDeformer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/gameengine') diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index fb0a86d6084..bb3636881ea 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -50,6 +50,8 @@ #include "DNA_meshdata_types.h" #include "BKE_armature.h" #include "BKE_action.h" +#include "BKE_global.h" +#include "BKE_main.h" #include "BKE_key.h" #include "BKE_ipo.h" #include "MT_Point3.h" @@ -97,10 +99,13 @@ BL_ShapeDeformer::BL_ShapeDeformer(BL_DeformableGameObject *gameobj, BL_ShapeDeformer::~BL_ShapeDeformer() { - if (m_key && m_bmesh->key) + if (m_key && m_bmesh->key && m_key != m_bmesh->key) { free_key(m_bmesh->key); + BLI_remlink_safe(&G.main->key, m_bmesh->key); + MEM_freeN(m_bmesh->key); m_bmesh->key = m_key; + m_key = NULL; } }; -- cgit v1.2.3 From 91058355cc0508ed938aa1cb2d1f35bb1b529cf6 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 14 Feb 2012 18:23:58 +0000 Subject: font objects in blenderplayer fail when object with alpha is rendered the embed bge has its own DisableForText() routine which prepares the GL flags for the text render. For some reason blenderplayer is taking a slim approach and going straight for the rendering. This routine helps to address this bug/case (non reported, foundin my own project files). If need arises we should move this to its own routine incorporating the other GL tests the embed bge performs. --- .../GamePlayer/common/GPC_RenderTools.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source/gameengine') diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 55e3220c08c..54e2efd8776 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -291,6 +291,29 @@ void GPC_RenderTools::RenderText3D( int fontid, double* mat, float aspect) { + if(GLEW_ARB_multitexture) { + for(int i=0; i