Merge branch 'master' into jgrpp

Remove 'byte' typedef
This commit is contained in:
Jonathan G Rennison
2024-05-07 17:21:50 +01:00
376 changed files with 2220 additions and 2152 deletions

View File

@@ -19,7 +19,7 @@
#include "tilearea_type.h"
/** Copy from station_map.h */
typedef byte StationGfx;
typedef uint8_t StationGfx;
/** Tile-offset / AirportTileID pair. */
struct AirportTileTable {
@@ -91,7 +91,7 @@ enum TTDPAirportType {
struct HangarTileTable {
TileIndexDiffC ti; ///< Tile offset from the top-most airport tile.
Direction dir; ///< Direction of the exit.
byte hangar_num; ///< The hangar to which this tile belongs.
uint8_t hangar_num; ///< The hangar to which this tile belongs.
};
/**
@@ -101,13 +101,13 @@ struct AirportSpec {
const struct AirportFTAClass *fsm; ///< the finite statemachine for the default airports
const AirportTileTable * const *table; ///< list of the tiles composing the airport
const Direction *rotation; ///< the rotation of each tiletable
byte num_table; ///< number of elements in the table
uint8_t num_table; ///< number of elements in the table
const HangarTileTable *depot_table; ///< gives the position of the depots on the airports
byte nof_depots; ///< the number of hangar tiles in this airport
byte size_x; ///< size of airport in x direction
byte size_y; ///< size of airport in y direction
byte noise_level; ///< noise that this airport generates
byte catchment; ///< catchment area of this airport
uint8_t nof_depots; ///< the number of hangar tiles in this airport
uint8_t size_x; ///< size of airport in x direction
uint8_t size_y; ///< size of airport in y direction
uint8_t noise_level; ///< noise that this airport generates
uint8_t catchment; ///< catchment area of this airport
CalTime::Year min_year; ///< first year the airport is available
CalTime::Year max_year; ///< last year the airport is available
StringID name; ///< name of this airport
@@ -119,19 +119,19 @@ struct AirportSpec {
bool enabled; ///< Entity still available (by default true). Newgrf can disable it, though.
struct GRFFileProps grf_prop; ///< Properties related to the grf file.
static const AirportSpec *Get(byte type);
static AirportSpec *GetWithoutOverride(byte type);
static const AirportSpec *Get(uint8_t type);
static AirportSpec *GetWithoutOverride(uint8_t type);
bool IsAvailable() const;
bool IsWithinMapBounds(byte table, TileIndex index) const;
bool IsWithinMapBounds(uint8_t table, TileIndex index) const;
static void ResetAirports();
/** Get the index of this spec. */
byte GetIndex() const
uint8_t GetIndex() const
{
assert(this >= specs && this < endof(specs));
return (byte)(this - specs);
return (uint8_t)(this - specs);
}
static const AirportSpec dummy; ///< The dummy airport.
@@ -148,8 +148,8 @@ void BindAirportSpecs();
/** Resolver for the airport scope. */
struct AirportScopeResolver : public ScopeResolver {
struct Station *st; ///< Station of the airport for which the callback is run, or \c nullptr for build gui.
byte airport_id; ///< Type of airport for which the callback is run.
byte layout; ///< Layout of the airport to build.
uint8_t airport_id; ///< Type of airport for which the callback is run.
uint8_t layout; ///< Layout of the airport to build.
TileIndex tile; ///< Tile for the callback, only valid for airporttile callbacks.
/**
@@ -160,7 +160,7 @@ struct AirportScopeResolver : public ScopeResolver {
* @param airport_id Type of airport for which the callback is run.
* @param layout Layout of the airport to build.
*/
AirportScopeResolver(ResolverObject &ro, TileIndex tile, Station *st, byte airport_id, byte layout)
AirportScopeResolver(ResolverObject &ro, TileIndex tile, Station *st, uint8_t airport_id, uint8_t layout)
: ScopeResolver(ro), st(st), airport_id(airport_id), layout(layout), tile(tile)
{
}
@@ -176,7 +176,7 @@ struct AirportResolverObject : public ResolverObject {
AirportScopeResolver airport_scope;
std::unique_ptr<TownScopeResolver> town_scope; ///< The town scope resolver (created on the first call).
AirportResolverObject(TileIndex tile, Station *st, byte airport_id, byte layout,
AirportResolverObject(TileIndex tile, Station *st, uint8_t airport_id, uint8_t layout,
CallbackID callback = CBID_NO_CALLBACK, uint32_t callback_param1 = 0, uint32_t callback_param2 = 0);
TownScopeResolver *GetTown();
@@ -199,6 +199,6 @@ struct AirportResolverObject : public ResolverObject {
uint32_t GetDebugID() const override;
};
StringID GetAirportTextCallback(const AirportSpec *as, byte layout, uint16_t callback);
StringID GetAirportTextCallback(const AirportSpec *as, uint8_t layout, uint16_t callback);
#endif /* NEWGRF_AIRPORT_H */