Update to 14.0-beta1

This commit is contained in:
dP
2024-02-04 02:18:17 +05:30
parent 79037e2c65
commit 33ef333b57
1325 changed files with 138465 additions and 70987 deletions

View File

@@ -15,6 +15,7 @@
#include "cargo_type.h"
#include "track_type.h"
#include "tile_map.h"
#include "timer/timer_game_calendar.h"
/** The returned bits of VehicleEnterTile. */
enum VehicleEnterTileStatus {
@@ -40,8 +41,8 @@ DECLARE_ENUM_AS_BIT_SET(VehicleEnterTileStatus)
/** Tile information, used while rendering the tile */
struct TileInfo {
uint x; ///< X position of the tile in unit coordinates
uint y; ///< Y position of the tile in unit coordinates
int x; ///< X position of the tile in unit coordinates
int y; ///< Y position of the tile in unit coordinates
Slope tileh; ///< Slope of the tile
TileIndex tile; ///< Tile index
int z; ///< Height
@@ -50,22 +51,22 @@ struct TileInfo {
/** Tile description for the 'land area information' tool */
struct TileDesc {
StringID str; ///< Description of the tile
uint64_t dparam; ///< Parameter of the \a str string
Owner owner[4]; ///< Name of the owner(s)
StringID owner_type[4]; ///< Type of each owner
Date build_date; ///< Date of construction of tile contents
TimerGameCalendar::Date build_date; ///< Date of construction of tile contents
StringID station_class; ///< Class of station
StringID station_name; ///< Type of station within the class
StringID airport_class; ///< Name of the airport class
StringID airport_name; ///< Name of the airport
StringID airport_tile_name; ///< Name of the airport tile
const char *grf; ///< newGRF used for the tile contents
uint64 dparam[2]; ///< Parameters of the \a str string
StringID railtype; ///< Type of rail on the tile.
uint16 rail_speed; ///< Speed limit of rail (bridges and track)
uint16_t rail_speed; ///< Speed limit of rail (bridges and track)
StringID roadtype; ///< Type of road on the tile.
uint16 road_speed; ///< Speed limit of road (bridges and track)
uint16_t road_speed; ///< Speed limit of road (bridges and track)
StringID tramtype; ///< Type of tram on the tile.
uint16 tram_speed; ///< Speed limit of tram (bridges and track)
uint16_t tram_speed; ///< Speed limit of tram (bridges and track)
};
/**
@@ -73,7 +74,19 @@ struct TileDesc {
* @param ti Information about the tile to draw
*/
typedef void DrawTileProc(TileInfo *ti);
typedef int GetSlopeZProc(TileIndex tile, uint x, uint y);
/**
* Tile callback function signature for obtaining the world \c Z coordinate of a given
* point of a tile.
*
* @param tile The queries tile for the Z coordinate.
* @param x World X coordinate in tile "units".
* @param y World Y coordinate in tile "units".
* @param ground_vehicle Whether to get the Z coordinate of the ground vehicle, or the ground.
* @return World Z coordinate at tile ground (vehicle) level, including slopes and foundations.
* @see GetSlopePixelZ
*/
typedef int GetSlopeZProc(TileIndex tile, uint x, uint y, bool ground_vehicle);
typedef CommandCost ClearTileProc(TileIndex tile, DoCommandFlag flags);
/**
@@ -166,7 +179,7 @@ VehicleEnterTileStatus VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y
void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner);
void GetTileDesc(TileIndex tile, TileDesc *td);
static inline void AddAcceptedCargo(TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted)
inline void AddAcceptedCargo(TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted)
{
AddAcceptedCargoProc *proc = _tile_type_procs[GetTileType(tile)]->add_accepted_cargo_proc;
if (proc == nullptr) return;
@@ -174,21 +187,21 @@ static inline void AddAcceptedCargo(TileIndex tile, CargoArray &acceptance, Carg
proc(tile, acceptance, always_accepted == nullptr ? &dummy : always_accepted);
}
static inline void AddProducedCargo(TileIndex tile, CargoArray &produced)
inline void AddProducedCargo(TileIndex tile, CargoArray &produced)
{
AddProducedCargoProc *proc = _tile_type_procs[GetTileType(tile)]->add_produced_cargo_proc;
if (proc == nullptr) return;
proc(tile, produced);
}
static inline void AnimateTile(TileIndex tile)
inline void AnimateTile(TileIndex tile)
{
AnimateTileProc *proc = _tile_type_procs[GetTileType(tile)]->animate_tile_proc;
assert(proc != nullptr);
proc(tile);
}
static inline bool ClickTile(TileIndex tile)
inline bool ClickTile(TileIndex tile)
{
ClickTileProc *proc = _tile_type_procs[GetTileType(tile)]->click_tile_proc;
if (proc == nullptr) return false;