00001 #ifndef INSTANCE_H
00002 #define INSTANCE_H
00003
00004 #include "model.h"
00005
00006
00007
00008 #define MAX_INSTANCES 200
00009 #define MAX_INSTANCE_MODELS 64
00010 #define MAX_INSTANCE_FILENAME 9
00011 #define MAX_INSTANCE_LOD 5
00012
00013 #define INSTANCE_ENV 1
00014 #define INSTANCE_HIDE 2
00015 #define INSTANCE_NO_MIRROR 4
00016 #define INSTANCE_NO_FILE_LIGHTS 8
00017 #define INSTANCE_SET_MODEL_RGB 16
00018
00019 enum {
00020 INSTANCE_AXIS_XY,
00021 INSTANCE_AXIS_XZ,
00022 INSTANCE_AXIS_ZY,
00023 INSTANCE_AXIS_X,
00024 INSTANCE_AXIS_Y,
00025 INSTANCE_AXIS_Z,
00026 };
00027
00028 typedef struct {
00029 unsigned char Model, Priority, Flag, pad;
00030 char r, g, b, pad2;
00031 unsigned long EnvRGB, MirrorFlag;
00032 float LodBias, MirrorHeight;
00033 VISIMASK VisiMask;
00034 VEC WorldPos;
00035 MAT WorldMatrix;
00036 POLY_RGB *rgb[MAX_INSTANCE_LOD];
00037 BOUNDING_BOX Box;
00038 NEWCOLLPOLY *CollPoly;
00039 short NCollPolys;
00040 } INSTANCE;
00041
00042 typedef struct {
00043 char Name[MAX_INSTANCE_FILENAME];
00044 char r, g, b;
00045 unsigned long EnvRGB;
00046 unsigned char Priority, Flag, pad[2];
00047 float LodBias;
00048 VEC WorldPos;
00049 MAT WorldMatrix;
00050 } FILE_INSTANCE;
00051
00052 typedef struct {
00053 long Count;
00054 char Name[MAX_INSTANCE_FILENAME];
00055 MODEL Models[MAX_INSTANCE_LOD];
00056 NEWCOLLPOLY *CollPoly;
00057 short NCollPolys;
00058 } INSTANCE_MODELS;
00059
00060
00061
00062 extern void LoadInstances(char *file);
00063 extern void SaveInstances(char *file);
00064 extern void EditInstances(void);
00065 extern void DrawInstances(void);
00066 extern void DisplayInstanceInfo(INSTANCE *inst);
00067 extern INSTANCE *AllocInstance(void);
00068 extern void FreeInstance(INSTANCE *inst);
00069 extern void LoadInstanceModels(void);
00070 extern void FreeInstanceModels(void);
00071 extern void FreeInstanceRGBs(void);
00072 extern void FreeOneInstanceRGB(INSTANCE *inst);
00073 extern void AllocOneInstanceRGB(INSTANCE *inst);
00074 extern void SetInstanceBoundingBoxes(INSTANCE *inst);
00075 extern void BuildInstanceCollPolys();
00076
00077
00078
00079 extern long InstanceNum;
00080 extern INSTANCE *CurrentInstance;
00081 extern INSTANCE Instances[];
00082 extern long InstanceModelNum;
00083 extern INSTANCE_MODELS *InstanceModels;
00084
00085 #endif