Files @ r24755:9b2ef076754d
Branch filter:

Location: cpp/openttd-patchpack/source/src/table/airporttile_ids.h

Michael Lutz
Codechange: Don't use cpp_offsetof in the save/load code.

Many of the member variables that are used in save/load are inside types
that are not standard layout types. Using pointer arithmetics to determine
addresses of members inside types that are not standard layout is generally
undefined behaviour. If we'd use C++17, it is conditionally supported, which means
each compiler may or may not support it. And even then using it for individual
array elements is syntactically not supported the the standard offsetof function.

Unfortunately, the trickery employed for saving linkgraph settings causes quite some
clutter in the settings ini files.
/*
 * 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.
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 */

/** @file airporttile_ids.h Enum of the default airport tiles. */

#ifndef AIRPORTTILE_IDS_H
#define AIRPORTTILE_IDS_H

enum AirportTiles {
	APT_APRON,
	APT_APRON_FENCE_NW,
	APT_APRON_FENCE_SW,
	APT_STAND,
	APT_APRON_W,
	APT_APRON_S,
	APT_APRON_VER_CROSSING_S,
	APT_APRON_HOR_CROSSING_W,
	APT_APRON_VER_CROSSING_N,
	APT_APRON_HOR_CROSSING_E,
	APT_APRON_E,
	APT_ARPON_N,
	APT_APRON_HOR,
	APT_APRON_N_FENCE_SW,
	APT_RUNWAY_1,
	APT_RUNWAY_2,
	APT_RUNWAY_3,
	APT_RUNWAY_4,
	APT_RUNWAY_END_FENCE_SE,
	APT_BUILDING_2,
	APT_TOWER_FENCE_SW,
	APT_ROUND_TERMINAL,
	APT_BUILDING_3,
	APT_BUILDING_1,
	APT_DEPOT_SE,
	APT_STAND_1,
	APT_STAND_PIER_NE,
	APT_PIER_NW_NE,
	APT_PIER,
	APT_EMPTY,
	APT_EMPTY_FENCE_NE,
	APT_RADAR_GRASS_FENCE_SW,
	APT_RADIO_TOWER_FENCE_NE,
	APT_SMALL_BUILDING_3,
	APT_SMALL_BUILDING_2,
	APT_SMALL_BUILDING_1,
	APT_GRASS_FENCE_SW,
	APT_GRASS_2,
	APT_GRASS_1,
	APT_GRASS_FENCE_NE_FLAG,
	APT_RUNWAY_SMALL_NEAR_END,
	APT_RUNWAY_SMALL_MIDDLE,
	APT_RUNWAY_SMALL_FAR_END,
	APT_SMALL_DEPOT_SE,
	APT_HELIPORT,
	APT_RUNWAY_END,
	APT_RUNWAY_5,
	APT_TOWER,
	APT_APRON_FENCE_NE,
	APT_RUNWAY_END_FENCE_NW,
	APT_RUNWAY_FENCE_NW,
	APT_RADAR_FENCE_SW,
	APT_RADAR_FENCE_NE,
	APT_HELIPAD_1,
	APT_HELIPAD_2_FENCE_NW,
	APT_HELIPAD_2,
	APT_APRON_FENCE_NE_SW,
	APT_RUNWAY_END_FENCE_NW_SW,
	APT_RUNWAY_END_FENCE_SE_SW,
	APT_RUNWAY_END_FENCE_NE_NW,
	APT_RUNWAY_END_FENCE_NE_SE,
	APT_HELIPAD_2_FENCE_NE_SE,
	APT_APRON_FENCE_SE_SW,
	APT_LOW_BUILDING_FENCE_N,
	APT_LOW_BUILDING_FENCE_NW,
	APT_APRON_FENCE_SE,
	APT_HELIPAD_3_FENCE_SE_SW,
	APT_HELIPAD_3_FENCE_NW_SW,
	APT_HELIPAD_3_FENCE_NW,
	APT_LOW_BUILDING,
	APT_APRON_FENCE_NE_SE,
	APT_APRON_HALF_EAST,
	APT_APRON_HALF_WEST,
	APT_GRASS_FENCE_NE_FLAG_2,
};

#endif /* AIRPORTTILE_IDS_H */