Merge branch 'openttd'

This commit is contained in:
Pavel Stupnikov
2023-01-03 19:05:48 +04:00
326 changed files with 12923 additions and 8705 deletions
+1
View File
@@ -56,6 +56,7 @@ enum StringControlCode {
SCC_CARGO_TINY,
SCC_CARGO_LIST,
SCC_POWER,
SCC_POWER_TO_WEIGHT,
SCC_VOLUME_LONG,
SCC_VOLUME_SHORT,
SCC_WEIGHT_LONG,
+9 -7
View File
@@ -327,7 +327,9 @@ struct SortableSpriteStruct {
/** Distance between wire and rail */
static const uint ELRAIL_ELEVATION = 10;
/** Wires that a draw one level higher than the north corner. */
static const uint ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT;
static const uint ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT + 1;
/** Wires that a draw one level lower than the north corner. */
static const uint ELRAIL_ELEVLOWER = ELRAIL_ELEVATION - 1;
static const SortableSpriteStruct RailCatenarySpriteData[] = {
/* X direction
@@ -345,9 +347,9 @@ static const SortableSpriteStruct RailCatenarySpriteData[] = {
/* "down" tiles
* Wires */
{ WSO_X_SW_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVATION }, //! 6: Wire in X pitch down, pylon on the SW end
{ WSO_X_NE_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVATION }, //! 7: Wire in X pitch down, pylon on the NE end
{ WSO_X_SHORT_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVATION }, //! 8: Wire in X pitch down, pylon on both ends
{ WSO_X_SW_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVLOWER }, //! 6: Wire in X pitch down, pylon on the SW end
{ WSO_X_NE_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVLOWER }, //! 7: Wire in X pitch down, pylon on the NE end
{ WSO_X_SHORT_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVLOWER }, //! 8: Wire in X pitch down, pylon on both ends
/* Y direction
@@ -365,9 +367,9 @@ static const SortableSpriteStruct RailCatenarySpriteData[] = {
/* "down" tiles
* Wires */
{ WSO_Y_SE_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVATION }, //!15: Wire in Y pitch down, pylon on the SE end
{ WSO_Y_NW_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVATION }, //!16: Wire in Y pitch down, pylon on the NW end
{ WSO_Y_SHORT_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVATION }, //!17: Wire in Y pitch down, pylon on both ends
{ WSO_Y_SE_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVLOWER }, //!15: Wire in Y pitch down, pylon on the SE end
{ WSO_Y_NW_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVLOWER }, //!16: Wire in Y pitch down, pylon on the NW end
{ WSO_Y_SHORT_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVLOWER }, //!17: Wire in Y pitch down, pylon on both ends
/* NS Direction */
{ WSO_NS_SHORT, 8, 0, 8, 8, 1, ELRAIL_ELEVATION }, //!18: LEFT trackbit wire, pylon on both ends
+6 -6
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) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, e, 0, 8, 1 << EF_RAIL_FLIPS, 0, 0, STR_EMPTY, CARGO_AGING_TICKS }
#define MT(a, b, c, d, e, f) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, e, 0, 8, 0, 0, 0, STR_EMPTY, CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
/**
* 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) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, e, 0, 8, 1 << EF_RAIL_FLIPS | 1 << EF_RAIL_IS_MU, 0, 0, STR_EMPTY, CARGO_AGING_TICKS }
#define MM(a, b, c, d, e, f) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, e, 0, 8, 1 << EF_RAIL_IS_MU, 0, 0, STR_EMPTY, CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
/**
* 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) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, e, 0, 8, 1 << EF_RAIL_FLIPS, 0, 0, STR_EMPTY, CARGO_AGING_TICKS }
#define MW(a, b, c, d, e, f) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, e, 0, 8, 0, 0, 0, STR_EMPTY, CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
/**
* 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) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, e, 0, 8, 0, 0, 0, STR_EMPTY, CARGO_AGING_TICKS }
#define MR(a, b, c, d, e, f) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, f, e, 0, 8, 0, 0, 0, STR_EMPTY, CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
/**
* 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) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 10, f, e, 0, 8, 0, 0, 0, STR_EMPTY, CARGO_AGING_TICKS }
#define MS(a, b, c, d, e, f) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 10, f, e, 0, 8, 0, 0, 0, STR_EMPTY, CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
/**
* 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) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 20, e, CT_INVALID, 0, 8, 0, 0, 0, STR_EMPTY, CARGO_AGING_TICKS }
#define MA(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 20, e, CT_INVALID, 0, 8, 0, 0, 0, STR_EMPTY, CARGO_AGING_TICKS, INVALID_ENGINE, ExtraEngineFlags::None }
/* Climates
* T = Temperate
-2
View File
@@ -1,5 +1,3 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+40
View File
@@ -53,6 +53,46 @@ static const DrawTileSprites _crossing_layout = {
{0, PAL_NONE}, _crossing_layout_ALL
};
static const DrawTileSeqStruct _crossing_layout_SW_ALL[] = {
TILE_SEQ_LINE(6, PAL_NONE, 13, 0, 3, 3)
TILE_SEQ_LINE(8, PAL_NONE, 13, 13, 3, 3)
TILE_SEQ_END()
};
static const DrawTileSprites _crossing_layout_SW = {
{0, PAL_NONE}, _crossing_layout_SW_ALL
};
static const DrawTileSeqStruct _crossing_layout_NW_ALL[] = {
TILE_SEQ_LINE(2, PAL_NONE, 0, 0, 3, 3)
TILE_SEQ_LINE(6, PAL_NONE, 13, 0, 3, 3)
TILE_SEQ_END()
};
static const DrawTileSprites _crossing_layout_NW = {
{0, PAL_NONE}, _crossing_layout_NW_ALL
};
static const DrawTileSeqStruct _crossing_layout_NE_ALL[] = {
TILE_SEQ_LINE(2, PAL_NONE, 0, 0, 3, 3)
TILE_SEQ_LINE(4, PAL_NONE, 0, 13, 3, 3)
TILE_SEQ_END()
};
static const DrawTileSprites _crossing_layout_NE = {
{0, PAL_NONE}, _crossing_layout_NE_ALL
};
static const DrawTileSeqStruct _crossing_layout_SE_ALL[] = {
TILE_SEQ_LINE(4, PAL_NONE, 0, 13, 3, 3)
TILE_SEQ_LINE(8, PAL_NONE, 13, 13, 3, 3)
TILE_SEQ_END()
};
static const DrawTileSprites _crossing_layout_SE = {
{0, PAL_NONE}, _crossing_layout_SE_ALL
};
#undef TILE_SEQ_LINE
#undef TILE_SEQ_END
+4 -4
View File
@@ -123,7 +123,7 @@ var = economy.bribe
def = true
str = STR_CONFIG_SETTING_BRIBE
strhelp = STR_CONFIG_SETTING_BRIBE_HELPTEXT
post_cb = [](auto) { SetWindowClassesDirty(WC_TOWN_AUTHORITY); }
post_cb = [](auto) { InvalidateWindowClassesData(WC_TOWN_AUTHORITY); }
cat = SC_BASIC
[SDT_BOOL]
@@ -132,7 +132,7 @@ from = SLV_79
def = true
str = STR_CONFIG_SETTING_ALLOW_EXCLUSIVE
strhelp = STR_CONFIG_SETTING_ALLOW_EXCLUSIVE_HELPTEXT
post_cb = [](auto) { SetWindowClassesDirty(WC_TOWN_AUTHORITY); }
post_cb = [](auto) { InvalidateWindowClassesData(WC_TOWN_AUTHORITY); }
cat = SC_BASIC
[SDT_BOOL]
@@ -141,7 +141,7 @@ from = SLV_165
def = true
str = STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS
strhelp = STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS_HELPTEXT
post_cb = [](auto) { SetWindowClassesDirty(WC_TOWN_AUTHORITY); }
post_cb = [](auto) { InvalidateWindowClassesData(WC_TOWN_AUTHORITY); }
cat = SC_BASIC
[SDT_BOOL]
@@ -150,7 +150,7 @@ from = SLV_160
def = true
str = STR_CONFIG_SETTING_ALLOW_FUND_ROAD
strhelp = STR_CONFIG_SETTING_ALLOW_FUND_ROAD_HELPTEXT
post_cb = [](auto) { SetWindowClassesDirty(WC_TOWN_AUTHORITY); }
post_cb = [](auto) { InvalidateWindowClassesData(WC_TOWN_AUTHORITY); }
cat = SC_BASIC
[SDT_BOOL]
+1 -1
View File
@@ -144,7 +144,7 @@ max = 1
full = _roadsides
str = STR_CONFIG_SETTING_ROAD_SIDE
strhelp = STR_CONFIG_SETTING_ROAD_SIDE_HELPTEXT
strval = STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT
strval = STR_CONFIG_SETTING_ROAD_SIDE_LEFT
pre_cb = CheckRoadSide
cat = SC_BASIC
+17
View File
@@ -728,6 +728,15 @@ strhelp = STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT
post_cb = [](auto) { MarkWholeScreenDirty(); }
cat = SC_ADVANCED
[SDTC_BOOL]
var = gui.show_cargo_in_vehicle_lists
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
def = false
str = STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS
strhelp = STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS_HELPTEXT
post_cb = [](auto) { MarkWholeScreenDirty(); }
cat = SC_ADVANCED
; For the dedicated build we'll enable dates in logs by default.
[SDTC_BOOL]
ifdef = DEDICATED
@@ -861,3 +870,11 @@ min = 1
max = 65535
cat = SC_EXPERT
[SDTC_BOOL]
var = gui.scale_bevels
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
def = true
post_cb = [](auto) { SetupWidgetDimensions(); ReInitAllWindows(true); }
cat = SC_BASIC
startup = true
+6 -15
View File
@@ -334,21 +334,12 @@ max = UINT32_MAX
cat = SC_EXPERT
[SDTG_VAR]
name = ""gui_zoom""
type = SLE_INT8
var = _gui_zoom_cfg
def = ZOOM_LVL_CFG_AUTO
min = ZOOM_LVL_CFG_AUTO
max = ZOOM_LVL_OUT_4X
cat = SC_BASIC
[SDTG_VAR]
name = ""font_zoom""
type = SLE_INT8
var = _font_zoom_cfg
def = ZOOM_LVL_CFG_AUTO
min = ZOOM_LVL_CFG_AUTO
max = ZOOM_LVL_OUT_4X
name = ""gui_scale""
type = SLE_INT32
var = _gui_scale_cfg
def = -1
min = -1
max = MAX_INTERFACE_SCALE
cat = SC_BASIC
[SDTG_BOOL]
+1 -1
View File
@@ -65,7 +65,7 @@ full = _climates
load = ConvertLandscape
str = STR_CONFIG_SETTING_LANDSCAPE
strhelp = STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT
strval = STR_CHEAT_SWITCH_CLIMATE_TEMPERATE_LANDSCAPE
strval = STR_CLIMATE_TEMPERATE_LANDSCAPE
cat = SC_BASIC
[SDT_VAR]
+10 -8
View File
@@ -290,8 +290,10 @@ static const SpriteID SPR_TRAMWAY_DEPOT_NO_TRACK = SPR_TRAMWAY_BASE + 113;
static const uint16 TRAMWAY_SPRITE_COUNT = 119;
/** One way road sprites */
static const SpriteID SPR_ONEWAY_BASE = SPR_TRAMWAY_BASE + TRAMWAY_SPRITE_COUNT;
static const uint16 ONEWAY_SPRITE_COUNT = 6;
static const SpriteID SPR_ONEWAY_BASE = SPR_TRAMWAY_BASE + TRAMWAY_SPRITE_COUNT;
static const SpriteID SPR_ONEWAY_SLOPE_N_OFFSET = 6;
static const SpriteID SPR_ONEWAY_SLOPE_S_OFFSET = 12;
static const uint16 ONEWAY_SPRITE_COUNT = 18;
/** Tunnel sprites with grass only for custom railtype tunnel. */
static const SpriteID SPR_RAILTYPE_TUNNEL_BASE = SPR_ONEWAY_BASE + ONEWAY_SPRITE_COUNT;
@@ -1542,18 +1544,18 @@ enum Modifiers {
* @see SpriteSetup
*/
enum SpriteMasks {
MAX_SPRITES = 1 << SPRITE_WIDTH, ///< Maximum number of sprites that can be loaded at a given time
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
MAX_PALETTES = 1 << PALETTE_WIDTH,
MAX_PALETTES = 1U << PALETTE_WIDTH,
PALETTE_MASK = MAX_PALETTES - 1, ///< The mask for the auxiliary sprite (the one that takes care of recolouring)
};
static_assert( (1 << TRANSPARENT_BIT & SPRITE_MASK) == 0 );
static_assert( (1 << RECOLOUR_BIT & SPRITE_MASK) == 0 );
static_assert( (1U << TRANSPARENT_BIT & SPRITE_MASK) == 0 );
static_assert( (1U << RECOLOUR_BIT & SPRITE_MASK) == 0 );
static_assert( TRANSPARENT_BIT != RECOLOUR_BIT );
static_assert( (1 << TRANSPARENT_BIT & PALETTE_MASK) == 0);
static_assert( (1 << RECOLOUR_BIT & PALETTE_MASK) == 0 );
static_assert( (1U << TRANSPARENT_BIT & PALETTE_MASK) == 0 );
static_assert( (1U << RECOLOUR_BIT & PALETTE_MASK) == 0 );
static const PaletteID PAL_NONE = 0;
+1
View File
@@ -78,6 +78,7 @@ static const CmdStruct _cmd_structs[] = {
{"CARGO_TINY", EmitSingleChar, SCC_CARGO_TINY, 2, 1, C_NONE}, // tiny cargo description with only the amount, not a specifier for the amount or the actual cargo name
{"CARGO_LIST", EmitSingleChar, SCC_CARGO_LIST, 1, -1, C_CASE},
{"POWER", EmitSingleChar, SCC_POWER, 1, 0, C_NONE},
{"POWER_TO_WEIGHT", EmitSingleChar, SCC_POWER_TO_WEIGHT, 1, 0, C_NONE},
{"VOLUME_LONG", EmitSingleChar, SCC_VOLUME_LONG, 1, 0, C_NONE},
{"VOLUME_SHORT", EmitSingleChar, SCC_VOLUME_SHORT, 1, 0, C_NONE},
{"WEIGHT_LONG", EmitSingleChar, SCC_WEIGHT_LONG, 1, 0, C_NONE},