[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45738] branches/soc-2011-tomato: Merging r45718 through r45737 from trunk into soc-2011-tomato
Sergey Sharybin
sergey.vfx at gmail.com
Wed Apr 18 09:57:21 CEST 2012
Revision: 45738
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45738
Author: nazgul
Date: 2012-04-18 07:57:20 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
Merging r45718 through r45737 from trunk into soc-2011-tomato
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45718
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45737
Modified Paths:
--------------
branches/soc-2011-tomato/source/blender/blenlib/intern/scanfill.c
branches/soc-2011-tomato/source/blender/blenloader/BLO_undofile.h
branches/soc-2011-tomato/source/blender/blenloader/BLO_writefile.h
branches/soc-2011-tomato/source/blender/blenloader/intern/undofile.c
branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c
branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_core.c
branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_mods.c
branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_queries.c
branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_queries.h
branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_walkers_impl.c
branches/soc-2011-tomato/source/blender/bmesh/operators/bmo_dissolve.c
branches/soc-2011-tomato/source/blender/bmesh/operators/bmo_triangulate.c
branches/soc-2011-tomato/source/blender/bmesh/tools/BME_bevel.c
branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_knife.c
branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_rip.c
branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_select.c
branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_tools.c
branches/soc-2011-tomato/source/blender/editors/transform/transform.c
branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_files.c
branches/soc-2011-tomato/source/blenderplayer/bad_level_call_stubs/stubs.c
Property Changed:
----------------
branches/soc-2011-tomato/
branches/soc-2011-tomato/release/scripts/templates/operator_file_import.py
branches/soc-2011-tomato/source/blender/editors/space_outliner/
Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-45717
+ /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-45737
Property changes on: branches/soc-2011-tomato/release/scripts/templates/operator_file_import.py
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: branches/soc-2011-tomato/source/blender/blenlib/intern/scanfill.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenlib/intern/scanfill.c 2012-04-18 07:29:12 UTC (rev 45737)
+++ branches/soc-2011-tomato/source/blender/blenlib/intern/scanfill.c 2012-04-18 07:57:20 UTC (rev 45738)
@@ -882,7 +882,7 @@
}
if (UNLIKELY(normalize_v3(n) == 0.0f)) {
- n[2] = 1.0f; /* other axis set to 0.0 */
+ return 0;
}
axis_dominant_v3(&co_x, &co_y, n);
Modified: branches/soc-2011-tomato/source/blender/blenloader/BLO_undofile.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/BLO_undofile.h 2012-04-18 07:29:12 UTC (rev 45737)
+++ branches/soc-2011-tomato/source/blender/blenloader/BLO_undofile.h 2012-04-18 07:57:20 UTC (rev 45738)
@@ -47,7 +47,7 @@
} MemFile;
/* actually only used writefile.c */
-extern void add_memfilechunk(MemFile *compare, MemFile *current, char *buf, unsigned int size);
+extern void add_memfilechunk(MemFile *compare, MemFile *current, const char *buf, unsigned int size);
/* exports */
extern void BLO_free_memfile(MemFile *memfile);
Modified: branches/soc-2011-tomato/source/blender/blenloader/BLO_writefile.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/BLO_writefile.h 2012-04-18 07:29:12 UTC (rev 45737)
+++ branches/soc-2011-tomato/source/blender/blenloader/BLO_writefile.h 2012-04-18 07:57:20 UTC (rev 45738)
@@ -37,7 +37,7 @@
struct Main;
struct ReportList;
-extern int BLO_write_file(struct Main *mainvar, const char *filepath, int write_flags, struct ReportList *reports, int *thumb);
+extern int BLO_write_file(struct Main *mainvar, const char *filepath, int write_flags, struct ReportList *reports, const int *thumb);
extern int BLO_write_file_mem(struct Main *mainvar, struct MemFile *compare, struct MemFile *current, int write_flags);
#define BLEN_THUMB_SIZE 128
Modified: branches/soc-2011-tomato/source/blender/blenloader/intern/undofile.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/intern/undofile.c 2012-04-18 07:29:12 UTC (rev 45737)
+++ branches/soc-2011-tomato/source/blender/blenloader/intern/undofile.c 2012-04-18 07:57:20 UTC (rev 45738)
@@ -85,9 +85,11 @@
BLO_free_memfile(first);
}
-static int my_memcmp(int *mem1, int *mem2, int len)
+static int my_memcmp(const int *mem1, const int *mem2, const int len)
{
- register int a= len, *mema= mem1, *memb= mem2;
+ register int a = len;
+ register const int *mema = mem1;
+ register const int *memb = mem2;
while (a--) {
if ( *mema != *memb) return 1;
@@ -97,7 +99,7 @@
return 0;
}
-void add_memfilechunk(MemFile *compare, MemFile *current, char *buf, unsigned int size)
+void add_memfilechunk(MemFile *compare, MemFile *current, const char *buf, unsigned int size)
{
static MemFileChunk *compchunk=NULL;
MemFileChunk *curchunk;
@@ -121,7 +123,7 @@
/* we compare compchunk with buf */
if (compchunk) {
if (compchunk->size == curchunk->size) {
- if ( my_memcmp((int *)compchunk->buf, (int *)buf, size/4)==0) {
+ if (my_memcmp((int *)compchunk->buf, (const int *)buf, size / 4) == 0) {
curchunk->buf= compchunk->buf;
curchunk->ident= 1;
}
Modified: branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c 2012-04-18 07:29:12 UTC (rev 45737)
+++ branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c 2012-04-18 07:57:20 UTC (rev 45738)
@@ -204,7 +204,7 @@
return wd;
}
-static void writedata_do_write(WriteData *wd, void *mem, int memlen)
+static void writedata_do_write(WriteData *wd, const void *mem, int memlen)
{
if ((wd == NULL) || wd->error || (mem == NULL) || memlen < 1) return;
if (wd->error) return;
@@ -239,7 +239,7 @@
#define MYWRITE_FLUSH NULL
-static void mywrite( WriteData *wd, void *adr, int len)
+static void mywrite( WriteData *wd, const void *adr, int len)
{
if (wd->error) return;
@@ -265,7 +265,7 @@
do {
int writelen= MIN2(len, MYWRITE_MAX_CHUNK);
writedata_do_write(wd, adr, writelen);
- adr = (char*)adr + writelen;
+ adr = (const char *)adr + writelen;
len -= writelen;
} while (len > 0);
@@ -354,22 +354,22 @@
mywrite(wd, adr, bh.len);
}
-static void writedata(WriteData *wd, int filecode, int len, void *adr) /* do not use for structs */
+static void writedata(WriteData *wd, int filecode, int len, const void *adr) /* do not use for structs */
{
BHead bh;
if (adr==NULL) return;
if (len==0) return;
- len+= 3;
- len-= ( len % 4);
+ len += 3;
+ len -= (len % 4);
/* init BHead */
- bh.code= filecode;
- bh.old= adr;
- bh.nr= 1;
- bh.SDNAnr= 0;
- bh.len= len;
+ bh.code = filecode;
+ bh.old = (void *)adr; /* this is safe to cast from const */
+ bh.nr = 1;
+ bh.SDNAnr = 0;
+ bh.len = len;
mywrite(wd, &bh, sizeof(BHead));
if (len) mywrite(wd, adr, len);
@@ -2764,7 +2764,7 @@
* second are an RGBA image (unsigned char)
* note, this uses 'TEST' since new types will segfault on file load for older blender versions.
*/
-static void write_thumb(WriteData *wd, int *img)
+static void write_thumb(WriteData *wd, const int *img)
{
if (img)
writedata(wd, TEST, (2 + img[0] * img[1]) * sizeof(int), img);
@@ -2772,7 +2772,7 @@
/* if MemFile * there's filesave to memory */
static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFile *current,
- int write_user_block, int write_flags, int *thumb)
+ int write_user_block, int write_flags, const int *thumb)
{
BHead bhead;
ListBase mainlist;
@@ -2880,7 +2880,7 @@
}
/* return: success (1) */
-int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportList *reports, int *thumb)
+int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportList *reports, const int *thumb)
{
char userfilename[FILE_MAX];
char tempname[FILE_MAX+1];
Modified: branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_core.c
===================================================================
--- branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_core.c 2012-04-18 07:29:12 UTC (rev 45737)
+++ branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_core.c 2012-04-18 07:57:20 UTC (rev 45738)
@@ -1594,13 +1594,13 @@
* \par Examples:
*
* A B
- * ---------- ----------
+ * +--------+ +--------+
* | | | |
* | f1 | | f1 |
* v1========v2 = Ok! v1==V2==v3 == Wrong!
* | f2 | | f2 |
* | | | |
- * ---------- ----------
+ * +--------+ +--------+
*
* In the example A, faces \a f1 and \a f2 are joined by a single edge,
* and the euler can safely be used.
@@ -1617,38 +1617,27 @@
BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
{
BMLoop *l_iter, *f1loop = NULL, *f2loop = NULL;
- int newlen = 0, i, f1len = 0, f2len = 0, radlen = 0, edok, shared;
- BMIter iter;
+ int newlen = 0, i, f1len = 0, f2len = 0, edok;
- /* can't join a face to itsel */
+ /* can't join a face to itself */
if (f1 == f2) {
return NULL;
}
+ /* validate that edge is 2-manifold edge */
+ if (!BM_edge_is_manifold(e)) {
+ return NULL;
+ }
+
/* verify that e is in both f1 and f2 */
f1len = f1->len;
f2len = f2->len;
- BM_ITER(l_iter, &iter, bm, BM_LOOPS_OF_FACE, f1) {
- if (l_iter->e == e) {
- f1loop = l_iter;
- break;
- }
- }
- BM_ITER(l_iter, &iter, bm, BM_LOOPS_OF_FACE, f2) {
- if (l_iter->e == e) {
- f2loop = l_iter;
- break;
- }
- }
- if (!(f1loop && f2loop)) {
+
+ if (!((f1loop = BM_face_edge_share_loop(f1, e)) &&
+ (f2loop = BM_face_edge_share_loop(f2, e))))
+ {
return NULL;
}
-
- /* validate that edge is 2-manifold edg */
- radlen = bmesh_radial_length(f1loop);
- if (radlen != 2) {
- return NULL;
- }
/* validate direction of f2's loop cycle is compatible */
if (f1loop->v == f2loop->v) {
@@ -1657,37 +1646,36 @@
/* validate that for each face, each vertex has another edge in its disk cycle that is
* not e, and not shared. */
- if ( bmesh_radial_face_find(f1loop->next->e, f2) ||
- bmesh_radial_face_find(f1loop->prev->e, f2) ||
- bmesh_radial_face_find(f2loop->next->e, f1) ||
- bmesh_radial_face_find(f2loop->prev->e, f1) )
+ if (bmesh_radial_face_find(f1loop->next->e, f2) ||
+ bmesh_radial_face_find(f1loop->prev->e, f2) ||
+ bmesh_radial_face_find(f2loop->next->e, f1) ||
+ bmesh_radial_face_find(f2loop->prev->e, f1) )
{
return NULL;
}
- /* validate only one shared edg */
- shared = BM_face_share_edge_count(f1, f2);
- if (shared > 1) {
+ /* validate only one shared edge */
+ if (BM_face_share_edge_count(f1, f2) > 1) {
return NULL;
}
/* validate no internal join */
for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, l_iter = l_iter->next) {
- BM_elem_flag_disable(l_iter->v, BM_ELEM_TAG);
+ BM_elem_flag_disable(l_iter->v, BM_ELEM_INTERNAL_TAG);
}
for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f2); i < f2len; i++, l_iter = l_iter->next) {
- BM_elem_flag_disable(l_iter->v, BM_ELEM_TAG);
+ BM_elem_flag_disable(l_iter->v, BM_ELEM_INTERNAL_TAG);
}
for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, l_iter = l_iter->next) {
if (l_iter != f1loop) {
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list