10 |
|
#include "object.h" |
11 |
|
#include "mesh.h" |
12 |
|
|
13 |
+ |
#ifdef putc_unlocked /* avoid horrendous overhead of flockfile */ |
14 |
+ |
#define putc putc_unlocked |
15 |
+ |
#endif |
16 |
|
|
17 |
+ |
static void putfullnode(OCTREE fn, FILE *fp); |
18 |
+ |
static void puttree(OCTREE ot, FILE *fp); |
19 |
+ |
static void putpatch(MESHPATCH *pp, FILE *fp); |
20 |
+ |
|
21 |
+ |
|
22 |
|
static void |
23 |
< |
putfullnode(fn, fp) /* write out a full node */ |
24 |
< |
OCTREE fn; |
25 |
< |
FILE *fp; |
23 |
> |
putfullnode( /* write out a full node */ |
24 |
> |
OCTREE fn, |
25 |
> |
FILE *fp |
26 |
> |
) |
27 |
|
{ |
28 |
|
OBJECT oset[MAXSET+1]; |
29 |
|
register int i; |
35 |
|
|
36 |
|
|
37 |
|
static void |
38 |
< |
puttree(ot, fp) /* write octree to fp in pre-order form */ |
39 |
< |
register OCTREE ot; |
40 |
< |
FILE *fp; |
38 |
> |
puttree( /* write octree to fp in pre-order form */ |
39 |
> |
register OCTREE ot, |
40 |
> |
FILE *fp |
41 |
> |
) |
42 |
|
{ |
43 |
|
|
44 |
|
if (istree(ot)) { |
58 |
|
|
59 |
|
|
60 |
|
static void |
61 |
< |
putpatch(pp, fp) /* write out a mesh patch */ |
62 |
< |
register MESHPATCH *pp; |
63 |
< |
FILE *fp; |
61 |
> |
putpatch( /* write out a mesh patch */ |
62 |
> |
register MESHPATCH *pp, |
63 |
> |
FILE *fp |
64 |
> |
) |
65 |
|
{ |
66 |
|
int flags = MT_V; |
67 |
|
int i, j; |
85 |
|
if (flags & MT_UV) |
86 |
|
for (i = 0; i < pp->nverts; i++) |
87 |
|
for (j = 0; j < 2; j++) |
88 |
< |
putint((long)pp->uv[i][j], 2, fp); |
88 |
> |
putint((long)pp->uv[i][j], 4, fp); |
89 |
|
/* local triangles */ |
90 |
|
putint((long)pp->ntris, 2, fp); |
91 |
|
for (i = 0; i < pp->ntris; i++) { |