[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15491] branches/apricot: svn merge -r15478:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender/

Campbell Barton ideasman42 at gmail.com
Tue Jul 8 20:32:45 CEST 2008


Revision: 15491
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15491
Author:   campbellbarton
Date:     2008-07-08 20:32:42 +0200 (Tue, 08 Jul 2008)

Log Message:
-----------
svn  merge  -r15478:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender/

Modified Paths:
--------------
    branches/apricot/intern/ghost/intern/GHOST_SystemWin32.cpp
    branches/apricot/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj
    branches/apricot/source/blender/blenkernel/BKE_bmeshCustomData.h
    branches/apricot/source/blender/blenkernel/BKE_customdata.h
    branches/apricot/source/blender/blenkernel/intern/BME_Customdata.c
    branches/apricot/source/blender/blenkernel/intern/BME_conversions.c
    branches/apricot/source/blender/blenkernel/intern/BME_eulers.c
    branches/apricot/source/blender/blenkernel/intern/BME_structure.c
    branches/apricot/source/blender/blenkernel/intern/BME_tools.c
    branches/apricot/source/blender/blenkernel/intern/customdata.c
    branches/apricot/source/blender/blenkernel/intern/library.c
    branches/apricot/source/blender/blenlib/BLI_mempool.h
    branches/apricot/source/blender/blenlib/intern/BLI_kdopbvh.c
    branches/apricot/source/blender/blenlib/intern/BLI_mempool.c
    branches/apricot/source/blender/include/BDR_drawobject.h
    branches/apricot/source/blender/include/BIF_editarmature.h
    branches/apricot/source/blender/makesdna/DNA_actuator_types.h
    branches/apricot/source/blender/src/buttons_logic.c
    branches/apricot/source/blender/src/drawarmature.c
    branches/apricot/source/blender/src/drawobject.c
    branches/apricot/source/blender/src/drawview.c
    branches/apricot/source/blender/src/editarmature.c
    branches/apricot/source/blender/src/editmesh_add.c
    branches/apricot/source/blender/src/editsima.c
    branches/apricot/source/blender/src/header_view3d.c
    branches/apricot/source/blender/src/space.c
    branches/apricot/source/blender/src/view.c
    branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp
    branches/apricot/source/gameengine/Expressions/PyObjectPlus.h
    branches/apricot/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_IActuator.h
    branches/apricot/source/gameengine/GameLogic/SCA_IObject.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_IObject.h
    branches/apricot/source/gameengine/GameLogic/SCA_ISensor.h
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.h
    branches/apricot/source/gameengine/Ketsji/KX_IPO_SGController.cpp
    branches/apricot/source/gameengine/Ketsji/KX_IPO_SGController.h
    branches/apricot/source/gameengine/Ketsji/KX_IpoActuator.cpp
    branches/apricot/source/gameengine/Ketsji/KX_IpoActuator.h
    branches/apricot/source/gameengine/Ketsji/KX_ParentActuator.cpp
    branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp
    branches/apricot/source/gameengine/SceneGraph/SG_Controller.h

Modified: branches/apricot/intern/ghost/intern/GHOST_SystemWin32.cpp
===================================================================
--- branches/apricot/intern/ghost/intern/GHOST_SystemWin32.cpp	2008-07-08 17:57:31 UTC (rev 15490)
+++ branches/apricot/intern/ghost/intern/GHOST_SystemWin32.cpp	2008-07-08 18:32:42 UTC (rev 15491)
@@ -302,6 +302,15 @@
 {
 	GHOST_TSuccess success = GHOST_System::init();
 
+	/* Disable scaling on high DPI displays on Vista */
+	HMODULE user32 = ::LoadLibraryA("user32.dll");
+	typedef BOOL (WINAPI * LPFNSETPROCESSDPIAWARE)();
+	LPFNSETPROCESSDPIAWARE SetProcessDPIAware =
+		(LPFNSETPROCESSDPIAWARE)GetProcAddress(user32, "SetProcessDPIAware");
+	if (SetProcessDPIAware)
+		SetProcessDPIAware();
+	FreeLibrary(user32);
+
 	// Determine whether this system has a high frequency performance counter. */
 	m_hasPerformanceCounter = ::QueryPerformanceFrequency((LARGE_INTEGER*)&m_freq) == TRUE;
 	if (m_hasPerformanceCounter) {

Modified: branches/apricot/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj
===================================================================
--- branches/apricot/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj	2008-07-08 17:57:31 UTC (rev 15490)
+++ branches/apricot/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj	2008-07-08 18:32:42 UTC (rev 15491)
@@ -359,6 +359,9 @@
 				RelativePath="..\..\..\source\blender\blenlib\intern\BLI_memarena.c">
 			</File>
 			<File
+				RelativePath="..\..\..\source\blender\blenlib\intern\BLI_mempool.c">
+			</File>
+			<File
 				RelativePath="..\..\..\source\blender\blenlib\intern\boxpack2d.c">
 			</File>
 			<File
@@ -474,6 +477,9 @@
 				RelativePath="..\..\..\source\blender\blenlib\BLI_memarena.h">
 			</File>
 			<File
+				RelativePath="..\..\..\source\blender\blenlib\BLI_mempool.h">
+			</File>
+			<File
 				RelativePath="..\..\..\source\blender\blenlib\intern\BLI_scanfill.h">
 			</File>
 			<File

Modified: branches/apricot/source/blender/blenkernel/BKE_bmeshCustomData.h
===================================================================
--- branches/apricot/source/blender/blenkernel/BKE_bmeshCustomData.h	2008-07-08 17:57:31 UTC (rev 15490)
+++ branches/apricot/source/blender/blenkernel/BKE_bmeshCustomData.h	2008-07-08 18:32:42 UTC (rev 15491)
@@ -38,7 +38,7 @@
 #ifndef BKE_BMESHCUSTOMDATA_H
 #define BKE_BMESHCUSTOMDATA_H
 
-struct BME_mempool;
+struct BLI_mempool;
 
 /*Custom Data Types and defines
 	Eventual plan is to move almost everything to custom data and let caller
@@ -62,7 +62,7 @@
 
 typedef struct BME_CustomData {
 	struct BME_CustomDataLayer *layers;	/*Custom Data Layers*/
-	struct BME_mempool *pool;				/*pool for alloc of blocks*/
+	struct BLI_mempool *pool;				/*pool for alloc of blocks*/
 	int totlayer, totsize;         	/*total layers and total size in bytes of each block*/
 } BME_CustomData;
 

Modified: branches/apricot/source/blender/blenkernel/BKE_customdata.h
===================================================================
--- branches/apricot/source/blender/blenkernel/BKE_customdata.h	2008-07-08 17:57:31 UTC (rev 15490)
+++ branches/apricot/source/blender/blenkernel/BKE_customdata.h	2008-07-08 18:32:42 UTC (rev 15491)
@@ -41,6 +41,7 @@
 extern const CustomDataMask CD_MASK_EDITMESH;
 extern const CustomDataMask CD_MASK_DERIVEDMESH;
 extern const CustomDataMask CD_MASK_BMESH;
+extern const CustomDataMask CD_MASK_FACECORNERS;
 
 /* for ORIGINDEX layer type, indicates no original index for this element */
 #define ORIGINDEX_NONE -1
@@ -264,4 +265,8 @@
 /* for file reading compatibility, returns false if the layer was freed,
    only after this test passes, layer->data should be assigned */
 int CustomData_verify_versions(struct CustomData *data, int index);
+
+void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata);
+void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata);
+void CustomData_bmesh_init_pool(struct CustomData *data, int allocsize);
 #endif

Modified: branches/apricot/source/blender/blenkernel/intern/BME_Customdata.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/BME_Customdata.c	2008-07-08 17:57:31 UTC (rev 15490)
+++ branches/apricot/source/blender/blenkernel/intern/BME_Customdata.c	2008-07-08 18:32:42 UTC (rev 15491)
@@ -40,6 +40,7 @@
 #include "bmesh_private.h"
 #include <string.h>
 #include "MEM_guardedalloc.h"
+#include "BLI_mempool.h"
 
 /********************* Layer type information **********************/
 typedef struct BME_LayerTypeInfo {
@@ -83,7 +84,7 @@
 	if(data->totlayer){
 		/*alloc memory*/
 		data->layers = MEM_callocN(sizeof(BME_CustomDataLayer)*data->totlayer, "BMesh Custom Data Layers");
-		data->pool = BME_mempool_create(data->totsize, initalloc, initalloc);
+		data->pool = BLI_mempool_create(data->totsize, initalloc, initalloc);
 		/*initialize layer data*/
 		for(i=0; i < BME_CD_NUMTYPES; i++){
 			if(init->layout[i]){
@@ -102,7 +103,7 @@
 
 void BME_CD_Free(BME_CustomData *data)
 {
-	if(data->pool) BME_mempool_destroy(data->pool);
+	if(data->pool) BLI_mempool_destroy(data->pool);
 }
 
 /*Block level ops*/
@@ -119,7 +120,7 @@
 			typeInfo->free((char*)*block + offset, 1, typeInfo->size);
 		}
 	}
-	BME_mempool_free(data->pool, *block);
+	BLI_mempool_free(data->pool, *block);
 	*block = NULL;
 }
 
@@ -130,7 +131,7 @@
 	if (*block) BME_CD_free_block(data, block); //if we copy layers that have their own free functions like deformverts
 	
 	if (data->totsize > 0)
-		*block = BME_mempool_alloc(data->pool);	
+		*block = BLI_mempool_alloc(data->pool);	
 	else
 		*block = NULL;
 }

Modified: branches/apricot/source/blender/blenkernel/intern/BME_conversions.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/BME_conversions.c	2008-07-08 17:57:31 UTC (rev 15490)
+++ branches/apricot/source/blender/blenkernel/intern/BME_conversions.c	2008-07-08 18:32:42 UTC (rev 15491)
@@ -55,14 +55,104 @@
 #include "bmesh_private.h"
 
 #include "BSE_edit.h"
-/*Converts an EditMesh to a BME_Mesh.*/
-static void bmesh_init_cdPool(CustomData *data, int allocsize){
-	if(data->totlayer)data->pool = BLI_mempool_create(data->totsize, allocsize, allocsize);
+
+static void BME_corners_to_loops(BME_Mesh *bm, CustomData *facedata, void *face_block, BME_Poly *f,int numCol, int numTex){
+	int i, j;
+	BME_Loop *l;
+	MTFace *texface;
+	MTexPoly *texpoly;
+	MCol *mcol;
+	MLoopCol *mloopcol;
+	MLoopUV *mloopuv;
+
+	for(i=0; i < numTex; i++){
+		texface = CustomData_em_get_n(facedata, face_block, CD_MTFACE, i);
+		texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i);
+		
+		texpoly->tpage = texface->tpage;
+		texpoly->flag = texface->flag;
+		texpoly->transp = texface->transp;
+		texpoly->mode = texface->mode;
+		texpoly->tile = texface->tile;
+		texpoly->unwrap = texface->unwrap;
+
+		j = 0;
+		l = f->loopbase;
+		do{
+			mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i);
+			mloopuv->uv[0] = texface->uv[j][0];
+			mloopuv->uv[1] = texface->uv[j][1];
+			j++;
+			l = l->next;
+		}while(l!=f->loopbase);
+
+	}
+	for(i=0; i < numCol; i++){
+		mcol = CustomData_em_get_n(facedata, face_block, CD_MCOL, i);
+		j = 0;
+		l = f->loopbase;
+		do{
+			mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i);
+			mloopcol->r = mcol[j].r;
+			mloopcol->g = mcol[j].g;
+			mloopcol->b = mcol[j].b;
+			mloopcol->a = mcol[j].a;
+			j++;
+			l = l->next;
+		}while(l!=f->loopbase);
+	}
 }
 
+static void BME_loops_to_corners(BME_Mesh *bm, CustomData *facedata, void *face_block, BME_Poly *f,int numCol, int numTex){
+	int i, j;
+	BME_Loop *l;
+	MTFace *texface;
+	MTexPoly *texpoly;
+	MCol *mcol;
+	MLoopCol *mloopcol;
+	MLoopUV *mloopuv;
+
+	for(i=0; i < numTex; i++){
+		texface = CustomData_em_get_n(facedata, face_block, CD_MTFACE, i);
+		texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, CD_MTEXPOLY, i);
+		
+		texface->tpage = texpoly->tpage;
+		texface->flag = texpoly->flag;
+		texface->transp = texpoly->transp;
+		texface->mode = texpoly->mode;
+		texface->tile = texpoly->tile;
+		texface->unwrap = texpoly->unwrap;
+
+		j = 0;
+		l = f->loopbase;
+		do{
+			mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPUV, i);
+			texface->uv[j][0] = mloopuv->uv[0];
+			texface->uv[j][1] = mloopuv->uv[1];
+			j++;
+			l = l->next;
+		}while(l!=f->loopbase);
+
+	}
+	for(i=0; i < numCol; i++){
+		mcol = CustomData_em_get_n(facedata, face_block, CD_MCOL, i);
+		j = 0;
+		l = f->loopbase;
+		do{
+			mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, CD_MLOOPCOL, i);
+			mcol[j].r = mloopcol->r;
+			mcol[j].g = mloopcol->g;
+			mcol[j].b = mloopcol->b;
+			mcol[j].a = mloopcol->a;
+			j++;
+			l = l->next;
+		}while(l!=f->loopbase);
+	}
+}
+/*move the EditMesh conversion functions to editmesh_tools.c*/
 BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) {
 	BME_Mesh *bm;
-	int allocsize[4] = {512,512,2048,512};
+	int allocsize[4] = {512,512,2048,512}, numTex, numCol;
 	BME_Vert *v1, *v2;
 	BME_Edge *e, *edar[4];
 	BME_Poly *f;
@@ -74,9 +164,22 @@
 	int len;
 	bm = BME_make_mesh(allocsize);
 
+	/*copy custom data layout*/
 	CustomData_copy(&em->vdata, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
-	bmesh_init_cdPool(&bm->vdata, allocsize[0]);
+	CustomData_copy(&em->edata, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0);
+	CustomData_copy(&em->fdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
 
+	/*copy face corner data*/
+	CustomData_to_bmeshpoly(&em->fdata, &bm->pdata, &bm->ldata);
+	/*initialize memory pools*/
+	CustomData_bmesh_init_pool(&bm->vdata, allocsize[0]);
+	CustomData_bmesh_init_pool(&bm->edata, allocsize[1]);
+	CustomData_bmesh_init_pool(&bm->ldata, allocsize[2]);
+	CustomData_bmesh_init_pool(&bm->pdata, allocsize[3]);
+	/*needed later*/
+	numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
+	numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL);
+
 	BME_model_begin(bm);
 	/*add verts*/
 	eve= em->verts.first;
@@ -86,7 +189,6 @@
 		v1->flag = eve->f;
 		v1->h = eve->h;
 		v1->bweight = eve->bweight;
-
 		/*Copy Custom Data*/
 		CustomData_bmesh_copy_data(&em->vdata, &bm->vdata, eve->data, &v1->data);
 		eve->tmp.v = (EditVert*)v1;
@@ -106,15 +208,10 @@
 		if(eed->seam) e->flag |= ME_SEAM;
 		if(eed->h & EM_FGON) e->flag |= ME_FGON;
 		if(eed->h & 1) e->flag |= ME_HIDE;
-
-		/* link the edges for face construction;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list