--- ray/src/common/readmesh.c 2003/06/08 12:03:09 2.5 +++ ray/src/common/readmesh.c 2004/04/29 14:36:49 2.12 @@ -1,17 +1,23 @@ #ifndef lint -static const char RCSid[] = "$Id: readmesh.c,v 2.5 2003/06/08 12:03:09 schorsch 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 */ -#include "standard.h" +#include + #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 */ @@ -90,7 +96,7 @@ gettree() /* get a pre-ordered octree */ default: mesherror(USER, "damaged mesh octree"); } - return NULL; /* pro forma return */ + return (OCTREE)NULL; /* pro forma return */ } @@ -133,17 +139,17 @@ register MESHPATCH *pp; pp->nverts = mgetint(2); if (pp->nverts <= 0 || pp->nverts > 256) mesherror(USER, "bad number of patch vertices"); - pp->xyz = (uint4 (*)[3])malloc(pp->nverts*3*sizeof(uint4)); + pp->xyz = (uint32 (*)[3])malloc(pp->nverts*3*sizeof(uint32)); if (pp->xyz == NULL) goto nomem; if (flags & MT_N) { - pp->norm = (int4 *)calloc(pp->nverts, sizeof(int4)); + pp->norm = (int32 *)calloc(pp->nverts, sizeof(int32)); if (pp->norm == NULL) goto nomem; } else pp->norm = NULL; if (flags & MT_UV) { - pp->uv = (uint4 (*)[2])calloc(pp->nverts, 2*sizeof(uint4)); + pp->uv = (uint32 (*)[2])calloc(pp->nverts, 2*sizeof(uint32)); if (pp->uv == NULL) goto nomem; } else @@ -179,7 +185,7 @@ register MESHPATCH *pp; pp->tri = NULL; /* local triangle material(s) */ if (mgetint(2) > 1) { - pp->trimat = (int2 *)malloc(pp->ntris*sizeof(int2)); + pp->trimat = (int16 *)malloc(pp->ntris*sizeof(int16)); if (pp->trimat == NULL) goto nomem; for (i = 0; i < pp->ntris; i++)