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/blender/src/meshtools.c')
-rw-r--r--source/blender/src/meshtools.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c
index 0f30aef04df..66a484eb903 100644
--- a/source/blender/src/meshtools.c
+++ b/source/blender/src/meshtools.c
@@ -84,7 +84,6 @@ void sort_faces(void);
#include "BIF_toolbox.h"
#include "BIF_editconstraint.h"
-#include "BDR_drawmesh.h"
#include "BDR_editobject.h"
#include "BDR_editface.h"
#include "BDR_sculptmode.h"
@@ -107,6 +106,10 @@ void sort_faces(void);
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
+#include "GPU_draw.h"
+
+#include "BLO_sys_types.h" // for intptr_t support
+
/* from rendercode.c */
#define VECMUL(dest, f) dest[0]*= f; dest[1]*= f; dest[2]*= f
@@ -592,7 +595,7 @@ void sort_faces(void)
typedef struct MocNode {
struct MocNode *next;
- long index[MOC_NODE_RES];
+ intptr_t index[MOC_NODE_RES];
} MocNode;
static int mesh_octree_get_base_offs(float *co, float *offs, float *div)
@@ -610,7 +613,7 @@ static int mesh_octree_get_base_offs(float *co, float *offs, float *div)
return (vx*MOC_RES*MOC_RES) + vy*MOC_RES + vz;
}
-static void mesh_octree_add_node(MocNode **bt, long index)
+static void mesh_octree_add_node(MocNode **bt, intptr_t index)
{
if(*bt==NULL) {
*bt= MEM_callocN(sizeof(MocNode), "MocNode");
@@ -642,7 +645,7 @@ static void mesh_octree_free_node(MocNode **bt)
/* temporal define, just to make nicer code below */
#define MOC_ADDNODE(vx, vy, vz) mesh_octree_add_node(basetable + ((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz), index)
-static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, long index)
+static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, intptr_t index)
{
float fx, fy, fz;
int vx, vy, vz;
@@ -690,7 +693,7 @@ static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, f
}
-static long mesh_octree_find_index(MocNode **bt, float (*orco)[3], MVert *mvert, float *co)
+static intptr_t mesh_octree_find_index(MocNode **bt, float (*orco)[3], MVert *mvert, float *co)
{
float *vec;
int a;
@@ -734,7 +737,7 @@ static struct {
/* mode is 's' start, or 'e' end, or 'u' use */
/* if end, ob can be NULL */
-long mesh_octree_table(Object *ob, float *co, char mode)
+intptr_t mesh_octree_table(Object *ob, float *co, char mode)
{
MocNode **bt;
@@ -768,15 +771,15 @@ long mesh_octree_table(Object *ob, float *co, char mode)
}
else {
MVert *mvert;
- float *co;
+ float *vco;
int a, totvert;
MeshOctree.orco= mesh_getRefKeyCos(me, &totvert);
mesh_get_texspace(me, MeshOctree.orcoloc, NULL, NULL);
for(a=0, mvert= me->mvert; a<me->totvert; a++, mvert++) {
- co= (MeshOctree.orco)? MeshOctree.orco[a]: mvert->co;
- DO_MINMAX(co, min, max);
+ vco= (MeshOctree.orco)? MeshOctree.orco[a]: mvert->co;
+ DO_MINMAX(vco, min, max);
}
}
@@ -805,17 +808,17 @@ long mesh_octree_table(Object *ob, float *co, char mode)
EditVert *eve;
for(eve= G.editMesh->verts.first; eve; eve= eve->next) {
- mesh_octree_add_nodes(MeshOctree.table, eve->co, MeshOctree.offs, MeshOctree.div, (long)(eve));
+ mesh_octree_add_nodes(MeshOctree.table, eve->co, MeshOctree.offs, MeshOctree.div, (intptr_t)(eve));
}
}
else {
MVert *mvert;
- float *co;
+ float *vco;
int a;
for(a=0, mvert= me->mvert; a<me->totvert; a++, mvert++) {
- co= (MeshOctree.orco)? MeshOctree.orco[a]: mvert->co;
- mesh_octree_add_nodes(MeshOctree.table, co, MeshOctree.offs, MeshOctree.div, a+1);
+ vco= (MeshOctree.orco)? MeshOctree.orco[a]: mvert->co;
+ mesh_octree_add_nodes(MeshOctree.table, vco, MeshOctree.offs, MeshOctree.div, a+1);
}
}
}
@@ -863,7 +866,7 @@ int mesh_get_x_mirror_vert(Object *ob, int index)
EditVert *editmesh_get_x_mirror_vert(Object *ob, float *co)
{
float vec[3];
- long poinval;
+ intptr_t poinval;
/* ignore nan verts */
if (isnan(co[0]) || !finite(co[0]) ||
@@ -1128,7 +1131,7 @@ void objects_bake_render(short event, char **error_msg)
if(ima->ok==IMA_OK_LOADED) {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
- free_realtime_image(ima);
+ GPU_free_image(ima);
imb_freemipmapImBuf(ibuf);
}
}