Header file for NewGRF stations. More...
#include "newgrf_animation_type.h"#include "newgrf_callbacks.h"#include "newgrf_class.h"#include "newgrf_commons.h"#include "sprite.h"#include "cargo_type.h"#include "station_type.h"#include "rail_type.h"Go to the source code of this file.
Data Structures | |
| struct | EnumPropsT< StationClassID > |
| struct | StationSpec |
| Station specification. More... | |
Typedefs | |
|
typedef SimpleTinyEnumT < StationClassID, byte > | StationClassIDByte |
| typedef byte * | StationLayout |
| typedef NewGRFClass < StationSpec, StationClassID, STAT_CLASS_MAX > | StationClass |
| Struct containing information relating to station classes. | |
Enumerations | |
| enum | StationClassID { STAT_CLASS_BEGIN = 0, STAT_CLASS_DFLT = 0, STAT_CLASS_WAYP, STAT_CLASS_MAX = 32 } |
| enum | StationSpecFlags { SSF_SEPARATE_GROUND, SSF_DIV_BY_STATION_SIZE, SSF_CB141_RANDOM_BITS, SSF_CUSTOM_FOUNDATIONS, SSF_EXTENDED_FOUNDATIONS } |
Allow incrementing of StationClassID variables. More... | |
Functions | |
| const StationSpec * | GetStationSpec (TileIndex t) |
| uint32 | GetPlatformInfo (Axis axis, byte tile, int platforms, int length, int x, int y, bool centred) |
| Evaluate a tile's position within a station, and return the result in a bit-stuffed format. | |
| SpriteID | GetCustomStationRelocation (const StationSpec *statspec, const BaseStation *st, TileIndex tile) |
| SpriteID | GetCustomStationGroundRelocation (const StationSpec *statspec, const BaseStation *st, TileIndex tile) |
| SpriteID | GetCustomStationFoundationRelocation (const StationSpec *statspec, const BaseStation *st, TileIndex tile) |
| uint16 | GetStationCallback (CallbackID callback, uint32 param1, uint32 param2, const StationSpec *statspec, const BaseStation *st, TileIndex tile) |
| int | AllocateSpecToStation (const StationSpec *statspec, BaseStation *st, bool exec) |
| Allocate a StationSpec to a Station. | |
| void | DeallocateSpecFromStation (BaseStation *st, byte specindex) |
| Deallocate a StationSpec from a Station. | |
| bool | DrawStationTile (int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station) |
| Draw representation of a station tile for GUI purposes. | |
| void | AnimateStationTile (TileIndex tile) |
| void | TriggerStationAnimation (const BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type=CT_INVALID) |
| void | StationUpdateAnimTriggers (BaseStation *st) |
| Update the cached animation trigger bitmask for a station. | |
Header file for NewGRF stations.
Definition in file newgrf_station.h.
| typedef NewGRFClass<StationSpec, StationClassID, STAT_CLASS_MAX> StationClass |
Struct containing information relating to station classes.
Definition at line 107 of file newgrf_station.h.
| enum StationClassID |
| STAT_CLASS_BEGIN |
the lowest valid value |
| STAT_CLASS_DFLT |
Default station class. |
| STAT_CLASS_WAYP |
Waypoint class. |
| STAT_CLASS_MAX |
Maximum number of classes. |
Definition at line 24 of file newgrf_station.h.
| enum StationSpecFlags |
Allow incrementing of StationClassID variables.
Definition at line 36 of file newgrf_station.h.
| int AllocateSpecToStation | ( | const StationSpec * | statspec, | |
| BaseStation * | st, | |||
| bool | exec | |||
| ) |
Allocate a StationSpec to a Station.
This is called once per build operation.
| statspec | StationSpec to allocate. | |
| st | Station to allocate it to. | |
| exec | Whether to actually allocate the spec. |
Definition at line 645 of file newgrf_station.cpp.
References StationSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, StationSpecList::grfid, GRFFilePropsBase< Tcnt >::local_id, StationSpecList::localidx, BaseStation::num_specs, ReallocT(), and BaseStation::speclist.
Referenced by CmdBuildRailStation(), CmdBuildRailWaypoint(), and MoveWaypointsToBaseStations().
| void DeallocateSpecFromStation | ( | BaseStation * | st, | |
| byte | specindex | |||
| ) |
Deallocate a StationSpec from a Station.
Called when removing a single station tile.
| st | Station to work with. | |
| specindex | Index of the custom station within the Station's spec list. |
Definition at line 696 of file newgrf_station.cpp.
References BaseStation::cached_anim_triggers, GetCustomStationSpecIndex(), StationSpecList::grfid, INVALID_TILE, StationSpecList::localidx, BaseStation::num_specs, ReallocT(), BaseStation::speclist, StationUpdateAnimTriggers(), TILE_AREA_LOOP, and BaseStation::TileBelongsToRailStation().
Referenced by CmdBuildRailStation(), CmdBuildRailWaypoint(), and RemoveFromRailBaseStation().
| bool DrawStationTile | ( | int | x, | |
| int | y, | |||
| RailType | railtype, | |||
| Axis | axis, | |||
| StationClassID | sclass, | |||
| uint | station | |||
| ) |
Draw representation of a station tile for GUI purposes.
| x | Position x of image. | |
| y | Position y of image. | |
| axis | Axis. | |
| railtype | Rail type. | |
| sclass,station | Type of station. | |
| station | station ID |
Definition at line 742 of file newgrf_station.cpp.
References _local_company, CALLBACK_FAILED, StationSpec::callback_mask, CBID_STATION_SPRITE_LAYOUT, CBM_STATION_SPRITE_LAYOUT, DrawRailTileSeqInGUI(), DrawSprite(), RailtypeInfo::fallback_railtype, GetRailTypeInfo(), RailtypeInfo::GetRailtypeSpriteOffset(), DrawTileSprites::ground, GroundSpritePaletteTransform(), HasBit(), INVALID_TILE, PalSpriteID::pal, StationSpec::renderdata, PalSpriteID::sprite, SPRITE_MODIFIER_CUSTOM_SPRITE, and StationSpec::tiles.
Referenced by DrawWaypointSprite(), and BuildRailStationWindow::DrawWidget().
| uint32 GetPlatformInfo | ( | Axis | axis, | |
| byte | tile, | |||
| int | platforms, | |||
| int | length, | |||
| int | x, | |||
| int | y, | |||
| bool | centred | |||
| ) |
Evaluate a tile's position within a station, and return the result in a bit-stuffed format.
if not centered: .TNLcCpP, if centered: .TNL..CP
if centered, C/P start from the centre and c/p are not available.
Definition at line 104 of file newgrf_station.cpp.
References AXIS_X, Clamp(), min(), SB(), and Swap().
Referenced by CmdBuildRailStation().
| void StationUpdateAnimTriggers | ( | BaseStation * | st | ) |
Update the cached animation trigger bitmask for a station.
| st | Station to update. |
Definition at line 876 of file newgrf_station.cpp.
References BaseStation::cached_anim_triggers, BaseStation::num_specs, BaseStation::speclist, and AnimationInfo::triggers.
Referenced by DeallocateSpecFromStation().
1.7.1