Files @ r28403:d4cdcb69255f
Branch filter:

Location: cpp/openttd-patchpack/source/src/vehicle_type.h - annotation

Patric Stout
Fix: race-condition when quitting the game with libcurl (#11688)

There could be a callback in _new_http_callbacks that is not
processed yet. All callbacks in _http_callbacks were cancelled,
but not the ones in _new_http_callbacks
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r8108:1d5bdeea7e20
r8108:1d5bdeea7e20
r8108:1d5bdeea7e20
r8108:1d5bdeea7e20
r8108:1d5bdeea7e20
r8108:1d5bdeea7e20
r8108:1d5bdeea7e20
r17624:f2c5f47dceaa
r27737:728d55b97775
r8108:1d5bdeea7e20
r23008:cfd113ad34d0
r23008:cfd113ad34d0
r23661:3655a2df3316
r23661:3655a2df3316
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r18145:767c15d9debd
r8108:1d5bdeea7e20
r18145:767c15d9debd
r8108:1d5bdeea7e20
r14900:c679fdaeebe6
r8108:1d5bdeea7e20
r8108:1d5bdeea7e20
r11980:193f7a6b6e37
r11980:193f7a6b6e37
r11980:193f7a6b6e37
r11980:193f7a6b6e37
r12109:90df01928018
r12109:90df01928018
r8108:1d5bdeea7e20
r16362:9d8d927a8276
r8144:1432edd15267
r8144:1432edd15267
r23661:3655a2df3316
r8144:1432edd15267
r8144:1432edd15267
r15882:30fbd9be7c68
r8144:1432edd15267
r8551:25fc15391278
r15173:a59afd6301a6
r23476:0c9f98112112
r8551:25fc15391278
r8551:25fc15391278
r8551:25fc15391278
r8551:25fc15391278
r26111:5721922c714f
r26111:5721922c714f
r26111:5721922c714f
r26111:5721922c714f
r26111:5721922c714f
r26111:5721922c714f
r26111:5721922c714f
r8891:a036f0390625
r26111:5721922c714f
r8891:a036f0390625
r17569:79cc833a8f35
r9913:5ef437117969
r17441:1a320fa88183
r17441:1a320fa88183
r17441:1a320fa88183
r14396:0e22f6ee524f
r14396:0e22f6ee524f
r14396:0e22f6ee524f
r14396:0e22f6ee524f
r10901:d21ccd8648fa
r10901:d21ccd8648fa
r18234:0d83ef81cba4
r18234:0d83ef81cba4
r18234:0d83ef81cba4
r18234:0d83ef81cba4
r18234:0d83ef81cba4
r18234:0d83ef81cba4
r18234:0d83ef81cba4
r18234:0d83ef81cba4
r18234:0d83ef81cba4
r18234:0d83ef81cba4
r8108:1d5bdeea7e20
/*
 * 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 vehicle_type.h Types related to vehicles. */

#ifndef VEHICLE_TYPE_H
#define VEHICLE_TYPE_H

#include "core/enum_type.hpp"

/** The type all our vehicle IDs have. */
typedef uint32_t VehicleID;

static const int GROUND_ACCELERATION = 9800; ///< Acceleration due to gravity, 9.8 m/s^2

/** Available vehicle types. It needs to be 8bits, because we save and load it as such */
enum VehicleType : byte {
	VEH_BEGIN,

	VEH_TRAIN = VEH_BEGIN,        ///< %Train vehicle type.
	VEH_ROAD,                     ///< Road vehicle type.
	VEH_SHIP,                     ///< %Ship vehicle type.
	VEH_AIRCRAFT,                 ///< %Aircraft vehicle type.

	VEH_COMPANY_END,              ///< Last company-ownable type.

	VEH_EFFECT = VEH_COMPANY_END, ///< Effect vehicle type (smoke, explosions, sparks, bubbles)
	VEH_DISASTER,                 ///< Disaster vehicle type.

	VEH_END,
	VEH_INVALID = 0xFF,           ///< Non-existing type of vehicle.
};
DECLARE_POSTFIX_INCREMENT(VehicleType)

struct Vehicle;
struct Train;
struct RoadVehicle;
struct Ship;
struct Aircraft;
struct EffectVehicle;
struct DisasterVehicle;

/** Base vehicle class. */
struct BaseVehicle
{
	VehicleType type; ///< Type of vehicle
};

static const VehicleID INVALID_VEHICLE = 0xFFFFF; ///< Constant representing a non-existing vehicle.

/** Pathfinding option states */
enum VehiclePathFinders {
	// Original PathFinder (OPF) used to be 0
	VPF_NPF  = 1, ///< New PathFinder
	VPF_YAPF = 2, ///< Yet Another PathFinder
};

/** Flags for goto depot commands. */
enum class DepotCommand : byte {
	None         = 0,         ///< No special flags.
	Service      = (1U << 0), ///< The vehicle will leave the depot right after arrival (service only)
	MassSend     = (1U << 1), ///< Tells that it's a mass send to depot command (type in VLW flag)
	DontCancel   = (1U << 2), ///< Don't cancel current goto depot command if any
	LocateHangar = (1U << 3), ///< Find another airport if the target one lacks a hangar
};
DECLARE_ENUM_AS_BIT_SET(DepotCommand)

static const uint MAX_LENGTH_VEHICLE_NAME_CHARS = 32; ///< The maximum length of a vehicle name in characters including '\0'

/** The length of a vehicle in tile units. */
static const uint VEHICLE_LENGTH = 8;

/** Vehicle acceleration models. */
enum AccelerationModel {
	AM_ORIGINAL,
	AM_REALISTIC,
};

/** Visualisation contexts of vehicles and engines. */
enum EngineImageType {
	EIT_ON_MAP     = 0x00,  ///< Vehicle drawn in viewport.
	EIT_IN_DEPOT   = 0x10,  ///< Vehicle drawn in depot.
	EIT_IN_DETAILS = 0x11,  ///< Vehicle drawn in vehicle details, refit window, ...
	EIT_IN_LIST    = 0x12,  ///< Vehicle drawn in vehicle list, group list, ...
	EIT_PURCHASE   = 0x20,  ///< Vehicle drawn in purchase list, autoreplace gui, ...
	EIT_PREVIEW    = 0x21,  ///< Vehicle drawn in preview window, news, ...
};

#endif /* VEHICLE_TYPE_H */