equal
deleted
inserted
replaced
59 station_classes[1].spec[0] = NULL; |
59 station_classes[1].spec[0] = NULL; |
60 } |
60 } |
61 |
61 |
62 /** |
62 /** |
63 * Allocate a station class for the given class id. |
63 * Allocate a station class for the given class id. |
64 * @param classid A 32 bit value identifying the class. |
64 * @param cls A 32 bit value identifying the class. |
65 * @return Index into station_classes of allocated class. |
65 * @return Index into station_classes of allocated class. |
66 */ |
66 */ |
67 StationClassID AllocateStationClass(uint32 cls) |
67 StationClassID AllocateStationClass(uint32 cls) |
68 { |
68 { |
69 for (StationClassID i = STAT_CLASS_BEGIN; i < STAT_CLASS_MAX; i++) { |
69 for (StationClassID i = STAT_CLASS_BEGIN; i < STAT_CLASS_MAX; i++) { |
136 return station_classes[sclass].stations; |
136 return station_classes[sclass].stations; |
137 } |
137 } |
138 |
138 |
139 /** |
139 /** |
140 * Tie a station spec to its station class. |
140 * Tie a station spec to its station class. |
141 * @param spec The station spec. |
141 * @param statspec The station spec. |
142 */ |
142 */ |
143 void SetCustomStationSpec(StationSpec *statspec) |
143 void SetCustomStationSpec(StationSpec *statspec) |
144 { |
144 { |
145 StationClass *station_class; |
145 StationClass *station_class; |
146 int i; |
146 int i; |
612 } |
612 } |
613 |
613 |
614 |
614 |
615 /** |
615 /** |
616 * Allocate a StationSpec to a Station. This is called once per build operation. |
616 * Allocate a StationSpec to a Station. This is called once per build operation. |
617 * @param spec StationSpec to allocate. |
617 * @param statspec StationSpec to allocate. |
618 * @param st Station to allocate it to. |
618 * @param st Station to allocate it to. |
619 * @param exec Whether to actually allocate the spec. |
619 * @param exec Whether to actually allocate the spec. |
620 * @return Index within the Station's spec list, or -1 if the allocation failed. |
620 * @return Index within the Station's spec list, or -1 if the allocation failed. |
621 */ |
621 */ |
622 int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec) |
622 int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec) |
693 } |
693 } |
694 } |
694 } |
695 } |
695 } |
696 |
696 |
697 /** Draw representation of a station tile for GUI purposes. |
697 /** Draw representation of a station tile for GUI purposes. |
698 * @param x, y Position of image. |
698 * @param x Position x of image. |
699 * @param dir Direction. |
699 * @param y Position y of image. |
|
700 * @param axis Axis. |
700 * @param railtype Rail type. |
701 * @param railtype Rail type. |
701 * @param sclass, station Type of station. |
702 * @param sclass, station Type of station. |
|
703 * @param station station ID |
702 * @return True if the tile was drawn (allows for fallback to default graphic) |
704 * @return True if the tile was drawn (allows for fallback to default graphic) |
703 */ |
705 */ |
704 bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station) |
706 bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station) |
705 { |
707 { |
706 const StationSpec *statspec; |
708 const StationSpec *statspec; |