[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12667] trunk/blender/source/blender: replace macro's with functions for UV editmode checks, this wasn' t nice code and broke building on solaris
Campbell Barton
ideasman42 at gmail.com
Sun Nov 25 14:43:14 CET 2007
Revision: 12667
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12667
Author: campbellbarton
Date: 2007-11-25 14:43:14 +0100 (Sun, 25 Nov 2007)
Log Message:
-----------
replace macro's with functions for UV editmode checks, this wasn't nice code and broke building on solaris
Modified Paths:
--------------
trunk/blender/source/blender/include/BIF_editsima.h
trunk/blender/source/blender/src/drawimage.c
trunk/blender/source/blender/src/editface.c
trunk/blender/source/blender/src/editsima.c
trunk/blender/source/blender/src/editview.c
trunk/blender/source/blender/src/transform_conversions.c
trunk/blender/source/blender/src/unwrapper.c
Modified: trunk/blender/source/blender/include/BIF_editsima.h
===================================================================
--- trunk/blender/source/blender/include/BIF_editsima.h 2007-11-25 03:46:41 UTC (rev 12666)
+++ trunk/blender/source/blender/include/BIF_editsima.h 2007-11-25 13:43:14 UTC (rev 12667)
@@ -40,31 +40,6 @@
#define TF_PIN_MASK(id) (TF_PIN1 << id)
#define TF_SEL_MASK(id) (TF_SEL1 << id)
-
-/* this checks weather a face is drarn without the local image check
- * - warning - no check for G.sima->flag, use SIMA_FACEDRAW_CHECK
- */
-#define SIMA_FACEDRAW_CHECK_NOLOCAL(efa) \
- ((G.sima->flag & SI_SYNC_UVSEL) ? (efa->h==0) : (efa->h==0 && efa->f & SELECT))
-
-/* this check includes the local image check - (does the faces image match the space image?) */
-#define SIMA_FACEDRAW_CHECK(efa, tf) \
- ((G.sima && G.sima->flag & SI_LOCAL_UV) ? ((tf->tpage==G.sima->image) ? SIMA_FACEDRAW_CHECK_NOLOCAL(efa):0) : (SIMA_FACEDRAW_CHECK_NOLOCAL(efa)))
-
-#define SIMA_FACESEL_CHECK(efa, tf) \
- ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? (efa->f & SELECT) : (!(~tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) &&(!efa->v4 || tf->flag & TF_SEL4)))
-#define SIMA_FACESEL_SET(efa, tf) \
- ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? (EM_select_face(efa, 1)) : (tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)))
-#define SIMA_FACESEL_UNSET(efa, tf) \
- ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? (EM_select_face(efa, 0)) : (tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)))
-
-#define SIMA_UVSEL_CHECK(efa, tf, i) ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? \
- (G.scene->selectmode == SCE_SELECT_FACE ? efa->f & SELECT : ((*(&efa->v1 + i))->f & SELECT) ) : (tf->flag & TF_SEL_MASK(i) ))
-#define SIMA_UVSEL_SET(efa, tf, i) ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? \
- (G.scene->selectmode == SCE_SELECT_FACE ? EM_select_face(efa, 1) : ((*(&efa->v1 + i))->f |= SELECT) ) : (tf->flag |= TF_SEL_MASK(i) ))
-#define SIMA_UVSEL_UNSET(efa, tf, i) ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? \
- (G.scene->selectmode == SCE_SELECT_FACE ? EM_select_face(efa, 0) : ((*(&efa->v1 + i))->f &= ~SELECT) ) : (tf->flag &= ~TF_SEL_MASK(i) ))
-
struct Object;
void object_uvs_changed(struct Object *ob);
@@ -122,3 +97,16 @@
void BIF_image_update_frame(void);
void find_nearest_uv(struct MTFace **nearesttf, struct EditFace **nearestefa, unsigned int *nearestv, int *nearestuv);
+
+/* face selection check functions */
+
+int simaFaceDraw_Check_nolocal( struct EditFace *efa );
+int simaFaceDraw_Check( struct EditFace *efa, struct MTFace *tf );
+
+int simaFaceSel_Check( struct EditFace *efa, struct MTFace *tf );
+void simaFaceSel_Set( struct EditFace *efa, struct MTFace *tf );
+void simaFaceSel_UnSet( struct EditFace *efa, struct MTFace *tf );
+
+int simaUVSel_Check( struct EditFace *efa, struct MTFace *tf, int i);
+void simaUVSel_Set( struct EditFace *efa, struct MTFace *tf, int i);
+void simaUVSel_UnSet( struct EditFace *efa, struct MTFace *tf, int i);
Modified: trunk/blender/source/blender/src/drawimage.c
===================================================================
--- trunk/blender/source/blender/src/drawimage.c 2007-11-25 03:46:41 UTC (rev 12666)
+++ trunk/blender/source/blender/src/drawimage.c 2007-11-25 13:43:14 UTC (rev 12667)
@@ -354,7 +354,7 @@
}
}
}
- /* change the space image after because SIMA_FACEDRAW_CHECK uses the space image
+ /* change the space image after because simaFaceDraw_Check uses the space image
* to check if the face is displayed in UV-localview */
sima->image = image;
@@ -581,10 +581,10 @@
for (efa= em->faces.first; efa; efa= efa->next) {
tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+ if (simaFaceDraw_Check(efa, tface)) {
efa->tmp.p = tface;
if (tface==activetface) continue; /* important the temp pointer is set above */
- if( SIMA_FACESEL_CHECK(efa, tface) )
+ if( simaFaceSel_Check(efa, tface) )
glColor4ubv((GLubyte *)col2);
else
glColor4ubv((GLubyte *)col1);
@@ -606,7 +606,7 @@
/* would be nice to do this within a draw loop but most below are optional, so it would involve too many checks */
for (efa= em->faces.first; efa; efa= efa->next) {
tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+ if (simaFaceDraw_Check(efa, tface)) {
efa->tmp.p = tface;
} else {
if (tface == activetface)
@@ -645,7 +645,7 @@
case SI_UVDT_DASH:
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+// if (simaFaceDraw_Check(efa, tface)) {
/*this is a shortcut to do the same as above but a faster for drawing */
if ((tface=(MTFace *)efa->tmp.p)) {
@@ -685,7 +685,7 @@
cpack((G.sima->dt_uv==SI_UVDT_WHITE) ? 0xFFFFFF : 0x0);
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+// if (simaFaceDraw_Check(efa, tface)) {
/*this is a shortcut to do the same as above but a faster for drawing */
if ((tface=(MTFace *)efa->tmp.p)) {
@@ -705,7 +705,7 @@
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+// if (simaFaceDraw_Check(efa, tface)) {
/*this is a shortcut to do the same as above but a faster for drawing */
if ((tface=(MTFace *)efa->tmp.p)) {
@@ -723,7 +723,7 @@
cpack(0xFFFFFF);
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+// if (simaFaceDraw_Check(efa, tface)) {
/*this is a shortcut to do the same as above but a faster for drawing */
if ((tface=(MTFace *)efa->tmp.p)) {
@@ -759,11 +759,11 @@
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+// if (simaFaceDraw_Check(efa, tface)) {
/*this is a shortcut to do the same as above but a faster for drawing */
if ((tface=(MTFace *)efa->tmp.p)) {
- if( ! SIMA_FACESEL_CHECK(efa, tface) ) {
+ if( ! simaFaceSel_Check(efa, tface) ) {
tface_center(tface, cent, (void *)efa->v4);
bglVertex2fv(cent);
}
@@ -776,11 +776,11 @@
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+// if (simaFaceDraw_Check(efa, tface)) {
/*this is a shortcut to do the same as above but a faster for drawing */
if ((tface=(MTFace *)efa->tmp.p)) {
- if( SIMA_FACESEL_CHECK(efa, tface) ) {
+ if( simaFaceSel_Check(efa, tface) ) {
tface_center(tface, cent, (void *)efa->v4);
bglVertex2fv(cent);
}
@@ -799,16 +799,16 @@
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+// if (simaFaceDraw_Check(efa, tface)) {
/*this is a shortcut to do the same as above but a faster for drawing */
if ((tface=(MTFace *)efa->tmp.p)) {
- if(SIMA_UVSEL_CHECK(efa, tface, 0)); else bglVertex2fv(tface->uv[0]);
- if(SIMA_UVSEL_CHECK(efa, tface, 1)); else bglVertex2fv(tface->uv[1]);
- if(SIMA_UVSEL_CHECK(efa, tface, 2)); else bglVertex2fv(tface->uv[2]);
+ if(simaUVSel_Check(efa, tface, 0)); else bglVertex2fv(tface->uv[0]);
+ if(simaUVSel_Check(efa, tface, 1)); else bglVertex2fv(tface->uv[1]);
+ if(simaUVSel_Check(efa, tface, 2)); else bglVertex2fv(tface->uv[2]);
if(efa->v4) {
- if(SIMA_UVSEL_CHECK(efa, tface, 3)); else bglVertex2fv(tface->uv[3]);
+ if(simaUVSel_Check(efa, tface, 3)); else bglVertex2fv(tface->uv[3]);
}
}
}
@@ -822,7 +822,7 @@
bglBegin(GL_POINTS);
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+// if (simaFaceDraw_Check(efa, tface)) {
/*this is a shortcut to do the same as above but a faster for drawing */
if ((tface=(MTFace *)efa->tmp.p)) {
@@ -844,16 +844,16 @@
bglBegin(GL_POINTS);
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
+// if (simaFaceDraw_Check(efa, tface)) {
/*this is a shortcut to do the same as above but a faster for drawing */
if ((tface=(MTFace *)efa->tmp.p)) {
- if(!SIMA_UVSEL_CHECK(efa, tface, 0)); else bglVertex2fv(tface->uv[0]);
- if(!SIMA_UVSEL_CHECK(efa, tface, 1)); else bglVertex2fv(tface->uv[1]);
- if(!SIMA_UVSEL_CHECK(efa, tface, 2)); else bglVertex2fv(tface->uv[2]);
+ if(!simaUVSel_Check(efa, tface, 0)); else bglVertex2fv(tface->uv[0]);
+ if(!simaUVSel_Check(efa, tface, 1)); else bglVertex2fv(tface->uv[1]);
+ if(!simaUVSel_Check(efa, tface, 2)); else bglVertex2fv(tface->uv[2]);
if(efa->v4) {
- if(!SIMA_UVSEL_CHECK(efa, tface, 3)); else bglVertex2fv(tface->uv[3]);
+ if(!simaUVSel_Check(efa, tface, 3)); else bglVertex2fv(tface->uv[3]);
}
}
}
@@ -1006,24 +1006,24 @@
for (efa= em->faces.first; efa; efa= efa->next) {
tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (SIMA_FACEDRAW_CHECK(efa, tf)) {
+ if (simaFaceDraw_Check(efa, tf)) {
- if (SIMA_UVSEL_CHECK(efa, tf, 0)) {
+ if (simaUVSel_Check(efa, tf, 0)) {
cent[0]+= tf->uv[0][0];
cent[1]+= tf->uv[0][1];
nactive++;
}
- if (SIMA_UVSEL_CHECK(efa, tf, 1)) {
+ if (simaUVSel_Check(efa, tf, 1)) {
cent[0]+= tf->uv[1][0];
cent[1]+= tf->uv[1][1];
nactive++;
}
- if (SIMA_UVSEL_CHECK(efa, tf, 2)) {
+ if (simaUVSel_Check(efa, tf, 2)) {
cent[0]+= tf->uv[2][0];
cent[1]+= tf->uv[2][1];
nactive++;
}
- if (efa->v4 && SIMA_UVSEL_CHECK(efa, tf, 3)) {
+ if (efa->v4 && simaUVSel_Check(efa, tf, 3)) {
cent[0]+= tf->uv[3][0];
cent[1]+= tf->uv[3][1];
nactive++;
@@ -1070,20 +1070,20 @@
for (efa= em->faces.first; efa; efa= efa->next) {
tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (SIMA_FACEDRAW_CHECK(efa, tf)) {
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list