Merge remote-tracking branch 'upstream/master'

This commit is contained in:
dP
2025-05-14 18:41:13 +05:00
994 changed files with 38753 additions and 34512 deletions
+33 -37
View File
@@ -28,7 +28,7 @@
#define MKEND {{-0x80, 0}, 0}
/** Tiles for Country Airfield (small) */
static const AirportTileTable _tile_table_country_0[] = {
static const std::initializer_list<AirportTileTable> _tile_table_country_0 = {
MK(0, 0, APT_SMALL_BUILDING_1),
MK(1, 0, APT_SMALL_BUILDING_2),
MK(2, 0, APT_SMALL_BUILDING_3),
@@ -44,12 +44,12 @@ static const AirportTileTable _tile_table_country_0[] = {
MKEND
};
static const AirportTileTable * const _tile_table_country[] = {
_tile_table_country_0,
static const std::initializer_list<AirportTileLayout> _tile_table_country = {
{ _tile_table_country_0, DIR_N },
};
/** Tiles for Commuter Airfield (small) */
static const AirportTileTable _tile_table_commuter_0[] = {
static const std::initializer_list<AirportTileTable> _tile_table_commuter_0 = {
MK(0, 0, APT_TOWER),
MK(1, 0, APT_BUILDING_3),
MK(2, 0, APT_HELIPAD_2_FENCE_NW),
@@ -73,12 +73,12 @@ static const AirportTileTable _tile_table_commuter_0[] = {
MKEND
};
static const AirportTileTable * const _tile_table_commuter[] = {
_tile_table_commuter_0,
static const std::initializer_list<AirportTileLayout> _tile_table_commuter = {
{ _tile_table_commuter_0, DIR_N },
};
/** Tiles for City Airport (large) */
static const AirportTileTable _tile_table_city_0[] = {
static const std::initializer_list<AirportTileTable> _tile_table_city_0 = {
MK(0, 0, APT_BUILDING_1),
MK(1, 0, APT_APRON_FENCE_NW),
MK(2, 0, APT_STAND_1),
@@ -118,12 +118,12 @@ static const AirportTileTable _tile_table_city_0[] = {
MKEND
};
static const AirportTileTable * const _tile_table_city[] = {
_tile_table_city_0,
static const std::initializer_list<AirportTileLayout> _tile_table_city = {
{ _tile_table_city_0, DIR_N },
};
/** Tiles for Metropolitain Airport (large) - 2 runways */
static const AirportTileTable _tile_table_metropolitan_0[] = {
static const std::initializer_list<AirportTileTable> _tile_table_metropolitan_0 = {
MK(0, 0, APT_BUILDING_1),
MK(1, 0, APT_APRON_FENCE_NW),
MK(2, 0, APT_STAND_1),
@@ -163,12 +163,12 @@ static const AirportTileTable _tile_table_metropolitan_0[] = {
MKEND
};
static const AirportTileTable * const _tile_table_metropolitan[] = {
_tile_table_metropolitan_0,
static const std::initializer_list<AirportTileLayout> _tile_table_metropolitan = {
{ _tile_table_metropolitan_0, DIR_N },
};
/** Tiles for International Airport (large) - 2 runways */
static const AirportTileTable _tile_table_international_0[] = {
static const std::initializer_list<AirportTileTable> _tile_table_international_0 = {
MK(0, 0, APT_RUNWAY_END_FENCE_NW),
MK(1, 0, APT_RUNWAY_FENCE_NW),
MK(2, 0, APT_RUNWAY_FENCE_NW),
@@ -221,12 +221,12 @@ static const AirportTileTable _tile_table_international_0[] = {
MKEND
};
static const AirportTileTable * const _tile_table_international[] = {
_tile_table_international_0,
static const std::initializer_list<AirportTileLayout> _tile_table_international = {
{ _tile_table_international_0, DIR_N },
};
/** Tiles for International Airport (large) - 2 runways */
static const AirportTileTable _tile_table_intercontinental_0[] = {
static const std::initializer_list<AirportTileTable> _tile_table_intercontinental_0 = {
MK(0, 0, APT_RADAR_FENCE_NE),
MK(1, 0, APT_RUNWAY_END_FENCE_NE_NW),
MK(2, 0, APT_RUNWAY_FENCE_NW),
@@ -329,22 +329,22 @@ static const AirportTileTable _tile_table_intercontinental_0[] = {
MKEND
};
static const AirportTileTable * const _tile_table_intercontinental[] = {
_tile_table_intercontinental_0,
static const std::initializer_list<AirportTileLayout> _tile_table_intercontinental = {
{ _tile_table_intercontinental_0, DIR_N },
};
/** Tiles for Heliport */
static const AirportTileTable _tile_table_heliport_0[] = {
static const std::initializer_list<AirportTileTable> _tile_table_heliport_0 = {
MK(0, 0, APT_HELIPORT),
MKEND
};
static const AirportTileTable * const _tile_table_heliport[] = {
_tile_table_heliport_0,
static const std::initializer_list<AirportTileLayout> _tile_table_heliport = {
{ _tile_table_heliport_0, DIR_N },
};
/** Tiles for Helidepot */
static const AirportTileTable _tile_table_helidepot_0[] = {
static const std::initializer_list<AirportTileTable> _tile_table_helidepot_0 = {
MK(0, 0, APT_LOW_BUILDING_FENCE_N),
MK(1, 0, APT_DEPOT_SE),
MK(0, 1, APT_HELIPAD_2_FENCE_NE_SE),
@@ -352,12 +352,12 @@ static const AirportTileTable _tile_table_helidepot_0[] = {
MKEND
};
static const AirportTileTable * const _tile_table_helidepot[] = {
_tile_table_helidepot_0,
static const std::initializer_list<AirportTileLayout> _tile_table_helidepot = {
{ _tile_table_helidepot_0, DIR_N },
};
/** Tiles for Helistation */
static const AirportTileTable _tile_table_helistation_0[] = {
static const std::initializer_list<AirportTileTable> _tile_table_helistation_0 = {
MK(0, 0, APT_DEPOT_SE),
MK(1, 0, APT_LOW_BUILDING_FENCE_NW),
MK(2, 0, APT_HELIPAD_3_FENCE_NW),
@@ -369,29 +369,25 @@ static const AirportTileTable _tile_table_helistation_0[] = {
MKEND
};
static const AirportTileTable * const _tile_table_helistation[] = {
_tile_table_helistation_0,
};
static const Direction _default_airports_rotation[] = {
DIR_N,
static const std::initializer_list<AirportTileLayout> _tile_table_helistation = {
{ _tile_table_helistation_0, DIR_N },
};
#undef MK
#undef MKEND
/** General AirportSpec definition. */
#define AS_GENERIC(fsm, att, rot, att_len, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, enabled) \
{fsm, att, rot, att_len, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, name, ttdpatch_type, class_id, preview, maint_cost, enabled, GRFFileProps(AT_INVALID)}
#define AS_GENERIC(fsm, layouts, depots, size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, enabled) \
{{class_id, 0}, fsm, layouts, depots, size_x, size_y, noise, catchment, min_year, max_year, name, ttdpatch_type, preview, maint_cost, enabled, GRFFileProps(AT_INVALID)}
/** AirportSpec definition for airports without any depot. */
#define AS_ND(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview) \
AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _default_airports_rotation, lengthof(_tile_table_##ap_name), nullptr, 0, \
AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, {}, \
size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, true)
/** AirportSpec definition for airports with at least one depot. */
#define AS(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview) \
AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _default_airports_rotation, lengthof(_tile_table_##ap_name), _airport_depots_##ap_name, lengthof(_airport_depots_##ap_name), \
AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _airport_depots_##ap_name, \
size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, true)
/* The helidepot and helistation have ATP_TTDP_SMALL because they are at ground level */
@@ -405,12 +401,12 @@ extern const AirportSpec _origin_airport_specs[] = {
AS(helidepot, 2, 2, 1976, CalendarTime::MAX_YEAR, 4, 2, 7, ATP_TTDP_SMALL, APC_HELIPORT, STR_AIRPORT_HELIDEPOT, SPR_AIRPORT_PREVIEW_HELIDEPOT),
AS(intercontinental, 9, 11, 2002, CalendarTime::MAX_YEAR, 10, 25, 72, ATP_TTDP_LARGE, APC_HUB, STR_AIRPORT_INTERCONTINENTAL, SPR_AIRPORT_PREVIEW_INTERCONTINENTAL),
AS(helistation, 4, 2, 1980, CalendarTime::MAX_YEAR, 4, 3, 14, ATP_TTDP_SMALL, APC_HELIPORT, STR_AIRPORT_HELISTATION, SPR_AIRPORT_PREVIEW_HELISTATION),
AS_GENERIC(&_airportfta_oilrig, nullptr, _default_airports_rotation, 0, nullptr, 0, 1, 1, 0, 4, 0, 0, 0, ATP_TTDP_OILRIG, APC_HELIPORT, STR_NULL, 0, false),
AS_GENERIC(&_airportfta_oilrig, {}, {}, 1, 1, 0, 4, 0, 0, 0, ATP_TTDP_OILRIG, APC_HELIPORT, STR_NULL, 0, false),
};
static_assert(NEW_AIRPORT_OFFSET == lengthof(_origin_airport_specs));
const AirportSpec AirportSpec::dummy = AS_GENERIC(&_airportfta_dummy, nullptr, _default_airports_rotation, 0, nullptr, 0, 0, 0, 0, 0, CalendarTime::MIN_YEAR, CalendarTime::MIN_YEAR, 0, ATP_TTDP_LARGE, APC_BEGIN, STR_NULL, 0, false);
const AirportSpec AirportSpec::dummy = AS_GENERIC(&_airportfta_dummy, {}, {}, 0, 0, 0, 0, CalendarTime::MIN_YEAR, CalendarTime::MIN_YEAR, 0, ATP_TTDP_LARGE, APC_BEGIN, STR_NULL, 0, false);
#undef AS
#undef AS_ND
+19 -19
View File
@@ -16,10 +16,10 @@
* Finite sTate mAchine --> FTA
*/
struct AirportFTAbuildup {
byte position; ///< The position that an airplane is at.
byte heading; ///< The current orders (eg. TAKEOFF, HANGAR, ENDLANDING, etc.).
uint8_t position; ///< The position that an airplane is at.
uint8_t heading; ///< The current orders (eg. TAKEOFF, HANGAR, ENDLANDING, etc.).
uint64_t block; ///< The block this position is on on the airport (st->airport.flags).
byte next; ///< Next position from this position.
uint8_t next; ///< Next position from this position.
};
///////////////////////////////////////////////////////////////////////
@@ -407,7 +407,7 @@ static const AirportMovingData _airport_moving_data_oilrig[9] = {
///////////////////////////////////////////////////////////////////////
/////**********Movement Machine on Airports*********************///////
static const byte _airport_entries_dummy[] = {0, 1, 2, 3};
static const uint8_t _airport_entries_dummy[] = {0, 1, 2, 3};
static const AirportFTAbuildup _airport_fta_dummy[] = {
{ 0, TO_ALL, 0, 3},
{ 1, TO_ALL, 0, 0},
@@ -419,8 +419,8 @@ static const AirportFTAbuildup _airport_fta_dummy[] = {
/* First element of terminals array tells us how many depots there are (to know size of array)
* this may be changed later when airports are moved to external file */
static const HangarTileTable _airport_depots_country[] = { {{3, 0}, DIR_SE, 0} };
static const byte _airport_terminal_country[] = {1, 2};
static const byte _airport_entries_country[] = {16, 15, 18, 17};
static const uint8_t _airport_terminal_country[] = {1, 2};
static const uint8_t _airport_entries_country[] = {16, 15, 18, 17};
static const AirportFTAbuildup _airport_fta_country[] = {
{ 0, HANGAR, NOTHING_block, 1 },
{ 1, TERMGROUP, AIRPORT_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TERM1, TERM1_block, 2 }, { 1, TERM2, 0, 4 }, { 1, HELITAKEOFF, 0, 19 }, { 1, TO_ALL, 0, 6 },
@@ -451,8 +451,8 @@ static const AirportFTAbuildup _airport_fta_country[] = {
};
static const HangarTileTable _airport_depots_commuter[] = { {{4, 0}, DIR_SE, 0} };
static const byte _airport_terminal_commuter[] = { 1, 3 };
static const byte _airport_entries_commuter[] = {22, 21, 24, 23};
static const uint8_t _airport_terminal_commuter[] = { 1, 3 };
static const uint8_t _airport_entries_commuter[] = {22, 21, 24, 23};
static const AirportFTAbuildup _airport_fta_commuter[] = {
{ 0, HANGAR, NOTHING_block, 1 }, { 0, HELITAKEOFF, TAXIWAY_BUSY_block, 1 }, { 0, TO_ALL, 0, 1 },
{ 1, TERMGROUP, TAXIWAY_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TAKEOFF, 0, 11 }, { 1, TERM1, TAXIWAY_BUSY_block, 10 }, { 1, TERM2, TAXIWAY_BUSY_block, 10 }, { 1, TERM3, TAXIWAY_BUSY_block, 10 }, { 1, HELIPAD1, TAXIWAY_BUSY_block, 10 }, { 1, HELIPAD2, TAXIWAY_BUSY_block, 10 }, { 1, HELITAKEOFF, TAXIWAY_BUSY_block, 37 }, { 1, TO_ALL, 0, 0 },
@@ -502,8 +502,8 @@ static const AirportFTAbuildup _airport_fta_commuter[] = {
};
static const HangarTileTable _airport_depots_city[] = { {{5, 0}, DIR_SE, 0} };
static const byte _airport_terminal_city[] = { 1, 3 };
static const byte _airport_entries_city[] = {26, 29, 27, 28};
static const uint8_t _airport_terminal_city[] = { 1, 3 };
static const uint8_t _airport_entries_city[] = {26, 29, 27, 28};
static const AirportFTAbuildup _airport_fta_city[] = {
{ 0, HANGAR, NOTHING_block, 1 }, { 0, TAKEOFF, OUT_WAY_block, 1 }, { 0, TO_ALL, 0, 1 },
{ 1, TERMGROUP, TAXIWAY_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TERM2, 0, 6 }, { 1, TERM3, 0, 6 }, { 1, TO_ALL, 0, 7 }, // for all else, go to 7
@@ -543,8 +543,8 @@ static const AirportFTAbuildup _airport_fta_city[] = {
};
static const HangarTileTable _airport_depots_metropolitan[] = { {{5, 0}, DIR_SE, 0} };
static const byte _airport_terminal_metropolitan[] = { 1, 3 };
static const byte _airport_entries_metropolitan[] = {20, 19, 22, 21};
static const uint8_t _airport_terminal_metropolitan[] = { 1, 3 };
static const uint8_t _airport_entries_metropolitan[] = {20, 19, 22, 21};
static const AirportFTAbuildup _airport_fta_metropolitan[] = {
{ 0, HANGAR, NOTHING_block, 1 },
{ 1, TERMGROUP, TAXIWAY_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TERM2, 0, 6 }, { 1, TERM3, 0, 6 }, { 1, TO_ALL, 0, 7 }, // for all else, go to 7
@@ -582,8 +582,8 @@ static const AirportFTAbuildup _airport_fta_metropolitan[] = {
};
static const HangarTileTable _airport_depots_international[] = { {{0, 3}, DIR_SE, 0}, {{6, 1}, DIR_SE, 1} };
static const byte _airport_terminal_international[] = { 2, 3, 3 };
static const byte _airport_entries_international[] = { 38, 37, 40, 39 };
static const uint8_t _airport_terminal_international[] = { 2, 3, 3 };
static const uint8_t _airport_entries_international[] = { 38, 37, 40, 39 };
static const AirportFTAbuildup _airport_fta_international[] = {
{ 0, HANGAR, NOTHING_block, 2 }, { 0, TERMGROUP, TERM_GROUP1_block, 0 }, { 0, TERMGROUP, TERM_GROUP2_ENTER1_block, 1 }, { 0, HELITAKEOFF, AIRPORT_ENTRANCE_block, 2 }, { 0, TO_ALL, 0, 2 },
{ 1, HANGAR, NOTHING_block, 3 }, { 1, TERMGROUP, HANGAR2_AREA_block, 1 }, { 1, HELITAKEOFF, HANGAR2_AREA_block, 3 }, { 1, TO_ALL, 0, 3 },
@@ -649,8 +649,8 @@ static const AirportFTAbuildup _airport_fta_international[] = {
/* intercontinental */
static const HangarTileTable _airport_depots_intercontinental[] = { {{0, 5}, DIR_SE, 0}, {{8, 4}, DIR_SE, 1} };
static const byte _airport_terminal_intercontinental[] = { 2, 4, 4 };
static const byte _airport_entries_intercontinental[] = { 44, 43, 46, 45 };
static const uint8_t _airport_terminal_intercontinental[] = { 2, 4, 4 };
static const uint8_t _airport_entries_intercontinental[] = { 44, 43, 46, 45 };
static const AirportFTAbuildup _airport_fta_intercontinental[] = {
{ 0, HANGAR, NOTHING_block, 2 }, { 0, TERMGROUP, HANGAR1_AREA_block | TERM_GROUP1_block, 0 }, { 0, TERMGROUP, HANGAR1_AREA_block | TERM_GROUP1_block, 1 }, { 0, TAKEOFF, HANGAR1_AREA_block | TERM_GROUP1_block, 2 }, { 0, TO_ALL, 0, 2 },
{ 1, HANGAR, NOTHING_block, 3 }, { 1, TERMGROUP, HANGAR2_AREA_block, 1 }, { 1, TERMGROUP, HANGAR2_AREA_block, 0 }, { 1, TO_ALL, 0, 3 },
@@ -742,7 +742,7 @@ static const AirportFTAbuildup _airport_fta_intercontinental[] = {
/* heliports, oilrigs don't have depots */
static const byte _airport_entries_heliport[] = { 7, 7, 7, 7 };
static const uint8_t _airport_entries_heliport[] = { 7, 7, 7, 7 };
static const AirportFTAbuildup _airport_fta_heliport[] = {
{ 0, HELIPAD1, HELIPAD1_block, 1 },
{ 1, HELITAKEOFF, NOTHING_block, 0 }, // takeoff
@@ -761,7 +761,7 @@ static const AirportFTAbuildup _airport_fta_heliport[] = {
/* helidepots */
static const HangarTileTable _airport_depots_helidepot[] = { {{1, 0}, DIR_SE, 0} };
static const byte _airport_entries_helidepot[] = { 4, 4, 4, 4 };
static const uint8_t _airport_entries_helidepot[] = { 4, 4, 4, 4 };
static const AirportFTAbuildup _airport_fta_helidepot[] = {
{ 0, HANGAR, NOTHING_block, 1 },
{ 1, TERMGROUP, HANGAR2_AREA_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, HELIPAD1, HELIPAD1_block, 14 }, { 1, HELITAKEOFF, 0, 15 }, { 1, TO_ALL, 0, 0 },
@@ -790,7 +790,7 @@ static const AirportFTAbuildup _airport_fta_helidepot[] = {
/* helistation */
static const HangarTileTable _airport_depots_helistation[] = { {{0, 0}, DIR_SE, 0} };
static const byte _airport_entries_helistation[] = { 25, 25, 25, 25 };
static const uint8_t _airport_entries_helistation[] = { 25, 25, 25, 25 };
static const AirportFTAbuildup _airport_fta_helistation[] = {
{ 0, HANGAR, NOTHING_block, 8 }, { 0, HELIPAD1, 0, 1 }, { 0, HELIPAD2, 0, 1 }, { 0, HELIPAD3, 0, 1 }, { 0, HELITAKEOFF, 0, 1 }, { 0, TO_ALL, 0, 0 },
{ 1, TERMGROUP, HANGAR2_AREA_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, HELITAKEOFF, 0, 3 }, { 1, TO_ALL, 0, 4 },
+45 -47
View File
@@ -1032,16 +1032,16 @@ static const std::vector<IndustryTileLayout> _tile_table_sugar_mine {
#undef MK
/** Array with saw sound, for sawmill */
static const uint8_t _sawmill_sounds[] = { SND_28_SAWMILL };
static const std::initializer_list<uint8_t> _sawmill_sounds = { SND_28_SAWMILL };
/** Array with whistle sound, for factory */
static const uint8_t _factory_sounds[] = { SND_03_FACTORY };
static const std::initializer_list<uint8_t> _factory_sounds = { SND_03_FACTORY };
/** Array with 3 animal sounds, for farms */
static const uint8_t _farm_sounds[] = { SND_24_FARM_1, SND_25_FARM_2, SND_26_FARM_3 };
static const std::initializer_list<uint8_t> _farm_sounds = { SND_24_FARM_1, SND_25_FARM_2, SND_26_FARM_3 };
/** Array with... hem... a sound of toyland */
static const uint8_t _plastic_mine_sounds[] = { SND_33_PLASTIC_MINE };
static const std::initializer_list<uint8_t> _plastic_mine_sounds = { SND_33_PLASTIC_MINE };
enum IndustryTypes {
IT_COAL_MINE = 0,
@@ -1125,17 +1125,16 @@ enum IndustryTypes {
* @param s3 text for production down
*/
#define MI(tbl, sndc, snd, d, pc, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, col, \
#define MI(tbl, snd, d, pc, 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) \
{tbl, d, 0, pc, {c1, c2, c3}, proc, \
{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}, \
{p1, p2, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID}, \
{r1, r2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, m, \
{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}, \
{a1, a2, a3, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID}, \
{{im1, 0}, {im2, 0}, {im3, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, \
pr, clim, bev, col, in, intx, s1, s2, s3, STR_UNDEFINED, {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, \
sndc, snd, 0, 0, true, GRFFileProps(INVALID_INDUSTRYTYPE)}
0, true, GRFFileProps(INVALID_INDUSTRYTYPE), snd, \
{{p1, p2}}, {{a1, a2, a3}}}
/* Format:
tile table count and sounds table
cost multiplier appear chances(4ingame, 4random) map colour
@@ -1147,7 +1146,7 @@ enum IndustryTypes {
industry name building text
messages : Closure production up production down */
static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
MI(_tile_table_coal_mine, 0, nullptr,
MI(_tile_table_coal_mine, {},
210, 0xB3333333, 2, 3, 0, 0, 8, 8, 0, 0, 1,
IT_POWER_STATION, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_COAL, 15, CT_INVALID, 0, 5,
@@ -1157,7 +1156,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_COAL_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_COAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_power_station, 0, nullptr,
MI(_tile_table_power_station, {},
240, 0xFFFFFFFF, 2, 2, 0, 0, 5, 5, 0, 0, 184,
IT_COAL_MINE, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_INVALID, 0, CT_INVALID, 0, 5,
@@ -1167,7 +1166,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_POWER_STATION, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_sawmill, 1, _sawmill_sounds,
MI(_tile_table_sawmill, _sawmill_sounds,
224, 0xFFFFFFFF, 2, 0, 0, 0, 5, 0, 0, 0, 194,
IT_FOREST, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_GOODS, 0, CT_INVALID, 0, 5,
@@ -1177,7 +1176,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_SAWMILL, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_forest, 0, nullptr,
MI(_tile_table_forest, {},
200, 0xBFFFFFFF, 3, 4, 0, 0, 5, 5, 0, 0, 86,
IT_SAWMILL, IT_PAPER_MILL, IT_INVALID, CHECK_FOREST,
CT_WOOD, 13, CT_INVALID, 0, 30,
@@ -1187,7 +1186,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_FOREST, STR_NEWS_INDUSTRY_PLANTED,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM),
MI(_tile_table_oil_refinery, 0, nullptr,
MI(_tile_table_oil_refinery, {},
244, 0xFFFFFFFF, 2, 2, 2, 0, 4, 4, 4, 0, 191,
IT_OIL_RIG, IT_INVALID, IT_INVALID, CHECK_REFINERY,
CT_GOODS, 0, CT_INVALID, 0, 5,
@@ -1197,7 +1196,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_OIL_REFINERY, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_oil_rig, 0, nullptr,
MI(_tile_table_oil_rig, {},
240, 0x99999999, 6, 0, 0, 0, 0, 0, 0, 0, 152,
IT_OIL_REFINERY, IT_INVALID, IT_INVALID, CHECK_OIL_RIG,
CT_OIL, 15, CT_PASSENGERS, 2, 5,
@@ -1207,7 +1206,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_OIL_RIG, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_OIL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_factory, 1, _factory_sounds,
MI(_tile_table_factory, _factory_sounds,
208, 0xFFFFFFFF, 2, 0, 0, 0, 5, 0, 0, 0, 174,
IT_FARM, IT_STEEL_MILL, IT_INVALID, CHECK_NOTHING,
CT_GOODS, 0, CT_INVALID, 0, 5,
@@ -1217,7 +1216,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_printing_works, 1, _factory_sounds,
MI(_tile_table_printing_works, _factory_sounds,
208, 0xFFFFFFFF, 0, 2, 0, 0, 0, 5, 0, 0, 174,
IT_PAPER_MILL, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_GOODS, 0, CT_INVALID, 0, 5,
@@ -1227,7 +1226,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_PRINTING_WORKS, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_steel_mill, 0, nullptr,
MI(_tile_table_steel_mill, {},
215, 0xFFFFFFFF, 2, 0, 0, 0, 5, 0, 0, 0, 10,
IT_IRON_MINE, IT_FACTORY, IT_INVALID, CHECK_NOTHING,
CT_STEEL, 0, CT_INVALID, 0, 5,
@@ -1237,7 +1236,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_STEEL_MILL, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_farm, 3, _farm_sounds,
MI(_tile_table_farm, _farm_sounds,
250, 0xD9999999, 2, 4, 0, 0, 9, 9, 0, 0, 48,
IT_FACTORY, IT_FOOD_PROCESS, IT_INVALID, CHECK_FARM,
MCT_GRAIN_WHEAT_MAIZE, 10, MCT_LIVESTOCK_FRUIT, 10, 5,
@@ -1247,7 +1246,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_FARM, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM),
MI(_tile_table_copper_mine, 0, nullptr,
MI(_tile_table_copper_mine, {},
205, 0xB3333333, 0, 0, 3, 0, 0, 0, 4, 0, 10,
IT_FACTORY_2, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_COPPER_ORE, 10, CT_INVALID, 0, 5,
@@ -1257,7 +1256,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_COPPER_ORE_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_oil_well, 0, nullptr,
MI(_tile_table_oil_well, {},
220, 0x99999999, 0, 5, 3, 0, 4, 5, 5, 0, 152,
IT_OIL_REFINERY, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_OIL, 12, CT_INVALID, 0, 5,
@@ -1267,7 +1266,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_OIL_WELLS, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_OIL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_bank, 0, nullptr,
MI(_tile_table_bank, {},
255, 0xA6666666, 7, 0, 0, 0, 0, 0, 0, 0, 15,
IT_BANK_TEMP, IT_INVALID, IT_INVALID, CHECK_NOTHING,
MCT_VALUABLES_GOLD_DIAMONDS, 6, CT_INVALID, 0, 5,
@@ -1277,7 +1276,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_BANK, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_food_process, 0, nullptr,
MI(_tile_table_food_process, {},
206, 0xFFFFFFFF, 0, 2, 2, 0, 0, 3, 4, 0, 55,
IT_FRUIT_PLANTATION, IT_FARM, IT_FARM_2, CHECK_NOTHING,
CT_FOOD, 0, CT_INVALID, 0, 5,
@@ -1287,7 +1286,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_FOOD_PROCESSING_PLANT, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_paper_mill, 1, _sawmill_sounds,
MI(_tile_table_paper_mill, _sawmill_sounds,
227, 0xFFFFFFFF, 0, 2, 0, 0, 0, 5, 0, 0, 10,
IT_FOREST, IT_PRINTING_WORKS, IT_INVALID, CHECK_NOTHING,
CT_PAPER, 0, CT_INVALID, 0, 5,
@@ -1297,7 +1296,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_PAPER_MILL, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_gold_mine, 0, nullptr,
MI(_tile_table_gold_mine, {},
208, 0x99999999, 0, 3, 0, 0, 0, 4, 0, 0, 194,
IT_BANK_TROPIC_ARCTIC, IT_INVALID, IT_INVALID, CHECK_NOTHING,
MCT_VALUABLES_GOLD_DIAMONDS, 7, CT_INVALID, 0, 5,
@@ -1307,7 +1306,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_GOLD_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_bank2, 0, nullptr,
MI(_tile_table_bank2, {},
151, 0xA6666666, 0, 3, 3, 0, 0, 6, 5, 0, 15,
IT_GOLD_MINE, IT_DIAMOND_MINE, IT_INVALID, CHECK_NOTHING,
CT_INVALID, 0, CT_INVALID, 0, 5,
@@ -1317,7 +1316,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_BANK_TROPIC_ARCTIC, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_diamond_mine, 0, nullptr,
MI(_tile_table_diamond_mine, {},
213, 0x99999999, 0, 0, 3, 0, 0, 0, 4, 0, 184,
IT_BANK_TROPIC_ARCTIC, IT_INVALID, IT_INVALID, CHECK_NOTHING,
MCT_VALUABLES_GOLD_DIAMONDS, 7, CT_INVALID, 0, 5,
@@ -1327,7 +1326,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_DIAMOND_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_iron_mine, 0, nullptr,
MI(_tile_table_iron_mine, {},
220, 0xB3333333, 2, 0, 0, 0, 5, 0, 0, 0, 55,
IT_STEEL_MILL, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_IRON_ORE, 10, CT_INVALID, 0, 5,
@@ -1337,7 +1336,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_IRON_ORE_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_fruit_plantation, 0, nullptr,
MI(_tile_table_fruit_plantation, {},
225, 0xBFFFFFFF, 0, 0, 2, 0, 0, 0, 4, 0, 86,
IT_FOOD_PROCESS, IT_INVALID, IT_INVALID, CHECK_PLANTATION,
MCT_LIVESTOCK_FRUIT, 10, CT_INVALID, 0, 15,
@@ -1347,7 +1346,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_FRUIT_PLANTATION, STR_NEWS_INDUSTRY_PLANTED,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM),
MI(_tile_table_rubber_plantation, 0, nullptr,
MI(_tile_table_rubber_plantation, {},
218, 0xBFFFFFFF, 0, 0, 3, 0, 0, 0, 4, 0, 39,
IT_FACTORY_2, IT_INVALID, IT_INVALID, CHECK_PLANTATION,
CT_RUBBER, 10, CT_INVALID, 0, 15,
@@ -1357,7 +1356,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_RUBBER_PLANTATION, STR_NEWS_INDUSTRY_PLANTED,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM),
MI(_tile_table_water_supply, 0, nullptr,
MI(_tile_table_water_supply, {},
199, 0xB3333333, 0, 0, 3, 0, 0, 0, 4, 0, 37,
IT_WATER_TOWER, IT_INVALID, IT_INVALID, CHECK_WATER,
CT_WATER, 12, CT_INVALID, 0, 5,
@@ -1367,7 +1366,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_WATER_SUPPLY, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_water_tower, 0, nullptr,
MI(_tile_table_water_tower, {},
115, 0xFFFFFFFF, 0, 0, 4, 0, 0, 0, 8, 0, 208,
IT_WATER_SUPPLY, IT_INVALID, IT_INVALID, CHECK_WATER,
CT_INVALID, 0, CT_INVALID, 0, 5,
@@ -1377,7 +1376,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_WATER_TOWER, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_factory2, 1, _factory_sounds,
MI(_tile_table_factory2, _factory_sounds,
208, 0xFFFFFFFF, 0, 0, 2, 0, 0, 0, 4, 0, 174,
IT_RUBBER_PLANTATION, IT_COPPER_MINE, IT_LUMBER_MILL, CHECK_PLANTATION,
CT_GOODS, 0, CT_INVALID, 0, 5,
@@ -1387,7 +1386,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_FACTORY_2, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_farm2, 0, nullptr,
MI(_tile_table_farm2, {},
250, 0xD9999999, 0, 0, 1, 0, 0, 0, 2, 0, 48,
IT_FOOD_PROCESS, IT_INVALID, IT_INVALID, CHECK_PLANTATION,
MCT_GRAIN_WHEAT_MAIZE, 11, CT_INVALID, 0, 5,
@@ -1397,7 +1396,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_FARM_2, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM),
MI(_tile_table_lumber_mill, 0, nullptr,
MI(_tile_table_lumber_mill, {},
135, 0xFFFFFFFF, 0, 0, 0, 0, 0, 0, 0, 0, 194,
IT_FACTORY_2, IT_INVALID, IT_INVALID, CHECK_LUMBERMILL,
CT_WOOD, 0, CT_INVALID, 0, 5,
@@ -1407,7 +1406,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_LUMBER_MILL, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_LACK_OF_TREES, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_cotton_candy, 0, nullptr,
MI(_tile_table_cotton_candy, {},
195, 0xBFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 5, 48,
IT_CANDY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_COTTON_CANDY, 13, CT_INVALID, 0, 30,
@@ -1417,7 +1416,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_COTTON_CANDY_FOREST, STR_NEWS_INDUSTRY_PLANTED,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_candy_factory, 0, nullptr,
MI(_tile_table_candy_factory, {},
206, 0xFFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 5, 174,
IT_COTTON_CANDY, IT_TOFFEE_QUARRY, IT_SUGAR_MINE, CHECK_NOTHING,
CT_CANDY, 0, CT_INVALID, 0, 5,
@@ -1427,7 +1426,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_CANDY_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_battery_farm, 0, nullptr,
MI(_tile_table_battery_farm, {},
187, 0xB3333333, 0, 0, 0, 3, 0, 0, 0, 4, 39,
IT_TOY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_BATTERIES, 11, CT_INVALID, 0, 30,
@@ -1437,7 +1436,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_BATTERY_FARM, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM),
MI(_tile_table_cola_wells, 0, nullptr,
MI(_tile_table_cola_wells, {},
193, 0x99999999, 0, 0, 0, 3, 0, 0, 0, 5, 55,
IT_FIZZY_DRINK_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_COLA, 12, CT_INVALID, 0, 5,
@@ -1447,7 +1446,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_COLA_WELLS, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_toy_shop, 0, nullptr,
MI(_tile_table_toy_shop, {},
133, 0xFFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 4, 208,
IT_TOY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_INVALID, 0, CT_INVALID, 0, 5,
@@ -1457,7 +1456,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_TOY_SHOP, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_toy_factory, 0, nullptr,
MI(_tile_table_toy_factory, {},
163, 0xFFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 5, 10,
IT_PLASTIC_FOUNTAINS, IT_BATTERY_FARM, IT_TOY_SHOP, CHECK_NOTHING,
CT_TOYS, 0, CT_INVALID, 0, 5,
@@ -1467,7 +1466,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_TOY_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_plastic_fountain, 1, _plastic_mine_sounds,
MI(_tile_table_plastic_fountain, _plastic_mine_sounds,
192, 0xA6666666, 0, 0, 0, 3, 0, 0, 0, 5, 37,
IT_TOY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_PLASTIC, 14, CT_INVALID, 0, 5,
@@ -1477,7 +1476,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_PLASTIC_FOUNTAINS, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_fizzy_drink, 0, nullptr,
MI(_tile_table_fizzy_drink, {},
177, 0xFFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 4, 184,
IT_COLA_WELLS, IT_BUBBLE_GENERATOR, IT_INVALID, CHECK_NOTHING,
CT_FIZZY_DRINKS, 0, CT_INVALID, 0, 5,
@@ -1487,7 +1486,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_FIZZY_DRINK_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_bubble_generator, 0, nullptr,
MI(_tile_table_bubble_generator, {},
203, 0xB3333333, 0, 0, 0, 3, 0, 0, 0, 5, 152,
IT_FIZZY_DRINK_FACTORY, IT_INVALID, IT_INVALID, CHECK_BUBBLEGEN,
CT_BUBBLES, 13, CT_INVALID, 0, 5,
@@ -1497,7 +1496,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_BUBBLE_GENERATOR, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_toffee_quarry, 0, nullptr,
MI(_tile_table_toffee_quarry, {},
213, 0xCCCCCCCC, 0, 0, 0, 3, 0, 0, 0, 5, 194,
IT_CANDY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_TOFFEE, 10, CT_INVALID, 0, 5,
@@ -1507,7 +1506,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
STR_INDUSTRY_NAME_TOFFEE_QUARRY, STR_NEWS_INDUSTRY_CONSTRUCTION,
STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL),
MI(_tile_table_sugar_mine, 0, nullptr,
MI(_tile_table_sugar_mine, {},
210, 0xBFFFFFFF, 0, 0, 0, 2, 0, 0, 0, 4, 15,
IT_CANDY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING,
CT_SUGAR, 11, CT_INVALID, 0, 5,
@@ -1534,8 +1533,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
*/
#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}, \
{c1, c2, c3, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID}, \
{ca1, ca2, ca3}, sl, a1, a2, a3, 0, {0, ANIM_STATUS_NO_ANIMATION, 2, 0}, INDTILE_SPECIAL_NONE, true, GRFFileProps(INVALID_INDUSTRYTILE) \
{ca1, ca2, ca3}, sl, a1, a2, a3, 0, {0, ANIM_STATUS_NO_ANIMATION, 2, 0}, INDTILE_SPECIAL_NONE, true, GRFFileProps(INVALID_INDUSTRYTILE), {c1, c2, c3} \
}
static const IndustryTileSpec _origin_industry_tile_specs[NEW_INDUSTRYTILEOFFSET] = {
/* Coal Mine */
+14 -14
View File
@@ -51,33 +51,33 @@
/** Cargo types available by default. */
static const CargoSpec _default_cargo[] = {
MK( 0, CT_PASSENGERS, 152, 1, 0x400, 3185, 0, 24, false, TAE_PASSENGERS, PASSENGERS, PASSENGER, STR_PASSENGERS, CC_PASSENGERS),
MK( 1, CT_COAL, 6, 16, 0x100, 5916, 7, 255, true, TAE_NONE, COAL, COAL, STR_TONS, CC_BULK),
MK( 1, CT_COAL, 6, 16, 0x100, 5916, 7, 255, true, TAE_NONE, COAL, COAL, STR_TONS, CC_BULK | CC_NON_POTABLE),
MK( 2, CT_MAIL, 15, 4, 0x200, 4550, 20, 90, false, TAE_MAIL, MAIL, MAIL, STR_BAGS, CC_MAIL),
/* Oil in temperate and arctic */
MK( 3, CT_OIL, 174, 16, 0x100, 4437, 25, 255, true, TAE_NONE, OIL, OIL, STR_LITERS, CC_LIQUID),
MK( 3, CT_OIL, 174, 16, 0x100, 4437, 25, 255, true, TAE_NONE, OIL, OIL, STR_LITERS, CC_LIQUID | CC_NON_POTABLE),
/* Oil in subtropic */
MK( 3, CT_OIL, 174, 16, 0x100, 4892, 25, 255, true, TAE_NONE, OIL, OIL, STR_LITERS, CC_LIQUID),
MK( 4, CT_LIVESTOCK, 208, 3, 0x100, 4322, 4, 18, true, TAE_NONE, LIVESTOCK, LIVESTOCK, STR_ITEMS, CC_PIECE_GOODS),
MK( 3, CT_OIL, 174, 16, 0x100, 4892, 25, 255, true, TAE_NONE, OIL, OIL, STR_LITERS, CC_LIQUID | CC_NON_POTABLE),
MK( 4, CT_LIVESTOCK, 208, 3, 0x100, 4322, 4, 18, true, TAE_NONE, LIVESTOCK, LIVESTOCK, STR_ITEMS, CC_PIECE_GOODS | CC_NON_POTABLE),
MK( 5, CT_GOODS, 194, 8, 0x200, 6144, 5, 28, true, TAE_GOODS, GOODS, GOODS, STR_CRATES, CC_EXPRESS),
MK( 6, CT_GRAIN, 191, 16, 0x100, 4778, 4, 40, true, TAE_NONE, GRAIN, GRAIN, STR_TONS, CC_BULK),
MK( 6, CT_WHEAT, 191, 16, 0x100, 4778, 4, 40, true, TAE_NONE, WHEAT, WHEAT, STR_TONS, CC_BULK),
MK( 6, CT_MAIZE, 191, 16, 0x100, 4322, 4, 40, true, TAE_NONE, MAIZE, MAIZE, STR_TONS, CC_BULK),
MK( 6, CT_GRAIN, 191, 16, 0x100, 4778, 4, 40, true, TAE_NONE, GRAIN, GRAIN, STR_TONS, CC_BULK | CC_POTABLE),
MK( 6, CT_WHEAT, 191, 16, 0x100, 4778, 4, 40, true, TAE_NONE, WHEAT, WHEAT, STR_TONS, CC_BULK | CC_POTABLE),
MK( 6, CT_MAIZE, 191, 16, 0x100, 4322, 4, 40, true, TAE_NONE, MAIZE, MAIZE, STR_TONS, CC_BULK | CC_POTABLE),
/* Wood in temperate and arctic */
MK( 7, CT_WOOD, 84, 16, 0x100, 5005, 15, 255, true, TAE_NONE, WOOD, WOOD, STR_TONS, CC_PIECE_GOODS),
/* Wood in subtropic */
MK( 7, CT_WOOD, 84, 16, 0x100, 7964, 15, 255, true, TAE_NONE, WOOD, WOOD, STR_TONS, CC_PIECE_GOODS),
MK( 8, CT_IRON_ORE, 184, 16, 0x100, 5120, 9, 255, true, TAE_NONE, IRON_ORE, IRON_ORE, STR_TONS, CC_BULK),
MK( 8, CT_IRON_ORE, 184, 16, 0x100, 5120, 9, 255, true, TAE_NONE, IRON_ORE, IRON_ORE, STR_TONS, CC_BULK | CC_NON_POTABLE),
MK( 9, CT_STEEL, 10, 16, 0x100, 5688, 7, 255, true, TAE_NONE, STEEL, STEEL, STR_TONS, CC_PIECE_GOODS),
MK( 10, CT_VALUABLES, 202, 2, 0x100, 7509, 1, 32, true, TAE_NONE, VALUABLES, VALUABLES, STR_BAGS, CC_ARMOURED),
MK( 10, CT_GOLD, 202, 8, 0x100, 5802, 10, 40, true, TAE_NONE, GOLD, GOLD, STR_BAGS, CC_ARMOURED),
MK( 10, CT_DIAMONDS, 202, 2, 0x100, 5802, 10, 255, true, TAE_NONE, DIAMONDS, DIAMOND, STR_BAGS, CC_ARMOURED),
MK( 11, CT_PAPER, 10, 16, 0x100, 5461, 7, 60, true, TAE_NONE, PAPER, PAPER, STR_TONS, CC_PIECE_GOODS),
MK( 12, CT_FOOD, 48, 16, 0x100, 5688, 0, 30, true, TAE_FOOD, FOOD, FOOD, STR_TONS, CC_EXPRESS | CC_REFRIGERATED),
MK( 13, CT_FRUIT, 208, 16, 0x100, 4209, 0, 15, true, TAE_NONE, FRUIT, FRUIT, STR_TONS, CC_BULK | CC_REFRIGERATED),
MK( 14, CT_COPPER_ORE, 184, 16, 0x100, 4892, 12, 255, true, TAE_NONE, COPPER_ORE, COPPER_ORE, STR_TONS, CC_BULK),
MK( 15, CT_WATER, 10, 16, 0x100, 4664, 20, 80, true, TAE_WATER, WATER, WATER, STR_LITERS, CC_LIQUID),
MK( 16, CT_RUBBER, 6, 16, 0x100, 4437, 2, 20, true, TAE_NONE, RUBBER, RUBBER, STR_LITERS, CC_LIQUID),
MK( 17, CT_SUGAR, 6, 16, 0x100, 4437, 20, 255, true, TAE_NONE, SUGAR, SUGAR, STR_TONS, CC_BULK),
MK( 12, CT_FOOD, 48, 16, 0x100, 5688, 0, 30, true, TAE_FOOD, FOOD, FOOD, STR_TONS, CC_EXPRESS | CC_REFRIGERATED | CC_POTABLE),
MK( 13, CT_FRUIT, 208, 16, 0x100, 4209, 0, 15, true, TAE_NONE, FRUIT, FRUIT, STR_TONS, CC_BULK | CC_REFRIGERATED | CC_POTABLE),
MK( 14, CT_COPPER_ORE, 184, 16, 0x100, 4892, 12, 255, true, TAE_NONE, COPPER_ORE, COPPER_ORE, STR_TONS, CC_BULK | CC_NON_POTABLE),
MK( 15, CT_WATER, 10, 16, 0x100, 4664, 20, 80, true, TAE_WATER, WATER, WATER, STR_LITERS, CC_LIQUID | CC_POTABLE),
MK( 16, CT_RUBBER, 6, 16, 0x100, 4437, 2, 20, true, TAE_NONE, RUBBER, RUBBER, STR_LITERS, CC_LIQUID | CC_NON_POTABLE),
MK( 17, CT_SUGAR, 6, 16, 0x100, 4437, 20, 255, true, TAE_NONE, SUGAR, SUGAR, STR_TONS, CC_BULK | CC_POTABLE),
MK( 18, CT_TOYS, 174, 2, 0x100, 5574, 25, 255, true, TAE_NONE, TOYS, TOY, STR_ITEMS, CC_PIECE_GOODS),
MK( 19, CT_BATTERIES, 208, 4, 0x100, 4322, 2, 30, true, TAE_NONE, BATTERIES, BATTERY, STR_ITEMS, CC_PIECE_GOODS),
MK( 20, CT_CANDY, 194, 5, 0x200, 6144, 8, 40, true, TAE_GOODS, SWEETS, SWEETS, STR_BAGS, CC_EXPRESS),
+4 -4
View File
@@ -18,28 +18,28 @@ static const SpriteID _landscape_clear_sprites_rough[8] = {
SPR_FLAT_ROUGH_LAND_2,
};
static const byte _fence_mod_by_tileh_sw[32] = {
static const uint8_t _fence_mod_by_tileh_sw[32] = {
0, 2, 4, 0, 0, 2, 4, 0,
0, 2, 4, 0, 0, 2, 4, 0,
0, 2, 4, 0, 0, 2, 4, 4,
0, 2, 4, 2, 0, 2, 4, 0,
};
static const byte _fence_mod_by_tileh_se[32] = {
static const uint8_t _fence_mod_by_tileh_se[32] = {
1, 1, 5, 5, 3, 3, 1, 1,
1, 1, 5, 5, 3, 3, 1, 1,
1, 1, 5, 5, 3, 3, 1, 5,
1, 1, 5, 5, 3, 3, 3, 1,
};
static const byte _fence_mod_by_tileh_ne[32] = {
static const uint8_t _fence_mod_by_tileh_ne[32] = {
0, 0, 0, 0, 4, 4, 4, 4,
2, 2, 2, 2, 0, 0, 0, 0,
0, 0, 0, 0, 4, 4, 4, 4,
2, 2, 2, 2, 0, 2, 4, 0,
};
static const byte _fence_mod_by_tileh_nw[32] = {
static const uint8_t _fence_mod_by_tileh_nw[32] = {
1, 5, 1, 5, 1, 5, 1, 5,
3, 1, 3, 1, 3, 1, 3, 1,
1, 5, 1, 5, 1, 5, 1, 5,
+5 -5
View File
@@ -40,7 +40,7 @@ enum TileSource {
static const uint NUM_TRACKS_AT_PCP = 6;
/** Which PPPs are possible at all on a given PCP */
static const byte AllowedPPPonPCP[DIAGDIR_END] = {
static const uint8_t AllowedPPPonPCP[DIAGDIR_END] = {
1 << DIR_N | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W | 1 << DIR_NW,
1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
1 << DIR_N | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W | 1 << DIR_NW,
@@ -52,7 +52,7 @@ static const byte AllowedPPPonPCP[DIAGDIR_END] = {
* the following system is used: if you rotate the PCP so that it is in the
* north, the eastern PPP belongs to the tile.
*/
static const byte OwnedPPPonPCP[DIAGDIR_END] = {
static const uint8_t OwnedPPPonPCP[DIAGDIR_END] = {
1 << DIR_SE | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
1 << DIR_N | 1 << DIR_SW | 1 << DIR_W | 1 << DIR_NW,
1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_NW,
@@ -76,7 +76,7 @@ static const DiagDirection PCPpositions[TRACK_END][2] = {
* which are not on either end of the track are fully preferred.
* @see PCPpositions
*/
static const byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
static const uint8_t PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
{ // X
1 << DIR_NE | 1 << DIR_SE | 1 << DIR_NW, // NE
PCP_NOT_ON_TRACK, // SE
@@ -119,7 +119,7 @@ static const byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
* so there are certain tiles which we ignore. A straight line is found if
* we have exactly two PPPs.
*/
static const byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
static const uint8_t IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
{ // Ignore group 1, X and Y tracks
{ // X even, Y even
IGNORE_NONE,
@@ -194,7 +194,7 @@ static const byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
#undef NO_IGNORE
/** Which pylons can definitely NOT be built */
static const byte DisallowedPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
static const uint8_t DisallowedPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
{1 << DIR_SW | 1 << DIR_NE, 0, 1 << DIR_SW | 1 << DIR_NE, 0 }, // X
{0, 1 << DIR_NW | 1 << DIR_SE, 0, 1 << DIR_NW | 1 << DIR_SE}, // Y
{1 << DIR_W | 1 << DIR_E, 0, 0, 1 << DIR_W | 1 << DIR_E }, // UPPER
+14 -14
View File
@@ -24,7 +24,7 @@
* @param f Bitmask of the climates
* @note the 5 between b and f is the load amount
*/
#define MT(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, INVALID_CARGO, e, 0, 8, 0, 0, 0, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
#define MT(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, INVALID_CARGO, e, 0, 8, 0, 0, 0, ExtraEngineFlags::None, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE }
/**
* Writes the properties of a multiple-unit train into the EngineInfo struct.
@@ -37,7 +37,7 @@
* @param f Bitmask of the climates
* @note the 5 between b and f is the load amount
*/
#define MM(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, INVALID_CARGO, e, 0, 8, 1 << EF_RAIL_IS_MU, 0, 0, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
#define MM(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, INVALID_CARGO, e, 0, 8, 1 << EF_RAIL_IS_MU, 0, 0, ExtraEngineFlags::None, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE }
/**
* Writes the properties of a train carriage into the EngineInfo struct.
@@ -50,7 +50,7 @@
* @see MT
* @note the 5 between b and f is the load amount
*/
#define MW(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, INVALID_CARGO, e, 0, 8, 0, 0, 0, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
#define MW(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, INVALID_CARGO, e, 0, 8, 0, 0, 0, ExtraEngineFlags::None, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE }
/**
* Writes the properties of a road vehicle into the EngineInfo struct.
@@ -63,7 +63,7 @@
* @param f Bitmask of the climates
* @note the 5 between b and f is the load amount
*/
#define MR(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, INVALID_CARGO, e, 0, 8, 0, 0, 0, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
#define MR(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, INVALID_CARGO, e, 0, 8, 0, 0, 0, ExtraEngineFlags::None, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE }
/**
* Writes the properties of a ship into the EngineInfo struct.
@@ -75,7 +75,7 @@
* @param f Bitmask of the climates
* @note the 10 between b and f is the load amount
*/
#define MS(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 10, f, INVALID_CARGO, e, 0, 8, 0, 0, 0, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
#define MS(a, b, c, d, e, f) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 10, f, INVALID_CARGO, e, 0, 8, 0, 0, 0, ExtraEngineFlags::None, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE }
/**
* Writes the properties of an aeroplane into the EngineInfo struct.
@@ -86,7 +86,7 @@
* @param e Bitmask of the climates
* @note the 20 between b and e is the load amount
*/
#define MA(a, b, c, d, e) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 20, e, INVALID_CARGO, CT_INVALID, 0, 8, 0, 0, 0, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
#define MA(a, b, c, d, e) { CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 20, e, INVALID_CARGO, CT_INVALID, 0, 8, 0, 0, 0, ExtraEngineFlags::None, STR_EMPTY, Ticks::CARGO_AGING_TICKS, INVALID_ENGINE }
/* Climates
* T = Temperate
@@ -97,7 +97,7 @@
#define A 2
#define S 4
#define Y 8
static const EngineInfo _orig_engine_info[] = {
static constexpr EngineInfo _orig_engine_info[] = {
/* base_intro base_life
* | decay_speed cargo_type
* | | lifelength | climates
@@ -386,7 +386,7 @@ static const EngineInfo _orig_engine_info[] = {
* Tractive effort coefficient by default is the same as TTDPatch, 0.30*256=76
* Air drag value depends on the top speed of the vehicle.
*/
#define RVI(a, b, c, d, e, f, g, h, i, j, k) { a, b, c, j, j, d, e, f, g, h, k, i, 0, 0, 0, VE_DEFAULT, 0, 76, 0, 0, 0 }
#define RVI(a, b, c, d, e, f, g, h, i, j, k) { a, b, c, j, j, 0, d, e, f, g, h, k, i, 0, 0, VE_DEFAULT, 0, 76, 0, 0, 0 }
#define M RAILVEH_MULTIHEAD
#define W RAILVEH_WAGON
#define G RAILVEH_SINGLEHEAD
@@ -408,7 +408,7 @@ static const EngineInfo _orig_engine_info[] = {
#define RC_E PR_RUNNING_TRAIN_ELECTRIC
#define RC_W INVALID_PRICE
static const RailVehicleInfo _orig_rail_vehicle_info[] = {
static constexpr RailVehicleInfo _orig_rail_vehicle_info[] = {
/* image_index max_speed running_cost engclass
* | type | power | running_cost_class
* | | cost_factor | weight | | capacity
@@ -564,8 +564,8 @@ static const RailVehicleInfo _orig_rail_vehicle_info[] = {
* @param g sound effect
* @param h refittable
*/
#define SVI(a, b, c, d, e, f, g, h) { a, b, c, d, e, f, g, h, VE_DEFAULT, 0, 0 }
static const ShipVehicleInfo _orig_ship_vehicle_info[] = {
#define SVI(a, b, c, d, e, f, g, h) { a, b, f, c, d, e, g, h, VE_DEFAULT, 0, 0 }
static constexpr ShipVehicleInfo _orig_ship_vehicle_info[] = {
/* image_index max_speed sfx refittable
* | cost_factor capacity | |
* | | acceleration running_cost |
@@ -597,11 +597,11 @@ static const ShipVehicleInfo _orig_ship_vehicle_info[] = {
* @param h mail_capacity (bags)
* @param i passenger_capacity (persons)
*/
#define AVI(a, b, c, d, e, f, g, h, i) { a, b, c, d, e, f, (g * 128) / 10, h, i, 0 }
#define AVI(a, b, c, d, e, f, g, h, i) { a, b, c, d, e, (g * 128) / 10, f, h, i, 0 }
#define H AIR_HELI
#define P AIR_CTOL
#define J AIR_CTOL | AIR_FAST
static const AircraftVehicleInfo _orig_aircraft_vehicle_info[] = {
static constexpr AircraftVehicleInfo _orig_aircraft_vehicle_info[] = {
/* image_index sfx acceleration
* | cost_factor | | max_speed
* | | running_cost | | mail_capacity
@@ -669,7 +669,7 @@ static const AircraftVehicleInfo _orig_aircraft_vehicle_info[] = {
* Air drag value depends on the top speed of the vehicle.
*/
#define ROV(a, b, c, d, e, f, g, h) { a, b, c, PR_RUNNING_ROADVEH, d, e, f, g, h, 76, 0, VE_DEFAULT, 0, ROADTYPE_ROAD }
static const RoadVehicleInfo _orig_road_vehicle_info[] = {
static constexpr RoadVehicleInfo _orig_road_vehicle_info[] = {
/* image_index sfx max_speed power
* | cost_factor | | capacity |
* | | running_cost | | weight
+7 -7
View File
@@ -17,9 +17,9 @@
*/
struct DrawIndustryAnimationStruct {
int x; ///< coordinate x of the first image offset
byte image_1; ///< image offset 1
byte image_2; ///< image offset 2
byte image_3; ///< image offset 3
uint8_t image_1; ///< image offset 1
uint8_t image_2; ///< image offset 2
uint8_t image_3; ///< image offset 3
};
/**
@@ -27,8 +27,8 @@ struct DrawIndustryAnimationStruct {
* industries animations
*/
struct DrawIndustryCoordinates {
byte x; ///< coordinate x of the pair
byte y; ///< coordinate y of the pair
uint8_t x; ///< coordinate x of the pair
uint8_t y; ///< coordinate y of the pair
};
/**
@@ -924,7 +924,7 @@ static const DrawIndustryAnimationStruct _industry_anim_offs_toys[] = {
#undef MD
/* this is ONLY used for Toffee Quarry*/
static const byte _industry_anim_offs_toffee[] = {
static const uint8_t _industry_anim_offs_toffee[] = {
255, 0, 0, 0, 2, 4, 6, 8, 10, 9,
7, 5, 3, 1, 255, 0, 0, 0, 2, 4,
6, 8, 10, 9, 7, 5, 3, 1, 255, 0,
@@ -935,7 +935,7 @@ static const byte _industry_anim_offs_toffee[] = {
};
/* this is ONLY used for the Bubble Generator*/
static const byte _industry_anim_offs_bubbles[] = {
static const uint8_t _industry_anim_offs_bubbles[] = {
68, 69, 71, 74, 77, 80, 83, 85, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 85, 84, 83, 82, 81, 80, 79, 78,
+124 -129
View File
@@ -7,137 +7,132 @@
/** @file landscape_sprite.h Offsets of sprites to replace for non-temperate landscapes. */
static const SpriteID END = 0xFFFF;
static const SpriteID _landscape_spriteindexes_arctic[] = {
0xF67, 0xF9F,
0xAAD, 0xAB0,
0x83A, 0x845,
0xFA0, 0xFC9,
0x43F, 0x45E,
0x566, 0x56D,
0x945, 0x94C,
0x3ED, 0x40C,
0x515, 0x51C,
0x55A, 0x561,
0x534, 0x546,
0x93D, 0x944,
0x955, 0x95C,
0xFDD, 0xFEC,
0x87D, 0x883,
0xA2B, 0xA39,
0x497, 0x4B0,
0x572, 0x575,
0x94D, 0x954,
0x818, 0x81D,
0x3DE, 0x3EB,
0x1212, 0x1212,
END
static constexpr std::pair<SpriteID, SpriteID> _landscape_spriteindexes_arctic[] = {
{ 0xF67, 0xF9F},
{ 0xAAD, 0xAB0},
{ 0x83A, 0x845},
{ 0xFA0, 0xFC9},
{ 0x43F, 0x45E},
{ 0x566, 0x56D},
{ 0x945, 0x94C},
{ 0x3ED, 0x40C},
{ 0x515, 0x51C},
{ 0x55A, 0x561},
{ 0x534, 0x546},
{ 0x93D, 0x944},
{ 0x955, 0x95C},
{ 0xFDD, 0xFEC},
{ 0x87D, 0x883},
{ 0xA2B, 0xA39},
{ 0x497, 0x4B0},
{ 0x572, 0x575},
{ 0x94D, 0x954},
{ 0x818, 0x81D},
{ 0x3DE, 0x3EB},
{0x1212, 0x1212},
};
static const SpriteID _landscape_spriteindexes_tropic[] = {
0xF67, 0xF9F,
0xAAD, 0xAB0,
0xFA0, 0xFC9,
0x43F, 0x45E,
0x566, 0x56D,
0x945, 0x94C,
0x3ED, 0x40C,
0x515, 0x51C,
0x55A, 0x561,
0x547, 0x559,
0x93D, 0x944,
0x955, 0x95C,
0xFDD, 0xFEC,
0x87D, 0x883,
0xA2B, 0xA39,
0x497, 0x4B0,
0x572, 0x575,
0x94D, 0x954,
0x5AE, 0x5AF,
0x118D, 0x11D8,
0x534, 0x546,
0x40D, 0x426,
0x45F, 0x478,
0x4B1, 0x4CA,
0x95D, 0x97C,
0x3DE, 0x3EB,
0x562, 0x565,
0x56E, 0x571,
0x57A, 0x57D,
0x83A, 0x845,
0xFF5, 0xFF5,
0xFF8, 0xFF8,
0x1212, 0x1212,
END
static constexpr std::pair<SpriteID, SpriteID> _landscape_spriteindexes_tropic[] = {
{ 0xF67, 0xF9F},
{ 0xAAD, 0xAB0},
{ 0xFA0, 0xFC9},
{ 0x43F, 0x45E},
{ 0x566, 0x56D},
{ 0x945, 0x94C},
{ 0x3ED, 0x40C},
{ 0x515, 0x51C},
{ 0x55A, 0x561},
{ 0x547, 0x559},
{ 0x93D, 0x944},
{ 0x955, 0x95C},
{ 0xFDD, 0xFEC},
{ 0x87D, 0x883},
{ 0xA2B, 0xA39},
{ 0x497, 0x4B0},
{ 0x572, 0x575},
{ 0x94D, 0x954},
{ 0x5AE, 0x5AF},
{0x118D, 0x11D8},
{ 0x534, 0x546},
{ 0x40D, 0x426},
{ 0x45F, 0x478},
{ 0x4B1, 0x4CA},
{ 0x95D, 0x97C},
{ 0x3DE, 0x3EB},
{ 0x562, 0x565},
{ 0x56E, 0x571},
{ 0x57A, 0x57D},
{ 0x83A, 0x845},
{ 0xFF5, 0xFF5},
{ 0xFF8, 0xFF8},
{0x1212, 0x1212},
};
static const SpriteID _landscape_spriteindexes_toyland[] = {
0xF54, 0xF9F,
0xFDD, 0xFE5,
0xFEC, 0xFEC,
0xFA0, 0xFC9,
0x818, 0x81D,
0x521, 0x546,
0x57E, 0x57F,
0x3ED, 0x40C,
0x43F, 0x45E,
0x491, 0x4B0,
0xA48, 0xA48,
0x4FB, 0x50A,
0x55A, 0x561,
0x566, 0x56D,
0x572, 0x579,
0x427, 0x42C,
0x479, 0x47E,
0x4CB, 0x4D0,
0x4EF, 0x4FA,
0xE9D, 0xECC,
0xF3D, 0xF40,
0xB59, 0xB60,
0xE5D, 0xE6C,
0xA49, 0xA59,
0xA63, 0xA68,
0xA5A, 0xA62,
0xA78, 0xA83,
0xA69, 0xA77,
0xA84, 0xAA3,
0xAA7, 0xAAC,
0xA2B, 0xA47,
0x3DE, 0x3EB,
0x47F, 0x488,
0x4D1, 0x4DA,
0x42D, 0x436,
0x515, 0x51C,
0x580, 0x585,
0xC14, 0xCB3,
0xAAD, 0xAB0,
0xAB5, 0xB00,
0xB69, 0xB70,
0xB61, 0xB68,
0xBC9, 0xBD0,
0xBD9, 0xBE0,
0xBA9, 0xBB0,
0xBC1, 0xBC4,
0x2D0, 0x2D0,
0xAA5, 0xAA6,
0x50F, 0x50F,
0x2EA, 0x2EA,
0x2ED, 0x2EE,
0x512, 0x513,
0x4EB, 0x4EE,
0x4E7, 0x4EA,
0x985, 0xA28,
0x10E4, 0x1133,
0x93D, 0x95C,
0x97D, 0x984,
0x7DA, 0x7DA,
0x2E6, 0x2E6,
0x1, 0x1,
0xE54, 0xE54,
0x51F, 0x520,
0x514, 0x514,
0x511, 0x511,
0x322, 0x322,
END
static constexpr std::pair<SpriteID, SpriteID> _landscape_spriteindexes_toyland[] = {
{ 0xF54, 0xF9F},
{ 0xFDD, 0xFE5},
{ 0xFEC, 0xFEC},
{ 0xFA0, 0xFC9},
{ 0x818, 0x81D},
{ 0x521, 0x546},
{ 0x57E, 0x57F},
{ 0x3ED, 0x40C},
{ 0x43F, 0x45E},
{ 0x491, 0x4B0},
{ 0xA48, 0xA48},
{ 0x4FB, 0x50A},
{ 0x55A, 0x561},
{ 0x566, 0x56D},
{ 0x572, 0x579},
{ 0x427, 0x42C},
{ 0x479, 0x47E},
{ 0x4CB, 0x4D0},
{ 0x4EF, 0x4FA},
{ 0xE9D, 0xECC},
{ 0xF3D, 0xF40},
{ 0xB59, 0xB60},
{ 0xE5D, 0xE6C},
{ 0xA49, 0xA59},
{ 0xA63, 0xA68},
{ 0xA5A, 0xA62},
{ 0xA78, 0xA83},
{ 0xA69, 0xA77},
{ 0xA84, 0xAA3},
{ 0xAA7, 0xAAC},
{ 0xA2B, 0xA47},
{ 0x3DE, 0x3EB},
{ 0x47F, 0x488},
{ 0x4D1, 0x4DA},
{ 0x42D, 0x436},
{ 0x515, 0x51C},
{ 0x580, 0x585},
{ 0xC14, 0xCB3},
{ 0xAAD, 0xAB0},
{ 0xAB5, 0xB00},
{ 0xB69, 0xB70},
{ 0xB61, 0xB68},
{ 0xBC9, 0xBD0},
{ 0xBD9, 0xBE0},
{ 0xBA9, 0xBB0},
{ 0xBC1, 0xBC4},
{ 0x2D0, 0x2D0},
{ 0xAA5, 0xAA6},
{ 0x50F, 0x50F},
{ 0x2EA, 0x2EA},
{ 0x2ED, 0x2EE},
{ 0x512, 0x513},
{ 0x4EB, 0x4EE},
{ 0x4E7, 0x4EA},
{ 0x985, 0xA28},
{0x10E4, 0x1133},
{ 0x93D, 0x95C},
{ 0x97D, 0x984},
{ 0x7DA, 0x7DA},
{ 0x2E6, 0x2E6},
{ 0x1, 0x1},
{ 0xE54, 0xE54},
{ 0x51F, 0x520},
{ 0x514, 0x514},
{ 0x511, 0x511},
{ 0x322, 0x322},
};
+76 -77
View File
@@ -78,7 +78,7 @@ class NIHVehicle : public NIHelper {
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
uint32_t GetGRFID(uint index) const override { return Vehicle::Get(index)->GetGRFID(); }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
Vehicle *v = Vehicle::Get(index);
VehicleResolverObject ro(v->engine_type, v, VehicleResolverObject::WO_CACHED);
@@ -99,8 +99,8 @@ static const NIFeature _nif_vehicle = {
#define NICS(cb_id, bit) NIC(cb_id, StationSpec, callback_mask, bit)
static const NICallback _nic_stations[] = {
NICS(CBID_STATION_AVAILABILITY, CBM_STATION_AVAIL),
NICS(CBID_STATION_SPRITE_LAYOUT, CBM_STATION_SPRITE_LAYOUT),
NICS(CBID_STATION_TILE_LAYOUT, CBM_NO_BIT),
NICS(CBID_STATION_DRAW_TILE_LAYOUT, CBM_STATION_DRAW_TILE_LAYOUT),
NICS(CBID_STATION_BUILD_TILE_LAYOUT,CBM_NO_BIT),
NICS(CBID_STATION_ANIM_START_STOP, CBM_NO_BIT),
NICS(CBID_STATION_ANIM_NEXT_FRAME, CBM_STATION_ANIMATION_NEXT_FRAME),
NICS(CBID_STATION_ANIMATION_SPEED, CBM_STATION_ANIMATION_SPEED),
@@ -141,9 +141,9 @@ class NIHStation : public NIHelper {
const void *GetInstance(uint ) const override { return nullptr; }
const void *GetSpec(uint index) const override { return GetStationSpec(index); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
StationResolverObject ro(GetStationSpec(index), Station::GetByTile(index), index);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -201,14 +201,14 @@ static const NIVariable _niv_house[] = {
};
class NIHHouse : public NIHelper {
bool IsInspectable(uint index) const override { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != nullptr; }
bool IsInspectable(uint index) const override { return HouseSpec::Get(GetHouseType(index))->grf_prop.HasGrfFile(); }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); }
const void *GetInstance(uint)const override { return nullptr; }
const void *GetSpec(uint index) const override { return HouseSpec::Get(GetHouseType(index)); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
HouseResolverObject ro(GetHouseType(index), index, Town::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -251,14 +251,14 @@ static const NIVariable _niv_industrytiles[] = {
};
class NIHIndustryTile : public NIHelper {
bool IsInspectable(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != nullptr; }
bool IsInspectable(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.HasGrfFile(); }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); }
const void *GetInstance(uint)const override { return nullptr; }
const void *GetSpec(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index)); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
IndustryTileResolverObject ro(GetIndustryGfx(index), index, Industry::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -274,43 +274,48 @@ static const NIFeature _nif_industrytile = {
/*** NewGRF industries ***/
#define NIP_PRODUCED_CARGO(prop, base, slot, type, name) { name, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->GetProduced(slot).cargo); }, sizeof(CargoID), prop, type }
#define NIP_ACCEPTED_CARGO(prop, base, slot, type, name) { name, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->GetAccepted(slot).cargo); }, sizeof(CargoID), prop, type }
static const NIProperty _nip_industries[] = {
NIP(0x25, Industry, produced[ 0].cargo, NIT_CARGO, "produced cargo 0"),
NIP(0x25, Industry, produced[ 1].cargo, NIT_CARGO, "produced cargo 1"),
NIP(0x25, Industry, produced[ 2].cargo, NIT_CARGO, "produced cargo 2"),
NIP(0x25, Industry, produced[ 3].cargo, NIT_CARGO, "produced cargo 3"),
NIP(0x25, Industry, produced[ 4].cargo, NIT_CARGO, "produced cargo 4"),
NIP(0x25, Industry, produced[ 5].cargo, NIT_CARGO, "produced cargo 5"),
NIP(0x25, Industry, produced[ 6].cargo, NIT_CARGO, "produced cargo 6"),
NIP(0x25, Industry, produced[ 7].cargo, NIT_CARGO, "produced cargo 7"),
NIP(0x25, Industry, produced[ 8].cargo, NIT_CARGO, "produced cargo 8"),
NIP(0x25, Industry, produced[ 9].cargo, NIT_CARGO, "produced cargo 9"),
NIP(0x25, Industry, produced[10].cargo, NIT_CARGO, "produced cargo 10"),
NIP(0x25, Industry, produced[11].cargo, NIT_CARGO, "produced cargo 11"),
NIP(0x25, Industry, produced[12].cargo, NIT_CARGO, "produced cargo 12"),
NIP(0x25, Industry, produced[13].cargo, NIT_CARGO, "produced cargo 13"),
NIP(0x25, Industry, produced[14].cargo, NIT_CARGO, "produced cargo 14"),
NIP(0x25, Industry, produced[15].cargo, NIT_CARGO, "produced cargo 15"),
NIP(0x26, Industry, accepted[ 0].cargo, NIT_CARGO, "accepted cargo 0"),
NIP(0x26, Industry, accepted[ 1].cargo, NIT_CARGO, "accepted cargo 1"),
NIP(0x26, Industry, accepted[ 2].cargo, NIT_CARGO, "accepted cargo 2"),
NIP(0x26, Industry, accepted[ 3].cargo, NIT_CARGO, "accepted cargo 3"),
NIP(0x26, Industry, accepted[ 4].cargo, NIT_CARGO, "accepted cargo 4"),
NIP(0x26, Industry, accepted[ 5].cargo, NIT_CARGO, "accepted cargo 5"),
NIP(0x26, Industry, accepted[ 6].cargo, NIT_CARGO, "accepted cargo 6"),
NIP(0x26, Industry, accepted[ 7].cargo, NIT_CARGO, "accepted cargo 7"),
NIP(0x26, Industry, accepted[ 8].cargo, NIT_CARGO, "accepted cargo 8"),
NIP(0x26, Industry, accepted[ 9].cargo, NIT_CARGO, "accepted cargo 9"),
NIP(0x26, Industry, accepted[10].cargo, NIT_CARGO, "accepted cargo 10"),
NIP(0x26, Industry, accepted[11].cargo, NIT_CARGO, "accepted cargo 11"),
NIP(0x26, Industry, accepted[12].cargo, NIT_CARGO, "accepted cargo 12"),
NIP(0x26, Industry, accepted[13].cargo, NIT_CARGO, "accepted cargo 13"),
NIP(0x26, Industry, accepted[14].cargo, NIT_CARGO, "accepted cargo 14"),
NIP(0x26, Industry, accepted[15].cargo, NIT_CARGO, "accepted cargo 15"),
NIP_PRODUCED_CARGO(0x25, Industry, 0, NIT_CARGO, "produced cargo 0"),
NIP_PRODUCED_CARGO(0x25, Industry, 1, NIT_CARGO, "produced cargo 1"),
NIP_PRODUCED_CARGO(0x25, Industry, 2, NIT_CARGO, "produced cargo 2"),
NIP_PRODUCED_CARGO(0x25, Industry, 3, NIT_CARGO, "produced cargo 3"),
NIP_PRODUCED_CARGO(0x25, Industry, 4, NIT_CARGO, "produced cargo 4"),
NIP_PRODUCED_CARGO(0x25, Industry, 5, NIT_CARGO, "produced cargo 5"),
NIP_PRODUCED_CARGO(0x25, Industry, 6, NIT_CARGO, "produced cargo 6"),
NIP_PRODUCED_CARGO(0x25, Industry, 7, NIT_CARGO, "produced cargo 7"),
NIP_PRODUCED_CARGO(0x25, Industry, 8, NIT_CARGO, "produced cargo 8"),
NIP_PRODUCED_CARGO(0x25, Industry, 9, NIT_CARGO, "produced cargo 9"),
NIP_PRODUCED_CARGO(0x25, Industry, 10, NIT_CARGO, "produced cargo 10"),
NIP_PRODUCED_CARGO(0x25, Industry, 11, NIT_CARGO, "produced cargo 11"),
NIP_PRODUCED_CARGO(0x25, Industry, 12, NIT_CARGO, "produced cargo 12"),
NIP_PRODUCED_CARGO(0x25, Industry, 13, NIT_CARGO, "produced cargo 13"),
NIP_PRODUCED_CARGO(0x25, Industry, 14, NIT_CARGO, "produced cargo 14"),
NIP_PRODUCED_CARGO(0x25, Industry, 15, NIT_CARGO, "produced cargo 15"),
NIP_ACCEPTED_CARGO(0x26, Industry, 0, NIT_CARGO, "accepted cargo 0"),
NIP_ACCEPTED_CARGO(0x26, Industry, 1, NIT_CARGO, "accepted cargo 1"),
NIP_ACCEPTED_CARGO(0x26, Industry, 2, NIT_CARGO, "accepted cargo 2"),
NIP_ACCEPTED_CARGO(0x26, Industry, 3, NIT_CARGO, "accepted cargo 3"),
NIP_ACCEPTED_CARGO(0x26, Industry, 4, NIT_CARGO, "accepted cargo 4"),
NIP_ACCEPTED_CARGO(0x26, Industry, 5, NIT_CARGO, "accepted cargo 5"),
NIP_ACCEPTED_CARGO(0x26, Industry, 6, NIT_CARGO, "accepted cargo 6"),
NIP_ACCEPTED_CARGO(0x26, Industry, 7, NIT_CARGO, "accepted cargo 7"),
NIP_ACCEPTED_CARGO(0x26, Industry, 8, NIT_CARGO, "accepted cargo 8"),
NIP_ACCEPTED_CARGO(0x26, Industry, 9, NIT_CARGO, "accepted cargo 9"),
NIP_ACCEPTED_CARGO(0x26, Industry, 10, NIT_CARGO, "accepted cargo 10"),
NIP_ACCEPTED_CARGO(0x26, Industry, 11, NIT_CARGO, "accepted cargo 11"),
NIP_ACCEPTED_CARGO(0x26, Industry, 12, NIT_CARGO, "accepted cargo 12"),
NIP_ACCEPTED_CARGO(0x26, Industry, 13, NIT_CARGO, "accepted cargo 13"),
NIP_ACCEPTED_CARGO(0x26, Industry, 14, NIT_CARGO, "accepted cargo 14"),
NIP_ACCEPTED_CARGO(0x26, Industry, 15, NIT_CARGO, "accepted cargo 15"),
NIP_END()
};
#undef NIP_PRODUCED_CARGO
#undef NIP_ACCEPTED_CARGO
#define NICI(cb_id, bit) NIC(cb_id, IndustrySpec, callback_mask, bit)
static const NICallback _nic_industries[] = {
NICI(CBID_INDUSTRY_PROBABILITY, CBM_IND_PROBABILITY),
@@ -359,27 +364,25 @@ static const NIVariable _niv_industries[] = {
};
class NIHIndustry : public NIHelper {
bool IsInspectable(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != nullptr; }
bool IsInspectable(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.HasGrfFile(); }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); }
const void *GetInstance(uint index)const override { return Industry::Get(index); }
const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); }
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
Industry *i = Industry::Get(index);
IndustriesResolverObject ro(i->location.tile, i, i->type);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
uint GetPSASize(uint, uint32_t) const override { return cpp_lengthof(PersistentStorage, storage); }
const int32_t *GetPSAFirstPosition(uint index, uint32_t) const override
const std::span<int32_t> GetPSA(uint index, uint32_t) const override
{
const Industry *i = (const Industry *)this->GetInstance(index);
if (i->psa == nullptr) return nullptr;
return (int32_t *)(&i->psa->storage);
if (i->psa == nullptr) return {};
return i->psa->storage;
}
};
@@ -424,14 +427,14 @@ static const NIVariable _niv_objects[] = {
};
class NIHObject : public NIHelper {
bool IsInspectable(uint index) const override { return ObjectSpec::GetByTile(index)->grf_prop.grffile != nullptr; }
bool IsInspectable(uint index) const override { return ObjectSpec::GetByTile(index)->grf_prop.HasGrfFile(); }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const override { return Object::GetByTile(index); }
const void *GetSpec(uint index) const override { return ObjectSpec::GetByTile(index); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
ObjectResolverObject ro(ObjectSpec::GetByTile(index), Object::GetByTile(index), index);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -465,7 +468,7 @@ class NIHRailType : public NIHelper {
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
uint32_t GetGRFID(uint) const override { return 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
/* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype.
* However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */
@@ -494,14 +497,14 @@ static const NICallback _nic_airporttiles[] = {
};
class NIHAirportTile : public NIHelper {
bool IsInspectable(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != nullptr; }
bool IsInspectable(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.HasGrfFile(); }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_AIRPORTS, GetStationIndex(index)); }
const void *GetInstance(uint)const override { return nullptr; }
const void *GetSpec(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index)); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
AirportTileResolverObject ro(AirportTileSpec::GetByTile(index), index, Station::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -535,27 +538,25 @@ static const NIVariable _niv_airports[] = {
};
class NIHAirport : public NIHelper {
bool IsInspectable(uint index) const override { return AirportSpec::Get(Station::Get(index)->airport.type)->grf_prop.grffile != nullptr; }
bool IsInspectable(uint index) const override { return AirportSpec::Get(Station::Get(index)->airport.type)->grf_prop.HasGrfFile(); }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::Get(index)->town->index); }
const void *GetInstance(uint index)const override { return Station::Get(index); }
const void *GetSpec(uint index) const override { return AirportSpec::Get(Station::Get(index)->airport.type); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, index, Station::Get(index)->airport.tile); }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? AirportSpec::Get(Station::Get(index)->airport.type)->grf_prop.grffile->grfid : 0; }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? AirportSpec::Get(Station::Get(index)->airport.type)->grf_prop.grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
Station *st = Station::Get(index);
AirportResolverObject ro(st->airport.tile, st, st->airport.type, st->airport.layout);
AirportResolverObject ro(st->airport.tile, st, AirportSpec::Get(st->airport.type), st->airport.layout);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
uint GetPSASize(uint, uint32_t) const override { return cpp_lengthof(PersistentStorage, storage); }
const int32_t *GetPSAFirstPosition(uint index, uint32_t) const override
const std::span<int32_t> GetPSA(uint index, uint32_t) const override
{
const Station *st = (const Station *)this->GetInstance(index);
if (st->airport.psa == nullptr) return nullptr;
return (int32_t *)(&st->airport.psa->storage);
if (st->airport.psa == nullptr) return {};
return st->airport.psa->storage;
}
};
@@ -590,23 +591,22 @@ class NIHTown : public NIHelper {
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
uint32_t GetGRFID(uint) const override { return 0; }
bool PSAWithParameter() const override { return true; }
uint GetPSASize(uint, uint32_t) const override { return cpp_lengthof(PersistentStorage, storage); }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
TownResolverObject ro(nullptr, Town::Get(index), true);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
const int32_t *GetPSAFirstPosition(uint index, uint32_t grfid) const override
const std::span<int32_t> GetPSA(uint index, uint32_t grfid) const override
{
Town *t = Town::Get(index);
for (const auto &it : t->psa_list) {
if (it->grfid == grfid) return &it->storage[0];
if (it->grfid == grfid) return it->storage;
}
return nullptr;
return {};
}
};
@@ -636,7 +636,7 @@ class NIHRoadType : public NIHelper {
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE, INVALID_STRING_ID, index); }
uint32_t GetGRFID(uint) const override { return 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
uint Resolve(uint index, uint var, uint param, bool &avail) const override
{
/* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype.
* However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */
@@ -700,12 +700,11 @@ class NIHRoadStop : public NIHelper {
const void *GetInstance(uint)const override { return nullptr; }
const void *GetSpec(uint index) const override { return GetRoadStopSpec(index); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetRoadStopSpec(index)->grf_prop.grffile->grfid : 0; }
uint32_t GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetRoadStopSpec(index)->grf_prop.grfid : 0; }
uint Resolve(uint index, uint var, uint32_t param, bool *avail) const override
uint Resolve(uint index, uint var, uint32_t param, bool &avail) const override
{
int view = GetRoadStopDir(index);
if (IsDriveThroughStopTile(index)) view += 4;
StationGfx view = GetStationGfx(index);
RoadStopResolverObject ro(GetRoadStopSpec(index), BaseStation::GetByTile(index), index, INVALID_ROADTYPE, GetStationType(index), view);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
+1 -1
View File
@@ -121,7 +121,7 @@ static const DrawTileSprites _object_hq[] = {
#undef TILE_SPRITE_LINE
#define M(name, size, build_cost_multiplier, clear_cost_multiplier, height, climate, gen_amount, flags) { GRFFilePropsBase<2>(), {0, 0, 0, 0}, INVALID_OBJECT_CLASS, name, climate, size, build_cost_multiplier, clear_cost_multiplier, 0, CalendarTime::MAX_DATE + 1, flags, 0, height, 1, gen_amount }
#define M(name, size, build_cost_multiplier, clear_cost_multiplier, height, climate, gen_amount, flags) {{INVALID_OBJECT_CLASS, 0}, GRFFilePropsBase<2>(), {0, 0, 0, 0}, name, climate, size, build_cost_multiplier, clear_cost_multiplier, 0, CalendarTime::MAX_DATE + 1, flags, 0, height, 1, gen_amount}
/* Climates
* T = Temperate
+2 -2
View File
@@ -8,7 +8,7 @@
/** @file palette_convert.h Translation tables from one GRF to another GRF. */
/** Converting from the Windows palette to the DOS palette */
extern const byte _palmap_w2d[] = {
extern const uint8_t _palmap_w2d[] = {
0, 1, 2, 3, 4, 5, 6, 7, // 0..7
8, 9, 10, 11, 12, 13, 14, 15, // 8..15
16, 17, 18, 19, 20, 21, 22, 23, // 16..23
@@ -44,7 +44,7 @@ extern const byte _palmap_w2d[] = {
};
/** Converting from the DOS palette to the Windows palette */
static const byte _palmap_d2w[] = {
static const uint8_t _palmap_d2w[] = {
0, 215, 216, 136, 88, 106, 32, 33, // 0..7
40, 245, 10, 11, 12, 13, 14, 15, // 8..15
16, 17, 18, 19, 20, 21, 22, 23, // 16..23
+1 -1
View File
@@ -1084,7 +1084,7 @@ static const RoadDriveEntry * const _road_road_drive_data[] = {
};
/** Table of road stop stop frames, when to stop at a road stop. */
extern const byte _road_stop_stop_frame[] = {
extern const uint8_t _road_stop_stop_frame[] = {
/* Duplicated left and right because of "entered stop" bit */
20, 20, 16, 16, 20, 20, 16, 16,
19, 19, 15, 15, 19, 19, 15, 15,
+24 -24
View File
@@ -58,11 +58,11 @@ static StringID SettingHelpWallclock(const IntSettingDesc &sd);
/* Macros for various objects to go in the configuration file.
* This section is for global variables */
#define SDTG_VAR(name, type, flags, var, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(Int, SLEG_GENERAL(name, SL_VAR, var, type, 1, from, to, extra), flags, startup, def, min, max, interval, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDTG_VAR(name, type, flags, var, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)\
NSD(Int, SLEG_GENERAL(name, SL_VAR, var, type, 1, from, to, extra), flags, startup, def, min, max, interval, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook)
#define SDTG_BOOL(name, flags, var, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(Bool, SLEG_GENERAL(name, SL_VAR, var, SLE_BOOL, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDTG_BOOL(name, flags, var, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)\
NSD(Bool, SLEG_GENERAL(name, SL_VAR, var, SLE_BOOL, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook)
#define SDTG_LIST(name, type, flags, var, def, length, from, to, cat, extra, startup)\
NSD(List, SLEG_GENERAL(name, SL_ARR, var, type, length, from, to, extra),flags, startup, def)
@@ -70,22 +70,22 @@ static StringID SettingHelpWallclock(const IntSettingDesc &sd);
#define SDTG_SSTR(name, type, flags, var, def, max_length, pre_check, post_callback, from, to, cat, extra, startup)\
NSD(String, SLEG_GENERAL(name, SL_STDSTR, var, type, sizeof(var), from, to, extra), flags, startup, def, max_length, pre_check, post_callback)
#define SDTG_OMANY(name, type, flags, var, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(OneOfMany, SLEG_GENERAL(name, SL_VAR, var, type, 1, from, to, extra), flags, startup, def, max, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, full, nullptr)
#define SDTG_OMANY(name, type, flags, var, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)\
NSD(OneOfMany, SLEG_GENERAL(name, SL_VAR, var, type, 1, from, to, extra), flags, startup, def, max, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, full, nullptr)
#define SDTG_MMANY(name, type, flags, var, def, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(ManyOfMany, SLEG_GENERAL(name, SL_VAR, var, type, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, full, nullptr)
#define SDTG_MMANY(name, type, flags, var, def, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)\
NSD(ManyOfMany, SLEG_GENERAL(name, SL_VAR, var, type, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, full, nullptr)
/* Macros for various objects to go in the configuration file.
* This section is for structures where their various members are saved */
#define SDT_VAR(base, var, type, flags, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(Int, SLE_GENERAL(SL_VAR, base, var, type, 1, from, to, extra), flags, startup, def, min, max, interval, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDT_VAR(base, var, type, flags, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)\
NSD(Int, SLE_GENERAL(SL_VAR, base, var, type, 1, from, to, extra), flags, startup, def, min, max, interval, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook)
#define SDT_VAR_NAME(base, var, type, flags, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup, name)\
NSD(Int, SLE_GENERAL_NAME(SL_VAR, name, base, var, type, 1, from, to, extra), flags, startup, def, min, max, interval, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDT_VAR_NAME(base, var, type, flags, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup, name)\
NSD(Int, SLE_GENERAL_NAME(SL_VAR, name, base, var, type, 1, from, to, extra), flags, startup, def, min, max, interval, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook)
#define SDT_BOOL(base, var, flags, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
NSD(Bool, SLE_GENERAL(SL_VAR, base, var, SLE_BOOL, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook)
#define SDT_BOOL(base, var, flags, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)\
NSD(Bool, SLE_GENERAL(SL_VAR, base, var, SLE_BOOL, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook)
#define SDT_LIST(base, var, type, flags, def, from, to, cat, extra, startup)\
NSD(List, SLE_GENERAL(SL_ARR, base, var, type, lengthof(((base*)8)->var), from, to, extra), flags, startup, def)
@@ -93,18 +93,18 @@ static StringID SettingHelpWallclock(const IntSettingDesc &sd);
#define SDT_SSTR(base, var, type, flags, def, pre_check, post_callback, from, to, cat, extra, startup)\
NSD(String, SLE_GENERAL(SL_STDSTR, base, var, type, sizeof(((base*)8)->var), from, to, extra), flags, startup, def, 0, pre_check, post_callback)
#define SDT_OMANY(base, var, type, flags, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, load, cat, extra, startup)\
NSD(OneOfMany, SLE_GENERAL(SL_VAR, base, var, type, 1, from, to, extra), flags, startup, def, max, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, full, load)
#define SDT_OMANY(base, var, type, flags, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, load, cat, extra, startup)\
NSD(OneOfMany, SLE_GENERAL(SL_VAR, base, var, type, 1, from, to, extra), flags, startup, def, max, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, full, load)
#define SDT_MMANY(base, var, type, flags, def, full, str, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, strhelp, strval, from, to, cat, extra, startup)\
NSD(ManyOfMany, SLE_GENERAL(SL_VAR, base, var, type, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, full, nullptr)
#define SDT_MMANY(base, var, type, flags, def, full, str, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, strhelp, strval, from, to, cat, extra, startup)\
NSD(ManyOfMany, SLE_GENERAL(SL_VAR, base, var, type, 1, from, to, extra), flags, startup, def, str, strhelp, strval, cat, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, full, nullptr)
#define SDTC_VAR(var, type, flags, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
SDTG_VAR(#var, type, flags, _settings_client.var, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)
#define SDTC_VAR(var, type, flags, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)\
SDTG_VAR(#var, type, flags, _settings_client.var, def, min, max, interval, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)
#define SDTC_BOOL(var, flags, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
SDTG_BOOL(#var, flags, _settings_client.var, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)
#define SDTC_BOOL(var, flags, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)\
SDTG_BOOL(#var, flags, _settings_client.var, def, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)
#define SDTC_LIST(var, type, flags, def, from, to, cat, extra, startup)\
SDTG_LIST(#var, type, flags, _settings_client.var, def, lengthof(_settings_client.var), from, to, cat, extra, startup)
@@ -112,5 +112,5 @@ static StringID SettingHelpWallclock(const IntSettingDesc &sd);
#define SDTC_SSTR(var, type, flags, def, max_length, pre_check, post_callback, from, to, cat, extra, startup)\
SDTG_SSTR(#var, type, flags, _settings_client.var, def, max_length, pre_check, post_callback, from, to, cat, extra, startup)\
#define SDTC_OMANY(var, type, flags, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)\
SDTG_OMANY(#var, type, flags, _settings_client.var, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, from, to, cat, extra, startup)
#define SDTC_OMANY(var, type, flags, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)\
SDTG_OMANY(#var, type, flags, _settings_client.var, def, max, full, str, strhelp, strval, pre_check, post_callback, get_title_hook, get_help_hook, set_value_dparams_hook, get_def_hook, from, to, cat, extra, startup)
+3 -3
View File
@@ -3,8 +3,7 @@ static const SettingVariant _citymania_settings_table[] = {
[post-amble]
};
[templates]
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
@@ -19,8 +18,9 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SLV_TABLE_CHUNKS
from = SL_MIN_VERSION
to = SL_MAX_VERSION
cat = SC_ADVANCED
extra = 0
+4 -3
View File
@@ -11,9 +11,9 @@ static const SettingVariant _cmclient_settings_table[] = {
[post-amble]
};
[templates]
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTC_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -30,6 +30,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+17 -6
View File
@@ -12,13 +12,15 @@ static void UpdateAllServiceInterval(int32_t new_value);
static bool CanUpdateServiceInterval(VehicleType type, int32_t &new_value);
static void UpdateServiceInterval(VehicleType type, int32_t new_value);
static void SettingsValueAbsolute(const IntSettingDesc &sd, uint first_param, int32_t value);
static void ServiceIntervalSettingsValueText(const IntSettingDesc &sd, uint first_param, int32_t value);
static int32_t GetDefaultServiceInterval(VehicleType type);
static const SettingVariant _company_settings_table[] = {
[post-amble]
};
[templates]
SDT_BOOL = SDT_BOOL(CompanySettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(CompanySettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(CompanySettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(CompanySettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for CompanySettings.$var exceeds storage size");
@@ -34,6 +36,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
@@ -94,9 +97,11 @@ max = MAX_SERVINT_DAYS
interval = 1
str = STR_CONFIG_SETTING_SERVINT_TRAINS
strhelp = STR_CONFIG_SETTING_SERVINT_TRAINS_HELPTEXT
strval = STR_CONFIG_SETTING_SERVINT_VALUE
strval = STR_CONFIG_SETTING_SERVINT_VALUE_DAYS
pre_cb = [](auto &new_value) { return CanUpdateServiceInterval(VEH_TRAIN, new_value); }
post_cb = [](auto new_value) { UpdateServiceInterval(VEH_TRAIN, new_value); }
def_cb = []() { return GetDefaultServiceInterval(VEH_TRAIN); }
val_cb = ServiceIntervalSettingsValueText
[SDT_VAR]
var = vehicle.servint_roadveh
@@ -108,9 +113,11 @@ max = MAX_SERVINT_DAYS
interval = 1
str = STR_CONFIG_SETTING_SERVINT_ROAD_VEHICLES
strhelp = STR_CONFIG_SETTING_SERVINT_ROAD_VEHICLES_HELPTEXT
strval = STR_CONFIG_SETTING_SERVINT_VALUE
strval = STR_CONFIG_SETTING_SERVINT_VALUE_DAYS
pre_cb = [](auto &new_value) { return CanUpdateServiceInterval(VEH_ROAD, new_value); }
post_cb = [](auto new_value) { UpdateServiceInterval(VEH_ROAD, new_value); }
def_cb = []() { return GetDefaultServiceInterval(VEH_ROAD); }
val_cb = ServiceIntervalSettingsValueText
[SDT_VAR]
var = vehicle.servint_ships
@@ -122,9 +129,11 @@ max = MAX_SERVINT_DAYS
interval = 1
str = STR_CONFIG_SETTING_SERVINT_SHIPS
strhelp = STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT
strval = STR_CONFIG_SETTING_SERVINT_VALUE
strval = STR_CONFIG_SETTING_SERVINT_VALUE_DAYS
pre_cb = [](auto &new_value) { return CanUpdateServiceInterval(VEH_SHIP, new_value); }
post_cb = [](auto new_value) { UpdateServiceInterval(VEH_SHIP, new_value); }
def_cb = []() { return GetDefaultServiceInterval(VEH_SHIP); }
val_cb = ServiceIntervalSettingsValueText
[SDT_VAR]
var = vehicle.servint_aircraft
@@ -136,6 +145,8 @@ max = MAX_SERVINT_DAYS
interval = 1
str = STR_CONFIG_SETTING_SERVINT_AIRCRAFT
strhelp = STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT
strval = STR_CONFIG_SETTING_SERVINT_VALUE
strval = STR_CONFIG_SETTING_SERVINT_VALUE_DAYS
pre_cb = [](auto &new_value) { return CanUpdateServiceInterval(VEH_AIRCRAFT, new_value); }
post_cb = [](auto new_value) { UpdateServiceInterval(VEH_AIRCRAFT, new_value); }
def_cb = []() { return GetDefaultServiceInterval(VEH_AIRCRAFT); }
val_cb = ServiceIntervalSettingsValueText
+2 -1
View File
@@ -11,7 +11,7 @@ static const SettingVariant _currency_settings_table[] = {
[post-amble]
};
[templates]
SDT_VAR = SDT_VAR (CurrencySpec, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR (CurrencySpec, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_SSTR = SDT_SSTR(CurrencySpec, $var, $type, $flags, $def, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
[validation]
@@ -28,6 +28,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+4 -3
View File
@@ -20,9 +20,9 @@ static const SettingVariant _difficulty_settings_table[] = {
[post-amble]
};
[templates]
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR (GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -39,6 +39,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+3 -2
View File
@@ -16,8 +16,8 @@ static const SettingVariant _economy_settings_table[] = {
[post-amble]
};
[templates]
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR (GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
@@ -33,6 +33,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+7 -12
View File
@@ -26,12 +26,12 @@ static const SettingVariant _game_settings_table[] = {
[post-amble]
};
[templates]
SDTG_BOOL = SDTG_BOOL($name, $flags, $var, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_BOOL = SDTG_BOOL($name, $flags, $var, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $load, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -49,6 +49,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
@@ -130,12 +131,6 @@ str = STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES
strhelp = STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT
post_cb = StationCatchmentChanged
[SDT_BOOL]
var = station.adjacent_stations
from = SLV_62
def = true
cat = SC_EXPERT
[SDT_BOOL]
var = station.distant_join_stations
from = SLV_106
+26 -18
View File
@@ -25,9 +25,9 @@ static const SettingVariant _gui_settings_table[] = {
[post-amble]
};
[templates]
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -44,6 +44,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
@@ -104,9 +105,9 @@ ifdef = UNIX
var = gui.scroll_mode
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
def = 2
min = 0
max = 3
def = VSM_MAP_RMB
min = VSM_VIEWPORT_RMB_FIXED
max = VSM_MAP_LMB
str = STR_CONFIG_SETTING_SCROLLMODE
strhelp = STR_CONFIG_SETTING_SCROLLMODE_HELPTEXT
strval = STR_CONFIG_SETTING_SCROLLMODE_DEFAULT
@@ -117,9 +118,9 @@ ifndef = UNIX
var = gui.scroll_mode
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
def = 0
min = 0
max = 3
def = VSM_VIEWPORT_RMB_FIXED
min = VSM_VIEWPORT_RMB_FIXED
max = VSM_MAP_LMB
str = STR_CONFIG_SETTING_SCROLLMODE
strhelp = STR_CONFIG_SETTING_SCROLLMODE_HELPTEXT
strval = STR_CONFIG_SETTING_SCROLLMODE_DEFAULT
@@ -260,7 +261,7 @@ type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
def = ZOOM_LVL_MIN
min = ZOOM_LVL_MIN
max = ZOOM_LVL_OUT_4X
max = ZOOM_LVL_NORMAL
str = STR_CONFIG_SETTING_ZOOM_MIN
strhelp = STR_CONFIG_SETTING_ZOOM_MIN_HELPTEXT
strval = STR_CONFIG_SETTING_ZOOM_LVL_MIN
@@ -272,7 +273,7 @@ var = gui.zoom_max
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
def = ZOOM_LVL_MAX
min = ZOOM_LVL_OUT_8X
min = ZOOM_LVL_OUT_2X
max = ZOOM_LVL_MAX
str = STR_CONFIG_SETTING_ZOOM_MAX
strhelp = STR_CONFIG_SETTING_ZOOM_MAX_HELPTEXT
@@ -286,7 +287,7 @@ type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
def = ZOOM_LVL_MIN
min = ZOOM_LVL_MIN
max = ZOOM_LVL_OUT_4X
max = ZOOM_LVL_NORMAL
str = STR_CONFIG_SETTING_SPRITE_ZOOM_MIN
strhelp = STR_CONFIG_SETTING_SPRITE_ZOOM_MIN_HELPTEXT
strval = STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN
@@ -336,9 +337,9 @@ cat = SC_BASIC
var = gui.liveries
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
def = 2
min = 0
max = 2
def = LIT_ALL
min = LIT_NONE
max = LIT_ALL
str = STR_CONFIG_SETTING_LIVERIES
strhelp = STR_CONFIG_SETTING_LIVERIES_HELPTEXT
strval = STR_CONFIG_SETTING_LIVERIES_NONE
@@ -386,9 +387,9 @@ cat = SC_BASIC
var = gui.scrollwheel_scrolling
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
def = 0
min = 0
max = 2
def = SWS_ZOOM_MAP
min = SWS_ZOOM_MAP
max = SWS_OFF
str = STR_CONFIG_SETTING_SCROLLWHEEL_SCROLLING
strhelp = STR_CONFIG_SETTING_SCROLLWHEEL_SCROLLING_HELPTEXT
strval = STR_CONFIG_SETTING_SCROLLWHEEL_ZOOM
@@ -590,6 +591,13 @@ def = true
str = STR_CONFIG_SETTING_WARN_LOST_VEHICLE
strhelp = STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT
[SDTC_BOOL]
var = gui.old_vehicle_warn
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
def = true
str = STR_CONFIG_SETTING_WARN_OLD_VEHICLE
strhelp = STR_CONFIG_SETTING_WARN_OLD_VEHICLE_HELPTEXT
[SDTC_BOOL]
var = gui.new_nonstop
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
+2 -1
View File
@@ -12,7 +12,7 @@ static const SettingVariant _linkgraph_settings_table[] = {
[post-amble]
};
[templates]
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
@@ -28,6 +28,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+4 -3
View File
@@ -12,7 +12,7 @@ static void SettingsValueVelocityUnit(const IntSettingDesc &sd, uint first_param
uint8_t _old_units; ///< Old units from old savegames
static constexpr std::initializer_list<const char*> _locale_currencies{"GBP", "USD", "EUR", "JPY", "ATS", "BEF", "CHF", "CZK", "DEM", "DKK", "ESP", "FIM", "FRF", "GRD", "HUF", "ISK", "ITL", "NLG", "NOK", "PLN", "RON", "RUR", "SIT", "SEK", "TRY", "SKK", "BRL", "EEK", "LTL", "KRW", "ZAR", "custom", "GEL", "IRR", "RUB", "MXN", "NTD", "CNY", "HKD", "INR", "IDR", "MYR", "LVL"};
static constexpr std::initializer_list<const char*> _locale_currencies{"GBP", "USD", "EUR", "JPY", "ATS", "BEF", "CHF", "CZK", "DEM", "DKK", "ESP", "FIM", "FRF", "GRD", "HUF", "ISK", "ITL", "NLG", "NOK", "PLN", "RON", "RUR", "SIT", "SEK", "TRY", "SKK", "BRL", "EEK", "LTL", "KRW", "ZAR", "custom", "GEL", "IRR", "RUB", "MXN", "NTD", "CNY", "HKD", "INR", "IDR", "MYR", "LVL", "PTE"};
static constexpr std::initializer_list<const char*> _locale_units{"imperial", "metric", "si", "gameunits", "knots"};
static_assert(_locale_currencies.size() == CURRENCY_END);
@@ -21,8 +21,8 @@ static const SettingVariant _locale_settings_table[] = {
[post-amble]
};
[templates]
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $load, $cat, $extra, $startup),
SDT_SSTR = SDT_SSTR(GameSettings, $var, $type, $flags, $def, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
[validation]
@@ -40,6 +40,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+6 -29
View File
@@ -25,11 +25,11 @@ static const SettingVariant _misc_settings_table[] = {
};
[templates]
SDTG_LIST = SDTG_LIST($name, $type, $flags, $var, $def, $length, $from, $to, $cat, $extra, $startup),
SDTG_MMANY = SDTG_MMANY($name, $type, $flags, $var, $def, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_MMANY = SDTG_MMANY($name, $type, $flags, $var, $def, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTG_SSTR = SDTG_SSTR($name, $type, $flags, $var, $def, 0, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
SDTG_BOOL = SDTG_BOOL($name, $flags, $var, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_BOOL = SDTG_BOOL($name, $flags, $var, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -46,6 +46,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
@@ -148,7 +149,7 @@ cat = SC_BASIC
; workaround for implicit lengthof() in SDTG_LIST
[SDTG_LIST]
name = ""resolution""
type = SLE_INT
type = SLE_UINT
length = 2
var = _cur_resolution
def = ""0,0""
@@ -237,30 +238,6 @@ def = 0
min = 0
max = 72
[SDTG_BOOL]
ifdef = HAS_TRUETYPE_FONT
name = ""small_aa""
var = _fcsettings.small.aa
def = false
[SDTG_BOOL]
ifdef = HAS_TRUETYPE_FONT
name = ""medium_aa""
var = _fcsettings.medium.aa
def = false
[SDTG_BOOL]
ifdef = HAS_TRUETYPE_FONT
name = ""large_aa""
var = _fcsettings.large.aa
def = false
[SDTG_BOOL]
ifdef = HAS_TRUETYPE_FONT
name = ""mono_aa""
var = _fcsettings.mono.aa
def = false
[SDTG_BOOL]
ifdef = HAS_TRUETYPE_FONT
name = ""global_aa""
+3 -2
View File
@@ -12,9 +12,9 @@ static const SettingVariant _multimedia_settings_table[] = {
[post-amble]
};
[templates]
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_LIST = SDTC_LIST( $var, $type, $flags, $def, $from, $to, $cat, $extra, $startup),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTC_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -30,6 +30,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
@@ -14,8 +14,8 @@ static const SettingVariant _network_private_settings_table[] = {
[post-amble]
};
[templates]
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_SSTR = SDTC_SSTR( $var, $type, $flags, $def, $length, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
[validation]
@@ -32,6 +32,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
@@ -62,18 +62,22 @@ def = nullptr
cat = SC_BASIC
[SDTC_SSTR]
var = network.default_company_pass
var = network.client_secret_key
type = SLE_STR
length = NETWORK_PASSWORD_LENGTH
length = NETWORK_SECRET_KEY_LENGTH
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
def = nullptr
; Prevent the user from setting the secret key from the console using 'setting'
pre_cb = [](auto) { return false; }
[SDTC_SSTR]
var = network.network_id
var = network.client_public_key
type = SLE_STR
length = NETWORK_SERVER_ID_LENGTH
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY
length = NETWORK_SECRET_KEY_LENGTH
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
def = nullptr
; Prevent the user from setting the public key from the console using 'setting'
pre_cb = [](auto) { return false; }
[SDTC_SSTR]
var = network.server_invite_code
+10 -11
View File
@@ -16,9 +16,9 @@ static const SettingVariant _network_settings_table[] = {
[post-amble]
};
[templates]
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -35,6 +35,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
@@ -176,6 +177,12 @@ flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY
def = true
cat = SC_EXPERT
[SDTC_BOOL]
var = network.allow_insecure_admin_login
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY
def = false
cat = SC_EXPERT
[SDTC_OMANY]
var = network.server_game_type
type = SLE_UINT8
@@ -192,14 +199,6 @@ var = network.autoclean_companies
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY
def = false
[SDTC_VAR]
var = network.autoclean_unprotected
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_0_IS_SPECIAL | SF_NETWORK_ONLY
def = 12
min = 0
max = 240
[SDTC_VAR]
var = network.autoclean_protected
type = SLE_UINT8
+2 -1
View File
@@ -13,7 +13,7 @@ static const SettingVariant _news_display_settings_table[] = {
[post-amble]
};
[templates]
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -29,6 +29,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+7 -6
View File
@@ -31,12 +31,12 @@ static const SettingVariant _old_gameopt_settings_table[] = {
};
[templates]
SDTG_LIST = SDTG_LIST($name, $type, $flags, $var, $def, $length, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_NULL = SDT_NULL( $length, $from, $to),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_NULL = SDT_NULL( $length, $from, $to),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $load, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -56,6 +56,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+3 -224
View File
@@ -8,14 +8,12 @@
; and in the savegame PATS chunk.
[pre-amble]
static void InvalidateShipPathCache(int32_t new_value);
static const SettingVariant _pathfinding_settings_table[] = {
[post-amble]
};
[templates]
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
@@ -31,6 +29,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
@@ -51,76 +50,6 @@ var = pf.roadveh_queue
def = true
cat = SC_EXPERT
[SDT_BOOL]
var = pf.new_pathfinding_all
to = SLV_87
def = false
cat = SC_EXPERT
[SDT_BOOL]
var = pf.yapf.ship_use_yapf
from = SLV_28
to = SLV_87
def = false
cat = SC_EXPERT
[SDT_BOOL]
var = pf.yapf.road_use_yapf
from = SLV_28
to = SLV_87
def = true
cat = SC_EXPERT
[SDT_BOOL]
var = pf.yapf.rail_use_yapf
from = SLV_28
to = SLV_87
def = true
cat = SC_EXPERT
[SDT_VAR]
var = pf.pathfinder_for_trains
type = SLE_UINT8
from = SLV_87
flags = SF_GUI_DROPDOWN
def = 2
min = 1
max = 2
interval = 1
str = STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS
strhelp = STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT
strval = STR_CONFIG_SETTING_PATHFINDER_NPF
cat = SC_EXPERT
[SDT_VAR]
var = pf.pathfinder_for_roadvehs
type = SLE_UINT8
from = SLV_87
flags = SF_GUI_DROPDOWN
def = 2
min = 1
max = 2
interval = 1
str = STR_CONFIG_SETTING_PATHFINDER_FOR_ROAD_VEHICLES
strhelp = STR_CONFIG_SETTING_PATHFINDER_FOR_ROAD_VEHICLES_HELPTEXT
strval = STR_CONFIG_SETTING_PATHFINDER_NPF
cat = SC_EXPERT
[SDT_VAR]
var = pf.pathfinder_for_ships
type = SLE_UINT8
from = SLV_87
flags = SF_GUI_DROPDOWN
def = 2
min = 1
max = 2
interval = 1
str = STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS
strhelp = STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS_HELPTEXT
strval = STR_CONFIG_SETTING_PATHFINDER_NPF
post_cb = InvalidateShipPathCache
cat = SC_EXPERT
[SDT_BOOL]
var = pf.reverse_at_signals
from = SLV_159
@@ -168,156 +97,6 @@ min = 1
max = 255
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_max_search_nodes
type = SLE_UINT
def = AYSTAR_DEF_MAX_SEARCH_NODES
min = 500
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_rail_firstred_penalty
type = SLE_UINT
def = 10 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_rail_firstred_exit_penalty
type = SLE_UINT
def = 100 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_rail_lastred_penalty
type = SLE_UINT
def = 10 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_rail_station_penalty
type = SLE_UINT
def = 1 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_rail_slope_penalty
type = SLE_UINT
def = 1 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_rail_curve_penalty
type = SLE_UINT
def = 1 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_rail_depot_reverse_penalty
type = SLE_UINT
def = 50 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_rail_pbs_cross_penalty
type = SLE_UINT
from = SLV_100
def = 3 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_rail_pbs_signal_back_penalty
type = SLE_UINT
from = SLV_100
def = 15 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_buoy_penalty
type = SLE_UINT
def = 2 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_water_curve_penalty
type = SLE_UINT
def = 1 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_road_curve_penalty
type = SLE_UINT
def = 1 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_crossing_penalty
type = SLE_UINT
def = 3 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_road_drive_through_penalty
type = SLE_UINT
from = SLV_47
def = 8 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_road_dt_occupied_penalty
type = SLE_UINT
from = SLV_130
def = 8 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.npf_road_bay_occupied_penalty
type = SLE_UINT
from = SLV_130
def = 15 * NPF_TILE_LENGTH
min = 0
max = 100000
cat = SC_EXPERT
[SDT_VAR]
var = pf.npf.maximum_go_to_depot_penalty
type = SLE_UINT
from = SLV_131
def = 20 * NPF_TILE_LENGTH
min = 0
max = 1000000
cat = SC_EXPERT
[SDT_BOOL]
var = pf.yapf.disable_node_optimization
from = SLV_28
+4 -3
View File
@@ -13,9 +13,9 @@ static const SettingVariant _script_settings_table[] = {
[post-amble]
};
[templates]
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $load, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_OMANY = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
@@ -32,6 +32,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+3 -2
View File
@@ -17,8 +17,8 @@ static const SettingVariant _win32_settings_table[] = {
};
#endif /* _WIN32 */
[templates]
SDTG_BOOL = SDTG_BOOL($name, $flags, $var, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDTG_BOOL = SDTG_BOOL($name, $flags, $var, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -34,6 +34,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+3 -2
View File
@@ -13,8 +13,8 @@ static const SettingVariant _window_settings_table[] = {
[post-amble]
};
[templates]
SDT_BOOL = SDT_BOOL(WindowDesc, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(WindowDesc, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(WindowDesc, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(WindowDesc, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for WindowDesc.$var exceeds storage size");
@@ -30,6 +30,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+4 -3
View File
@@ -18,9 +18,9 @@ static const SettingVariant _world_settings_table[] = {
[post-amble]
};
[templates]
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $load, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_OMANY = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
@@ -37,6 +37,7 @@ post_cb = nullptr
str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
+27 -24
View File
@@ -307,8 +307,16 @@ static const uint16_t EMPTY_BOUNDING_BOX_SPRITE_COUNT = 1;
static const SpriteID SPR_PALETTE_BASE = SPR_EMPTY_BOUNDING_BOX + EMPTY_BOUNDING_BOX_SPRITE_COUNT;
static const uint16_t PALETTE_SPRITE_COUNT = 1;
/** Road waypoint sprites. */
static const SpriteID SPR_ROAD_WAYPOINTS_BASE = SPR_PALETTE_BASE + PALETTE_SPRITE_COUNT;
static const SpriteID SPR_ROAD_WAYPOINT_Y_W = SPR_ROAD_WAYPOINTS_BASE;
static const SpriteID SPR_ROAD_WAYPOINT_Y_E = SPR_ROAD_WAYPOINTS_BASE + 1;
static const SpriteID SPR_ROAD_WAYPOINT_X_W = SPR_ROAD_WAYPOINTS_BASE + 2;
static const SpriteID SPR_ROAD_WAYPOINT_X_E = SPR_ROAD_WAYPOINTS_BASE + 3;
static const uint16_t ROAD_WAYPOINTS_SPRITE_COUNT = 4;
/* CityMania extra sprites */
static const SpriteID CM_SPR_CITYMANIA_BASE = SPR_PALETTE_BASE + PALETTE_SPRITE_COUNT;
static const SpriteID CM_SPR_CITYMANIA_BASE = SPR_ROAD_WAYPOINTS_BASE + ROAD_WAYPOINTS_SPRITE_COUNT;
static const SpriteID CM_SPR_RAIL_COPY_PASTE = CM_SPR_CITYMANIA_BASE + 2;
static const SpriteID CM_SPR_HQ = CM_SPR_CITYMANIA_BASE + 3;
static const SpriteID CM_SPR_WATCH = CM_SPR_CITYMANIA_BASE + 4;
@@ -1567,19 +1575,18 @@ static const CursorID ANIMCURSOR_BUILDSIGNALS = ANIMCURSOR_FLAG | 4; ///< 1292 -
* <li> PALETTE_SPRITE_WIDTH and PALETTE_SPRITE_START determine the position and number of
* bits used for the recolouring process. For transparency, it must be 0x322.</li></ul>
*/
enum SpriteSetup {
/* These bits are applied to sprite ID */
TRANSPARENT_BIT = 31, ///< toggles transparency in the sprite
RECOLOUR_BIT = 30, ///< toggles recolouring in the sprite
CUSTOM_BIT = 29,
OPAQUE_BIT = 28,
/* This bit is applied to palette ID */
PALETTE_TEXT_RECOLOUR = 31, ///< Set if palette is actually a magic text recolour
/* These bits are applied to sprite ID */
static constexpr uint8_t TRANSPARENT_BIT = 31; ///< toggles transparency in the sprite
static constexpr uint8_t RECOLOUR_BIT = 30; ///< toggles recolouring in the sprite
static constexpr uint8_t CUSTOM_BIT = 29;
static constexpr uint8_t OPAQUE_BIT = 28;
PALETTE_WIDTH = 24, ///< number of bits of the sprite containing the recolour palette
SPRITE_WIDTH = 24, ///< number of bits for the sprite number
};
/* This bit is applied to palette ID */
static constexpr uint8_t PALETTE_TEXT_RECOLOUR = 31; ///< Set if palette is actually a magic text recolour
static constexpr uint8_t PALETTE_WIDTH = 24; ///< number of bits of the sprite containing the recolour palette
static constexpr uint8_t SPRITE_WIDTH = 24; ///< number of bits for the sprite number
/**
* these masks change the colours of the palette for a sprite.
@@ -1589,25 +1596,21 @@ enum SpriteSetup {
* @note Do not modify this enum. Alter SpriteSetup instead
* @see SpriteSetup
*/
enum Modifiers {
SPRITE_MODIFIER_CUSTOM_SPRITE = CUSTOM_BIT, ///< Set when a sprite originates from an Action 1
SPRITE_MODIFIER_OPAQUE = OPAQUE_BIT, ///< Set when a sprite must not ever be displayed transparently
PALETTE_MODIFIER_TRANSPARENT = TRANSPARENT_BIT, ///< when a sprite is to be displayed transparently, this bit needs to be set.
PALETTE_MODIFIER_COLOUR = RECOLOUR_BIT, ///< this bit is set when a recolouring process is in action
};
static constexpr uint8_t SPRITE_MODIFIER_CUSTOM_SPRITE = CUSTOM_BIT; ///< Set when a sprite originates from an Action 1
static constexpr uint8_t SPRITE_MODIFIER_OPAQUE = OPAQUE_BIT; ///< Set when a sprite must not ever be displayed transparently
static constexpr uint8_t PALETTE_MODIFIER_TRANSPARENT = TRANSPARENT_BIT; ///< when a sprite is to be displayed transparently, this bit needs to be set.
static constexpr uint8_t PALETTE_MODIFIER_COLOUR = RECOLOUR_BIT; ///< this bit is set when a recolouring process is in action
/**
* Masks needed for sprite operations.
* @note Do not modify this enum. Alter SpriteSetup instead
* @see SpriteSetup
*/
enum SpriteMasks {
MAX_SPRITES = 1U << SPRITE_WIDTH, ///< Maximum number of sprites that can be loaded at a given time
SPRITE_MASK = MAX_SPRITES - 1, ///< The mask to for the main sprite
static constexpr uint32_t MAX_SPRITES = 1U << SPRITE_WIDTH; ///< Maximum number of sprites that can be loaded at a given time
static constexpr uint32_t SPRITE_MASK = MAX_SPRITES - 1; ///< The mask to for the main sprite
MAX_PALETTES = 1U << PALETTE_WIDTH,
PALETTE_MASK = MAX_PALETTES - 1, ///< The mask for the auxiliary sprite (the one that takes care of recolouring)
};
static constexpr uint32_t MAX_PALETTES = 1U << PALETTE_WIDTH;
static constexpr uint32_t PALETTE_MASK = MAX_PALETTES - 1; ///< The mask for the auxiliary sprite (the one that takes care of recolouring)
static_assert( (1U << TRANSPARENT_BIT & SPRITE_MASK) == 0 );
static_assert( (1U << RECOLOUR_BIT & SPRITE_MASK) == 0 );
+26 -2
View File
@@ -763,6 +763,20 @@ static const DrawTileSeqStruct _station_display_datas_0171[] = {
TILE_SEQ_END()
};
/* road waypoint X */
static const DrawTileSeqStruct _station_display_datas_road_waypoint_X[] = {
TILE_SEQ_LINE( 0, 0, 0, 16, 3, 16, SPR_ROAD_WAYPOINT_X_W | (1U << PALETTE_MODIFIER_COLOUR))
TILE_SEQ_LINE( 0, 13, 0, 16, 3, 16, SPR_ROAD_WAYPOINT_X_E | (1U << PALETTE_MODIFIER_COLOUR))
TILE_SEQ_END()
};
/* road waypoint Y */
static const DrawTileSeqStruct _station_display_datas_road_waypoint_Y[] = {
TILE_SEQ_LINE(13, 0, 0, 3, 16, 16, SPR_ROAD_WAYPOINT_Y_W | (1U << PALETTE_MODIFIER_COLOUR))
TILE_SEQ_LINE( 0, 0, 0, 3, 16, 16, SPR_ROAD_WAYPOINT_Y_E | (1U << PALETTE_MODIFIER_COLOUR))
TILE_SEQ_END()
};
static const DrawTileSeqStruct _station_display_datas_waypoint_X[] = {
TILE_SEQ_LINE( 0, 0, 0, 16, 5, 23, SPR_WAYPOINT_X_1 | (1U << PALETTE_MODIFIER_COLOUR))
TILE_SEQ_LINE( 0, 11, 0, 16, 5, 23, SPR_WAYPOINT_X_2 | (1U << PALETTE_MODIFIER_COLOUR))
@@ -955,6 +969,15 @@ static const DrawTileSprites _station_display_datas_bus[] = {
TILE_SPRITE_LINE(SPR_ROAD_PAVED_STRAIGHT_Y, _station_display_datas_0171)
};
static const DrawTileSprites _station_display_datas_road_waypoint[] = {
TILE_SPRITE_LINE(0, nullptr)
TILE_SPRITE_LINE(0, nullptr)
TILE_SPRITE_LINE(0, nullptr)
TILE_SPRITE_LINE(0, nullptr)
TILE_SPRITE_LINE(SPR_ROAD_PAVED_STRAIGHT_X, _station_display_datas_road_waypoint_X)
TILE_SPRITE_LINE(SPR_ROAD_PAVED_STRAIGHT_Y, _station_display_datas_road_waypoint_Y)
};
static const DrawTileSprites _station_display_datas_oilrig[] = {
TILE_SPRITE_LINE(SPR_FLAT_WATER_TILE, _station_display_nothing)
};
@@ -990,7 +1013,7 @@ static const DrawTileSprites _station_display_datas_waypoint[] = {
* As these are drawn/build like stations, they may use the same number of layouts. */
static_assert(lengthof(_station_display_datas_rail) == lengthof(_station_display_datas_waypoint));
static const DrawTileSprites * const _station_display_datas[] = {
static const std::array<std::span<const DrawTileSprites>, STATION_END> _station_display_datas = {{
_station_display_datas_rail,
_station_display_datas_airport,
_station_display_datas_truck,
@@ -999,4 +1022,5 @@ static const DrawTileSprites * const _station_display_datas[] = {
_station_display_datas_dock,
_station_display_datas_buoy,
_station_display_datas_waypoint,
};
_station_display_datas_road_waypoint,
}};
+1
View File
@@ -127,6 +127,7 @@ static const CmdStruct _cmd_structs[] = {
{"COMPANY_NUM", EmitSingleChar, SCC_COMPANY_NUM, 1, -1, C_NONE},
{"PRESIDENT_NAME", EmitSingleChar, SCC_PRESIDENT_NAME, 1, -1, C_NONE | C_GENDER},
{"SPACE", EmitSingleChar, ' ', 0, -1, C_DONTCOUNT},
{"", EmitSingleChar, '\n', 0, -1, C_DONTCOUNT},
{"{", EmitSingleChar, '{', 0, -1, C_DONTCOUNT},
{"UP_ARROW", EmitSingleChar, SCC_UP_ARROW, 0, -1, C_DONTCOUNT},
+1 -1
View File
@@ -8,7 +8,7 @@
/** @file string_colours.h The colour translation of GRF's strings. */
/** Colour mapping for #TextColour. */
static const byte _string_colourmap[17] = {
static const uint8_t _string_colourmap[17] = {
150, // TC_BLUE
12, // TC_SILVER
189, // TC_GOLD
+3 -4
View File
@@ -24,7 +24,7 @@
#define M(s1, p1, s2, p2, sx, sy, w, h, dz, p) { { s1, p1 }, { s2, p2 }, sx, sy, w, h, dz, p}
/** structure of houses graphics*/
static const DrawBuildingsTileStruct _town_draw_tile_data[] = {
extern const DrawBuildingsTileStruct _town_draw_tile_data[] = {
M( SPR_FLAT_BARE_LAND, PAL_NONE, 0x58d, PAL_NONE, 0, 0, 14, 14, 8, 0),
M( SPR_FLAT_BARE_LAND, PAL_NONE, 0x58e, PAL_NONE, 0, 0, 14, 14, 60, 0),
M( SPR_FLAT_BARE_LAND, PAL_NONE, 0x58f, PAL_NONE, 0, 0, 14, 14, 60, 0),
@@ -1813,11 +1813,10 @@ static_assert(lengthof(_town_draw_tile_data) == (NEW_HOUSE_OFFSET) * 4 * 4);
{mnd, mxd, p, rc, bn, rr, mg, \
{ca1, ca2, ca3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \
{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}, \
{cg1, cg2, cg3, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID}, \
bf, ba, true, GRFFileProps(INVALID_HOUSE_ID), 0, {COLOUR_BEGIN, COLOUR_BEGIN, COLOUR_BEGIN, COLOUR_BEGIN}, \
16, NO_EXTRA_FLAG, HOUSE_NO_CLASS, {0, 2, 0, 0}, 0, 0, 0}
16, NO_EXTRA_FLAG, HOUSE_NO_CLASS, {0, 2, 0, 0}, 0, 0, 0, {cg1, cg2, cg3}, }
/** House specifications from original data */
static const HouseSpec _original_house_specs[] = {
extern const HouseSpec _original_house_specs[NEW_HOUSE_OFFSET] = {
/**
* remove_rating_decrease
* | mail_generation
+3 -3
View File
@@ -22,7 +22,7 @@ static const SpriteID _engine_sprite_base[] = {
/* For how many directions do we have sprites? (8 or 4; if 4, the other 4
* directions are symmetric. */
static const byte _engine_sprite_and[] = {
static const uint8_t _engine_sprite_and[] = {
7, 7, 7, 7, 3, 3, 7, 7,
7, 7, 7, 7, 7, 7, 7, 3,
7, 7, 3, 7, 3, 7, 7, 7,
@@ -36,7 +36,7 @@ static const byte _engine_sprite_and[] = {
};
/* Non-zero for multihead trains. */
static const byte _engine_sprite_add[] = {
static const uint8_t _engine_sprite_add[] = {
0, 0, 0, 0, 0, 0, 0, 4,
0, 4, 0, 4, 0, 0, 0, 0,
0, 4, 0, 0, 0, 0, 4, 0,
@@ -50,7 +50,7 @@ static const byte _engine_sprite_add[] = {
};
static const byte _wagon_full_adder[] = {
static const uint8_t _wagon_full_adder[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
+2 -2
View File
@@ -10,8 +10,8 @@
#ifndef TREE_LAND_H
#define TREE_LAND_H
static const byte _tree_base_by_landscape[4] = {0, 12, 20, 32};
static const byte _tree_count_by_landscape[4] = {12, 8, 12, 9};
static const uint8_t _tree_base_by_landscape[4] = {0, 12, 20, 32};
static const uint8_t _tree_count_by_landscape[4] = {12, 8, 12, 9};
struct TreePos {
uint8_t x;
+2 -2
View File
@@ -9,10 +9,10 @@
struct DefaultUnicodeMapping {
char32_t code; ///< Unicode value
byte key; ///< Character index of sprite
uint8_t key; ///< Character index of sprite
};
static const byte CLRA = 0; ///< Identifier to clear all glyphs at this codepoint
static const uint8_t CLRA = 0; ///< Identifier to clear all glyphs at this codepoint
/* Default unicode mapping table for sprite based glyphs.
* This table allows us use unicode characters even though the glyphs don't