6 |
|
*/ |
7 |
|
#ifndef _RAD_MESH_H_ |
8 |
|
#define _RAD_MESH_H_ |
9 |
+ |
|
10 |
+ |
#include "lookup.h" |
11 |
+ |
|
12 |
|
#ifdef __cplusplus |
13 |
|
extern "C" { |
14 |
|
#endif |
15 |
|
|
13 |
– |
#include "copyright.h" |
14 |
– |
|
15 |
– |
#include "lookup.h" |
16 |
– |
|
16 |
|
#ifndef BYTE |
17 |
|
#define BYTE unsigned char |
18 |
|
#endif |
50 |
|
typedef struct { |
51 |
|
uint32 (*xyz)[3]; /* up to 256 patch vertices */ |
52 |
|
int32 *norm; /* vertex normals */ |
53 |
< |
uint32 (*uv)[2]; /* vertex local coordinates */ |
53 |
> |
uint16 (*uv)[2]; /* vertex local coordinates */ |
54 |
|
struct PTri { |
55 |
|
BYTE v1, v2, v3; /* local vertices */ |
56 |
|
} *tri; /* local triangles */ |
67 |
|
BYTE v3; /* local vertex */ |
68 |
|
} *j2tri; /* double joiner triangles */ |
69 |
|
short nverts; /* vertex count */ |
70 |
< |
short ntris; /* triangle count */ |
70 |
> |
short ntris; /* local triangle count */ |
71 |
|
short nj1tris; /* joiner triangle count */ |
72 |
|
short nj2tris; /* double joiner triangle count */ |
73 |
|
} MESHPATCH; |
78 |
|
int nref; /* reference count */ |
79 |
|
int ldflags; /* what we've loaded */ |
80 |
|
CUBE mcube; /* bounds and octree */ |
81 |
< |
FLOAT uvlim[2][2]; /* local coordinate extrema */ |
81 |
> |
RREAL uvlim[2][2]; /* local coordinate extrema */ |
82 |
|
OBJECT mat0; /* base material index */ |
83 |
|
OBJECT nmats; /* number of materials */ |
84 |
|
MESHPATCH *patch; /* mesh patch list */ |
105 |
|
int fl; /* setting flags */ |
106 |
|
FVECT v; /* vertex location */ |
107 |
|
FVECT n; /* vertex normal */ |
108 |
< |
FLOAT uv[2]; /* local coordinates */ |
108 |
> |
RREAL uv[2]; /* local coordinates */ |
109 |
|
} MESHVERT; |
110 |
|
|
111 |
|
/* mesh format identifier */ |
112 |
|
#define MESHFMT "Radiance_tmesh" |
113 |
|
/* magic number for mesh files */ |
114 |
< |
#define MESHMAGIC ( 1 *MAXOBJSIZ+311) /* increment first value */ |
114 |
> |
#define MESHMAGIC ( 2 *MAXOBJSIZ+311) /* increment first value */ |
115 |
|
|
116 |
|
|
117 |
|
extern MESH *getmesh(char *mname, int flags); |