summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2019-04-22 10:53:40 +0100
committerPeterN <peter@fuzzle.org>2019-04-29 17:40:22 +0100
commit0a53ee8cfe3d02aa1e7abb6c8cf67ef1d7e5ab58 (patch)
treef065a3cb5ce2145e4f773122d6473eb4f693a30e
parent5d66d8fd7dc6e684108887770c11aee4c356c5e7 (diff)
downloadopenttd-0a53ee8cfe3d02aa1e7abb6c8cf67ef1d7e5ab58.tar.xz
Codechange: Remove PartOfSubsidyByte
-rw-r--r--src/industry.h30
-rw-r--r--src/subsidy_type.h5
-rw-r--r--src/town.h2
3 files changed, 17 insertions, 20 deletions
diff --git a/src/industry.h b/src/industry.h
index 281672959..b03b69654 100644
--- a/src/industry.h
+++ b/src/industry.h
@@ -56,24 +56,24 @@ struct Industry : IndustryPool::PoolItem<&_industry_pool> {
uint16 last_month_transported[INDUSTRY_NUM_OUTPUTS]; ///< total units transported per cargo in the last full month
uint16 counter; ///< used for animation and/or production (if available cargo)
- IndustryType type; ///< type of industry.
- Owner owner; ///< owner of the industry. Which SHOULD always be (imho) OWNER_NONE
- byte random_colour; ///< randomized colour of the industry, for display purpose
- Year last_prod_year; ///< last year of production
- byte was_cargo_delivered; ///< flag that indicate this has been the closest industry chosen for cargo delivery by a station. see DeliverGoodsToIndustry
-
- PartOfSubsidyByte part_of_subsidy; ///< NOSAVE: is this industry a source/destination of a subsidy?
- StationList stations_near; ///< NOSAVE: List of nearby stations.
-
- Owner founder; ///< Founder of the industry
- Date construction_date; ///< Date of the construction of the industry
- uint8 construction_type; ///< Way the industry was constructed (@see IndustryConstructionType)
+ IndustryType type; ///< type of industry.
+ Owner owner; ///< owner of the industry. Which SHOULD always be (imho) OWNER_NONE
+ byte random_colour; ///< randomized colour of the industry, for display purpose
+ Year last_prod_year; ///< last year of production
+ byte was_cargo_delivered; ///< flag that indicate this has been the closest industry chosen for cargo delivery by a station. see DeliverGoodsToIndustry
+
+ PartOfSubsidy part_of_subsidy; ///< NOSAVE: is this industry a source/destination of a subsidy?
+ StationList stations_near; ///< NOSAVE: List of nearby stations.
+
+ Owner founder; ///< Founder of the industry
+ Date construction_date; ///< Date of the construction of the industry
+ uint8 construction_type; ///< Way the industry was constructed (@see IndustryConstructionType)
Date last_cargo_accepted_at[INDUSTRY_NUM_INPUTS]; ///< Last day each cargo type was accepted by this industry
- byte selected_layout; ///< Which tile layout was used when creating the industry
+ byte selected_layout; ///< Which tile layout was used when creating the industry
- uint16 random; ///< Random value used for randomisation of all kinds of things
+ uint16 random; ///< Random value used for randomisation of all kinds of things
- PersistentStorage *psa; ///< Persistent storage for NewGRF industries.
+ PersistentStorage *psa; ///< Persistent storage for NewGRF industries.
Industry(TileIndex tile = INVALID_TILE) : location(tile, 0, 0) {}
~Industry();
diff --git a/src/subsidy_type.h b/src/subsidy_type.h
index 83c33a00a..968351ffb 100644
--- a/src/subsidy_type.h
+++ b/src/subsidy_type.h
@@ -15,14 +15,11 @@
#include "core/enum_type.hpp"
/** What part of a subsidy is something? */
-enum PartOfSubsidy {
+enum PartOfSubsidy : byte {
POS_NONE = 0, ///< nothing
POS_SRC = 1 << 0, ///< bit 0 set -> town/industry is source of subsidised path
POS_DST = 1 << 1, ///< bit 1 set -> town/industry is destination of subsidised path
};
-/** Helper to store the PartOfSubsidy data in a single byte. */
-typedef SimpleTinyEnumT<PartOfSubsidy, byte> PartOfSubsidyByte;
-
DECLARE_ENUM_AS_BIT_SET(PartOfSubsidy)
typedef uint16 SubsidyID; ///< ID of a subsidy
diff --git a/src/town.h b/src/town.h
index 8e8a6551d..5f0f4992f 100644
--- a/src/town.h
+++ b/src/town.h
@@ -46,7 +46,7 @@ struct TownCache {
uint32 num_houses; ///< Amount of houses
uint32 population; ///< Current population of people
ViewportSign sign; ///< Location of name sign, UpdateVirtCoord updates this
- PartOfSubsidyByte part_of_subsidy; ///< Is this town a source/destination of a subsidy?
+ PartOfSubsidy part_of_subsidy; ///< Is this town a source/destination of a subsidy?
uint32 squared_town_zone_radius[HZB_END]; ///< UpdateTownRadius updates this given the house count
BuildingCounts<uint16> building_counts; ///< The number of each type of building in the town
};