[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40552] branches/soc-2011-cucumber: Bringing the patch back into the branch.

Daniel Stokes kupomail at gmail.com
Mon Sep 26 08:56:42 CEST 2011


Revision: 40552
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40552
Author:   kupoman
Date:     2011-09-26 06:56:41 +0000 (Mon, 26 Sep 2011)
Log Message:
-----------
Bringing the patch back into the branch.
The changelog:
* properties_scene.py now uses COMPAT_ENGINES properly
* fixed an error in space_logic.py
* changed cmake flag WITH_DDS to WITH_IMAGE_DDS
* fixed a crash with reading mipmap data in DDS files
* fixed an inconsistency in GPG_Application.cpp
* added a comment explaining why USER_DISABLE_VBO is set in GPG_ghost.cpp
* removed some code that was accidentally committed to refix a crash from libloaded lights
* fixed a memory leak with dynamic lights
* reapplied a fix for raycasting (seems to always disappear)

Thanks to Mitchell Stokes for the DDS fixes

Modified Paths:
--------------
    branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_scene.py
    branches/soc-2011-cucumber/release/scripts/startup/bl_ui/space_logic.py
    branches/soc-2011-cucumber/source/blender/gpu/CMakeLists.txt
    branches/soc-2011-cucumber/source/blender/gpu/SConscript
    branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
    branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/DirectDrawSurface.h
    branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/dds_api.cpp
    branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
    branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
    branches/soc-2011-cucumber/source/gameengine/Ketsji/CMakeLists.txt
    branches/soc-2011-cucumber/source/gameengine/Ketsji/KX_Light.cpp
    branches/soc-2011-cucumber/source/gameengine/Physics/Bullet/CcdPhysicsController.h

Modified: branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_scene.py
===================================================================
--- branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_scene.py	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_scene.py	2011-09-26 06:56:41 UTC (rev 40552)
@@ -35,6 +35,7 @@
 
 class SCENE_PT_scene(SceneButtonsPanel, Panel):
     bl_label = "Scene"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     def draw(self, context):
         layout = self.layout
@@ -74,6 +75,7 @@
 
 class SCENE_PT_unit(SceneButtonsPanel, Panel):
     bl_label = "Units"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     def draw(self, context):
         layout = self.layout
@@ -191,6 +193,7 @@
 
 class SCENE_PT_simplify(SceneButtonsPanel, Panel):
     bl_label = "Simplify"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         scene = context.scene

Modified: branches/soc-2011-cucumber/release/scripts/startup/bl_ui/space_logic.py
===================================================================
--- branches/soc-2011-cucumber/release/scripts/startup/bl_ui/space_logic.py	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/release/scripts/startup/bl_ui/space_logic.py	2011-09-26 06:56:41 UTC (rev 40552)
@@ -70,9 +70,9 @@
         layout.template_header()
 
         if context.area.show_menus:
-            sub = row.row(align=True)
-            sub.menu("LOGIC_MT_view")
-            sub.menu("LOGIC_MT_logicbricks_add")
+            row = layout.row(align=True)
+            row.menu("LOGIC_MT_view")
+            row.menu("LOGIC_MT_logicbricks_add")
 
 
 class LOGIC_MT_view(Menu):

Modified: branches/soc-2011-cucumber/source/blender/gpu/CMakeLists.txt
===================================================================
--- branches/soc-2011-cucumber/source/blender/gpu/CMakeLists.txt	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/blender/gpu/CMakeLists.txt	2011-09-26 06:56:41 UTC (rev 40552)
@@ -62,7 +62,7 @@
 
 add_definitions(-DGLEW_STATIC)
 
-if(WITH_DDS)
+if(WITH_IMAGE_DDS)
 	add_definitions(-DWITH_DDS)
 endif()
 

Modified: branches/soc-2011-cucumber/source/blender/gpu/SConscript
===================================================================
--- branches/soc-2011-cucumber/source/blender/gpu/SConscript	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/blender/gpu/SConscript	2011-09-26 06:56:41 UTC (rev 40552)
@@ -15,4 +15,7 @@
 
 defs.append('WITH_SMOKE')  # TODO, make optional
 
+if env['WITH_BF_DDS']:
+	defs.append('WITH_DDS')
+
 env.BlenderLib ( 'bf_gpu', sources, Split(incs), defines = defs, libtype=['core','player'], priority=[160,110] )

Modified: branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
===================================================================
--- branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp	2011-09-26 06:56:41 UTC (rev 40552)
@@ -1137,16 +1137,26 @@
 	}
 }
 
-unsigned char* DirectDrawSurface::compressedData(uint &size)
+// It was easier to copy this function from upstream than to resync.
+// This should be removed if a resync ever occurs.
+void* DirectDrawSurface::readData(uint &rsize)
 {
-	int factor = fourCC() == FOURCC_DXT1 ? 2 : 4;
-	size = mipmapCount() > 1 ? header.pitch * factor: header.pitch;
-	
+	uint header_size = 128; // sizeof(DDSHeader);
+	if (header.hasDX10Header())
+	{
+		header_size += 20; // sizeof(DDSHeader10);
+	}
+
+	uint size = stream.size - header_size;
+	rsize = size;
+
 	unsigned char *data = new unsigned char[size];
 
-	stream.seek(offset(0, 0));
+	stream.seek(header_size);
 	mem_read(stream, data, size);
 
+	// Maybe check if size == rsize? assert() isn't in this scope...
+
 	return data;
 }
 

Modified: branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/DirectDrawSurface.h
===================================================================
--- branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/DirectDrawSurface.h	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/DirectDrawSurface.h	2011-09-26 06:56:41 UTC (rev 40552)
@@ -174,7 +174,7 @@
         void setUserVersion(int version);
 	
 	void mipmap(Image * img, uint f, uint m);
-	unsigned char* compressedData(uint &size);
+	void* readData(uint &size);
 	//	void mipmap(FloatImage * img, uint f, uint m);
 	
 	void printInfo() const;

Modified: branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/dds_api.cpp
===================================================================
--- branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/dds_api.cpp	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/blender/imbuf/intern/dds/dds_api.cpp	2011-09-26 06:56:41 UTC (rev 40552)
@@ -146,7 +146,7 @@
 		}
 
 		if (ibuf->dds_data.fourcc != FOURCC_DDS)
-			ibuf->dds_data.data = dds.compressedData(ibuf->dds_data.size);
+			ibuf->dds_data.data = (unsigned char*)dds.readData(ibuf->dds_data.size);
 		else {
 			ibuf->dds_data.data = NULL;
 			ibuf->dds_data.size = 0;

Modified: branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.cpp	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.cpp	2011-09-26 06:56:41 UTC (rev 40552)
@@ -627,10 +627,7 @@
 		m_ketsjiengine->SetRasterizer(m_rasterizer);
 
 		m_ketsjiengine->SetTimingDisplay(frameRate, false, false);
-		
-		
-
-		KX_KetsjiEngine::SetExitKey(ConvertKeyCode(gm->exitkey));
+		m_ketsjiengine->SetExitKey(ConvertKeyCode(gm->exitkey));
 #ifdef WITH_PYTHON
 		CValue::SetDeprecationWarnings(nodepwarnings);
 #else

Modified: branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2011-09-26 06:56:41 UTC (rev 40552)
@@ -413,6 +413,7 @@
 	
 	initglobals();
 
+	// Blender's VBOs cause odd problems with modifiers (we have our own vbo code)
 	U.gameflags |= USER_DISABLE_VBO;
 	// We load our own G.main, so free the one that initglobals() gives us
 	free_main(G.main);

Modified: branches/soc-2011-cucumber/source/gameengine/Ketsji/CMakeLists.txt
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/Ketsji/CMakeLists.txt	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/gameengine/Ketsji/CMakeLists.txt	2011-09-26 06:56:41 UTC (rev 40552)
@@ -221,7 +221,7 @@
 
 add_definitions(-DGLEW_STATIC)
 
-if(WITH_DDS)
+if(WITH_IMAGE_DDS)
 	add_definitions(-DWITH_DDS)
 endif()
 

Modified: branches/soc-2011-cucumber/source/gameengine/Ketsji/KX_Light.cpp
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/Ketsji/KX_Light.cpp	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/gameengine/Ketsji/KX_Light.cpp	2011-09-26 06:56:41 UTC (rev 40552)
@@ -341,7 +341,7 @@
 	//Don't bother finishing setup if there are no lights in the pools
 	//Also if no Dynamic lights are allocated, sometimes libload will get passed the count
 	//check and screw things up
-	if (m_blenderlight_count == 0 && false)
+	if (m_blenderlight_count == 0)
 		return;
 
 	init_subpool(scene, &m_blenderlight_points, point_count, LA_LOCAL);
@@ -412,6 +412,7 @@
 
 		base = object_in_scene(subpool->back(), m_blenderlight_scene);
 		BLI_remlink(&m_blenderlight_scene->base, base);
+		GPU_lamp_free(base->object);
 		free_libblock_us(&G.main->object, base->object);
 		if(m_blenderlight_scene->basact==base) m_blenderlight_scene->basact=NULL;
 		MEM_freeN(base);

Modified: branches/soc-2011-cucumber/source/gameengine/Physics/Bullet/CcdPhysicsController.h
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/Physics/Bullet/CcdPhysicsController.h	2011-09-26 06:39:19 UTC (rev 40551)
+++ branches/soc-2011-cucumber/source/gameengine/Physics/Bullet/CcdPhysicsController.h	2011-09-26 06:56:41 UTC (rev 40552)
@@ -222,7 +222,7 @@
 		DebrisFilter = 8,
 		SensorFilter = 16,
 		UserFilter = 1<<8 | 1<<9 | 1<<10 | 1<<11 | 1<<12 | 1<<13 | 1<<14 | 1<<15,
-		AllFilter = StaticFilter | KinematicFilter | DebrisFilter | SensorFilter | UserFilter,
+		AllFilter = DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorFilter | UserFilter,
 	};
 
 




More information about the Bf-blender-cvs mailing list