#ifndef __ICOS_H__ #define __ICOS_H__ #include "shmath.h" #include "demo.h" #include "poly.h" #ifndef _ANSI_I386_STDARG_H_ #define _ANSI_I386_STDARG_H_ /* BSD compatibility: if #include seen, don't redefine per ANSI */ #ifndef __VARARGS__ #ifndef va_start /* Indicate that this program uses */ #define __STDARG__ #ifndef _VA_LIST #define _VA_LIST typedef char *va_list; #endif /* Amount of space required in an argument list for an arg of type TYPE. TYPE may alternatively be an expression whose type is used. */ #define __va_rounded_size(TYPE) \ (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) #define va_start(AP, LASTARG) \ (AP = ((char *) __builtin_next_arg ())) #define va_end(AP) #define va_arg(AP, TYPE) \ (AP += __va_rounded_size (TYPE), \ *((TYPE *) (AP - __va_rounded_size (TYPE)))) #endif va_start #endif __VARARGS__ #endif _ANSI_I386_STDARG_H_ int D_vsprintf(char *string, const char *format, va_list argptr); void D_printf (char *str, ...); #define NUM_ICOS_VERTS 12 #define NUM_ICOS_FACES 20 #define CENTER_X 160 #define CENTER_Y 102 #define NUM_TEXTURES 20 void icosDemo(); struct Icosahedron { Triangle faces[NUM_ICOS_FACES]; XYZ vert[NUM_ICOS_VERTS]; XYZ xformVert[NUM_ICOS_VERTS]; Point3D projVert[NUM_ICOS_VERTS]; XYZ normals[NUM_ICOS_FACES]; Fixed32 centerX; Fixed32 centerY; Fixed32 centerZ; Fixed32 faceLength; Fixed32 faceLengthOver2; }; typedef struct Icosahedron Icosahedron; typedef XYZ IcosVert[NUM_ICOS_VERTS]; void icosInit( void ); void icosCreate( Icosahedron *poly, Fixed32 centerX, Fixed32 centerY, Fixed32 centerZ, Fixed32 faceLength ); void icosParProj( Icosahedron *poly ); void icosXformVert( Icosahedron *poly ); void icosCalcFace( Icosahedron *poly ); void icosCalc( Icosahedron *poly ); void icosMove( Icosahedron *poly ); void icosDraw( Icosahedron *poly ); void myLoadTex(); #endif /* __ICOS_H__ */