// types.h - global typedefs // *** WARNING: Do not change this value because file formats depend on it! *** #define FILENAME_LEN 256 // maximums #define MAX_COOL_MENU_ITEMS 32 #define MAX_MESSAGESTRINGLEN 128 #define MAX_MAPMESSAGETRIGGERS 1024 #define MAX_MAPMESSAGESTRINGS 1024 #define MAX_TSPRITES 2048 #define MAX_PICKUP_COLOURS 16 // last entry reserved for map theatre #define MAX_TILES 1024 // per tileset #define MAX_GSTRS 196 #define MAX_GNUMS 128 #define MAX_PARAMS 32 #define MAX_SPRITES 1024 #define MAX_SUB_BITMAPS 5 #define MAX_SPRITE_FRAMES 50 #define MAX_ITEMS 128 #define MAX_POWERUPS 128 #define MAX_PLAYER_WEAPONS 32 #define MAX_GAME_PROJECTILES 1024 #define MAX_TSPRITE_X 320 #define MAX_TSPRITE_Y 200 #define MAX_TSPRITE_FRAMES 10 #define MAX_MAP_SPRITES 4096 #define MAX_MAP_POWERUPS 1024 #define MAX_RACES 512 #define MAX_PTILE_TYPES 512 #define MAX_WEAPONS 512 #define MAX_WEAPON_MOUNTS 8 #define MAX_INSPECTOR_ENTRIES 32 #define MAX_GAME_UNITS 512 #define MAX_MAP_UNITS MAX_GAME_UNITS /* #define MAX_POWERUPTYPES 256 */ #define MAX_EXPLOSIONS 2048 #define MAX_UNSEEABLE_PROJECTILE_LINES MAX_GAME_PROJECTILES #define MAX_MAP_LIST_ENTRIES 64 #define MAX_GAME_PARTICLES 384 #define MAX_CLIENTS 63 typedef struct{ char *MapFilename; char *MusicFilename; }TMAP_LIST_ENTRY; typedef struct{ char ListTitle[ 64]; TMAP_LIST_ENTRY entries[ MAX_MAP_LIST_ENTRIES]; char count; }TMAP_LIST; typedef struct{ char desc[ 21]; char address[ 16]; char port[7]; }TSERVER_BOOKMARK; typedef struct{ char *str; BITMAP *glyph; char *description; }TCOOL_MENU_ITEM; typedef struct{ int ItemCount; int select; TCOOL_MENU_ITEM items[ MAX_COOL_MENU_ITEMS]; char *title; int w; // menu width char MenuWaitsForSelection; }TCOOL_MENU; typedef struct{ int x1, y1, x2, y2; }TUNSEEABLE_PROJECTILE_LINE; typedef struct{ int x, y; int w, h; int damage; int OwnerId; }TEXPLOSION; /*typedef struct{ char name[32]; char item[32]; // item name to credit int number; // number of occurences of item to credit int sprite; }TPOWERUPTYPE;*/ typedef struct{ char SpecialTypeNumber; int UsedTileNumber; // use -1 for same as "TileNumber" int LinkTile; // link tile int UsedLinkTile; // used link tile char EventSound[13]; // play this when this special tile is used char RequiredItem[32]; // item needed to activate this object (NULL for none) int NumberRequired; /* amount of "RequiredItem"s needed */ // calc int a_EventSoundNumber; }TSPECIAL_TILE_DATA; typedef struct{ double x, y; unsigned char angle; int projectile; int dist; TTIMER a_MoveTimer; int LastTeleportTileId; char active; // stops clients from processing projectiles which are waiting to be deleted by the server short int ProjectileId; short int OwnerObjectId; }GAME_PROJECTILE; typedef struct{ int x, y; unsigned char angle; double speed; int dist; int SpriteNumber; }TGAME_PARTICLE; typedef struct{ unsigned char RotatePos; // current rotation position TTIMER RotateTimer; // rotation animation timer }TSUB_BITMAP_ANIMATION_DATA; typedef struct{ char CurrentFrame; TTIME CurrentFrameTimer; // animation frame timer TTIME RotateTimer; // animation rotation timer // animation data for sub bitmaps TSUB_BITMAP_ANIMATION_DATA SubBitmapAnimationData[ MAX_SUB_BITMAPS]; unsigned long DataId; // each animation data has its own ID for loops and key frame sounds char WaitingToPlayFrameSound; }TSPRITE_ANIMATION_DATA; typedef struct{ double PosX, PosY; unsigned char angle; // actual angle that this unit is facing, must be int! unsigned char bearing; // destination bearing int hits; char height; //char selected; //char ai; // AI type TTIMER a_MoveTimer; TTIMER a_RofTimers[ MAX_WEAPON_MOUNTS]; char active; // active? char firing; // firing flag unsigned char FiringBearing; // bearing firing on char stuck; // stuck flag //char moving; // moving flag // calculated data, stored for speed int range; // range int TerrainType; int RaceNumber; int sight; // each unit has a fixed id for keeping net // games and demos in sync, although the net // and demo code has been removed from Meteor // this var has not! - (JB: 20001024) // int id; // bye id, 26/1/2004 int LastTeleportTileId; char DisappearOffMap; short int ObjectId; TSPRITE_ANIMATION_DATA StillAnimationData; TSPRITE_ANIMATION_DATA MovingAnimationData; // net stuff double NetPosX, NetPosY; unsigned char NetAngle; int NetHits; char NetHeight; }GAME_UNIT; typedef struct{ int PlayerNumber; GAME_UNIT GameUnits[ MAX_GAME_UNITS]; int GameUnitsUsed; int wx1, wy1, wx2, wy2; // window points (in tiles) int wox, woy; // terrain window offsets int ProjectilesUsed; char coop; // cooperative / head to head flag (0 = DM, 1 = coop, 2 = coop NFF) char server; char NoMonsters; GAME_PROJECTILE Projectiles[ MAX_GAME_PROJECTILES]; //int WaterX, WaterY, WaterUp, WaterLeft; int UseMiniMap; char game; // game type flag char god; // god mode flag! char level, LevelDone; TEXPLOSION explosions[ MAX_EXPLOSIONS]; int NumberOfExplosions; TTIMER SpriteTimeDownTimer; char LevelExitFlag; int WaterX, WaterY; char WaterMovingLeft, WaterMovingUp; char BriefingFilename[ FILENAME_LEN]; int ActiveUnitCount; TUNSEEABLE_PROJECTILE_LINE UnseeableProjectileLines[ MAX_UNSEEABLE_PROJECTILE_LINES]; int NumberOfUnseeableProjectileLines; TGAME_PARTICLE GameParticles[MAX_GAME_PARTICLES]; int NumberOfParticles; int NumPlayers; double MapWindowX, MapWindowY; char CurrentMapFilename[ FILENAME_LEN]; char paused; char MapListFilename[ FILENAME_LEN]; char MissionMapFilename[ FILENAME_LEN]; char MissionMusicFilename[ FILENAME_LEN]; short int SecondsRemaining; char RemoteServerIsDedicated; unsigned long NextAnimationDataId; }GAME_DATA; typedef struct{ char caption[48]; char type; // for int pointers int *val; int *val2; int min; int max; // also used for max string len (if string) // for strings char *data; // string data BITMAP *BitmapPointer; // pointer to bitmap data BITMAP *BitmapPointer2; // pointer to secondary bitmap data TCOLOUR *ColourPointer; // colour pointer }INSPECTOR_ENTRY; typedef struct{ char caption[48]; int count; int x, y; int w, h; //int *vals[ MAX_INSPECTOR_ENTRIES]; INSPECTOR_ENTRY entries[ MAX_INSPECTOR_ENTRIES]; }INSPECTOR; typedef struct{ int x, y; // mount coords char WeaponName[ FILENAME_LEN]; // calc int WeaponNumber; TROTATED_SUB_BITMAP_OFFSETS RotatedOffsets; }TWEAPON_MOUNT; typedef struct{ char desc[32]; char FireSound[ FILENAME_LEN]; //32]; // firing sound char SpriteName[ FILENAME_LEN]; //13]; char ProjectileName[ FILENAME_LEN]; //13]; int FireX, FireY; // coords or projectile spawn int rotate; // does this weapon rotate independently? int rof; // rate of fire int MultiFire; // calc int SpriteNumber; int ProjectileNumber; int a_FireSoundNumber; }TWEAPON; // ** this old weapon structure is used for file reading only ** typedef struct{ char desc[32]; int FireX, FireY; // coords or projectile spawn int KickBack; // number of pixels to kick back int rotate; // does this weapon rotate independently? char FireSound[ 32]; // firing sound int rof; // rate of fire char SpriteName[ 13]; char ProjectileName[ 13]; // version 2+ int MultiFire; // calc int SpriteNumber; int ProjectileNumber; }TOLD_WEAPON; typedef struct{ char desc[ 32]; // description of this projectile type BITMAP *image; // the image for this projectile type int range; // the range of this projectile (pixels) int damage; // apply "damage" number of HP on contact int speed; // move one pixel every "speed" hundreths of a second //char SelfGuide; // does this thing self lock to a target? int BlastRadius; // apply damage to other units within "BlastRadius" pixels char ContactSound[ FILENAME_LEN]; //32]; // wave file to play on contact int LightRadius; // (self explained) (0 - 255) TCOLOUR LightColour; // added in v1.3 int height; // height above ground (really pixel shadow offset) (0 for none) int VapourLen; // length of vapour trail // char missile; // is this thing a missile? // char patriot; // does this thing shoot down missiles? char bounce; char SourceFilename[ FILENAME_LEN]; // original image source // calc TROTATED_IMAGE_DATA rid; BITMAP *LightBitmap; char LightBitmapAllocated; int LightDrawOffX, LightDrawOffY; int a_ContactSoundNumber; }TPROJECTILE; typedef struct{ char name[32]; BITMAP *image; int xp; // x pixel offset int yp; // y pixel offset int rotate; char SourceFilename[ FILENAME_LEN]; // calc data TROTATED_SUB_BITMAP_OFFSETS RotatedOffsets; TROTATED_IMAGE_DATA rid; }TSUB_BITMAP; typedef struct{ BITMAP *image; // image data int DisplayTime; // time to display in 100/sec char SourceFilename[ FILENAME_LEN]; char SoundName[ FILENAME_LEN]; // calc int a_SoundNumber; }TSPRITE_FRAME; // This is the SPRITE strcuture. A SPRITE is made up from up to // MAX_SPRITE_FRAMES bitmaps which can be dispayed for a given number // of 100/secs. Up to MAX_SUB_SPRITES can also be added on top of // each sprite. A sort of recusive data structure. Use wisely! typedef struct{ char name[32]; // name of sprite TSPRITE_FRAME frames[ MAX_SPRITE_FRAMES]; // actual frame images TSUB_BITMAP subs[ MAX_SUB_BITMAPS]; // sub bitmaps char NumFrames; // number of frames char NumSubs; // number of subs int rotate; // 0 = none, + = clockwise speed, - = anti clockwise speed char TerrainType; char DestroyType; TCOLOUR LightColour; int LightSize; char LoopSound[ FILENAME_LEN]; // calculated data TROTATED_IMAGE_DATA rid; // used for frame 0 only TSPRITE_ANIMATION_DATA DefaultAnimationData; BITMAP *LightBitmap; int LightBitmapAllocated; int LightDrawOffX, LightDrawOffY; int a_LoopSoundNumber; char a_HasFrameSounds; }TSPRITE; /* If a SPRITE_FRAME has a DisplayTime value of 0 then no bitmap data will be loaded or saved for that frame, if the value is -1 then the frame will be displayed as a single frame. Any other value will be taken as the number of hundreths of a second to display that frame. This hundreths of a second thing is very approximate, in time a tick timer (18.2 ticks/sec) system may be introduced. */ typedef struct{ FONT *BigFont; BITMAP *HUDBack; BITMAP *SelectedHUDBack; BITMAP *CrossHair; BITMAP *WaterSurface; BITMAP *LavaSurface; BITMAP *AcidSurface; BITMAP *BulletLines; BITMAP *Icon_GoodGuy; BITMAP *Icon_BadGuy; BITMAP *Icon_Neutral; }ENGINE; typedef struct{ char *name; float data; }GNUM; typedef struct{ char *name; char *data; }GSTR; typedef struct{ char pass; char desc[20]; char special; char DestroyType; int DestroyedTile; }TILE_DATA; typedef struct{ char desc[ 48]; char used; int pickup, start, range; }T_PICKUP_COLOUR; typedef struct{ int PickUpColours[ MAX_PICKUP_COLOURS]; int PickUpStartColours[ MAX_PICKUP_COLOURS]; int PickUpRandColours[ MAX_PICKUP_COLOURS]; char PickUpDescs[ MAX_PICKUP_COLOURS][ 48]; }OLD_TILE_HEADER; // used for pre v1.2 8 bit tilesets typedef struct{ T_PICKUP_COLOUR PickUpColours[ MAX_PICKUP_COLOURS]; }TILE_HEADER; typedef struct{ long location; int MessageId; }TMAPMESSAGETRIGGER; typedef struct{ int x, y, w, h; }T_START_ZONE; typedef struct{ // see MapFiles.c for file header (id and version) info // map info char title[ 128]; int MapX, MapY; // start zones (single is also dm1, see global.h for SZ_ numbers) T_START_ZONE StartZones[5]; // counts int SpritesUsed; int UnitsUsed; int PowerUpsUsed; int MessageStringsUsed; int MessageTriggersUsed; char author[ 128]; char email[ 128]; char ExtendedTilesetFilename[ FILENAME_LEN]; char PlayerCharacterFilename[ FILENAME_LEN]; char NextLevelNames[3][ FILENAME_LEN]; // char GrassTheatre; char GrassTheatre; T_PICKUP_COLOUR GrassPickup; char night, rain, storm, battle; int TimeLimit; // in mins char ConveyorsOn; char IgnoreRequiredItemsInDeathmatch; // message triggers TMAPMESSAGETRIGGER MessageTriggers[MAX_MAPMESSAGETRIGGERS]; }MAP_HEADER; typedef struct{ int x, y; char name[ 128]; // power up name // calc int PowerUpNumber; int RespawnTimer; char DroppedInGame; }MAP_POWERUP; typedef struct{ // common stuff char desc[32]; // unit name int UnitClass; // unit type int side; // whos side is this unit on? int hp; // hit points // int sight; // sight in pixels int speed; // self ex... // flight options (only applicable if the "TerrainType" is TT_AIR int MaxHeight; // shadow offset in pixels int NumMounts; // number of weapon mounts TWEAPON_MOUNT WeaponMounts[ MAX_WEAPON_MOUNTS]; char DestroyedSound[ FILENAME_LEN]; // sprites char StillSpriteName[ FILENAME_LEN]; char MovingSpriteName[FILENAME_LEN]; int ProjectileStop; char WastedSpriteName[64]; char DropPowerUpName[64]; char DropPowerUpName2[64]; char DropPowerUpNameMP[64]; // calc int StillSpriteNumber; int MovingSpriteNumber; int WastedSpriteNumber; int a_DestroyedSoundNumber; }TCHAR_RACE; // a map sprite typedef struct{ int x, y; char SpriteName[ FILENAME_LEN]; int angle; // calc int SpriteNumber; // store sprite index number for each sprite for speed, this is a calculated field int DisplayTime; // not used, default is -1 char ConveyorCheck; TSPRITE_ANIMATION_DATA AnimationData; }TMAP_SPRITE; // a collection of map sprites typedef TMAP_SPRITE TMAP_SPRITES[ MAX_MAP_SPRITES]; typedef struct{ int x, y; // x and y map pos int angle; int ai; // this the unit's AI type (i.e. AI_NORMAL) int RaceNumber; char StartActive; }MAP_UNIT; typedef struct{ TSPRITE sprites[ MAX_TSPRITES]; char *names[ MAX_TSPRITES]; int count; }TLOADED_SPRITES; typedef struct{ TCHAR_RACE races[ MAX_RACES]; char *names[ MAX_RACES]; int count; }TLOADED_RACES; typedef struct{ TPROJECTILE projectiles[ MAX_PTILE_TYPES]; char *names[ MAX_PTILE_TYPES]; int count; }TLOADED_PROJECTILES; typedef struct{ TWEAPON weapons[ MAX_WEAPONS]; char *names[ MAX_WEAPONS]; int count; }TLOADED_WEAPONS; // standard file header structure /*typedef struct{ char id[32]; int version; }TSTANDARD_FILE_HEADER;*/ typedef struct{ // standard options int AnimateWater; int TranslucentWater; int ShowAllWeaponsOnHUD; int SpinPlayer; int ProjectileLines; int UseLightSourcing; int FlatButtons; //int TranslucentShadows; int TranslucentHints; int ShowItemsHUD; int UseVsync; int ShowMapTitleOnGameScreen; int HoverboardHoverEffect; int AllowRain; int RedHurtEffect; // mouse options int InvertMouseWheel; int AlwaysMouseLook; // video mode options int card, ScreenW, ScreenH; // sound options, set by Audio Conrol Panel int SoundFxVolume; int MusicVolume; int ReverseStereo; char MusicPath[ FILENAME_LEN]; int SoundTravelDistance; // network options char PlayerName[ 64]; unsigned char PlayerColourR; unsigned char PlayerColourG; unsigned char PlayerColourB; int RemoteServerPort; int LocalServerPort; int MaxNetPlayers; // must not exceed MAX_CLIENTS in net.c char PlayerInfoMode; char CoopMapList[ FILENAME_LEN]; char HeadToHeadMapList[ FILENAME_LEN]; char HeadToHeadTimeLimit; char ShowKillCounts; // editing options // int AutoWater; char ImportExportPath[ FILENAME_LEN]; }TOPTIONS; typedef struct{ char *name; // item name and desc int start; // start amount of this item int max; // max amount of this item char local; // is local? (reset on level start) char ShowOnHUD; // calc int SuitablePowerUpNumber; }TITEM; typedef struct{ char *name; // power up name int ItemNumber; int amount; // number of "credits" char *SpriteName; char StayInCoop; // new for v1.2 // calc int SpriteNumber; }TPOWERUP; typedef struct{ int x, y; char WeaponItemName[64]; char AmmoItemName[64]; char HudSpriteName[ FILENAME_LEN]; char WeaponFilename[ FILENAME_LEN]; // calc data int a_WeaponItemNumber; int a_AmmoItemNumber; int a_HudSpriteNumber; int a_WeaponNumber; TROTATED_SUB_BITMAP_OFFSETS RotatedOffsets; }TPLAYER_WEAPON_MOUNT; // 1.2 ok typedef struct{ char desc[ 128]; // sprites char StillSpriteName[ FILENAME_LEN]; char MovingSpriteName[ FILENAME_LEN]; // weapons int NumberOfWeapons; // weapon count TPLAYER_WEAPON_MOUNT WeaponMounts[ MAX_PLAYER_WEAPONS]; // weapon mounts // sounds char HurtSound[ FILENAME_LEN]; char WastedSound[ FILENAME_LEN]; // misc int TerrainType; // terrain type int side; // side int hp; // max health (hit points) char FaceSpriteName[ FILENAME_LEN]; // name of sprite for face int ControlType; int height; // added in v1.2 (int for inspectors otherwise could be char but too late to change due to file format) int HoverboardOffX, HoverboardOffY; // Hoverboard offsets - added in v1.2 (later on). char DropPowerUpNameMP[64]; char DropPowerUpNameMP2[64]; // calculated int StillSpriteNumber; int MovingSpriteNumber; int FaceSpriteNumber; TROTATED_SUB_BITMAP_OFFSETS HoverboardOffsets; int a_HurtSoundNumber, a_WastedSoundNumber; }TCHARACTER; typedef struct{ double x, y; double NewX, NewY; //int colour; //int StartX, StartY; TTIMER FiringTimer; int RateOfFire; char name[ 128]; int items[ MAX_ITEMS]; // number of each item (see items.c) int StartItems[ MAX_ITEMS]; // number of each item at start of level int JustPickedUp; // id of power up that has just been picked up unsigned char angle, TargetAngle; char JustPickedUpTimer; char CurrentWeapon, StartWeapon; char moving; long LastSpecialTile; // flag to prevent constant teleporting! see sptiles.c char state; char InHelicopter; char mouseAiming; TCHARACTER character; int colour; TSPRITE StillSprite, MovingSprite; // these are pre-drawn to the player's colour int DestX, DestY; // used for when the player is in an APC char HeliHeight; // int TotalKills, KillsThisLevel; double CurrentSpeed; char MaxSpeed; short int kills; // control flags char AllowAutoStop; char AllowSteering; char AllowSpeedUp; // net stuff double NetX, NetY; unsigned char NetAngle; char NetHeliHeight; char NetCurrentWeapon; char NetInHelicopter; char NetState; short int NetKills; int NetItems[ MAX_ITEMS]; int ObjectId; }PLAYER; typedef struct{ int explode; int PlayerDie; int PlayerHurt; int PowerUp; int WeaponSelect; int NeedKey; int NoAmmo; int message; int NoWeapon; int bounce; int battle; int thunder; int teleport; int respawn; int chat; int NoTime; int VolumeTest; int DefaultBeep; int MenuMove; int MenuSelect; int MenuCancel; }TSOUND_NUMBERS;