From 368d131fb77c6f34ddd1503138c9b39d6cb1f3e2 Mon Sep 17 00:00:00 2001 From: frosch Date: Wed, 16 Apr 2025 13:17:37 +0200 Subject: [PATCH] Codechange: Use 'construction stage' consistently, instead of 'construction state'. --- src/industry_cmd.cpp | 2 +- src/industrytype.h | 2 +- src/newgrf_animation_type.h | 2 +- src/newgrf_callbacks.h | 6 +++--- src/newgrf_house.cpp | 4 ++-- src/table/build_industry.h | 2 +- src/table/newgrf_debug_data.h | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index d58a577b32..d27cae4b68 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -763,7 +763,7 @@ static void MakeIndustryTileBigger(TileIndex tile) uint8_t stage = GetIndustryConstructionStage(tile) + 1; SetIndustryConstructionCounter(tile, 0); SetIndustryConstructionStage(tile, stage); - StartStopIndustryTileAnimation(tile, IAT_CONSTRUCTION_STATE_CHANGE); + StartStopIndustryTileAnimation(tile, IAT_CONSTRUCTION_STAGE_CHANGE); if (stage == INDUSTRY_COMPLETED) SetIndustryCompleted(tile); MarkTileDirtyByTile(tile); diff --git a/src/industrytype.h b/src/industrytype.h index 87fad405cf..d384085fe4 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -157,7 +157,7 @@ struct IndustryTileSpec { uint8_t anim_next; ///< Next frame in an 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; /* Newgrf data */ diff --git a/src/newgrf_animation_type.h b/src/newgrf_animation_type.h index ec1354b3fb..fd20022a59 100644 --- a/src/newgrf_animation_type.h +++ b/src/newgrf_animation_type.h @@ -37,7 +37,7 @@ enum StationAnimationTrigger : uint8_t { /** Animation triggers of the industries. */ 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_INDUSTRY_TICK, ///< Trigger every tick. IAT_INDUSTRY_RECEIVED_CARGO, ///< Trigger when cargo is received . diff --git a/src/newgrf_callbacks.h b/src/newgrf_callbacks.h index 1753713d06..c448981426 100644 --- a/src/newgrf_callbacks.h +++ b/src/newgrf_callbacks.h @@ -67,8 +67,8 @@ enum CallbackID : uint16_t { /** Called for periodically starting or stopping the animation. */ CBID_HOUSE_ANIMATION_START_STOP = 0x1B, // 15 bit callback - /** Called whenever the construction state of a house changes. */ - CBID_HOUSE_CONSTRUCTION_STATE_CHANGE = 0x1C, // 15 bit callback + /** Called whenever the construction stage of a house changes. */ + CBID_HOUSE_CONSTRUCTION_STAGE_CHANGE = 0x1C, // 15 bit callback /** Determine whether a wagon can be attached to an already existing train. */ 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 AnimationNextFrame = 1, ///< decides next animation frame 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 CargoAcceptance = 5, ///< decides amount of cargo acceptance AnimationSpeed = 6, ///< decides animation speed diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp index d9d67beee7..8fc006c676 100644 --- a/src/newgrf_house.cpp +++ b/src/newgrf_house.cpp @@ -541,8 +541,8 @@ void AnimateNewHouseConstruction(TileIndex tile) { const HouseSpec *hs = HouseSpec::Get(GetHouseType(tile)); - if (hs->callback_mask.Test(HouseCallbackMask::ConstructionStateChange)) { - HouseAnimationBase::ChangeAnimationFrame(CBID_HOUSE_CONSTRUCTION_STATE_CHANGE, hs, Town::GetByTile(tile), tile, 0, 0); + if (hs->callback_mask.Test(HouseCallbackMask::ConstructionStageChange)) { + HouseAnimationBase::ChangeAnimationFrame(CBID_HOUSE_CONSTRUCTION_STAGE_CHANGE, hs, Town::GetByTile(tile), tile, 0, 0); } } diff --git a/src/table/build_industry.h b/src/table/build_industry.h index 27f5fd151a..c32b2772d8 100644 --- a/src/table/build_industry.h +++ b/src/table/build_industry.h @@ -1531,7 +1531,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { * @param sl slope refused upon choosing a place to build * @param a1 animation frame on production * @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) { \ {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}, \ diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 14e16f127b..e24ce2ec29 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -161,7 +161,7 @@ static const NICallback _nic_house[] = { NICH(CBID_HOUSE_ALLOW_CONSTRUCTION, HouseCallbackMask::AllowConstruction), NICH(CBID_HOUSE_ANIMATION_NEXT_FRAME, HouseCallbackMask::AnimationNextFrame), 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_CARGO_ACCEPTANCE, HouseCallbackMask::CargoAcceptance), NICH(CBID_HOUSE_ANIMATION_SPEED, HouseCallbackMask::AnimationSpeed), @@ -176,7 +176,7 @@ static const NICallback _nic_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(0x42, "town zone"), NIV(0x43, "terrain type"), @@ -234,7 +234,7 @@ static const NICallback _nic_industrytiles[] = { }; static const NIVariable _niv_industrytiles[] = { - NIV(0x40, "construction state of tile"), + NIV(0x40, "construction stage of tile"), NIV(0x41, "ground type"), NIV(0x42, "current town zone in nearest town"), NIV(0x43, "relative position"),