1
0
Fork 0

Codechange: Disable clang-format for tables.

pull/14014/head
frosch 2025-04-19 21:39:58 +02:00
parent dca2b428a6
commit 945579756c
34 changed files with 138 additions and 3 deletions

View File

@ -12,6 +12,8 @@
#include "../timer/timer_game_calendar.h"
/* clang-format off */
/**
* Definition of an airport tiles layout.
* @param x offset x of this tile
@ -412,4 +414,6 @@ const AirportSpec AirportSpec::dummy = AS_GENERIC(&_airportfta_dummy, {}, {}, 0,
#undef AS_ND
#undef AS_GENERIC
/* clang-format on */
#endif /* AIRPORT_DEFAULTS_H */

View File

@ -24,6 +24,8 @@ struct AirportFTAbuildup {
uint8_t next; ///< Next position from this position.
};
/* clang-format off */
///////////////////////////////////////////////////////////////////////
/////*********Movement Positions on Airports********************///////
@ -832,4 +834,6 @@ static const AirportFTAbuildup _airport_fta_helistation[] = {
{ MAX_ELEMENTS, TO_ALL, {}, 0 } // end marker. DO NOT REMOVE
};
/* clang-format on */
#endif /* AIRPORT_MOVEMENT_H */

View File

@ -12,6 +12,8 @@
#include "table/strings.h"
/* clang-format off */
/** Writes all airport tile properties in the AirportTile struct */
#define AT(num_frames, anim_speed) {{num_frames, AnimationStatus::Looping, anim_speed, 0}, STR_NULL, AirportTileCallbackMasks{}, 0, true, GRFFileProps(INVALID_AIRPORTTILE), {}}
/** Writes an airport tile without animation in the AirportTile struct */
@ -111,4 +113,6 @@ static_assert(NEW_AIRPORTTILE_OFFSET == lengthof(_origin_airporttile_specs));
#undef AT_NOANIM
#undef AT
/* clang-format on */
#endif /* AIRPORTTILES_H */

View File

@ -14,6 +14,8 @@
* is to be displayed.
*/
/* clang-format off */
/**
* Creates two array entries that define one
* status of the cursor.
@ -89,3 +91,5 @@ static const AnimCursor * const _animcursors[] = {
_order_goto_animcursor,
_build_signals_animcursor
};
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file autorail.h Highlight/sprite information for autorail. */
/* clang-format off */
/* Rail selection types (directions):
* / \ / \ / \ / \ / \ / \
* / /\ /\ \ /===\ / \ /| \ / |\
@ -77,3 +79,5 @@ static const HighLightStyle _autorail_piece[][16] = {
{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL }
};
/* clang-format on */

View File

@ -7,6 +7,8 @@
#include "table/strings.h"
/* clang-format off */
/**
* @file bridge_land.h This file contains all the sprites for bridges
* It consists of a number of arrays.
@ -799,3 +801,5 @@ const BridgeSpec _orig_bridge[] = {
#undef MR
#undef MW
#undef MC
/* clang-format on */

View File

@ -12,6 +12,8 @@
#include "table/strings.h"
/* clang-format off */
/**
* Definition of an industry tiles layout.
* @param x offset x of this tile
@ -1787,4 +1789,6 @@ static const IndustryTileSpec _origin_industry_tile_specs[NEW_INDUSTRYTILEOFFSET
};
#undef MT
/* clang-format on */
#endif /* BUILD_INDUSTRY_H */

View File

@ -12,6 +12,8 @@
#include "table/strings.h"
#endif
/* clang-format off */
/** Construction macros for the #CargoSpec StringID entries. */
#define MK_STR_CARGO_PLURAL(label_plural) STR_CARGO_PLURAL_ ## label_plural
#define MK_STR_CARGO_SINGULAR(label_singular) STR_CARGO_SINGULAR_ ## label_singular
@ -108,3 +110,4 @@ static const std::variant<CargoLabel, int> _default_climate_cargo[NUM_LANDSCAPE]
{ CT_PASSENGERS, CT_SUGAR, CT_MAIL, CT_TOYS, CT_BATTERIES, CT_CANDY, CT_TOFFEE, CT_COLA, CT_COTTON_CANDY, CT_BUBBLES, CT_PLASTIC, CT_FIZZY_DRINKS, },
};
/* clang-format on */

View File

@ -9,6 +9,8 @@
#include "sprites.h"
/* clang-format off */
static const SpriteID _landscape_clear_sprites_rough[8] = {
SPR_FLAT_ROUGH_LAND,
SPR_FLAT_ROUGH_LAND_1,
@ -76,3 +78,5 @@ static const SpriteID _clear_land_sprites_snow_desert[8] = {
SPR_FLAT_3_QUART_SNOW_DESERT_TILE,
SPR_FLAT_SNOW_DESERT_TILE,
};
/* clang-format on */

View File

@ -13,6 +13,8 @@
#ifndef ELRAIL_DATA_H
#define ELRAIL_DATA_H
/* clang-format off */
/**
* Tile Location group.
* This defines whether the X and or Y coordinate of a tile is even
@ -510,4 +512,6 @@ static const RailCatenarySprite Wires[5][TRACK_END][4] = {
}
};
/* clang-format on */
#endif /* ELRAIL_DATA_H */

View File

@ -15,6 +15,8 @@
#include "table/strings.h"
/* clang-format off */
/**
* Writes the properties of a train into the EngineInfo struct.
* @see EngineInfo
@ -767,4 +769,6 @@ static constexpr RoadVehicleInfo _orig_road_vehicle_info[] = {
};
#undef ROV
/* clang-format on */
#endif /* ENGINES_H */

View File

@ -7,6 +7,8 @@
/** @file genland.h Table used to generate deserts and/or rainforests. */
/* clang-format off */
#define M(x, y) {x, y}
static const TileIndexDiffC _make_desert_or_rainforest_data[] = {
@ -161,6 +163,6 @@ static const TileIndexDiffC _make_desert_or_rainforest_data[] = {
M( 3, -6)
};
#undef M
/* clang-format on */

View File

@ -9,6 +9,8 @@
* @file heightmap_colours.h The colour tables for heightmaps.
*/
/* clang-format off */
/** Height map colours for the green colour scheme, ordered by height. */
static const uint32_t _green_map_heights[] = {
MKCOLOUR(0x59595958),
@ -340,3 +342,5 @@ static const uint32_t _violet_map_heights[] = {
MKCOLOUR(0x87878786),
MKCOLOUR(0x87878787),
};
/* clang-format on */

View File

@ -31,6 +31,8 @@ struct DrawIndustryCoordinates {
uint8_t y; ///< coordinate y of the pair
};
/* clang-format off */
/**
* Macro to ease the declaration of the array
* @param s1 sprite ID of ground sprite
@ -954,3 +956,4 @@ static const DrawIndustryCoordinates _coal_plant_sparks[] = {
{15, 0},
};
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file landscape_sprite.h Offsets of sprites to replace for non-temperate landscapes. */
/* clang-format off */
static constexpr std::pair<SpriteID, SpriteID> _landscape_spriteindexes_arctic[] = {
{ 0xF67, 0xF9F},
{ 0xAAD, 0xAB0},
@ -136,3 +138,5 @@ static constexpr std::pair<SpriteID, SpriteID> _landscape_spriteindexes_toyland[
{ 0x511, 0x511},
{ 0x322, 0x322},
};
/* clang-format on */

View File

@ -12,6 +12,8 @@
#include "../newgrf_roadtype.h"
#include "../newgrf_roadstop.h"
/* clang-format off */
/* Helper for filling property tables */
#define NIP(prop, base, variable, type, name) { name, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->variable); }, cpp_sizeof(base, variable), prop, type }
@ -747,3 +749,5 @@ static const NIFeature * const _nifeatures[] = {
nullptr,
};
static_assert(lengthof(_nifeatures) == GSF_FAKE_END);
/* clang-format on */

View File

@ -9,6 +9,8 @@
#include "table/strings.h"
/* clang-format off */
#define TILE_SEQ_LINE(sz, img) { 0, 0, 0, 16, 16, sz, {img, PAL_NONE} },
static const DrawTileSeqStruct _object_transmitter_seq[] = {
@ -131,3 +133,5 @@ extern const ObjectSpec _original_objects[] = {
#undef S
#undef A
#undef T
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file opengl_shader.h OpenGL shader programs. */
/* clang-format off */
/** Vertex shader that positions a sprite on screen.. */
static const char *_vertex_shader_sprite[] = {
"#version 110\n",
@ -199,3 +201,5 @@ static const char *_frag_shader_sprite_blend_150[] = {
" colour.rgb = idx > 0.0 ? adj_brightness(remap_col.rgb, max3(rgb_col.rgb)) : rgb_col.rgb;",
"}",
};
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file palette_convert.h Translation tables from one GRF to another GRF. */
/* clang-format off */
/** Converting from the Windows palette to the DOS palette */
extern const uint8_t _palmap_w2d[] = {
0, 1, 2, 3, 4, 5, 6, 7, // 0..7
@ -78,3 +80,5 @@ static const uint8_t _palmap_d2w[] = {
240, 241, 242, 243, 244, 217, 218, 219, // 240..247
220, 221, 222, 223, 224, 225, 226, 255, // 248..255
};
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file palettes.h The colour translation of the GRF palettes. */
/* clang-format off */
#define M(r, g, b) Colour(r, g, b)
/** Colour palette (DOS) */
@ -143,3 +145,5 @@ static const ExtraPaletteValues _extra_palette_values = {
M(116, 180, 196), M(148, 200, 216), M(180, 220, 232) }
};
#undef M
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file pricebase.h Price Bases */
/* clang-format off */
extern const PriceBaseSpec _price_base_specs[] = {
{ 100, PCAT_NONE, GSF_END, INVALID_PRICE }, ///< PR_STATION_VALUE
{ 100, PCAT_CONSTRUCTION, GSF_END, INVALID_PRICE }, ///< PR_BUILD_RAIL
@ -81,3 +83,5 @@ extern const PriceBaseSpec _price_base_specs[] = {
{ 5000, PCAT_RUNNING, GSF_END, PR_BUILD_STATION_AIRPORT}, ///< PR_INFRASTRUCTURE_AIRPORT
};
static_assert(lengthof(_price_base_specs) == PR_END);
/* clang-format on */

View File

@ -15,6 +15,8 @@
#include "table/strings.h"
/* clang-format off */
/**
* Global Railtype definition
*/
@ -416,4 +418,6 @@ static const RailTypeInfo _original_railtypes[] = {
},
};
/* clang-format on */
#endif /* RAILTYPES_H */

View File

@ -7,6 +7,8 @@
/** @file road_land.h Sprite constructs for road depots. */
/* clang-format off */
#define TILE_SEQ_LINE(img, pal, dx, dy, sx, sy) { dx, dy, 0, sx, sy, 20, {img, pal} },
static const DrawTileSeqStruct _road_depot_NE[] = {
@ -287,3 +289,5 @@ static const DrawRoadTileStruct * const * const _road_display_table[] = {
_roadside_none,
_roadside_trees,
};
/* clang-format on */

View File

@ -15,6 +15,8 @@
#include "table/strings.h"
/* clang-format off */
/**
* Global Roadtype definition
*/
@ -182,4 +184,6 @@ static const RoadTypeInfo _original_roadtypes[] = {
},
};
/* clang-format on */
#endif /* ROADTYPES_H */

View File

@ -7,6 +7,8 @@
/** @file table/roadveh_movement.h Data about how a road vehicle must drive on a tile */
/* clang-format off */
static const RoadDriveEntry _roadveh_drive_data_0[] = {
{15, 5},
{14, 5},
@ -1482,3 +1484,5 @@ static const RoadDriveEntry * const * const _road_drive_data[2] = {
_road_road_drive_data,
_road_tram_drive_data,
};
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file station_land.h Sprites to use and how to display them for station tiles. */
/* clang-format off */
/**
* Constructor macro for an image without a palette in a DrawTileSeqStruct array.
* @param dx Offset in x direction
@ -902,3 +904,5 @@ static const std::array<std::span<const DrawTileSpriteSpan>, to_underlying(Stati
_station_display_datas_waypoint,
_station_display_datas_road_waypoint,
}};
/* clang-format on */

View File

@ -32,6 +32,8 @@ extern void EmitSingleChar(StringBuilder &builder, std::string_view param, char3
extern void EmitPlural(StringBuilder &builder, std::string_view param, char32_t value);
extern void EmitGender(StringBuilder &builder, std::string_view param, char32_t value);
/* clang-format off */
static const CmdStruct _cmd_structs[] = {
/* Font size */
{"NORMAL_FONT", EmitSingleChar, SCC_NORMALFONT, 0, std::nullopt, {}},
@ -157,6 +159,8 @@ static const CmdStruct _cmd_structs[] = {
{"PDF", EmitSingleChar, CHAR_TD_PDF, 0, std::nullopt, {CmdFlag::DontCount}},
};
/* clang-format on */
/** Description of a plural form */
struct PluralForm {
size_t plural_count; ///< The number of plural forms
@ -167,6 +171,8 @@ struct PluralForm {
/** The maximum number of plurals. */
static const size_t MAX_PLURALS = 5;
/* clang-format off */
/** All plural forms used */
static const PluralForm _plural_forms[] = {
{ 2, "Two forms: special case for 1.", "\"1\" \"other\"" },
@ -214,3 +220,5 @@ static const char * const _pragmas[][4] = {
{ "gender", "tag", "", "List of genders" },
{ "case", "tac", "", "List of cases" },
};
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file string_colours.h The colour translation of GRF's strings. */
/* clang-format off */
/** Colour mapping for #TextColour. */
static const uint8_t _string_colourmap[17] = {
150, // TC_BLUE
@ -27,3 +29,5 @@ static const uint8_t _string_colourmap[17] = {
133, // TC_DARK_BLUE
1, // TC_BLACK
};
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file town_land.h Sprites to use and how to display them for town tiles. */
/* clang-format off */
/**
* Writes the data into the Town Tile Drawing Struct
* @param s1 The first sprite of the building, mostly the ground sprite
@ -2277,3 +2279,5 @@ extern const HouseSpec _original_house_specs[] = {
/** Make sure we have the right number of elements: one entry for each house */
static_assert(lengthof(_original_house_specs) == NEW_HOUSE_OFFSET);
/* clang-format on */

View File

@ -9,6 +9,8 @@
#include "../core/enum_type.hpp"
/* clang-format off */
static const char * const _name_original_english_1[] = {
"Great ",
"Little ",
@ -3312,3 +3314,5 @@ static const char * const _name_catalan_river1[] = {
" de Segre",
" de Francol\u00ed",
};
/* clang-format on */

View File

@ -7,8 +7,9 @@
/** @file track_land.h Sprites to use and how to display them for train depot tiles. */
#define TILE_SEQ_LINE(img, dx, dy, sx, sy) { dx, dy, 0, sx, sy, 23, {img, PAL_NONE} },
/* clang-format off */
#define TILE_SEQ_LINE(img, dx, dy, sx, sy) { dx, dy, 0, sx, sy, 23, {img, PAL_NONE} },
static const DrawTileSeqStruct _depot_gfx_NE[] = {
TILE_SEQ_LINE(SPR_RAIL_DEPOT_NE | (1 << PALETTE_MODIFIER_COLOUR), 2, 13, 13, 1)
@ -43,3 +44,5 @@ static const DrawTileSpriteSpan _depot_invisible_gfx_table[] = {
};
#undef TILE_SEQ_LINE
/* clang-format on */

View File

@ -7,6 +7,8 @@
/** @file train_sprites.h Sprites to use for trains. */
/* clang-format off */
static const SpriteID _engine_sprite_base[] = {
0x0B59, 0x0B61, 0x0B69, 0x0BE1, 0x0B71, 0x0B75, 0x0B7D, 0x0B7D,
0x0B85, 0x0B85, 0x0B8D, 0x0B8D, 0x0BC9, 0x0BD1, 0x0BD9, 0x0BE9,
@ -66,3 +68,5 @@ static const uint8_t _wagon_full_adder[] = {
static_assert(lengthof(_engine_sprite_base) == lengthof(_engine_sprite_and));
static_assert(lengthof(_engine_sprite_base) == lengthof(_engine_sprite_add));
static_assert(lengthof(_engine_sprite_base) == lengthof(_wagon_full_adder));
/* clang-format on */

View File

@ -10,6 +10,8 @@
#ifndef TREE_LAND_H
#define TREE_LAND_H
/* clang-format off */
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};
@ -225,4 +227,6 @@ static const PalSpriteID _tree_layout_sprite[164 + (79 - 48 + 1)][4] = {
{ { 0x716, PAL_NONE }, { 0x701, PAL_NONE }, { 0x6fa, PAL_NONE }, { 0x716, PAL_NONE } }, // 31
};
/* clang-format on */
#endif /* TREE_LAND_H */

View File

@ -7,6 +7,8 @@
/** @file water_land.h Sprites to use and how to display them for water tiles (depots/locks). */
/* clang-format off */
/**
* Constructor macro for an image without a palette in a DrawTileSeqStruct array.
* @param dx Offset in x direction
@ -140,3 +142,5 @@ static const DrawTileSpriteSpan _lock_display_data[][DIAGDIR_END] = {
#undef TILE_SEQ_LINE
#undef TILE_SPRITE_LINE
/* clang-format on */