Lephisto/src/ship.h
Allanis e1b23f928b [Change] GUI's are now saved in XML and thrown into data pack file.
-- This allows for multiple gui's.
  -- Each ship can also have it's own gui if it so chooses.
2013-02-12 19:34:47 +00:00

61 lines
1.0 KiB
C

#pragma once
#include "main.h"
#include "outfit.h"
#include "opengl.h"
// Target gfx dimensions.
#define SHIP_TARGET_W 128
#define SHIP_TARGET_H 96
enum ship_class {
SHIP_CLASS_NULL,
SHIP_CLASS_CIV_LIGHT,
SHIP_CLASS_CIV_MEDIUM,
SHIP_CLASS_CIV_HEAVY
};
typedef enum ship_class ship_class;
// Small wrapper for the outfits.
typedef struct ShipOutfit {
struct ShipOutfit* next; // Linked list.
Outfit* data; // Data itself.
int quantity;
} ShipOutfit;
// Ship structure.
typedef struct {
char* name; // Ship name.
ship_class class; // Ship class.
// Movement.
double thrust, turn, speed;
// Graphics.
gl_texture* gfx_space, *gfx_target;
// GUI interface.
char* gui;
// Characteristics.
int crew;
int mass;
// Health.
double armor, armor_regen;
double shield, shield_regen;
double energy, energy_regen;
// Capacity.
int cap_cargo, cap_weapon;
// Outfits
ShipOutfit* outfit;
} Ship;
int ships_load(void);
void ships_free(void);
Ship* ship_get(const char* name);