12 |
|
#include <time.h> |
13 |
|
|
14 |
|
#include "platform.h" |
15 |
– |
#include "paths.h" |
15 |
|
#include "resolu.h" |
16 |
|
#include "radogl.h" |
17 |
|
#include "octree.h" |
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); |
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; |
119 |
|
error(USER, "too many octree levels -- instance loop?"); |
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); |
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 */ |