/************************************ Height.h ************************************/ #include "3dgraph.h" #include //defines //------- #define TILE_WIDTH (1500) #define TILE_LENGTH (1500) #define CLIP_WIDTH (10) //8 #define CLIP_LENGTH (10) #define CLIP_AREA (100) // 64 // MACROS //------- #define SetVec(_v,_x,_y,_z) \ (_v)->vx = (_x), \ (_v)->vy = (_y), \ (_v)->vz = (_z) // STRUCTS //-------- typedef struct { GsDOBJ2 Object_Handler; GsCOORDINATE2 Object_Coord; } MapObject; typedef struct { u_long NuTextures; u_long MapLength; u_long MapWidth; u_long MapArea; //world constraints long GRAVITY; // change gravity for strange other world effects long FRICTION; // change friction for icy places long WIND; // change weather conditions //Dynamically allocated arrays ! u_long *DYNAMIC_TMD[400]; //the Addresses MapObject tileModel[400]; //the actual models long heightFields[41][41]; //height field long texturePosition[40][40]; //tile position of textures VECTOR Beacons[11][2]; } MAPStruct; // GLOBALS //--------- MAPStruct *currentMap; MAPStruct Level1; MapObject Level1Objects[35]; // PROTOTYPES //------------ void InitMapObject(MapObject *theModel, int nX, int nY, int nZ, unsigned long *lModelAddress); u_long * CreateTileTMD(u_long * myTMD,long texture1,long texture2,long texture3,long texture4, long h1, long h2, long h3, long h4,long h5,long h6, long h7, long h8,long h9); void CreateTileModel(); void RotateMap(long x, long y, long z); void SetupMap(); void DrawMap(GsCOORDINATE2 coordinate); void SetCurrentMap(MAPStruct *theMap); void SetDimensions(MAPStruct *theMap,u_long NuTx,u_long ML, u_long MW); long FindHeight(long rx,long rz); long FindRotation(long height1, long height2,long length); void SetAttributes(MAPStruct *theMap,long grav,long fric, long wind); long getWind(); long getFriction(); long getGravity(); void GetBeacon(u_long number,VECTOR *vect1, VECTOR *vect2); void RotateModelMatrixMap (MapObject *theModel, int nRX, int nRY, int nRZ); void DrawMapObjects(GsCOORDINATE2 coordinate); void DrawMapTile(MapObject *theModel,u_long bitShift); VECTOR VectorNormal(long x1,long y1,long z1,long x2,long y2,long z2,long x3 ,long y3,long z3); void SetLevelMap(); void InitialiseMap1Objects();