#pragma once #include "opengl.h" #define outfit_isProp(o,p) ((o)->properties & p) // Property flags. #define OUTFIT_PROP_WEAP_SECONDARY (1<<0) // Outfit types. typedef enum { OUTFIT_TYPE_NULL = 0, OUTFIT_TYPE_BOLT = 1, OUTFIT_TYPE_BEAM = 2, OUTFIT_TYPE_MISSILE_DUMB = 3, OUTFIT_TYPE_MISSILE_DUMB_AMMO = 4, OUTFIT_TYPE_MISSILE_SEEK = 5, OUTFIT_TYPE_MISSILE_SEEK_AMMO = 6, OUTFIT_TYPE_MISSILE_SEEK_SMART = 7, OUTFIT_TYPE_MISSILE_SEEK_SMART_AMMO = 8, OUTFIT_TYPE_MISSILE_SWARM = 9, OUTFIT_TYPE_MISSILE_SWARM_AMMO = 10, OUTFIT_TYPE_MISSILE_SWARM_SMART = 11, OUTFIT_TYPE_MISSILE_SWARM_SMART_AMMO = 12 } OutfitType; // An outfit depends a lot on the type. typedef struct { char* name; // General specs. int max; int tech; int mass; glTexture gfx_store; // Store graphic. int properties; // Properties stored bitwise. // Type dependant. OutfitType type; union { struct { // Beam/Bolt. unsigned int delay; // Delay between shots. double speed; // Speed of shot. (not applicable to beam. double range; double accuracy; // Desviation accuracy. double damage_armour, damage_shield; // Damage. glTexture* gfx_space; }; struct { // Launcher. //unsigned int delay; // Delay between shots. char* ammo; }; struct { // Ammo. //double speed; // Max speed. double turn; // Turn vel. double thrust; // Acceleration. unsigned int duration; // Duration. //double damage_armour, damage_shield; // Damage. //glTexture* gfx_space; }; }; } Outfit; Outfit* outfit_get(const char* name); // Outfit types. int outfit_isWeapon(const Outfit* o); int outfit_isLauncher(const Outfit* o); int outfit_isAmmo(const Outfit* o); const char* outfit_getType(const Outfit* o); const char* outfit_getTypeBroad(const Outfit* o); // Load/free outfit stack. int outfit_load(void); void outfit_free(void);