|
OpenTTD
|
Road vehicle states. More...
#include "ground_vehicle.hpp"#include "engine_base.h"#include "cargotype.h"#include "track_func.h"#include "road_type.h"#include "newgrf_engine.h"Go to the source code of this file.
Data Structures | |
| struct | RoadVehicle |
| Buses, trucks and trams belong to this class. More... | |
Macros | |
| #define | FOR_ALL_ROADVEHICLES(var) FOR_ALL_VEHICLES_OF_TYPE(RoadVehicle, var) |
Enumerations | |
| enum | RoadVehicleStates { RVSB_IN_DEPOT = 0xFE, RVSB_WORMHOLE = 0xFF, RVS_USING_SECOND_BAY = 1, RVS_ENTERED_STOP = 2, RVS_DRIVE_SIDE = 4, RVS_IN_ROAD_STOP = 5, RVS_IN_DT_ROAD_STOP = 6, RVSB_IN_ROAD_STOP = 1 << RVS_IN_ROAD_STOP, RVSB_IN_ROAD_STOP_END = RVSB_IN_ROAD_STOP + TRACKDIR_END, RVSB_IN_DT_ROAD_STOP = 1 << RVS_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END = RVSB_IN_DT_ROAD_STOP + TRACKDIR_END, RVSB_DRIVE_SIDE = 1 << RVS_DRIVE_SIDE, RVSB_TRACKDIR_MASK = 0x0F, RVSB_ROAD_STOP_TRACKDIR_MASK = 0x09 } |
| Road vehicle states. More... | |
Functions | |
| void | RoadVehUpdateCache (RoadVehicle *v, bool same_length=false) |
| Update the cache of a road vehicle. | |
| void | GetRoadVehSpriteSize (EngineID engine, uint &width, uint &height, int &xoffs, int &yoffs, EngineImageType image_type) |
| Get the size of the sprite of a road vehicle sprite heading west (used for lists). | |
Variables | |
| static const uint | RDE_NEXT_TILE = 0x80 |
| State information about the Road Vehicle controller. | |
| static const uint | RDE_TURNED = 0x40 |
| We just finished turning. | |
| static const uint | RVC_DEFAULT_START_FRAME = 0 |
| static const uint | RVC_TURN_AROUND_START_FRAME = 1 |
| static const uint | RVC_DEPOT_START_FRAME = 6 |
| static const uint | RVC_START_FRAME_AFTER_LONG_TRAM = 21 |
| static const uint | RVC_TURN_AROUND_START_FRAME_SHORT_TRAM = 16 |
| static const uint | RVC_DRIVE_THROUGH_STOP_FRAME = 11 |
| static const uint | RVC_DEPOT_STOP_FRAME = 11 |
| static const byte | RV_OVERTAKE_TIMEOUT = 35 |
| The number of ticks a vehicle has for overtaking. | |
Road vehicle states.
Definition in file roadveh.h.
| enum RoadVehicleStates |
Road vehicle states.
| void GetRoadVehSpriteSize | ( | EngineID | engine, |
| uint & | width, | ||
| uint & | height, | ||
| int & | xoffs, | ||
| int & | yoffs, | ||
| EngineImageType | image_type | ||
| ) |
Get the size of the sprite of a road vehicle sprite heading west (used for lists).
| engine | The engine to get the sprite from. | |
| [out] | width | The width of the sprite. |
| [out] | height | The height of the sprite. |
| [out] | xoffs | Number of pixels to shift the sprite to the right. |
| [out] | yoffs | Number of pixels to shift the sprite downwards. |
| image_type | Context the sprite is used in. |
Definition at line 180 of file roadveh_cmd.cpp.
References Sprite::height, ST_NORMAL, UnScaleGUI(), Sprite::width, Sprite::x_offs, and Sprite::y_offs.
Referenced by EnginePreviewWindow::UpdateWidgetSize().
| void RoadVehUpdateCache | ( | RoadVehicle * | v, |
| bool | same_length | ||
| ) |
Update the cache of a road vehicle.
| v | Road vehicle needing an update of its cache. |
| same_length | should length of vehicles stay the same? |
Definition at line 223 of file roadveh_cmd.cpp.
References VehicleCache::cached_max_speed, GroundVehicleCache::cached_total_length, Vehicle::engine_type, GroundVehicle< T, Type >::gcache, GetRoadVehLength(), INVALID_ENGINE, Vehicle::InvalidateNewGRFCacheOfChain(), Vehicle::IsFrontEngine(), SpecializedVehicle< T, Type >::Next(), PROP_ROADVEH_CARGO_AGE_PERIOD, PROP_ROADVEH_SPEED, BaseVehicle::type, Vehicle::vcache, VEH_ROAD, and VehicleLengthChanged().
Referenced by AfterLoadVehicles(), CheckCaches(), CmdBuildRoadVehicle(), and CmdRefitVehicle().
|
static |
1.8.1.2