--- ray/src/common/readmesh.c 2003/09/18 16:53:53 2.9 +++ ray/src/common/readmesh.c 2004/04/29 14:36:49 2.12 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: readmesh.c,v 2.9 2003/09/18 16:53:53 greg Exp $"; +static const char RCSid[] = "$Id: readmesh.c,v 2.12 2004/04/29 14:36:49 greg Exp $"; #endif /* * Routines for reading a compiled mesh from a file @@ -7,13 +7,17 @@ static const char RCSid[] = "$Id: readmesh.c,v 2.9 200 #include -#include "standard.h" #include "platform.h" +#include "standard.h" #include "octree.h" #include "object.h" #include "mesh.h" #include "resolu.h" +#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ +#define getc getc_unlocked +#endif + static char *meshfn; /* input file name */ static FILE *meshfp; /* mesh file pointer */ static int objsize; /* sizeof(OBJECT) from writer */ @@ -145,7 +149,7 @@ register MESHPATCH *pp; } else pp->norm = NULL; if (flags & MT_UV) { - pp->uv = (uint16 (*)[2])calloc(pp->nverts, 2*sizeof(uint16)); + pp->uv = (uint32 (*)[2])calloc(pp->nverts, 2*sizeof(uint32)); if (pp->uv == NULL) goto nomem; } else @@ -162,7 +166,7 @@ register MESHPATCH *pp; if (flags & MT_UV) for (i = 0; i < pp->nverts; i++) for (j = 0; j < 2; j++) - pp->uv[i][j] = mgetint(2); + pp->uv[i][j] = mgetint(4); /* local triangles */ pp->ntris = mgetint(2); if (pp->ntris < 0 || pp->ntris > 512)