|
OpenTTD Source
14.0-beta1
|
#include "newgrf_animation_type.h"#include "newgrf_spritegroup.h"#include "newgrf_class.h"#include "newgrf_commons.h"#include "newgrf_town.h"#include "road.h"Go to the source code of this file.
Data Structures | |
| struct | RoadStopScopeResolver |
| Scope resolver for road stops. More... | |
| struct | RoadStopResolverObject |
| Road stop resolver. More... | |
| struct | RoadStopSpec |
| Road stop specification. More... | |
Typedefs | |
| typedef NewGRFClass< RoadStopSpec, RoadStopClassID, ROADSTOP_CLASS_MAX > | RoadStopClass |
Enumerations | |
| enum | RoadStopClassID : byte { ROADSTOP_CLASS_BEGIN = 0, ROADSTOP_CLASS_DFLT = 0, ROADSTOP_CLASS_WAYP, ROADSTOP_CLASS_MAX = 255 } |
| enum | RoadStopRandomTrigger { RSRT_NEW_CARGO, RSRT_CARGO_TAKEN, RSRT_VEH_ARRIVES, RSRT_VEH_DEPARTS, RSRT_VEH_LOADS } |
| enum | RoadStopAvailabilityType : byte { ROADSTOPTYPE_PASSENGER, ROADSTOPTYPE_FREIGHT, ROADSTOPTYPE_ALL, ROADSTOPTYPE_END } |
| Various different options for availability, restricting the roadstop to be only for busses or for trucks. More... | |
| enum | RoadStopDrawMode : byte { ROADSTOP_DRAW_MODE_NONE = 0, ROADSTOP_DRAW_MODE_ROAD = 1 << 0, ROADSTOP_DRAW_MODE_OVERLAY = 1 << 1 } |
| Different draw modes to disallow rendering of some parts of the stop or road. More... | |
| enum | RoadStopSpecFlags { RSF_CB141_RANDOM_BITS = 0, RSF_NO_CATENARY = 2, RSF_DRIVE_THROUGH_ONLY = 3, RSF_NO_AUTO_ROAD_CONNECTION = 4, RSF_BUILD_MENU_ROAD_ONLY = 5, RSF_BUILD_MENU_TRAM_ONLY = 6 } |
Functions | |
| void | DrawRoadStopTile (int x, int y, RoadType roadtype, const RoadStopSpec *spec, StationType type, int view) |
| Draw representation of a road stop tile for GUI purposes. More... | |
| uint16_t | GetRoadStopCallback (CallbackID callback, uint32_t param1, uint32_t param2, const RoadStopSpec *roadstopspec, BaseStation *st, TileIndex tile, RoadType roadtype, StationType type, uint8_t view) |
| void | AnimateRoadStopTile (TileIndex tile) |
| uint8_t | GetRoadStopTileAnimationSpeed (TileIndex tile) |
| void | TriggerRoadStopAnimation (BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type=INVALID_CARGO) |
| void | TriggerRoadStopRandomisation (Station *st, TileIndex tile, RoadStopRandomTrigger trigger, CargoID cargo_type=INVALID_CARGO) |
| Trigger road stop randomisation. More... | |
| bool | GetIfNewStopsByType (RoadStopType rs, RoadType roadtype) |
| Checks if there's any new stations by a specific RoadStopType. More... | |
| bool | GetIfClassHasNewStopsByType (RoadStopClass *roadstopclass, RoadStopType rs, RoadType roadtype) |
| Checks if the given RoadStopClass has any specs assigned to it, compatible with the given RoadStopType. More... | |
| bool | GetIfStopIsForType (const RoadStopSpec *roadstopspec, RoadStopType rs, RoadType roadtype) |
| Checks if the given RoadStopSpec is compatible with the given RoadStopType. More... | |
| uint | GetCountOfCompatibleStopsByType (RoadStopClass *roadstopclass, RoadStopType rs) |
| const RoadStopSpec * | GetRoadStopSpec (TileIndex t) |
| int | AllocateSpecToRoadStop (const RoadStopSpec *statspec, BaseStation *st, bool exec) |
| void | DeallocateSpecFromRoadStop (BaseStation *st, byte specindex) |
| void | RoadStopUpdateCachedTriggers (BaseStation *st) |
| Update the cached animation trigger bitmask for a station. More... | |
Variables | |
| static const int | NUM_ROADSTOPS_PER_GRF = UINT16_MAX - 1 |
| The maximum amount of roadstops a single GRF is allowed to add. | |
NewGRF definitions and structures for road stops.
Definition in file newgrf_roadstop.h.
| enum RoadStopAvailabilityType : byte |
Various different options for availability, restricting the roadstop to be only for busses or for trucks.
| Enumerator | |
|---|---|
| ROADSTOPTYPE_PASSENGER | This RoadStop is for passenger (bus) stops. |
| ROADSTOPTYPE_FREIGHT | This RoadStop is for freight (truck) stops. |
| ROADSTOPTYPE_ALL | This RoadStop is for both types of station road stops. |
Definition at line 46 of file newgrf_roadstop.h.
| enum RoadStopClassID : byte |
| Enumerator | |
|---|---|
| ROADSTOP_CLASS_BEGIN | The lowest valid value. |
| ROADSTOP_CLASS_DFLT | Default road stop class. |
| ROADSTOP_CLASS_WAYP | Waypoint class (unimplemented: this is reserved for future use with road waypoints). |
| ROADSTOP_CLASS_MAX | Maximum number of classes. |
Definition at line 25 of file newgrf_roadstop.h.
| enum RoadStopDrawMode : byte |
Different draw modes to disallow rendering of some parts of the stop or road.
| Enumerator | |
|---|---|
| ROADSTOP_DRAW_MODE_ROAD | Bay stops: Draw the road itself. |
| ROADSTOP_DRAW_MODE_OVERLAY | Drive-through stops: Draw the road overlay, e.g. pavement. |
Definition at line 58 of file newgrf_roadstop.h.
Definition at line 34 of file newgrf_roadstop.h.
| enum RoadStopSpecFlags |
Definition at line 65 of file newgrf_roadstop.h.
| void DrawRoadStopTile | ( | int | x, |
| int | y, | ||
| RoadType | roadtype, | ||
| const RoadStopSpec * | spec, | ||
| StationType | type, | ||
| int | view | ||
| ) |
Draw representation of a road stop tile for GUI purposes.
| x | position x of image. |
| y | position y of image. |
| image | an int offset for the sprite. |
| roadtype | the RoadType of the underlying road. |
| spec | the RoadStop's spec. |
Definition at line 277 of file newgrf_roadstop.cpp.
| bool GetIfClassHasNewStopsByType | ( | RoadStopClass * | roadstopclass, |
| RoadStopType | rs, | ||
| RoadType | roadtype | ||
| ) |
Checks if the given RoadStopClass has any specs assigned to it, compatible with the given RoadStopType.
| roadstopclass | the RoadStopClass to check. |
| rs | the RoadStopType to check. |
| roadtype | the RoadType to check. |
Definition at line 484 of file newgrf_roadstop.cpp.
References GetIfStopIsForType(), and NewGRFClass< Tspec, Tid, Tmax >::GetSpecCount().
Referenced by GetIfNewStopsByType().
| bool GetIfNewStopsByType | ( | RoadStopType | rs, |
| RoadType | roadtype | ||
| ) |
Checks if there's any new stations by a specific RoadStopType.
| rs | the RoadStopType to check. |
| roadtype | the RoadType to check. |
Definition at line 465 of file newgrf_roadstop.cpp.
References NewGRFClass< Tspec, Tid, Tmax >::Get(), GetIfClassHasNewStopsByType(), ROADSTOP_CLASS_DFLT, and ROADSTOP_CLASS_WAYP.
| bool GetIfStopIsForType | ( | const RoadStopSpec * | roadstopspec, |
| RoadStopType | rs, | ||
| RoadType | roadtype | ||
| ) |
Checks if the given RoadStopSpec is compatible with the given RoadStopType.
| roadstopspec | the RoadStopSpec to check. |
| rs | the RoadStopType to check. |
| roadtype | the RoadType to check. |
Definition at line 499 of file newgrf_roadstop.cpp.
References HasBit(), and RSF_BUILD_MENU_ROAD_ONLY.
Referenced by GetIfClassHasNewStopsByType().
| void RoadStopUpdateCachedTriggers | ( | BaseStation * | st | ) |
Update the cached animation trigger bitmask for a station.
| st | Station to update. |
Definition at line 607 of file newgrf_roadstop.cpp.
References BaseStation::cached_roadstop_anim_triggers, BaseStation::cached_roadstop_cargo_triggers, RoadStopSpec::cargo_triggers, BaseStation::roadstop_speclist, and AnimationInfo::triggers.
| void TriggerRoadStopRandomisation | ( | Station * | st, |
| TileIndex | tile, | ||
| RoadStopRandomTrigger | trigger, | ||
| CargoID | cargo_type | ||
| ) |
Trigger road stop randomisation.
| st | the station being triggered |
| tile | the exact tile of the station that should be triggered |
| trigger | trigger type |
| cargo_type | cargo type causing the trigger |
Definition at line 392 of file newgrf_roadstop.cpp.
References BaseStation::cached_roadstop_cargo_triggers, SpecializedStation< Station, false >::GetByTile(), GetEmptyMask(), HasBit(), IsValidCargoID(), RSRT_CARGO_TAKEN, SetBit(), and BaseStation::waiting_triggers.