| 14 |
|
#include "mesh.h" |
| 15 |
|
#include "resolu.h" |
| 16 |
|
|
| 17 |
+ |
#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ |
| 18 |
+ |
#undef getc |
| 19 |
+ |
#define getc getc_unlocked |
| 20 |
+ |
#endif |
| 21 |
+ |
|
| 22 |
|
static char *meshfn; /* input file name */ |
| 23 |
|
static FILE *meshfp; /* mesh file pointer */ |
| 24 |
|
static int objsize; /* sizeof(OBJECT) from writer */ |
| 97 |
|
default: |
| 98 |
|
mesherror(USER, "damaged mesh octree"); |
| 99 |
|
} |
| 100 |
< |
return (OCTREE)NULL; /* pro forma return */ |
| 100 |
> |
return (OCTREE)0; /* pro forma return */ |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
|
| 150 |
|
} else |
| 151 |
|
pp->norm = NULL; |
| 152 |
|
if (flags & MT_UV) { |
| 153 |
< |
pp->uv = (uint16 (*)[2])calloc(pp->nverts, 2*sizeof(uint16)); |
| 153 |
> |
pp->uv = (uint32 (*)[2])calloc(pp->nverts, 2*sizeof(uint32)); |
| 154 |
|
if (pp->uv == NULL) |
| 155 |
|
goto nomem; |
| 156 |
|
} else |
| 167 |
|
if (flags & MT_UV) |
| 168 |
|
for (i = 0; i < pp->nverts; i++) |
| 169 |
|
for (j = 0; j < 2; j++) |
| 170 |
< |
pp->uv[i][j] = mgetint(2); |
| 170 |
> |
pp->uv[i][j] = mgetint(4); |
| 171 |
|
/* local triangles */ |
| 172 |
|
pp->ntris = mgetint(2); |
| 173 |
|
if (pp->ntris < 0 || pp->ntris > 512) |