diff options
author | Chris Want <cwant@ualberta.ca> | 2003-12-16 04:27:37 +0300 |
---|---|---|
committer | Chris Want <cwant@ualberta.ca> | 2003-12-16 04:27:37 +0300 |
commit | 356cf7953482891afe3dd289b1584b355de23b17 (patch) | |
tree | e746ec1bff3654872a80ecb136cb95d2a1fa856c /source | |
parent | e4d63d5764c1b23d34e66e57148048654a983159 (diff) |
OK, My turn to break things ...
The maximum vertex count for a mesh has been raised from 65000 to
2000000000L (yep, 2 billion!).
Please test!
Chris
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/exotic.c | 29 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesdna/intern/makesdna.c | 2 | ||||
-rw-r--r-- | source/blender/src/editmesh.c | 2 | ||||
-rw-r--r-- | source/blender/src/editobject.c | 5 |
5 files changed, 21 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 7467fb171cb..fb4735bbb9d 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -140,7 +140,7 @@ static void read_videoscape_mesh(char *str) float *vertdata, *vd, min[3], max[3], cent[3], ftemp; unsigned int color[32], col; int totcol, a, b, verts, tottria=0, totquad=0, totedge=0, poly, nr0, nr, first; - short end; + int end; char s[50]; fp= fopen(str, "rb"); @@ -158,7 +158,7 @@ static void read_videoscape_mesh(char *str) return; } - if(verts>65000) { + if(verts>2000000000L) { error("too many vertices"); fclose(fp); return; @@ -202,7 +202,7 @@ static void read_videoscape_mesh(char *str) } } - if(totedge+tottria+totquad>65000) { + if(totedge+tottria+totquad>2000000000L) { printf(" var1: %d, var2: %d, var3: %d \n", totedge, tottria, totquad); error("too many faces"); MEM_freeN(vertdata); @@ -357,7 +357,7 @@ static void read_radiogour(char *str) float *vertdata, *vd, min[3], max[3], cent[3], ftemp; unsigned int *colv, *colf, *colvertdata; int itemp, a, b, verts, tottria=0, totquad=0, totedge=0, poly, nr0, nr, first; - short end; + int end; char s[50]; fp= fopen(str, "rb"); @@ -375,7 +375,7 @@ static void read_radiogour(char *str) return; } - if(verts>65000) { + if(verts>2000000000L) { error("too many vertices"); fclose(fp); return; @@ -410,7 +410,7 @@ static void read_radiogour(char *str) } - if(totedge+tottria+totquad>65000) { + if(totedge+tottria+totquad>2000000000L) { printf(" var1: %d, var2: %d, var3: %d \n", totedge, tottria, totquad); error("too many faces"); MEM_freeN(vertdata); @@ -683,7 +683,7 @@ static void read_videoscape_nurbs(char *str) static void read_videoscape(char *str) { int file, type; - unsigned short val, numlen; + unsigned int val, numlen; char name[FILE_MAXDIR+FILE_MAXFILE], head[FILE_MAXFILE], tail[FILE_MAXFILE]; strcpy(name, str); @@ -1672,8 +1672,8 @@ static void displist_to_mesh(DispList *dlfirst) if(totvert==0) { return; } - if(totvert>=65000 || tottria>=65000) { - if (totvert>=65000) { + if(totvert>=2000000000L || tottria>=2000000000L) { + if (totvert>=2000000000L) { error("Too many vertices (%d)", totvert); } else { error("Too many faces (%d)", tottria); @@ -2234,7 +2234,7 @@ void write_videoscape(char *str) { Base *base; int file, val, lampdone=0; - unsigned short numlen; + unsigned int numlen; char head[FILE_MAXFILE], tail[FILE_MAXFILE]; if(BLI_testextensie(str,".trace")) str[ strlen(str)-6]= 0; @@ -3284,7 +3284,7 @@ static void dxf_read_line(int noob) { /* Check to see if we need to make a new object */ if(!lwasline || strcmp(layname, oldllay)!=0) dxf_close_line(); - if(linemhold != NULL && linemhold->totvert>65000) dxf_close_line(); + if(linemhold != NULL && linemhold->totvert>2000000000L) dxf_close_line(); if (linemhold==NULL) { if (noob) { @@ -3432,7 +3432,7 @@ static void dxf_read_polyline(int noob) { if (flag&1) { if(!lwasp2d || strcmp(layname, oldplay)!=0) dxf_close_2dpoly(); - if(p2dmhold != NULL && p2dmhold->totvert>65000) dxf_close_2dpoly(); + if(p2dmhold != NULL && p2dmhold->totvert>2000000000L) dxf_close_2dpoly(); if (p2dmhold==NULL) { if (noob) { @@ -3592,7 +3592,8 @@ static void dxf_read_polyline(int noob) { me->totvert++; /* If we are nearing the limit scan to the next entry */ - if(me->totvert > 65000) while(group_isnt(0, "SEQEND")) read_group(id, val); + if(me->totvert > 2000000000L) + while(group_isnt(0, "SEQEND")) read_group(id, val); vtmp= MEM_callocN(me->totvert*sizeof(MVert), "mverts"); @@ -3771,7 +3772,7 @@ static void dxf_read_3dface(int noob) /* Check to see if we need to make a new object */ if(!lwasf3d || strcmp(layname, oldflay)!=0) dxf_close_3dface(); - if(f3dmhold != NULL && f3dmhold->totvert>65000) dxf_close_3dface(); + if(f3dmhold != NULL && f3dmhold->totvert>2000000000L) dxf_close_3dface(); if(nverts<3) { error("(3DF) Error parsing dxf, not enough vertices near line %d", dxf_line); diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index b39ccb2fc54..3b69656464e 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -53,11 +53,8 @@ struct bDeformGroup; * the other hand, it also interferes with sys/types.h, so we get rid * of it asap. */ -#define ushort unsigned short - typedef struct MFace { -/* unsigned short v1, v2, v3, v4; */ - ushort v1, v2, v3, v4; + unsigned int v1, v2, v3, v4; char puno, mat_nr; char edcode, flag; } MFace; diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index a38b89dfbcf..5f3673e95c7 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -1041,7 +1041,7 @@ int make_structDNA(FILE *file) void make_bad_file(char *file) { FILE *fp= fopen(file, "w"); - fprintf(fp, "ERROR! Cannot make correct DNA.c file\n"); + fprintf(fp, "ERROR! Cannot make correct DNA.c file, STUPID!\n"); fclose(fp); } diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index 67c994abc2b..34c5b171233 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -6412,7 +6412,7 @@ void join_mesh(void) /* that way the active object is always selected */ if(ok==0) return; - if(totvert==0 || totvert>65000) return; + if(totvert==0 || totvert>2000000000L) return; if(okee("Join selected Meshes")==0) return; diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index d1a5fc1299c..c411a61da65 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -1062,7 +1062,8 @@ void exit_editmode(int freedata) /* freedata==0 at render */ /* temporal */ countall(); - if(G.totvert>65000) { + + if(G.totvert>2000000000L) { error("too many vertices"); return; } @@ -6828,4 +6829,4 @@ void mirrormenu(void){ transvmain= 0; tottrans= 0; -}
\ No newline at end of file +} |