86 |
|
ms->nref++; /* increase reference count */ |
87 |
|
break; |
88 |
|
} |
89 |
< |
if (ms == NULL) { /* load first time */ |
89 |
> |
if (ms == NULL) { /* new mesh entry? */ |
90 |
|
ms = (MESH *)calloc(1, sizeof(MESH)); |
91 |
|
if (ms == NULL) |
92 |
|
error(SYSTEM, "out of memory in getmesh"); |
96 |
|
ms->next = mlist; |
97 |
|
mlist = ms; |
98 |
|
} |
99 |
+ |
if (!(flags &= ~ms->ldflags)) /* nothing to load? */ |
100 |
+ |
return(ms); |
101 |
|
if ((pathname = getpath(mname, getrlibpath(), R_OK)) == NULL) { |
102 |
|
sprintf(errmsg, "cannot find mesh file \"%s\"", mname); |
103 |
|
error(SYSTEM, errmsg); |
104 |
|
} |
105 |
< |
flags &= ~ms->ldflags; |
104 |
< |
if (flags) |
105 |
< |
readmesh(ms, pathname, flags); |
105 |
> |
readmesh(ms, pathname, flags); |
106 |
|
return(ms); |
107 |
|
} |
108 |
|
|