12 |
|
#include <time.h> |
13 |
|
|
14 |
|
#include "platform.h" |
15 |
+ |
#include "paths.h" |
16 |
|
#include "resolu.h" |
17 |
|
#include "radogl.h" |
18 |
|
#include "octree.h" |
61 |
|
o->oargs.nsargs-1) |
62 |
|
objerror(o, USER, "bad transform"); |
63 |
|
glPushAttrib(GL_TRANSFORM_BIT); |
64 |
< |
if (xfs.sca < 1.-FTINY | xfs.sca > 1.+FTINY) |
64 |
> |
if ((xfs.sca < 1.-FTINY) | (xfs.sca > 1.+FTINY)) |
65 |
|
glEnable(GL_NORMALIZE); |
66 |
|
glMatrixMode(GL_MODELVIEW); |
67 |
|
glPushMatrix(); |
89 |
|
|
90 |
|
|
91 |
|
static int |
92 |
< |
buildoctlist(lp) /* build octree list */ |
92 |
> |
buildoctlist(lp, p) /* build octree list */ |
93 |
|
LUENT *lp; |
94 |
+ |
void *p; |
95 |
|
{ |
96 |
|
int old_dolights = dolights, old_domats = domats; |
97 |
|
register OCTINST *op = (OCTINST *)lp->data; |
118 |
|
while (ottab.tsiz) { |
119 |
|
if (!levelsleft--) |
120 |
|
error(USER, "too many octree levels -- instance loop?"); |
121 |
< |
copystruct(&looptab, &ottab); |
121 |
> |
looptab = ottab; |
122 |
|
ottab.tsiz = 0; |
123 |
< |
nocts += lu_doall(&looptab, buildoctlist); |
123 |
> |
nocts += lu_doall(&looptab, buildoctlist, NULL); |
124 |
|
lu_done(&looptab); |
125 |
|
} |
126 |
|
return(nocts); |
158 |
|
return(op); |
159 |
|
memerr: |
160 |
|
error(SYSTEM, "out of memory in getoct"); |
161 |
+ |
return NULL; /* pro forma return */ |
162 |
|
} |
163 |
|
|
164 |
|
|
341 |
|
/* get name id */ |
342 |
|
ob.oname = ogetstr(idbuf); |
343 |
|
/* get string arguments */ |
344 |
< |
if (ob.oargs.nsargs = ogetint(2)) { |
344 |
> |
if ((ob.oargs.nsargs = ogetint(2))) { |
345 |
|
ob.oargs.sarg = (char **)malloc |
346 |
|
(ob.oargs.nsargs*sizeof(char *)); |
347 |
|
if (ob.oargs.sarg == NULL) |
363 |
|
ob.oargs.iarg = NULL; |
364 |
|
#endif |
365 |
|
/* get real arguments */ |
366 |
< |
if (ob.oargs.nfargs = ogetint(2)) { |
366 |
> |
if ((ob.oargs.nfargs = ogetint(2))) { |
367 |
|
ob.oargs.farg = (RREAL *)malloc |
368 |
|
(ob.oargs.nfargs*sizeof(RREAL)); |
369 |
|
if (ob.oargs.farg == NULL) |
385 |
|
return(nobjects++); /* return object id */ |
386 |
|
memerr: |
387 |
|
error(SYSTEM, "out of memory in loadobj"); |
388 |
+ |
return OVOID; /* pro forma return */ |
389 |
|
} |
390 |
|
|
391 |
|
|