00001 #ifndef AC3D_IMPORTER_INCLUDED
00002 #define AC3D_IMPORTER_INCLUDED
00003
00004 namespace lilith3d
00005 {
00006 class Texture;
00007 };
00008
00009 typedef struct ACPoint_t
00010 {
00011 float x, y, z;
00012 } ACPoint;
00013
00014
00015 typedef struct ACNormal_t
00016 {
00017 float x, y, z;
00018 } ACNormal;
00019
00020
00021 typedef struct ACVertex_t
00022 {
00023 float x, y, z;
00024 ACNormal normal;
00025 } ACVertex;
00026
00027 typedef struct ACUV_t
00028 {
00029 float u, v;
00030 } ACUV;
00031
00032
00033 typedef struct ACSurface_t
00034 {
00035 int *vertref;
00036 ACUV *uvs;
00037 int num_vertref;
00038 ACNormal normal;
00039 int flags;
00040 int mat;
00041 } ACSurface;
00042
00043 typedef struct ACObject_t
00044 {
00045 ACPoint loc;
00046 char *name;
00047 char *data;
00048 char *url;
00049 ACVertex *vertices;
00050 int num_vert;
00051
00052 ACSurface *surfaces;
00053 int num_surf;
00054 float texture_repeat_x, texture_repeat_y;
00055 float texture_offset_x, texture_offset_y;
00056
00057 int num_kids;
00058 struct ACObject_t **kids;
00059 float matrix[9];
00060 int type;
00061
00062
00063 const lilith3d::Texture* texture;
00064
00065 } ACObject;
00066
00067 typedef struct ACCol_t
00068 {
00069 float r, g, b, a;
00070 } ACCol;
00071
00072 typedef struct Material_t
00073 {
00074 ACCol rgb;
00075 ACCol ambient;
00076 ACCol specular;
00077 ACCol emissive;
00078 float shininess;
00079 float transparency;
00080 char *name;
00081 } ACMaterial;
00082
00083 typedef struct ACImage_t
00084 {
00085 unsigned short width, height, depth;
00086 void *data;
00087 int index;
00088 char *name;
00089 int amask;
00090 char *origname;
00092 } ACImage;
00093
00094 #define OBJECT_WORLD 999
00095 #define OBJECT_NORMAL 0
00096 #define OBJECT_GROUP 1
00097 #define OBJECT_LIGHT 2
00098
00099 #define SURFACE_SHADED (1<<4)
00100 #define SURFACE_TWOSIDED (1<<5)
00101
00102 #define SURFACE_TYPE_POLYGON (0)
00103 #define SURFACE_TYPE_CLOSEDLINE (1)
00104 #define SURFACE_TYPE_LINE (2)
00105
00106 #define Prototype
00107 #define Private static
00108 #define Boolean int
00109
00110 #ifndef TRUE
00111 #define FALSE (0)
00112 #define TRUE (!FALSE)
00113 #endif
00114
00115 #define STRING(s) (char *)(strcpy((char *)myalloc(strlen(s)+1), s))
00116 #define streq(a,b) (!strcmp(a,b))
00117 #define myalloc malloc
00118 #define myfree free
00119
00120 Prototype ACObject *ac_load_ac3d(char *filename);
00121 Prototype ACMaterial *ac_palette_get_material(int index);
00122 Prototype ACImage *ac_get_texture(int ind);
00123 Prototype int ac_load_texture(char *name);
00124 Prototype int ac_load_rgb_image(char *fileName);
00125 Prototype void ac_prepare_render();
00126 Prototype int ac_display_list_render_object(ACObject *ob);
00127 Prototype void ac_object_free(ACObject *ob);
00128
00129 #endif
00130