33 |
|
|
34 |
|
#define FORALLPORT(pl,i) for (i=0;i<MAXPORT&&pl[i]!=NULL;i++) |
35 |
|
|
36 |
< |
extern char *atos(), *sskip(), *sskip2(); |
36 |
> |
extern char *nextword(); |
37 |
|
|
38 |
|
|
39 |
|
gmNewGeom(file) /* add new geometry to next list */ |
55 |
|
return; |
56 |
|
} |
57 |
|
/* else load new octree */ |
58 |
< |
gmNext[i].gfile = file; |
58 |
> |
gmNext[i].gfile = savestr(file); |
59 |
|
dolights = 0; |
60 |
|
domats = 1; |
61 |
|
gmNext[i].listid = rgl_octlist(file, gmNext[i].cent, &gmNext[i].rad); |
75 |
|
FORALLGEOM(gmNext, j) |
76 |
|
if (gmNext[j].listid == gmCurrent[i].listid) |
77 |
|
break; |
78 |
< |
if (j >= MAXGEO || gmNext[j].gfile == NULL) |
78 |
> |
if (j >= MAXGEO || gmNext[j].gfile == NULL) { |
79 |
|
glDeleteLists(gmCurrent[i].listid, 1); /* not found */ |
80 |
+ |
freestr(gmCurrent[i].gfile); |
81 |
+ |
} |
82 |
|
} |
83 |
|
bcopy((char *)gmNext, (char *)gmCurrent, sizeof(gmNext)); |
84 |
|
bzero((char *)gmNext, sizeof(gmNext)); |
86 |
|
|
87 |
|
|
88 |
|
int |
89 |
< |
gmDrawGeom() /* draw current list of octrees (and ports) */ |
89 |
> |
gmDrawGeom() /* draw current list of octrees */ |
90 |
|
{ |
91 |
|
register int n; |
92 |
|
|
147 |
|
|
148 |
|
if (pflist == NULL) |
149 |
|
return; |
150 |
< |
while (*pflist) { |
149 |
< |
atos(newfile, sizeof(newfile), pflist); |
150 |
< |
if (!*newfile) |
151 |
< |
break; |
152 |
< |
pflist = sskip(pflist); |
150 |
> |
while ((pflist = nextword(newfile, sizeof(newfile), pflist)) != NULL) { |
151 |
|
FORALLPORT(newportlist,i) |
152 |
|
if (!strcmp(newportlist[i], newfile)) |
153 |
|
goto endloop; /* in list already */ |