38 |
|
static int objsize; /* size of stored OBJECT's */ |
39 |
|
static short otypmap[NUMOTYPE+8]; /* object type map */ |
40 |
|
|
41 |
< |
static unsigned long imhash(mod) char *mod; {return((unsigned long)mod);} |
41 |
> |
static unsigned long imhash(const char *mod) {return((unsigned long)mod);} |
42 |
|
static LUTAB imtab = {imhash,NULL,NULL,NULL,0,NULL,0}; |
43 |
|
|
44 |
|
static LUTAB ottab = LU_SINIT(free,free); |
60 |
|
o->oargs.nsargs-1) |
61 |
|
objerror(o, USER, "bad transform"); |
62 |
|
glPushAttrib(GL_TRANSFORM_BIT); |
63 |
< |
if (xfs.sca < 1.-FTINY | xfs.sca > 1.+FTINY) |
63 |
> |
if ((xfs.sca < 1.-FTINY) | (xfs.sca > 1.+FTINY)) |
64 |
|
glEnable(GL_NORMALIZE); |
65 |
|
glMatrixMode(GL_MODELVIEW); |
66 |
|
glPushMatrix(); |
88 |
|
|
89 |
|
|
90 |
|
static int |
91 |
< |
buildoctlist(lp) /* build octree list */ |
92 |
< |
LUENT *lp; |
91 |
> |
buildoctlist(lp, p) /* build octree list */ |
92 |
> |
const LUENT *lp; |
93 |
> |
void *p; |
94 |
|
{ |
95 |
|
int old_dolights = dolights, old_domats = domats; |
96 |
|
register OCTINST *op = (OCTINST *)lp->data; |
117 |
|
while (ottab.tsiz) { |
118 |
|
if (!levelsleft--) |
119 |
|
error(USER, "too many octree levels -- instance loop?"); |
120 |
< |
copystruct(&looptab, &ottab); |
120 |
> |
looptab = ottab; |
121 |
|
ottab.tsiz = 0; |
122 |
< |
nocts += lu_doall(&looptab, buildoctlist); |
122 |
> |
nocts += lu_doall(&looptab, buildoctlist, NULL); |
123 |
|
lu_done(&looptab); |
124 |
|
} |
125 |
|
return(nocts); |
146 |
|
path = getpath(name, getrlibpath(), R_OK); |
147 |
|
if (path == NULL) { |
148 |
|
sprintf(errmsg, "cannot find octree \"%s\"", name); |
149 |
< |
error(USER, errmsg); |
149 |
> |
error(SYSTEM, errmsg); |
150 |
|
} |
151 |
|
op = (OCTINST *)(lp->data = (char *)malloc(sizeof(OCTINST))); |
152 |
|
strcpy(op->octfile, path); |
157 |
|
return(op); |
158 |
|
memerr: |
159 |
|
error(SYSTEM, "out of memory in getoct"); |
160 |
+ |
return NULL; /* pro forma return */ |
161 |
|
} |
162 |
|
|
163 |
|
|
340 |
|
/* get name id */ |
341 |
|
ob.oname = ogetstr(idbuf); |
342 |
|
/* get string arguments */ |
343 |
< |
if (ob.oargs.nsargs = ogetint(2)) { |
343 |
> |
if ((ob.oargs.nsargs = ogetint(2))) { |
344 |
|
ob.oargs.sarg = (char **)malloc |
345 |
|
(ob.oargs.nsargs*sizeof(char *)); |
346 |
|
if (ob.oargs.sarg == NULL) |
362 |
|
ob.oargs.iarg = NULL; |
363 |
|
#endif |
364 |
|
/* get real arguments */ |
365 |
< |
if (ob.oargs.nfargs = ogetint(2)) { |
365 |
> |
if ((ob.oargs.nfargs = ogetint(2))) { |
366 |
|
ob.oargs.farg = (RREAL *)malloc |
367 |
|
(ob.oargs.nfargs*sizeof(RREAL)); |
368 |
|
if (ob.oargs.farg == NULL) |
375 |
|
(*ofun[ob.otype].funp)(&ob); |
376 |
|
/* record material if modifier */ |
377 |
|
if (ismodifier(ob.otype)) { |
378 |
< |
if ((lep = lu_find(&imtab, (char *)nobjects)) == NULL) |
378 |
> |
if ((lep = lu_find(&imtab, (char *)(size_t)nobjects)) == NULL) |
379 |
|
goto memerr; |
380 |
< |
lep->key = (char *)nobjects; |
380 |
> |
lep->key = (char *)(size_t)nobjects; |
381 |
|
lep->data = (char *)getmatp(ob.oname); |
382 |
|
} |
383 |
|
freefargs(&ob.oargs); /* free arguments */ |
384 |
|
return(nobjects++); /* return object id */ |
385 |
|
memerr: |
386 |
|
error(SYSTEM, "out of memory in loadobj"); |
387 |
+ |
return OVOID; /* pro forma return */ |
388 |
|
} |
389 |
|
|
390 |
|
|