5 #include "../../x3d/src/X3DDefs.h"
10 #if defined (WIN32) || defined (__MWERKS__)
46 puts (
"Unable to allocate memory for points !");
60 puts (
"Unable to allocate memory for colors !");
100 segs = (segment *) calloc (
gSize3D.numSegs, sizeof (segment));
102 puts (
"Unable to allocate memory for segments !");
113 polys = (polygon *) calloc(
gSize3D.numPolys, sizeof (polygon));
115 puts (
"Unable to allocate memory for polygons !");
147 int n, i, j, p,
q,
c;
148 int oldNumOfPoints, oldNumOfSegments;
172 p = oldNumOfPoints + buff->
segs[3*i+1];
173 q = oldNumOfPoints + buff->
segs[3*i+2];
183 if(
points[p].numSegs == 0){
184 if((
points[p].
segs = (segment **)calloc(1,
sizeof(segment *))) ==
NULL){
185 puts(
"Unable to allocate memory for point segments !");
190 (
points[p].numSegs + 1) *
sizeof(segment *))) ==
NULL){
191 puts(
"Unable to allocate memory for point segments !");
196 if(
points[q].numSegs == 0){
197 if((
points[q].
segs = (segment **)calloc(1,
sizeof(segment *))) ==
NULL){
198 puts(
"Unable to allocate memory for point segments !");
203 (
points[q].numSegs + 1) *
sizeof(segment *))) ==
NULL){
204 puts(
"Unable to allocate memory for point segments !");
222 c = buff->
polys[n++];
228 puts(
"Unable to allocate memory for polygon segments !");
232 int seg = oldNumOfSegments + buff->
polys[n++];
239 if(segs[seg].numPolys == 0) {
240 if((segs[seg].
polys = (polygon **) calloc(1,
sizeof(polygon *)))==
NULL){
241 puts(
"Unable to allocate memory for segment polygons !");
246 if((segs[seg].
polys = (polygon **) realloc(segs[seg].
polys,
247 (segs[seg].numPolys + 1) *
sizeof(polygon *))) ==
NULL){
248 puts(
"Unable to allocate memory for segment polygons !");
253 segs[seg].numPolys++;
RooCmdArg Color(Color_t color)
void FillX3DBuffer(X3DBuffer *buff)