mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Use 'construction stage' consistently, instead of 'construction state'.
parent
98445088b1
commit
368d131fb7
|
@ -763,7 +763,7 @@ static void MakeIndustryTileBigger(TileIndex tile)
|
||||||
uint8_t stage = GetIndustryConstructionStage(tile) + 1;
|
uint8_t stage = GetIndustryConstructionStage(tile) + 1;
|
||||||
SetIndustryConstructionCounter(tile, 0);
|
SetIndustryConstructionCounter(tile, 0);
|
||||||
SetIndustryConstructionStage(tile, stage);
|
SetIndustryConstructionStage(tile, stage);
|
||||||
StartStopIndustryTileAnimation(tile, IAT_CONSTRUCTION_STATE_CHANGE);
|
StartStopIndustryTileAnimation(tile, IAT_CONSTRUCTION_STAGE_CHANGE);
|
||||||
if (stage == INDUSTRY_COMPLETED) SetIndustryCompleted(tile);
|
if (stage == INDUSTRY_COMPLETED) SetIndustryCompleted(tile);
|
||||||
|
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
|
|
|
@ -157,7 +157,7 @@ struct IndustryTileSpec {
|
||||||
uint8_t anim_next; ///< Next frame in an animation
|
uint8_t anim_next; ///< Next frame in an animation
|
||||||
/**
|
/**
|
||||||
* When true, the tile has to be drawn using the animation
|
* When true, the tile has to be drawn using the animation
|
||||||
* state instead of the construction state
|
* state instead of the construction stage
|
||||||
*/
|
*/
|
||||||
bool anim_state;
|
bool anim_state;
|
||||||
/* Newgrf data */
|
/* Newgrf data */
|
||||||
|
|
|
@ -37,7 +37,7 @@ enum StationAnimationTrigger : uint8_t {
|
||||||
|
|
||||||
/** Animation triggers of the industries. */
|
/** Animation triggers of the industries. */
|
||||||
enum IndustryAnimationTrigger : uint8_t {
|
enum IndustryAnimationTrigger : uint8_t {
|
||||||
IAT_CONSTRUCTION_STATE_CHANGE, ///< Trigger whenever the construction state changes.
|
IAT_CONSTRUCTION_STAGE_CHANGE, ///< Trigger whenever the construction stage changes.
|
||||||
IAT_TILELOOP, ///< Trigger in the periodic tile loop.
|
IAT_TILELOOP, ///< Trigger in the periodic tile loop.
|
||||||
IAT_INDUSTRY_TICK, ///< Trigger every tick.
|
IAT_INDUSTRY_TICK, ///< Trigger every tick.
|
||||||
IAT_INDUSTRY_RECEIVED_CARGO, ///< Trigger when cargo is received .
|
IAT_INDUSTRY_RECEIVED_CARGO, ///< Trigger when cargo is received .
|
||||||
|
|
|
@ -67,8 +67,8 @@ enum CallbackID : uint16_t {
|
||||||
/** Called for periodically starting or stopping the animation. */
|
/** Called for periodically starting or stopping the animation. */
|
||||||
CBID_HOUSE_ANIMATION_START_STOP = 0x1B, // 15 bit callback
|
CBID_HOUSE_ANIMATION_START_STOP = 0x1B, // 15 bit callback
|
||||||
|
|
||||||
/** Called whenever the construction state of a house changes. */
|
/** Called whenever the construction stage of a house changes. */
|
||||||
CBID_HOUSE_CONSTRUCTION_STATE_CHANGE = 0x1C, // 15 bit callback
|
CBID_HOUSE_CONSTRUCTION_STAGE_CHANGE = 0x1C, // 15 bit callback
|
||||||
|
|
||||||
/** Determine whether a wagon can be attached to an already existing train. */
|
/** Determine whether a wagon can be attached to an already existing train. */
|
||||||
CBID_TRAIN_ALLOW_WAGON_ATTACH = 0x1D,
|
CBID_TRAIN_ALLOW_WAGON_ATTACH = 0x1D,
|
||||||
|
@ -342,7 +342,7 @@ enum class HouseCallbackMask : uint8_t {
|
||||||
AllowConstruction = 0, ///< decide whether the house can be built on a given tile
|
AllowConstruction = 0, ///< decide whether the house can be built on a given tile
|
||||||
AnimationNextFrame = 1, ///< decides next animation frame
|
AnimationNextFrame = 1, ///< decides next animation frame
|
||||||
AnimationStartStop = 2, ///< periodically start/stop the animation
|
AnimationStartStop = 2, ///< periodically start/stop the animation
|
||||||
ConstructionStateChange = 3, ///< change animation when construction state changes
|
ConstructionStageChange = 3, ///< change animation when construction stage changes
|
||||||
Colour = 4, ///< decide the colour of the building
|
Colour = 4, ///< decide the colour of the building
|
||||||
CargoAcceptance = 5, ///< decides amount of cargo acceptance
|
CargoAcceptance = 5, ///< decides amount of cargo acceptance
|
||||||
AnimationSpeed = 6, ///< decides animation speed
|
AnimationSpeed = 6, ///< decides animation speed
|
||||||
|
|
|
@ -541,8 +541,8 @@ void AnimateNewHouseConstruction(TileIndex tile)
|
||||||
{
|
{
|
||||||
const HouseSpec *hs = HouseSpec::Get(GetHouseType(tile));
|
const HouseSpec *hs = HouseSpec::Get(GetHouseType(tile));
|
||||||
|
|
||||||
if (hs->callback_mask.Test(HouseCallbackMask::ConstructionStateChange)) {
|
if (hs->callback_mask.Test(HouseCallbackMask::ConstructionStageChange)) {
|
||||||
HouseAnimationBase::ChangeAnimationFrame(CBID_HOUSE_CONSTRUCTION_STATE_CHANGE, hs, Town::GetByTile(tile), tile, 0, 0);
|
HouseAnimationBase::ChangeAnimationFrame(CBID_HOUSE_CONSTRUCTION_STAGE_CHANGE, hs, Town::GetByTile(tile), tile, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1531,7 +1531,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
|
||||||
* @param sl slope refused upon choosing a place to build
|
* @param sl slope refused upon choosing a place to build
|
||||||
* @param a1 animation frame on production
|
* @param a1 animation frame on production
|
||||||
* @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 stage
|
||||||
*/
|
*/
|
||||||
#define MT(ca1, c1, ca2, c2, ca3, c3, sl, a1, a2, a3) { \
|
#define MT(ca1, c1, ca2, c2, ca3, c3, sl, a1, a2, a3) { \
|
||||||
{INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO}, \
|
{INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO}, \
|
||||||
|
|
|
@ -161,7 +161,7 @@ static const NICallback _nic_house[] = {
|
||||||
NICH(CBID_HOUSE_ALLOW_CONSTRUCTION, HouseCallbackMask::AllowConstruction),
|
NICH(CBID_HOUSE_ALLOW_CONSTRUCTION, HouseCallbackMask::AllowConstruction),
|
||||||
NICH(CBID_HOUSE_ANIMATION_NEXT_FRAME, HouseCallbackMask::AnimationNextFrame),
|
NICH(CBID_HOUSE_ANIMATION_NEXT_FRAME, HouseCallbackMask::AnimationNextFrame),
|
||||||
NICH(CBID_HOUSE_ANIMATION_START_STOP, HouseCallbackMask::AnimationStartStop),
|
NICH(CBID_HOUSE_ANIMATION_START_STOP, HouseCallbackMask::AnimationStartStop),
|
||||||
NICH(CBID_HOUSE_CONSTRUCTION_STATE_CHANGE, HouseCallbackMask::ConstructionStateChange),
|
NICH(CBID_HOUSE_CONSTRUCTION_STAGE_CHANGE, HouseCallbackMask::ConstructionStageChange),
|
||||||
NICH(CBID_HOUSE_COLOUR, HouseCallbackMask::Colour),
|
NICH(CBID_HOUSE_COLOUR, HouseCallbackMask::Colour),
|
||||||
NICH(CBID_HOUSE_CARGO_ACCEPTANCE, HouseCallbackMask::CargoAcceptance),
|
NICH(CBID_HOUSE_CARGO_ACCEPTANCE, HouseCallbackMask::CargoAcceptance),
|
||||||
NICH(CBID_HOUSE_ANIMATION_SPEED, HouseCallbackMask::AnimationSpeed),
|
NICH(CBID_HOUSE_ANIMATION_SPEED, HouseCallbackMask::AnimationSpeed),
|
||||||
|
@ -176,7 +176,7 @@ static const NICallback _nic_house[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NIVariable _niv_house[] = {
|
static const NIVariable _niv_house[] = {
|
||||||
NIV(0x40, "construction state of tile and pseudo-random value"),
|
NIV(0x40, "construction stage of tile and pseudo-random value"),
|
||||||
NIV(0x41, "age of building in years"),
|
NIV(0x41, "age of building in years"),
|
||||||
NIV(0x42, "town zone"),
|
NIV(0x42, "town zone"),
|
||||||
NIV(0x43, "terrain type"),
|
NIV(0x43, "terrain type"),
|
||||||
|
@ -234,7 +234,7 @@ static const NICallback _nic_industrytiles[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NIVariable _niv_industrytiles[] = {
|
static const NIVariable _niv_industrytiles[] = {
|
||||||
NIV(0x40, "construction state of tile"),
|
NIV(0x40, "construction stage of tile"),
|
||||||
NIV(0x41, "ground type"),
|
NIV(0x41, "ground type"),
|
||||||
NIV(0x42, "current town zone in nearest town"),
|
NIV(0x42, "current town zone in nearest town"),
|
||||||
NIV(0x43, "relative position"),
|
NIV(0x43, "relative position"),
|
||||||
|
|
Loading…
Reference in New Issue