// *********************************************** // USEFUL.H - some general rubbish and structures // *********************************************** #ifndef _USEFUL_ #define _USEFUL_ // **** includes #include #include "graphics.h" // **** defines #define TRUE (1) #define FALSE (0) #define BitSet(_v,_b) \ *(_v) = *(_v) | (_b) #define BitCheck(_v,_b) \ (*(_v) & (_b)) #define BitClear(_v,_b) \ (*(_v) = *(_v) - (*(_v) & (_b))) #define SetRect(_r,_x,_y,_w,_h) \ (_r)->x = (_x), (_r)->y = (_y), (_r)->w = (_w), (_r)->h = (_h) #define SetRGB(_o,_r,_g,_b) \ (_o)->r = (_r), (_o)->g = (_g), (_o)->b = (_b) // **** global structures (can only be defined once) typedef struct { u_long xPos, yPos, zPos; u_char x0, y0, x1, y1; } CAMERASINGLETYPE; typedef struct { u_long numCameras; CAMERASINGLETYPE camera[16]; } CAMERAINFOTYPE; typedef struct { u_long x,z; u_char type; u_char orientation; u_char r,g,b; } OBJECTSINGLETYPE; typedef struct { u_char numObjects; OBJECTSINGLETYPE object[50]; } OBJECTINFOTYPE; typedef struct { u_char xPos, zPos; u_char direction; } ENTRANCETYPE; typedef struct { u_char mapTo, entranceTo; u_char x0, y0, x1, y1; } EXITSINGLETYPE; typedef struct { u_char numExits; EXITSINGLETYPE exit[10]; } EXITINFOTYPE; typedef struct { u_char type; u_long modelAddr; u_char state; u_char howToHandle; u_char orientation; long scaleX, scaleY, scaleZ; u_char r,g,b; } SMALLCHARACTERTYPE; typedef struct { Model charModel; SVECTOR charVector; u_char howToHandle; u_char type; u_char state; short health; long scaleX, scaleY, scaleZ; long momentumX, momentumY, momentumZ; } LARGECHARACTERTYPE; typedef struct { u_char music; u_char fight; u_long heightAddr, colourAddr, textureAddr; u_char weather; u_char background, middleground; u_char skyBottom[3], skyTop[3], middle[3]; CAMERAINFOTYPE cameras; ENTRANCETYPE entrances[10]; EXITINFOTYPE exits; OBJECTINFOTYPE objects; SMALLCHARACTERTYPE characters[20]; u_char numChars; // u_char height2[21][21]; u_char collide[5][40]; } MAPINFO; #endif