33 #include "table/strings.h"
65 if (cur_dist < thres) {
115 if (*waypoint == INVALID_STATION) {
117 }
else if (*waypoint != wp) {
128 if (ret.
Failed())
return ret;
164 Axis axis = Extract<Axis, 4, 1>(p1);
165 byte width =
GB(p1, 8, 8);
166 byte height =
GB(p1, 16, 8);
167 bool adjacent =
HasBit(p1, 24);
170 byte spec_index =
GB(p2, 8, 8);
171 StationID station_to_join =
GB(p2, 16, 16);
178 byte count = axis ==
AXIS_X ? height : width;
183 bool reuse = (station_to_join != NEW_STATION);
184 if (!reuse) station_to_join = INVALID_STATION;
185 bool distant_join = (station_to_join != INVALID_STATION);
190 StationID est = INVALID_STATION;
194 for (
int i = 0; i < count; i++) {
195 TileIndex tile = start_tile + i * offset;
197 if (ret.
Failed())
return ret;
203 if (ret.
Failed())
return ret;
206 TileIndex center_tile = start_tile + (count / 2) * offset;
216 if (ret.
Failed())
return ret;
219 CommandCost ret = wp->
rect.BeforeAddRect(start_tile, width, height, StationRect::ADD_TEST);
220 if (ret.
Failed())
return ret;
235 wp->
rect.BeforeAddRect(start_tile, width, height, StationRect::ADD_TRY);
248 byte *layout_ptr =
AllocaM(byte, count);
251 memset(layout_ptr, 0, count);
259 for (
int i = 0; i < count; i++) {
260 TileIndex tile = start_tile + i * offset;
303 if (ret.
Failed())
return ret;
315 wp->
rect.BeforeAddTile(tile, StationRect::ADD_TRY);
351 if (!(flags & DC_BANKRUPT)) {
353 if (ret.
Failed())
return ret;
366 wp->
rect.AfterRemoveTile(wp, tile);
385 if (wp->
name != NULL && strcmp(wp->
name, name) == 0)
return false;
407 if (ret.
Failed())
return ret;