mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
(svn r9906) -Codechange: Add common properties for both industry and industry tiles specs
This commit is contained in:
parent
39016328cc
commit
f3cf7f6b2d
@ -14,7 +14,8 @@ typedef uint8 IndustryType;
|
|||||||
enum {
|
enum {
|
||||||
INVALID_INDUSTRY = 0xFFFF,
|
INVALID_INDUSTRY = 0xFFFF,
|
||||||
NUM_INDUSTRYTYPES = 37,
|
NUM_INDUSTRYTYPES = 37,
|
||||||
INDUTILE_NOANIM = 0xFF, ///< flag to mark industry tiles as having no animation
|
INDUTILE_NOANIM = 0xFF, ///< flag to mark industry tiles as having no animation
|
||||||
|
INVALID_INDUSTRYTYPE = NUM_INDUSTRYTYPES, ///< one above amount is considered invalid
|
||||||
};
|
};
|
||||||
|
|
||||||
enum IndustryLifeType {
|
enum IndustryLifeType {
|
||||||
@ -91,6 +92,16 @@ struct IndustryTileTable {
|
|||||||
IndustryGfx gfx;
|
IndustryGfx gfx;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Data related to the handling of grf files. Common to both industry and industry tile */
|
||||||
|
struct GRFFileProps {
|
||||||
|
uint8 subst_id;
|
||||||
|
uint16 local_id; ///< id defined by the grf file for this industry
|
||||||
|
struct SpriteGroup *spritegroup; ///< pointer to the different sprites of the industry
|
||||||
|
const struct GRFFile *grffile; ///< grf file that introduced this house
|
||||||
|
uint8 override; ///< id of the entity been replaced by
|
||||||
|
bool enabled; ///< entity still avaible (by default true).newgrf can disable it, though
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the data structure for constructing industry.
|
* Defines the data structure for constructing industry.
|
||||||
*/
|
*/
|
||||||
@ -119,11 +130,9 @@ struct IndustrySpec {
|
|||||||
byte appear_creation[NUM_LANDSCAPE]; ///< Probability of appearance during map creation
|
byte appear_creation[NUM_LANDSCAPE]; ///< Probability of appearance during map creation
|
||||||
uint8 number_of_sounds; ///< Number of sounds available in the sounds array
|
uint8 number_of_sounds; ///< Number of sounds available in the sounds array
|
||||||
const uint8 *random_sounds; ///< array of random sounds.
|
const uint8 *random_sounds; ///< array of random sounds.
|
||||||
/* Newgrf stuff coming in */
|
/* Newgrf data */
|
||||||
uint16 callback_flags; ///< Flags telling which grf callback is set
|
uint16 callback_flags; ///< Flags telling which grf callback is set
|
||||||
byte subst_id;
|
struct GRFFileProps grf_prop; ///< properties related the the grf file
|
||||||
uint32 grfid;
|
|
||||||
byte override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -136,6 +145,9 @@ struct IndustryTileSpec {
|
|||||||
byte anim_next; ///< Next frame in an animation
|
byte anim_next; ///< Next frame in an animation
|
||||||
bool anim_state; ///< When true, the tile has to be drawn using the animation
|
bool anim_state; ///< When true, the tile has to be drawn using the animation
|
||||||
///< state instead of the construction state
|
///< state instead of the construction state
|
||||||
|
/* Newgrf data */
|
||||||
|
uint8 callback_flags; ///< Flags telling which grf callback is set
|
||||||
|
struct GRFFileProps grf_prop;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* industry_cmd.cpp*/
|
/* industry_cmd.cpp*/
|
||||||
|
@ -1133,9 +1133,9 @@ static const uint8 _plastic_mine_sounds[] = { SND_33_PLASTIC_MINE };
|
|||||||
|
|
||||||
#define MI(tbl, sndc, snd, d, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, col, \
|
#define MI(tbl, sndc, snd, d, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, col, \
|
||||||
c1, c2, c3, proc, p1, r1, p2, r2, m, a1, im1, a2, im2, a3, im3, pr, clim, bev, in, intx, s1, s2, s3) \
|
c1, c2, c3, proc, p1, r1, p2, r2, m, a1, im1, a2, im2, a3, im3, pr, clim, bev, in, intx, s1, s2, s3) \
|
||||||
{tbl, lengthof(tbl), d, {c1, c2, c3}, proc, {p1, p2}, {r1, r2}, m, \
|
{tbl, lengthof(tbl), d, {c1, c2, c3}, proc, {p1, p2}, {r1, r2}, m, \
|
||||||
{a1, a2, a3}, {{im1, 0}, {im2, 0}, {im3, 0}}, pr, clim, bev, col, in, intx, s1, s2, s3, {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, sndc, snd, 0, 0, 0, 0}
|
{a1, a2, a3}, {{im1, 0}, {im2, 0}, {im3, 0}}, pr, clim, bev, col, in, intx, s1, s2, s3, {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, \
|
||||||
|
sndc, snd, 0, {0, 0, NULL, NULL, INVALID_INDUSTRYTYPE, true}}
|
||||||
static const IndustrySpec _industry_specs[] = {
|
static const IndustrySpec _industry_specs[] = {
|
||||||
/* Format:
|
/* Format:
|
||||||
tile table count and sounds table
|
tile table count and sounds table
|
||||||
@ -1527,7 +1527,7 @@ static const IndustrySpec _industry_specs[] = {
|
|||||||
* @param a2 next frame of animation
|
* @param a2 next frame of animation
|
||||||
* @param a3 chooses between animation or construction state
|
* @param a3 chooses between animation or construction state
|
||||||
*/
|
*/
|
||||||
#define MT(c1, c2, c3, sl, a1, a2, a3) {{c1, c2, c3}, sl, a1, a2, a3}
|
#define MT(c1, c2, c3, sl, a1, a2, a3) {{c1, c2, c3}, sl, a1, a2, a3, 0, {0, 0, NULL, NULL, 0, true}}
|
||||||
static const IndustryTileSpec _industry_tile_specs[] = {
|
static const IndustryTileSpec _industry_tile_specs[] = {
|
||||||
/* Coal Mine */
|
/* Coal Mine */
|
||||||
MT(CT_INVALID, CT_INVALID, CT_INVALID, SLOPE_STEEP, INDUTILE_NOANIM, INDUTILE_NOANIM, false),
|
MT(CT_INVALID, CT_INVALID, CT_INVALID, SLOPE_STEEP, INDUTILE_NOANIM, INDUTILE_NOANIM, false),
|
||||||
|
Loading…
Reference in New Issue
Block a user