| 1 |
|
#ifndef lint |
| 2 |
< |
static const char RCSid[] = "$Id"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 4 |
|
/* |
| 5 |
|
* Replace markers in Radiance scene description with objects or instances. |
| 26 |
|
#define FEQ(a,b) ((a)-(b) <= 1e-7 && (b)-(a) <= 1e-7) |
| 27 |
|
|
| 28 |
|
#define MAXVERT 6 /* maximum number of vertices for markers */ |
| 29 |
< |
#define MAXMARK 32 /* maximum number of markers */ |
| 29 |
> |
#define MAXMARK 128 /* maximum number of markers */ |
| 30 |
|
|
| 31 |
|
#define USE_XFORM 1 /* use !xform inline command */ |
| 32 |
|
#define USE_INSTANCE 2 /* use instance primitive */ |
| 43 |
|
char *modin; /* input modifier indicating marker */ |
| 44 |
|
char *objname; /* output object file or octree */ |
| 45 |
|
int usetype; /* one of USE_* above */ |
| 46 |
< |
} marker[MAXMARK]; /* array of markers */ |
| 46 |
> |
} marker[MAXMARK+1]; /* array of markers */ |
| 47 |
|
int nmarkers = 0; /* number of markers */ |
| 48 |
|
|
| 49 |
|
int expand; /* expand commands? */ |
| 102 |
|
} while (argv[i][0] == '-'); |
| 103 |
|
if (marker[nmarkers].objname == NULL) |
| 104 |
|
goto userr; |
| 105 |
+ |
if (nmarkers >= MAXMARK) { |
| 106 |
+ |
fprintf(stderr, "%s: too many markers\n", progname); |
| 107 |
+ |
return 1; |
| 108 |
+ |
} |
| 109 |
|
marker[nmarkers++].modin = argv[i++]; |
| 106 |
– |
if (nmarkers >= MAXMARK) |
| 107 |
– |
break; |
| 110 |
|
marker[nmarkers].mscale = marker[nmarkers-1].mscale; |
| 111 |
|
} |
| 112 |
|
if (nmarkers == 0) |