mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
6 Commits
479cf68b79
...
390ddf2668
Author | SHA1 | Date |
---|---|---|
|
390ddf2668 | |
|
614a01907a | |
|
f51067f9f5 | |
|
8031d68d01 | |
|
7df9426000 | |
|
0b44deedd0 |
|
@ -110,7 +110,7 @@ struct Aircraft final : public SpecializedVehicle<Aircraft, VEH_AIRCRAFT> {
|
||||||
uint Crash(bool flooded = false) override;
|
uint Crash(bool flooded = false) override;
|
||||||
TileIndex GetOrderStationLocation(StationID station) override;
|
TileIndex GetOrderStationLocation(StationID station) override;
|
||||||
TileIndex GetCargoTile() const override { return this->First()->tile; }
|
TileIndex GetCargoTile() const override { return this->First()->tile; }
|
||||||
ClosestDepot FindClosestDepot() override;
|
ClosestDepot FindClosestDepot(bool may_reverse = false) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the aircraft type is a normal flying device; eg
|
* Check if the aircraft type is a normal flying device; eg
|
||||||
|
|
|
@ -393,7 +393,7 @@ CommandCost CmdBuildAircraft(DoCommandFlags flags, TileIndex tile, const Engine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ClosestDepot Aircraft::FindClosestDepot()
|
ClosestDepot Aircraft::FindClosestDepot([[maybe_unused]] bool may_reverse)
|
||||||
{
|
{
|
||||||
const Station *st = GetTargetAirportIfValid(this);
|
const Station *st = GetTargetAirportIfValid(this);
|
||||||
/* If the station is not a valid airport or if it has no hangars */
|
/* If the station is not a valid airport or if it has no hangars */
|
||||||
|
|
|
@ -509,7 +509,7 @@ public:
|
||||||
this->SetWidgetLoweredState(WID_AP_BTN_DONTHILIGHT, !_settings_client.gui.station_show_coverage);
|
this->SetWidgetLoweredState(WID_AP_BTN_DONTHILIGHT, !_settings_client.gui.station_show_coverage);
|
||||||
this->SetWidgetLoweredState(WID_AP_BTN_DOHILIGHT, _settings_client.gui.station_show_coverage);
|
this->SetWidgetLoweredState(WID_AP_BTN_DOHILIGHT, _settings_client.gui.station_show_coverage);
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->UpdateSelectSize();
|
this->UpdateSelectSize();
|
||||||
SetViewportCatchmentStation(nullptr, true);
|
SetViewportCatchmentStation(nullptr, true);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -469,7 +469,7 @@ public:
|
||||||
this->RaiseWidget(_settings_client.gui.station_show_coverage + BDSW_LT_OFF);
|
this->RaiseWidget(_settings_client.gui.station_show_coverage + BDSW_LT_OFF);
|
||||||
_settings_client.gui.station_show_coverage = (widget != BDSW_LT_OFF);
|
_settings_client.gui.station_show_coverage = (widget != BDSW_LT_OFF);
|
||||||
this->LowerWidget(_settings_client.gui.station_show_coverage + BDSW_LT_OFF);
|
this->LowerWidget(_settings_client.gui.station_show_coverage + BDSW_LT_OFF);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
SetViewportCatchmentStation(nullptr, true);
|
SetViewportCatchmentStation(nullptr, true);
|
||||||
break;
|
break;
|
||||||
|
@ -580,7 +580,7 @@ public:
|
||||||
this->RaiseWidget(WID_BDD_X + _ship_depot_direction);
|
this->RaiseWidget(WID_BDD_X + _ship_depot_direction);
|
||||||
_ship_depot_direction = (widget == WID_BDD_X ? AXIS_X : AXIS_Y);
|
_ship_depot_direction = (widget == WID_BDD_X ? AXIS_X : AXIS_Y);
|
||||||
this->LowerWidget(WID_BDD_X + _ship_depot_direction);
|
this->LowerWidget(WID_BDD_X + _ship_depot_direction);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
UpdateDocksDirection();
|
UpdateDocksDirection();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -323,7 +323,7 @@ static void StartGeneratingLandscape(GenerateLandscapeWindowMode mode)
|
||||||
MakeNewgameSettingsLive();
|
MakeNewgameSettingsLive();
|
||||||
ResetGRFConfig(true);
|
ResetGRFConfig(true);
|
||||||
|
|
||||||
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
SndConfirmBeep();
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GLWM_GENERATE: _switch_mode = (_game_mode == GM_EDITOR) ? SM_GENRANDLAND : SM_NEWGAME; break;
|
case GLWM_GENERATE: _switch_mode = (_game_mode == GM_EDITOR) ? SM_GENRANDLAND : SM_NEWGAME; break;
|
||||||
case GLWM_HEIGHTMAP: _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_HEIGHTMAP : SM_START_HEIGHTMAP; break;
|
case GLWM_HEIGHTMAP: _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_HEIGHTMAP : SM_START_HEIGHTMAP; break;
|
||||||
|
|
|
@ -3076,7 +3076,7 @@ struct IndustryCargoesWindow : public Window {
|
||||||
case WID_IC_NOTIFY:
|
case WID_IC_NOTIFY:
|
||||||
this->ToggleWidgetLoweredState(WID_IC_NOTIFY);
|
this->ToggleWidgetLoweredState(WID_IC_NOTIFY);
|
||||||
this->SetWidgetDirty(WID_IC_NOTIFY);
|
this->SetWidgetDirty(WID_IC_NOTIFY);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
|
|
||||||
if (this->IsWidgetLowered(WID_IC_NOTIFY)) {
|
if (this->IsWidgetLowered(WID_IC_NOTIFY)) {
|
||||||
if (FindWindowByClass(WC_SMALLMAP) == nullptr) ShowSmallMap();
|
if (FindWindowByClass(WC_SMALLMAP) == nullptr) ShowSmallMap();
|
||||||
|
|
|
@ -64,7 +64,7 @@ bool HandlePlacePushButton(Window *w, WidgetID widget, CursorID cursor, HighLigh
|
||||||
{
|
{
|
||||||
if (w->IsWidgetDisabled(widget)) return false;
|
if (w->IsWidgetDisabled(widget)) return false;
|
||||||
|
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
w->SetDirty();
|
w->SetDirty();
|
||||||
|
|
||||||
if (w->IsWidgetLowered(widget)) {
|
if (w->IsWidgetLowered(widget)) {
|
||||||
|
|
|
@ -319,7 +319,7 @@ public:
|
||||||
if (_object_gui.sel_type != std::numeric_limits<uint16_t>::max()) {
|
if (_object_gui.sel_type != std::numeric_limits<uint16_t>::max()) {
|
||||||
_object_gui.sel_view = this->GetWidget<NWidgetBase>(widget)->GetParentWidget<NWidgetMatrix>()->GetCurrentElement();
|
_object_gui.sel_view = this->GetWidget<NWidgetBase>(widget)->GetParentWidget<NWidgetMatrix>()->GetCurrentElement();
|
||||||
this->InvalidateData(PickerInvalidation::Position);
|
this->InvalidateData(PickerInvalidation::Position);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1896,10 +1896,11 @@ VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v)
|
||||||
* Update the vehicle's destination tile from an order.
|
* Update the vehicle's destination tile from an order.
|
||||||
* @param order the order the vehicle currently has
|
* @param order the order the vehicle currently has
|
||||||
* @param v the vehicle to update
|
* @param v the vehicle to update
|
||||||
|
* @param may_reverse Whether the vehicle is allowed to reverse when executing the updated order.
|
||||||
* @param conditional_depth the depth (amount of steps) to go with conditional orders. This to prevent infinite loops.
|
* @param conditional_depth the depth (amount of steps) to go with conditional orders. This to prevent infinite loops.
|
||||||
* @param pbs_look_ahead Whether we are forecasting orders for pbs reservations in advance. If true, the order indices must not be modified.
|
* @param pbs_look_ahead Whether we are forecasting orders for pbs reservations in advance. If true, the order indices must not be modified.
|
||||||
*/
|
*/
|
||||||
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool pbs_look_ahead)
|
bool UpdateOrderDest(Vehicle *v, const Order *order, bool may_reverse, int conditional_depth, bool pbs_look_ahead)
|
||||||
{
|
{
|
||||||
if (conditional_depth > v->GetNumOrders()) {
|
if (conditional_depth > v->GetNumOrders()) {
|
||||||
v->current_order.Free();
|
v->current_order.Free();
|
||||||
|
@ -1926,7 +1927,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
|
||||||
if (v->dest_tile == 0 && TimerGameEconomy::date_fract != (v->index % Ticks::DAY_TICKS)) break;
|
if (v->dest_tile == 0 && TimerGameEconomy::date_fract != (v->index % Ticks::DAY_TICKS)) break;
|
||||||
|
|
||||||
/* We need to search for the nearest depot (hangar). */
|
/* We need to search for the nearest depot (hangar). */
|
||||||
ClosestDepot closest_depot = v->FindClosestDepot();
|
ClosestDepot closest_depot = v->FindClosestDepot(may_reverse);
|
||||||
|
|
||||||
if (closest_depot.found) {
|
if (closest_depot.found) {
|
||||||
/* PBS reservations cannot reverse */
|
/* PBS reservations cannot reverse */
|
||||||
|
@ -2018,7 +2019,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
v->current_order = *order;
|
v->current_order = *order;
|
||||||
return UpdateOrderDest(v, order, conditional_depth + 1, pbs_look_ahead);
|
return UpdateOrderDest(v, order, may_reverse, conditional_depth + 1, pbs_look_ahead);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2116,7 +2117,7 @@ bool ProcessOrders(Vehicle *v)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return UpdateOrderDest(v, order) && may_reverse;
|
return UpdateOrderDest(v, order, may_reverse) && may_reverse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -20,7 +20,7 @@ void InvalidateVehicleOrder(const Vehicle *v, int data);
|
||||||
void CheckOrders(const Vehicle*);
|
void CheckOrders(const Vehicle*);
|
||||||
void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist = false, bool reset_order_indices = true);
|
void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist = false, bool reset_order_indices = true);
|
||||||
bool ProcessOrders(Vehicle *v);
|
bool ProcessOrders(Vehicle *v);
|
||||||
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth = 0, bool pbs_look_ahead = false);
|
bool UpdateOrderDest(Vehicle *v, const Order *order, bool may_reverse = false, int conditional_depth = 0, bool pbs_look_ahead = false);
|
||||||
VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v);
|
VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v);
|
||||||
uint GetOrderDistance(VehicleOrderID prev, VehicleOrderID cur, const Vehicle *v, int conditional_depth = 0);
|
uint GetOrderDistance(VehicleOrderID prev, VehicleOrderID cur, const Vehicle *v, int conditional_depth = 0);
|
||||||
|
|
||||||
|
|
|
@ -430,3 +430,83 @@ void PrintWaterRegionDebugInfo(TileIndex tile)
|
||||||
{
|
{
|
||||||
GetUpdatedWaterRegion(tile).PrintDebugInfo();
|
GetUpdatedWaterRegion(tile).PrintDebugInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the provided callback function on all tiles of the water patch of the region
|
||||||
|
* and returns true on the first tile that passes the callback test.
|
||||||
|
* @param callback The test function that will be called for the water patch.
|
||||||
|
* @param water_region_patch Water patch within the water region to test the callback.
|
||||||
|
* @return true if it passes the callback test, or false if the callback failed.
|
||||||
|
*/
|
||||||
|
bool TestTileInWaterRegionPatch(const WaterRegionPatchDesc &water_region_patch, TestTileIndexCallBack &callback)
|
||||||
|
{
|
||||||
|
const WaterRegion region = GetUpdatedWaterRegion(water_region_patch.x, water_region_patch.y);
|
||||||
|
|
||||||
|
/* Check if the region has a tile which passes the callback test. */
|
||||||
|
for (const TileIndex tile : region) {
|
||||||
|
if (region.GetLabel(tile) != water_region_patch.label || !callback(tile)) continue;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the provided callback function on all tiles of the current water patch of the region, collects the
|
||||||
|
* tiles which passed the callback and returns the tile closest to the edge from where the region is entered from.
|
||||||
|
* @param high_level_path A span containing at least current and parent water patches.
|
||||||
|
* @param callback The test function that will be called for each tile in the water patch.
|
||||||
|
* @return The tile closest to the edge from where it came from that passed the callback test, or INVALID_TILE if no tile passed.
|
||||||
|
*/
|
||||||
|
TileIndex FindClosestEnteringTile(const std::span<WaterRegionPatchDesc> high_level_path, TestTileIndexCallBack &callback)
|
||||||
|
{
|
||||||
|
assert(high_level_path.size() > 1);
|
||||||
|
|
||||||
|
const WaterRegionPatchDesc ¤t_water_region_patch = high_level_path.back();
|
||||||
|
const WaterRegion current_region = GetUpdatedWaterRegion(current_water_region_patch.x, current_water_region_patch.y);
|
||||||
|
|
||||||
|
/* Check if the current region has a tile which passes the callback test. */
|
||||||
|
std::vector<TileIndex> tile_list;
|
||||||
|
for (const TileIndex tile : current_region) {
|
||||||
|
if (current_region.GetLabel(tile) != current_water_region_patch.label || !callback(tile)) continue;
|
||||||
|
|
||||||
|
/* We collect the tiles when we know which region we came from for further evaluation. */
|
||||||
|
tile_list.push_back(tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If there aren't any tiles that passed the callback, return with an invalid tile. */
|
||||||
|
if (tile_list.empty()) return INVALID_TILE;
|
||||||
|
|
||||||
|
/* If there's only one, just return it. */
|
||||||
|
if (tile_list.size() == 1) return tile_list.front();
|
||||||
|
|
||||||
|
const TileIndex top_tile = current_region.begin();
|
||||||
|
const TileIndex bot_tile = TileAddXY(top_tile, WATER_REGION_EDGE_LENGTH - 1, WATER_REGION_EDGE_LENGTH - 1);
|
||||||
|
|
||||||
|
/* Get the side from which the current region is entered from. */
|
||||||
|
const WaterRegionPatchDesc &parent_water_region_patch = high_level_path[high_level_path.size() - 2];
|
||||||
|
const WaterRegion parent_region = GetUpdatedWaterRegion(parent_water_region_patch.x, parent_water_region_patch.y);
|
||||||
|
const DiagDirection side = DiagdirBetweenTiles(top_tile, parent_region.begin());
|
||||||
|
|
||||||
|
/* Depending on the side, determine which corner tile to use to extract their x or y coordinates. */
|
||||||
|
const bool is_at_top = side == DIAGDIR_NE || side == DIAGDIR_NW;
|
||||||
|
const TileIndex edge_tile = is_at_top ? top_tile : bot_tile;
|
||||||
|
const bool is_axis_x = DiagDirToAxis(side) == AXIS_X;
|
||||||
|
const int x_or_y_edge = is_axis_x ? TileX(edge_tile) : TileY(edge_tile);
|
||||||
|
|
||||||
|
/* With more than one tile passing the callback, calculate the tile that is closest to the edge from whence it came. */
|
||||||
|
TileIndex best_tile = INVALID_TILE;
|
||||||
|
int best_dist = WATER_REGION_EDGE_LENGTH;
|
||||||
|
for (const TileIndex &tile : tile_list) {
|
||||||
|
const int x_or_y_tile = is_axis_x ? TileX(tile) : TileY(tile);
|
||||||
|
const int dist_to_edge = std::abs(x_or_y_tile - x_or_y_edge);
|
||||||
|
assert(dist_to_edge < WATER_REGION_EDGE_LENGTH);
|
||||||
|
if (dist_to_edge >= best_dist) continue;
|
||||||
|
|
||||||
|
best_dist = dist_to_edge;
|
||||||
|
best_tile = tile;
|
||||||
|
}
|
||||||
|
|
||||||
|
return best_tile;
|
||||||
|
}
|
||||||
|
|
|
@ -64,4 +64,8 @@ void AllocateWaterRegions();
|
||||||
|
|
||||||
void PrintWaterRegionDebugInfo(TileIndex tile);
|
void PrintWaterRegionDebugInfo(TileIndex tile);
|
||||||
|
|
||||||
|
using TestTileIndexCallBack = std::function<bool(const TileIndex)>;
|
||||||
|
bool TestTileInWaterRegionPatch(const WaterRegionPatchDesc &water_region_patch, TestTileIndexCallBack &callback);
|
||||||
|
TileIndex FindClosestEnteringTile(const std::span<WaterRegionPatchDesc> high_level_path, TestTileIndexCallBack &callback);
|
||||||
|
|
||||||
#endif /* WATER_REGIONS_H */
|
#endif /* WATER_REGIONS_H */
|
||||||
|
|
|
@ -34,6 +34,17 @@ Track YapfShipChooseTrack(const Ship *v, TileIndex tile, bool &path_found, ShipP
|
||||||
*/
|
*/
|
||||||
bool YapfShipCheckReverse(const Ship *v, Trackdir *trackdir);
|
bool YapfShipCheckReverse(const Ship *v, Trackdir *trackdir);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used when user sends ship to the nearest depot or if ship needs servicing using YAPF.
|
||||||
|
* @param v ship that needs to go to some depot
|
||||||
|
* @param max_penalty max distance (in pathfinder penalty) from the current ship position
|
||||||
|
* (used also as optimization - the pathfinder can stop path finding if max_penalty
|
||||||
|
* was reached and no depot was seen)
|
||||||
|
* @param may_reverse whether the ship is allowed to reverse
|
||||||
|
* @return the data about the depot
|
||||||
|
*/
|
||||||
|
FindDepotData YapfShipFindNearestDepot(const Ship *v, int max_penalty, bool may_reverse);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the best path for given road vehicle using YAPF.
|
* Finds the best path for given road vehicle using YAPF.
|
||||||
* @param v the RV that needs to find a path
|
* @param v the RV that needs to find a path
|
||||||
|
|
|
@ -36,6 +36,7 @@ protected:
|
||||||
TileIndex dest_tile;
|
TileIndex dest_tile;
|
||||||
TrackdirBits dest_trackdirs;
|
TrackdirBits dest_trackdirs;
|
||||||
StationID dest_station;
|
StationID dest_station;
|
||||||
|
bool any_ship_depot = false;
|
||||||
|
|
||||||
bool has_intermediate_dest = false;
|
bool has_intermediate_dest = false;
|
||||||
TileIndex intermediate_dest_tile;
|
TileIndex intermediate_dest_tile;
|
||||||
|
@ -55,6 +56,11 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetAnyShipDepotDestination()
|
||||||
|
{
|
||||||
|
this->any_ship_depot = true;
|
||||||
|
}
|
||||||
|
|
||||||
void SetIntermediateDestination(const WaterRegionPatchDesc &water_region_patch)
|
void SetIntermediateDestination(const WaterRegionPatchDesc &water_region_patch)
|
||||||
{
|
{
|
||||||
this->has_intermediate_dest = true;
|
this->has_intermediate_dest = true;
|
||||||
|
@ -69,10 +75,16 @@ protected:
|
||||||
return *static_cast<Tpf*>(this);
|
return *static_cast<Tpf*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TestTileIndexCallBack detect_ship_depot = [&](const TileIndex tile)
|
||||||
|
{
|
||||||
|
return IsShipDepotTile(tile) && GetShipDepotPart(tile) == DEPOT_PART_NORTH && IsTileOwner(tile, Yapf().GetVehicle()->owner);
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Called by YAPF to detect if node ends in the desired destination. */
|
/** Called by YAPF to detect if node ends in the desired destination. */
|
||||||
inline bool PfDetectDestination(Node &n)
|
inline bool PfDetectDestination(Node &n)
|
||||||
{
|
{
|
||||||
|
if (this->any_ship_depot) return this->detect_ship_depot(n.key.tile);
|
||||||
return this->PfDetectDestinationTile(n.segment_last_tile, n.segment_last_td);
|
return this->PfDetectDestinationTile(n.segment_last_tile, n.segment_last_td);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +101,11 @@ public:
|
||||||
return tile == this->dest_tile && ((this->dest_trackdirs & TrackdirToTrackdirBits(trackdir)) != TRACKDIR_BIT_NONE);
|
return tile == this->dest_tile && ((this->dest_trackdirs & TrackdirToTrackdirBits(trackdir)) != TRACKDIR_BIT_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline TileIndex GetShipDepotDestination(const std::span<WaterRegionPatchDesc> high_level_path)
|
||||||
|
{
|
||||||
|
return FindClosestEnteringTile(high_level_path, this->detect_ship_depot);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
|
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
|
||||||
* adds it to the actual cost from origin and stores the sum to the Node::estimate.
|
* adds it to the actual cost from origin and stores the sum to the Node::estimate.
|
||||||
|
@ -99,7 +116,7 @@ public:
|
||||||
|
|
||||||
static const int dg_dir_to_x_offs[] = { -1, 0, 1, 0 };
|
static const int dg_dir_to_x_offs[] = { -1, 0, 1, 0 };
|
||||||
static const int dg_dir_to_y_offs[] = { 0, 1, 0, -1 };
|
static const int dg_dir_to_y_offs[] = { 0, 1, 0, -1 };
|
||||||
if (this->PfDetectDestination(n)) {
|
if (this->any_ship_depot || this->PfDetectDestination(n)) {
|
||||||
n.estimate = n.cost;
|
n.estimate = n.cost;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +175,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Restricts the search by creating corridor or water regions through which the ship is allowed to travel. */
|
/** Restricts the search by creating corridor or water regions through which the ship is allowed to travel. */
|
||||||
inline void RestrictSearch(const std::vector<WaterRegionPatchDesc> &path)
|
inline void RestrictSearch(const std::span<WaterRegionPatchDesc> &path)
|
||||||
{
|
{
|
||||||
this->water_region_corridor.clear();
|
this->water_region_corridor.clear();
|
||||||
for (const WaterRegionPatchDesc &path_entry : path) this->water_region_corridor.push_back(path_entry);
|
for (const WaterRegionPatchDesc &path_entry : path) this->water_region_corridor.push_back(path_entry);
|
||||||
|
@ -211,16 +228,20 @@ public:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Trackdir ChooseShipTrack(const Ship *v, TileIndex tile, TrackdirBits forward_dirs, TrackdirBits reverse_dirs,
|
static Trackdir ChooseShipTrack(const Ship *v, TileIndex &tile, TrackdirBits forward_dirs, TrackdirBits reverse_dirs, int max_penalty,
|
||||||
bool &path_found, ShipPathCache &path_cache, Trackdir &best_origin_dir)
|
bool &path_found, ShipPathCache &path_cache, Trackdir &best_origin_dir)
|
||||||
{
|
{
|
||||||
const std::vector<WaterRegionPatchDesc> high_level_path = YapfShipFindWaterRegionPath(v, tile, NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1);
|
std::vector<WaterRegionPatchDesc> high_level_path = YapfShipFindWaterRegionPath(v, tile, NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1);
|
||||||
if (high_level_path.empty()) {
|
if (high_level_path.empty()) {
|
||||||
path_found = false;
|
path_found = false;
|
||||||
/* Make the ship move around aimlessly. This prevents repeated pathfinder calls and clearly indicates that the ship is lost. */
|
/* Make the ship move around aimlessly. This prevents repeated pathfinder calls and clearly indicates that the ship is lost. */
|
||||||
return CreateRandomPath(v, path_cache, SHIP_LOST_PATH_LENGTH);
|
return CreateRandomPath(v, path_cache, SHIP_LOST_PATH_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool find_closest_depot = tile == INVALID_TILE;
|
||||||
|
if (find_closest_depot) tile = v->tile;
|
||||||
|
const bool automatic_servicing = find_closest_depot && max_penalty != 0;
|
||||||
|
|
||||||
/* Try one time without restricting the search area, which generally results in better and more natural looking paths.
|
/* Try one time without restricting the search area, which generally results in better and more natural looking paths.
|
||||||
* However the pathfinder can hit the node limit in certain situations such as long aqueducts or maze-like terrain.
|
* However the pathfinder can hit the node limit in certain situations such as long aqueducts or maze-like terrain.
|
||||||
* If that happens we run the pathfinder again, but restricted only to the regions provided by the region pathfinder. */
|
* If that happens we run the pathfinder again, but restricted only to the regions provided by the region pathfinder. */
|
||||||
|
@ -229,13 +250,28 @@ public:
|
||||||
|
|
||||||
/* Set origin and destination nodes */
|
/* Set origin and destination nodes */
|
||||||
pf.SetOrigin(v->tile, forward_dirs | reverse_dirs);
|
pf.SetOrigin(v->tile, forward_dirs | reverse_dirs);
|
||||||
pf.SetDestination(v);
|
if (find_closest_depot) {
|
||||||
const bool is_intermediate_destination = static_cast<int>(high_level_path.size()) >= NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1;
|
pf.SetAnyShipDepotDestination();
|
||||||
if (is_intermediate_destination) pf.SetIntermediateDestination(high_level_path.back());
|
} else {
|
||||||
|
pf.SetDestination(v);
|
||||||
|
}
|
||||||
|
pf.SetMaxCost(max_penalty);
|
||||||
|
|
||||||
|
const std::span<WaterRegionPatchDesc> high_level_path_span(high_level_path.data(), std::min<size_t>(high_level_path.size(), NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1));
|
||||||
|
const bool is_intermediate_destination = static_cast<int>(high_level_path_span.size()) >= NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1;
|
||||||
|
if (is_intermediate_destination) {
|
||||||
|
if (automatic_servicing) {
|
||||||
|
/* Automatic servicing requires a valid path cost from start to end.
|
||||||
|
* However, when an intermediate destination is set, the resulting cost
|
||||||
|
* cannot be used to determine if it falls within the maximum allowed penalty. */
|
||||||
|
return INVALID_TRACKDIR;
|
||||||
|
}
|
||||||
|
pf.SetIntermediateDestination(high_level_path_span.back());
|
||||||
|
}
|
||||||
|
|
||||||
/* Restrict the search area to prevent the low level pathfinder from expanding too many nodes. This can happen
|
/* Restrict the search area to prevent the low level pathfinder from expanding too many nodes. This can happen
|
||||||
* when the terrain is very "maze-like" or when the high level path "teleports" via a very long aqueduct. */
|
* when the terrain is very "maze-like" or when the high level path "teleports" via a very long aqueduct. */
|
||||||
if (attempt > 0) pf.RestrictSearch(high_level_path);
|
if (attempt > 0) pf.RestrictSearch(high_level_path_span);
|
||||||
|
|
||||||
/* Find best path. */
|
/* Find best path. */
|
||||||
path_found = pf.FindPath(v);
|
path_found = pf.FindPath(v);
|
||||||
|
@ -245,6 +281,12 @@ public:
|
||||||
/* Make the ship move around aimlessly. This prevents repeated pathfinder calls and clearly indicates that the ship is lost. */
|
/* Make the ship move around aimlessly. This prevents repeated pathfinder calls and clearly indicates that the ship is lost. */
|
||||||
if (!path_found) return CreateRandomPath(v, path_cache, SHIP_LOST_PATH_LENGTH);
|
if (!path_found) return CreateRandomPath(v, path_cache, SHIP_LOST_PATH_LENGTH);
|
||||||
|
|
||||||
|
/* Return early when only searching for the closest depot tile. */
|
||||||
|
if (find_closest_depot) {
|
||||||
|
tile = is_intermediate_destination ? pf.GetShipDepotDestination(high_level_path) : node->GetTile();
|
||||||
|
return INVALID_TRACKDIR;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return only the path within the current water region if an intermediate destination was returned. If not, cache the entire path
|
/* Return only the path within the current water region if an intermediate destination was returned. If not, cache the entire path
|
||||||
* to the final destination tile. The low-level pathfinder might actually prefer a different docking tile in a nearby region. Without
|
* to the final destination tile. The low-level pathfinder might actually prefer a different docking tile in a nearby region. Without
|
||||||
* caching the full path the ship can get stuck in a loop. */
|
* caching the full path the ship can get stuck in a loop. */
|
||||||
|
@ -254,7 +296,7 @@ public:
|
||||||
while (node->parent) {
|
while (node->parent) {
|
||||||
const WaterRegionPatchDesc node_water_patch = GetWaterRegionPatchInfo(node->GetTile());
|
const WaterRegionPatchDesc node_water_patch = GetWaterRegionPatchInfo(node->GetTile());
|
||||||
|
|
||||||
const bool node_water_patch_on_high_level_path = std::ranges::find(high_level_path, node_water_patch) != high_level_path.end();
|
const bool node_water_patch_on_high_level_path = std::ranges::find(high_level_path_span, node_water_patch) != high_level_path_span.end();
|
||||||
const bool add_full_path = !is_intermediate_destination && node_water_patch != end_water_patch;
|
const bool add_full_path = !is_intermediate_destination && node_water_patch != end_water_patch;
|
||||||
|
|
||||||
/* The cached path must always lead to a region patch that's on the high level path.
|
/* The cached path must always lead to a region patch that's on the high level path.
|
||||||
|
@ -303,6 +345,7 @@ public:
|
||||||
{
|
{
|
||||||
bool path_found = false;
|
bool path_found = false;
|
||||||
ShipPathCache dummy_cache;
|
ShipPathCache dummy_cache;
|
||||||
|
TileIndex tile = v->tile;
|
||||||
Trackdir best_origin_dir = INVALID_TRACKDIR;
|
Trackdir best_origin_dir = INVALID_TRACKDIR;
|
||||||
|
|
||||||
if (trackdir == nullptr) {
|
if (trackdir == nullptr) {
|
||||||
|
@ -310,17 +353,45 @@ public:
|
||||||
const Trackdir reverse_dir = ReverseTrackdir(v->GetVehicleTrackdir());
|
const Trackdir reverse_dir = ReverseTrackdir(v->GetVehicleTrackdir());
|
||||||
const TrackdirBits forward_dirs = TrackdirToTrackdirBits(v->GetVehicleTrackdir());
|
const TrackdirBits forward_dirs = TrackdirToTrackdirBits(v->GetVehicleTrackdir());
|
||||||
const TrackdirBits reverse_dirs = TrackdirToTrackdirBits(reverse_dir);
|
const TrackdirBits reverse_dirs = TrackdirToTrackdirBits(reverse_dir);
|
||||||
(void)ChooseShipTrack(v, v->tile, forward_dirs, reverse_dirs, path_found, dummy_cache, best_origin_dir);
|
(void)ChooseShipTrack(v, tile, forward_dirs, reverse_dirs, 0, path_found, dummy_cache, best_origin_dir);
|
||||||
return path_found && best_origin_dir == reverse_dir;
|
return path_found && best_origin_dir == reverse_dir;
|
||||||
} else {
|
} else {
|
||||||
/* This gets called when a ship suddenly can't move forward, e.g. due to terraforming. */
|
/* This gets called when a ship suddenly can't move forward, e.g. due to terraforming. */
|
||||||
const DiagDirection entry = ReverseDiagDir(VehicleExitDir(v->direction, v->state));
|
const DiagDirection entry = ReverseDiagDir(VehicleExitDir(v->direction, v->state));
|
||||||
const TrackdirBits reverse_dirs = DiagdirReachesTrackdirs(entry) & TrackStatusToTrackdirBits(GetTileTrackStatus(v->tile, TRANSPORT_WATER, 0, entry));
|
const TrackdirBits reverse_dirs = DiagdirReachesTrackdirs(entry) & TrackStatusToTrackdirBits(GetTileTrackStatus(v->tile, TRANSPORT_WATER, 0, entry));
|
||||||
(void)ChooseShipTrack(v, v->tile, TRACKDIR_BIT_NONE, reverse_dirs, path_found, dummy_cache, best_origin_dir);
|
(void)ChooseShipTrack(v, tile, TRACKDIR_BIT_NONE, reverse_dirs, 0, path_found, dummy_cache, best_origin_dir);
|
||||||
*trackdir = path_found && best_origin_dir != INVALID_TRACKDIR ? best_origin_dir : GetRandomTrackdir(reverse_dirs);
|
*trackdir = path_found && best_origin_dir != INVALID_TRACKDIR ? best_origin_dir : GetRandomTrackdir(reverse_dirs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find the best depot for a ship.
|
||||||
|
* @param v Ship
|
||||||
|
* @param max_penalty maximum pathfinder cost.
|
||||||
|
* @param may_reverse whether the ship is allowed to reverse.
|
||||||
|
* @return FindDepotData with the best depot tile, cost and whether to reverse.
|
||||||
|
*/
|
||||||
|
static inline FindDepotData FindNearestDepot(const Ship *v, int max_penalty, bool may_reverse)
|
||||||
|
{
|
||||||
|
FindDepotData depot;
|
||||||
|
|
||||||
|
bool path_found = false;
|
||||||
|
ShipPathCache dummy_cache;
|
||||||
|
TileIndex tile = INVALID_TILE;
|
||||||
|
Trackdir best_origin_dir = INVALID_TRACKDIR;
|
||||||
|
const bool search_both_ways = may_reverse && max_penalty == 0;
|
||||||
|
const Trackdir forward_dir = v->GetVehicleTrackdir();
|
||||||
|
const Trackdir reverse_dir = ReverseTrackdir(forward_dir);
|
||||||
|
const TrackdirBits forward_dirs = TrackdirToTrackdirBits(forward_dir);
|
||||||
|
const TrackdirBits reverse_dirs = search_both_ways ? TrackdirToTrackdirBits(reverse_dir) : TRACKDIR_BIT_NONE;
|
||||||
|
(void)ChooseShipTrack(v, tile, forward_dirs, reverse_dirs, max_penalty, path_found, dummy_cache, best_origin_dir);
|
||||||
|
if (path_found) {
|
||||||
|
assert(tile != INVALID_TILE);
|
||||||
|
depot.tile = tile;
|
||||||
|
}
|
||||||
|
return depot;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Cost Provider module of YAPF for ships. */
|
/** Cost Provider module of YAPF for ships. */
|
||||||
|
@ -333,6 +404,11 @@ public:
|
||||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type.
|
typedef typename Types::NodeList::Item Node; ///< this will be our node type.
|
||||||
typedef typename Node::Key Key; ///< key to hash tables.
|
typedef typename Node::Key Key; ///< key to hash tables.
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int max_cost;
|
||||||
|
|
||||||
|
CYapfCostShipT() : max_cost(0) {}
|
||||||
|
|
||||||
/** to access inherited path finder */
|
/** to access inherited path finder */
|
||||||
Tpf &Yapf()
|
Tpf &Yapf()
|
||||||
{
|
{
|
||||||
|
@ -340,6 +416,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
inline void SetMaxCost(int cost)
|
||||||
|
{
|
||||||
|
this->max_cost = cost;
|
||||||
|
}
|
||||||
|
|
||||||
inline int CurveCost(Trackdir td1, Trackdir td2)
|
inline int CurveCost(Trackdir td1, Trackdir td2)
|
||||||
{
|
{
|
||||||
assert(IsValidTrackdir(td1));
|
assert(IsValidTrackdir(td1));
|
||||||
|
@ -384,6 +465,10 @@ public:
|
||||||
uint8_t speed_frac = (GetEffectiveWaterClass(n.GetTile()) == WATER_CLASS_SEA) ? svi->ocean_speed_frac : svi->canal_speed_frac;
|
uint8_t speed_frac = (GetEffectiveWaterClass(n.GetTile()) == WATER_CLASS_SEA) ? svi->ocean_speed_frac : svi->canal_speed_frac;
|
||||||
if (speed_frac > 0) c += YAPF_TILE_LENGTH * (1 + tf->tiles_skipped) * speed_frac / (256 - speed_frac);
|
if (speed_frac > 0) c += YAPF_TILE_LENGTH * (1 + tf->tiles_skipped) * speed_frac / (256 - speed_frac);
|
||||||
|
|
||||||
|
/* Finish if we already exceeded the maximum path cost (i.e. when
|
||||||
|
* searching for the nearest depot). */
|
||||||
|
if (this->max_cost > 0 && (n.parent->cost + c) > this->max_cost) return false;
|
||||||
|
|
||||||
/* Apply it. */
|
/* Apply it. */
|
||||||
n.cost = n.parent->cost + c;
|
n.cost = n.parent->cost + c;
|
||||||
return true;
|
return true;
|
||||||
|
@ -422,7 +507,7 @@ Track YapfShipChooseTrack(const Ship *v, TileIndex tile, bool &path_found, ShipP
|
||||||
{
|
{
|
||||||
Trackdir best_origin_dir = INVALID_TRACKDIR;
|
Trackdir best_origin_dir = INVALID_TRACKDIR;
|
||||||
const TrackdirBits origin_dirs = TrackdirToTrackdirBits(v->GetVehicleTrackdir());
|
const TrackdirBits origin_dirs = TrackdirToTrackdirBits(v->GetVehicleTrackdir());
|
||||||
const Trackdir td_ret = CYapfShip::ChooseShipTrack(v, tile, origin_dirs, TRACKDIR_BIT_NONE, path_found, path_cache, best_origin_dir);
|
const Trackdir td_ret = CYapfShip::ChooseShipTrack(v, tile, origin_dirs, TRACKDIR_BIT_NONE, 0, path_found, path_cache, best_origin_dir);
|
||||||
return (td_ret != INVALID_TRACKDIR) ? TrackdirToTrack(td_ret) : INVALID_TRACK;
|
return (td_ret != INVALID_TRACKDIR) ? TrackdirToTrack(td_ret) : INVALID_TRACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,3 +515,8 @@ bool YapfShipCheckReverse(const Ship *v, Trackdir *trackdir)
|
||||||
{
|
{
|
||||||
return CYapfShip::CheckShipReverse(v, trackdir);
|
return CYapfShip::CheckShipReverse(v, trackdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FindDepotData YapfShipFindNearestDepot(const Ship *v, int max_penalty, bool may_reverse)
|
||||||
|
{
|
||||||
|
return CYapfShip::FindNearestDepot(v, max_penalty, may_reverse);
|
||||||
|
}
|
||||||
|
|
|
@ -119,6 +119,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Key dest;
|
Key dest;
|
||||||
|
bool any_ship_depot = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void SetDestination(const WaterRegionPatchDesc &water_region_patch)
|
void SetDestination(const WaterRegionPatchDesc &water_region_patch)
|
||||||
|
@ -126,18 +127,32 @@ public:
|
||||||
this->dest.Set(water_region_patch);
|
this->dest.Set(water_region_patch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetAnyShipDepotDestination()
|
||||||
|
{
|
||||||
|
this->any_ship_depot = true;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
TestTileIndexCallBack detect_ship_depot = [&](const TileIndex tile)
|
||||||
|
{
|
||||||
|
return IsShipDepotTile(tile) && GetShipDepotPart(tile) == DEPOT_PART_NORTH && IsTileOwner(tile, Yapf().GetVehicle()->owner);
|
||||||
|
};
|
||||||
|
|
||||||
Tpf &Yapf() { return *static_cast<Tpf*>(this); }
|
Tpf &Yapf() { return *static_cast<Tpf*>(this); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline bool PfDetectDestination(Node &n) const
|
inline bool PfDetectDestination(Node &n)
|
||||||
{
|
{
|
||||||
|
if (this->any_ship_depot) {
|
||||||
|
return TestTileInWaterRegionPatch(n.key.water_region_patch, this->detect_ship_depot);
|
||||||
|
}
|
||||||
|
|
||||||
return n.key == this->dest;
|
return n.key == this->dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool PfCalcEstimate(Node &n)
|
inline bool PfCalcEstimate(Node &n)
|
||||||
{
|
{
|
||||||
if (this->PfDetectDestination(n)) {
|
if (this->any_ship_depot || this->PfDetectDestination(n)) {
|
||||||
n.estimate = n.cost;
|
n.estimate = n.cost;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -218,6 +233,31 @@ public:
|
||||||
assert(!path.empty());
|
assert(!path.empty());
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<WaterRegionPatchDesc> FindShipDepotRegionPath(const Ship *v)
|
||||||
|
{
|
||||||
|
const WaterRegionPatchDesc start_water_region_patch = GetWaterRegionPatchInfo(v->tile);
|
||||||
|
|
||||||
|
/* We reserve 4 nodes (patches) per water region. The vast majority of water regions have 1 or 2 regions so this should be a pretty
|
||||||
|
* safe limit. We cap the limit at 65536 which is at a region size of 16x16 is equivalent to one node per region for a 4096x4096 map. */
|
||||||
|
Tpf pf(std::min(static_cast<int>(Map::Size() * NODES_PER_REGION) / WATER_REGION_NUMBER_OF_TILES, MAX_NUMBER_OF_NODES));
|
||||||
|
pf.AddOrigin(start_water_region_patch);
|
||||||
|
pf.SetAnyShipDepotDestination();
|
||||||
|
|
||||||
|
/* Find best path. */
|
||||||
|
if (!pf.FindPath(v)) return {}; // Path not found.
|
||||||
|
|
||||||
|
std::vector<WaterRegionPatchDesc> path;
|
||||||
|
Node *node = pf.GetBestNode();
|
||||||
|
while (node != nullptr) {
|
||||||
|
path.push_back(node->key.water_region_patch);
|
||||||
|
node = node->parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(!path.empty());
|
||||||
|
std::ranges::reverse(path);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Cost Provider of YAPF for water regions. */
|
/** Cost Provider of YAPF for water regions. */
|
||||||
|
@ -296,5 +336,8 @@ struct CYapfRegionWater : CYapfT<CYapfRegion_TypesT<CYapfRegionWater, CRegionNod
|
||||||
*/
|
*/
|
||||||
std::vector<WaterRegionPatchDesc> YapfShipFindWaterRegionPath(const Ship *v, TileIndex start_tile, int max_returned_path_length)
|
std::vector<WaterRegionPatchDesc> YapfShipFindWaterRegionPath(const Ship *v, TileIndex start_tile, int max_returned_path_length)
|
||||||
{
|
{
|
||||||
|
const bool find_closest_depot = start_tile == INVALID_TILE;
|
||||||
|
|
||||||
|
if (find_closest_depot) return CYapfRegionWater::FindShipDepotRegionPath(v);
|
||||||
return CYapfRegionWater::FindWaterRegionPath(v, start_tile, max_returned_path_length);
|
return CYapfRegionWater::FindWaterRegionPath(v, start_tile, max_returned_path_length);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,5 +16,6 @@
|
||||||
struct Ship;
|
struct Ship;
|
||||||
|
|
||||||
std::vector<WaterRegionPatchDesc> YapfShipFindWaterRegionPath(const Ship *v, TileIndex start_tile, int max_returned_path_length);
|
std::vector<WaterRegionPatchDesc> YapfShipFindWaterRegionPath(const Ship *v, TileIndex start_tile, int max_returned_path_length);
|
||||||
|
std::vector<WaterRegionPatchDesc> YapfFindShipDepotRegionPath(const Ship *v);
|
||||||
|
|
||||||
#endif /* YAPF_SHIP_REGIONS_H */
|
#endif /* YAPF_SHIP_REGIONS_H */
|
||||||
|
|
|
@ -384,7 +384,7 @@ void PickerWindow::OnClick(Point pt, WidgetID widget, int)
|
||||||
this->callbacks.SetSelectedClass(*it);
|
this->callbacks.SetSelectedClass(*it);
|
||||||
this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Position, PickerInvalidation::Validate});
|
this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Position, PickerInvalidation::Validate});
|
||||||
}
|
}
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
CloseWindowById(WC_SELECT_STATION, 0);
|
CloseWindowById(WC_SELECT_STATION, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ void PickerWindow::OnClick(Point pt, WidgetID widget, int)
|
||||||
this->callbacks.SetSelectedType(item.index);
|
this->callbacks.SetSelectedType(item.index);
|
||||||
this->InvalidateData(PickerInvalidation::Position);
|
this->InvalidateData(PickerInvalidation::Position);
|
||||||
}
|
}
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
CloseWindowById(WC_SELECT_STATION, 0);
|
CloseWindowById(WC_SELECT_STATION, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -357,7 +357,7 @@ static void BuildRailClick_Remove(Window *w)
|
||||||
{
|
{
|
||||||
if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return;
|
if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return;
|
||||||
ToggleRailButton_Remove(w);
|
ToggleRailButton_Remove(w);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
|
|
||||||
/* handle station builder */
|
/* handle station builder */
|
||||||
if (w->IsWidgetLowered(WID_RAT_BUILD_STATION)) {
|
if (w->IsWidgetLowered(WID_RAT_BUILD_STATION)) {
|
||||||
|
@ -1239,7 +1239,7 @@ public:
|
||||||
this->RaiseWidget(WID_BRAS_PLATFORM_DIR_X + _station_gui.axis);
|
this->RaiseWidget(WID_BRAS_PLATFORM_DIR_X + _station_gui.axis);
|
||||||
_station_gui.axis = (Axis)(widget - WID_BRAS_PLATFORM_DIR_X);
|
_station_gui.axis = (Axis)(widget - WID_BRAS_PLATFORM_DIR_X);
|
||||||
this->LowerWidget(WID_BRAS_PLATFORM_DIR_X + _station_gui.axis);
|
this->LowerWidget(WID_BRAS_PLATFORM_DIR_X + _station_gui.axis);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
CloseWindowById(WC_SELECT_STATION, 0);
|
CloseWindowById(WC_SELECT_STATION, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -1271,7 +1271,7 @@ public:
|
||||||
|
|
||||||
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
|
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
|
||||||
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
|
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
CloseWindowById(WC_SELECT_STATION, 0);
|
CloseWindowById(WC_SELECT_STATION, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -1304,7 +1304,7 @@ public:
|
||||||
|
|
||||||
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
|
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
|
||||||
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
|
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
CloseWindowById(WC_SELECT_STATION, 0);
|
CloseWindowById(WC_SELECT_STATION, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -1338,7 +1338,7 @@ public:
|
||||||
|
|
||||||
this->SetWidgetLoweredState(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN, !_settings_client.gui.station_dragdrop);
|
this->SetWidgetLoweredState(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN, !_settings_client.gui.station_dragdrop);
|
||||||
this->SetWidgetLoweredState(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN, !_settings_client.gui.station_dragdrop);
|
this->SetWidgetLoweredState(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN, !_settings_client.gui.station_dragdrop);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
CloseWindowById(WC_SELECT_STATION, 0);
|
CloseWindowById(WC_SELECT_STATION, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -1350,7 +1350,7 @@ public:
|
||||||
|
|
||||||
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_OFF, !_settings_client.gui.station_show_coverage);
|
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_OFF, !_settings_client.gui.station_show_coverage);
|
||||||
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_ON, _settings_client.gui.station_show_coverage);
|
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_ON, _settings_client.gui.station_show_coverage);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
SetViewportCatchmentStation(nullptr, true);
|
SetViewportCatchmentStation(nullptr, true);
|
||||||
break;
|
break;
|
||||||
|
@ -1743,7 +1743,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
|
||||||
this->RaiseWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
|
this->RaiseWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
|
||||||
_build_depot_direction = (DiagDirection)(widget - WID_BRAD_DEPOT_NE);
|
_build_depot_direction = (DiagDirection)(widget - WID_BRAD_DEPOT_NE);
|
||||||
this->LowerWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
|
this->LowerWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -582,7 +582,7 @@ struct BuildRoadToolbarWindow : Window {
|
||||||
|
|
||||||
CloseWindowById(WC_SELECT_STATION, 0);
|
CloseWindowById(WC_SELECT_STATION, 0);
|
||||||
ToggleRoadButton_Remove(this);
|
ToggleRoadButton_Remove(this);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_ROT_CONVERT_ROAD:
|
case WID_ROT_CONVERT_ROAD:
|
||||||
|
@ -1145,7 +1145,7 @@ struct BuildRoadDepotWindow : public PickerWindowBase {
|
||||||
this->RaiseWidget(WID_BROD_DEPOT_NE + _road_depot_orientation);
|
this->RaiseWidget(WID_BROD_DEPOT_NE + _road_depot_orientation);
|
||||||
_road_depot_orientation = (DiagDirection)(widget - WID_BROD_DEPOT_NE);
|
_road_depot_orientation = (DiagDirection)(widget - WID_BROD_DEPOT_NE);
|
||||||
this->LowerWidget(WID_BROD_DEPOT_NE + _road_depot_orientation);
|
this->LowerWidget(WID_BROD_DEPOT_NE + _road_depot_orientation);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1477,7 +1477,7 @@ public:
|
||||||
this->RaiseWidget(WID_BROS_STATION_NE + _roadstop_gui.orientation);
|
this->RaiseWidget(WID_BROS_STATION_NE + _roadstop_gui.orientation);
|
||||||
_roadstop_gui.orientation = (DiagDirection)(widget - WID_BROS_STATION_NE);
|
_roadstop_gui.orientation = (DiagDirection)(widget - WID_BROS_STATION_NE);
|
||||||
this->LowerWidget(WID_BROS_STATION_NE + _roadstop_gui.orientation);
|
this->LowerWidget(WID_BROS_STATION_NE + _roadstop_gui.orientation);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
CloseWindowById(WC_SELECT_STATION, 0);
|
CloseWindowById(WC_SELECT_STATION, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -1487,7 +1487,7 @@ public:
|
||||||
this->RaiseWidget(_settings_client.gui.station_show_coverage + WID_BROS_LT_OFF);
|
this->RaiseWidget(_settings_client.gui.station_show_coverage + WID_BROS_LT_OFF);
|
||||||
_settings_client.gui.station_show_coverage = (widget != WID_BROS_LT_OFF);
|
_settings_client.gui.station_show_coverage = (widget != WID_BROS_LT_OFF);
|
||||||
this->LowerWidget(_settings_client.gui.station_show_coverage + WID_BROS_LT_OFF);
|
this->LowerWidget(_settings_client.gui.station_show_coverage + WID_BROS_LT_OFF);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
SetViewportCatchmentStation(nullptr, true);
|
SetViewportCatchmentStation(nullptr, true);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -132,7 +132,7 @@ struct RoadVehicle final : public GroundVehicle<RoadVehicle, VEH_ROAD> {
|
||||||
uint Crash(bool flooded = false) override;
|
uint Crash(bool flooded = false) override;
|
||||||
Trackdir GetVehicleTrackdir() const override;
|
Trackdir GetVehicleTrackdir() const override;
|
||||||
TileIndex GetOrderStationLocation(StationID station) override;
|
TileIndex GetOrderStationLocation(StationID station) override;
|
||||||
ClosestDepot FindClosestDepot() override;
|
ClosestDepot FindClosestDepot(bool may_reverse = false) override;
|
||||||
|
|
||||||
bool IsBus() const;
|
bool IsBus() const;
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ static FindDepotData FindClosestRoadDepot(const RoadVehicle *v, int max_distance
|
||||||
return YapfRoadVehicleFindNearestDepot(v, max_distance);
|
return YapfRoadVehicleFindNearestDepot(v, max_distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClosestDepot RoadVehicle::FindClosestDepot()
|
ClosestDepot RoadVehicle::FindClosestDepot([[maybe_unused]] bool may_reverse)
|
||||||
{
|
{
|
||||||
FindDepotData rfdd = FindClosestRoadDepot(this, 0);
|
FindDepotData rfdd = FindClosestRoadDepot(this, 0);
|
||||||
if (rfdd.best_length == UINT_MAX) return ClosestDepot();
|
if (rfdd.best_length == UINT_MAX) return ClosestDepot();
|
||||||
|
|
|
@ -57,7 +57,7 @@ struct Ship final : public SpecializedVehicle<Ship, VEH_SHIP> {
|
||||||
void OnNewEconomyDay() override;
|
void OnNewEconomyDay() override;
|
||||||
Trackdir GetVehicleTrackdir() const override;
|
Trackdir GetVehicleTrackdir() const override;
|
||||||
TileIndex GetOrderStationLocation(StationID station) override;
|
TileIndex GetOrderStationLocation(StationID station) override;
|
||||||
ClosestDepot FindClosestDepot() override;
|
ClosestDepot FindClosestDepot(bool may_reverse = false) override;
|
||||||
void UpdateCache();
|
void UpdateCache();
|
||||||
void SetDestTile(TileIndex tile) override;
|
void SetDestTile(TileIndex tile) override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
#include "station_base.h"
|
#include "station_base.h"
|
||||||
#include "newgrf_engine.h"
|
#include "newgrf_engine.h"
|
||||||
#include "pathfinder/yapf/yapf.h"
|
#include "pathfinder/yapf/yapf.h"
|
||||||
#include "pathfinder/yapf/yapf_ship_regions.h"
|
|
||||||
#include "newgrf_sound.h"
|
#include "newgrf_sound.h"
|
||||||
#include "spritecache.h"
|
#include "spritecache.h"
|
||||||
#include "strings_func.h"
|
#include "strings_func.h"
|
||||||
|
@ -39,13 +38,8 @@
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
||||||
#include <unordered_set>
|
|
||||||
|
|
||||||
#include "safeguards.h"
|
#include "safeguards.h"
|
||||||
|
|
||||||
/** Max distance in tiles (as the crow flies) to search for depots when user clicks "go to depot". */
|
|
||||||
constexpr int MAX_SHIP_DEPOT_SEARCH_DISTANCE = 80;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the effective #WaterClass for a ship travelling on a tile.
|
* Determine the effective #WaterClass for a ship travelling on a tile.
|
||||||
* @param tile Tile of interest
|
* @param tile Tile of interest
|
||||||
|
@ -148,57 +142,15 @@ void Ship::GetImage(Direction direction, EngineImageType image_type, VehicleSpri
|
||||||
result->Set(_ship_sprites[spritenum] + direction);
|
result->Set(_ship_sprites[spritenum] + direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Depot *FindClosestShipDepot(const Vehicle *v, uint max_distance)
|
static const Depot *FindClosestShipDepot(const Vehicle *v, uint max_distance, bool may_reverse = false)
|
||||||
{
|
{
|
||||||
const int max_region_distance = (max_distance / WATER_REGION_EDGE_LENGTH) + 1;
|
const TileIndex tile = v->tile;
|
||||||
|
if (IsShipDepotTile(tile) && IsTileOwner(tile, v->owner)) return Depot::GetByTile(tile);
|
||||||
|
|
||||||
static std::unordered_set<int> visited_patch_hashes;
|
FindDepotData sfdd = YapfShipFindNearestDepot(Ship::From(v), max_distance, may_reverse);
|
||||||
static std::deque<WaterRegionPatchDesc> patches_to_search;
|
|
||||||
visited_patch_hashes.clear();
|
|
||||||
patches_to_search.clear();
|
|
||||||
|
|
||||||
/* Step 1: find a set of reachable Water Region Patches using BFS. */
|
if (sfdd.tile == INVALID_TILE) return nullptr;
|
||||||
const WaterRegionPatchDesc start_patch = GetWaterRegionPatchInfo(v->tile);
|
return Depot::GetByTile(sfdd.tile);
|
||||||
patches_to_search.push_back(start_patch);
|
|
||||||
visited_patch_hashes.insert(CalculateWaterRegionPatchHash(start_patch));
|
|
||||||
|
|
||||||
while (!patches_to_search.empty()) {
|
|
||||||
/* Remove first patch from the queue and make it the current patch. */
|
|
||||||
const WaterRegionPatchDesc current_node = patches_to_search.front();
|
|
||||||
patches_to_search.pop_front();
|
|
||||||
|
|
||||||
/* Add neighbours of the current patch to the search queue. */
|
|
||||||
VisitWaterRegionPatchCallback visit_func = [&](const WaterRegionPatchDesc &water_region_patch) {
|
|
||||||
/* Note that we check the max distance per axis, not the total distance. */
|
|
||||||
if (std::abs(water_region_patch.x - start_patch.x) > max_region_distance ||
|
|
||||||
std::abs(water_region_patch.y - start_patch.y) > max_region_distance) return;
|
|
||||||
|
|
||||||
const int hash = CalculateWaterRegionPatchHash(water_region_patch);
|
|
||||||
if (visited_patch_hashes.count(hash) == 0) {
|
|
||||||
visited_patch_hashes.insert(hash);
|
|
||||||
patches_to_search.push_back(water_region_patch);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
VisitWaterRegionPatchNeighbours(current_node, visit_func);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Step 2: Find the closest depot within the reachable Water Region Patches. */
|
|
||||||
const Depot *best_depot = nullptr;
|
|
||||||
uint best_dist_sq = std::numeric_limits<uint>::max();
|
|
||||||
for (const Depot *depot : Depot::Iterate()) {
|
|
||||||
const TileIndex tile = depot->xy;
|
|
||||||
if (IsShipDepotTile(tile) && IsTileOwner(tile, v->owner)) {
|
|
||||||
const uint dist_sq = DistanceSquare(tile, v->tile);
|
|
||||||
if (dist_sq < best_dist_sq && dist_sq <= max_distance * max_distance &&
|
|
||||||
visited_patch_hashes.count(CalculateWaterRegionPatchHash(GetWaterRegionPatchInfo(tile))) > 0) {
|
|
||||||
best_dist_sq = dist_sq;
|
|
||||||
best_depot = depot;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return best_depot;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CheckIfShipNeedsService(Vehicle *v)
|
static void CheckIfShipNeedsService(Vehicle *v)
|
||||||
|
@ -209,7 +161,7 @@ static void CheckIfShipNeedsService(Vehicle *v)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint max_distance = _settings_game.pf.yapf.maximum_go_to_depot_penalty / YAPF_TILE_LENGTH;
|
uint max_distance = _settings_game.pf.yapf.maximum_go_to_depot_penalty;
|
||||||
|
|
||||||
const Depot *depot = FindClosestShipDepot(v, max_distance);
|
const Depot *depot = FindClosestShipDepot(v, max_distance);
|
||||||
|
|
||||||
|
@ -948,9 +900,9 @@ CommandCost CmdBuildShip(DoCommandFlags flags, TileIndex tile, const Engine *e,
|
||||||
return CommandCost();
|
return CommandCost();
|
||||||
}
|
}
|
||||||
|
|
||||||
ClosestDepot Ship::FindClosestDepot()
|
ClosestDepot Ship::FindClosestDepot(bool may_reverse)
|
||||||
{
|
{
|
||||||
const Depot *depot = FindClosestShipDepot(this, MAX_SHIP_DEPOT_SEARCH_DISTANCE);
|
const Depot *depot = FindClosestShipDepot(this, 0, may_reverse);
|
||||||
if (depot == nullptr) return ClosestDepot();
|
if (depot == nullptr) return ClosestDepot();
|
||||||
|
|
||||||
return ClosestDepot(depot->xy, depot->index);
|
return ClosestDepot(depot->xy, depot->index);
|
||||||
|
|
|
@ -1717,7 +1717,7 @@ public:
|
||||||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
|
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
|
||||||
Point zoom_pt = { (int)wid->current_x / 2, (int)wid->current_y / 2};
|
Point zoom_pt = { (int)wid->current_x / 2, (int)wid->current_y / 2};
|
||||||
this->SetZoomLevel((widget == WID_SM_ZOOM_IN) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &zoom_pt);
|
this->SetZoomLevel((widget == WID_SM_ZOOM_IN) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &zoom_pt);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1729,13 +1729,13 @@ public:
|
||||||
case WID_SM_VEGETATION: // Show vegetation
|
case WID_SM_VEGETATION: // Show vegetation
|
||||||
case WID_SM_OWNERS: // Show land owners
|
case WID_SM_OWNERS: // Show land owners
|
||||||
this->SwitchMapType((SmallMapType)(widget - WID_SM_CONTOUR));
|
this->SwitchMapType((SmallMapType)(widget - WID_SM_CONTOUR));
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_SM_CENTERMAP: // Center the smallmap again
|
case WID_SM_CENTERMAP: // Center the smallmap again
|
||||||
this->SmallMapCenterOnCurrentPos();
|
this->SmallMapCenterOnCurrentPos();
|
||||||
this->HandleButtonClick(WID_SM_CENTERMAP);
|
this->HandleButtonClick(WID_SM_CENTERMAP);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_SM_TOGGLETOWNNAME: // Toggle town names
|
case WID_SM_TOGGLETOWNNAME: // Toggle town names
|
||||||
|
@ -1743,7 +1743,7 @@ public:
|
||||||
this->SetWidgetLoweredState(WID_SM_TOGGLETOWNNAME, this->show_towns);
|
this->SetWidgetLoweredState(WID_SM_TOGGLETOWNNAME, this->show_towns);
|
||||||
|
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_SM_SHOW_IND_NAMES: // Toggle industry names
|
case WID_SM_SHOW_IND_NAMES: // Toggle industry names
|
||||||
|
@ -1751,7 +1751,7 @@ public:
|
||||||
this->SetWidgetLoweredState(WID_SM_SHOW_IND_NAMES, this->show_ind_names);
|
this->SetWidgetLoweredState(WID_SM_SHOW_IND_NAMES, this->show_ind_names);
|
||||||
|
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_SM_LEGEND: // Legend
|
case WID_SM_LEGEND: // Legend
|
||||||
|
|
|
@ -247,6 +247,22 @@ void SndPlayFx(SoundID sound)
|
||||||
StartSound(sound, 0.5, UINT8_MAX);
|
StartSound(sound, 0.5, UINT8_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Play a beep sound for a click event if enabled in settings.
|
||||||
|
*/
|
||||||
|
void SndClickBeep()
|
||||||
|
{
|
||||||
|
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Play a beep sound for a confirm event if enabled in settings.
|
||||||
|
*/
|
||||||
|
void SndConfirmBeep()
|
||||||
|
{
|
||||||
|
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
||||||
|
}
|
||||||
|
|
||||||
/** Names corresponding to the sound set's files */
|
/** Names corresponding to the sound set's files */
|
||||||
static const std::string_view _sound_file_names[] = { "samples" };
|
static const std::string_view _sound_file_names[] = { "samples" };
|
||||||
|
|
||||||
|
|
|
@ -21,4 +21,7 @@ void SndPlayVehicleFx(SoundID sound, const Vehicle *v);
|
||||||
void SndPlayFx(SoundID sound);
|
void SndPlayFx(SoundID sound);
|
||||||
void SndCopyToPool();
|
void SndCopyToPool();
|
||||||
|
|
||||||
|
void SndClickBeep();
|
||||||
|
void SndConfirmBeep();
|
||||||
|
|
||||||
#endif /* SOUND_FUNC_H */
|
#endif /* SOUND_FUNC_H */
|
||||||
|
|
|
@ -47,7 +47,7 @@ static const PalSpriteID _aqueduct_sprite_table_heads[] = {
|
||||||
{SPR_AQUEDUCT_RAMP_SW, PAL_NONE}, {SPR_AQUEDUCT_RAMP_SE, PAL_NONE}, {SPR_AQUEDUCT_RAMP_NE, PAL_NONE}, {SPR_AQUEDUCT_RAMP_NW, PAL_NONE},
|
{SPR_AQUEDUCT_RAMP_SW, PAL_NONE}, {SPR_AQUEDUCT_RAMP_SE, PAL_NONE}, {SPR_AQUEDUCT_RAMP_NE, PAL_NONE}, {SPR_AQUEDUCT_RAMP_NW, PAL_NONE},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_4_0[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_oxide_north[] = {
|
||||||
{ 0x9A9, PAL_NONE }, { 0x99F, PAL_NONE }, { 0x9B1, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9A9, PAL_NONE }, { 0x99F, PAL_NONE }, { 0x9B1, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A5, PAL_NONE }, { 0x997, PAL_NONE }, { 0x9AD, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9A5, PAL_NONE }, { 0x997, PAL_NONE }, { 0x9AD, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x99D, PAL_NONE }, { 0x99F, PAL_NONE }, { 0x9B1, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x99D, PAL_NONE }, { 0x99F, PAL_NONE }, { 0x9B1, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -58,7 +58,7 @@ static const PalSpriteID _bridge_sprite_table_4_0[] = {
|
||||||
{ 0x1116, PAL_NONE }, { 0x997, PAL_NONE }, { 0x9AD, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1116, PAL_NONE }, { 0x997, PAL_NONE }, { 0x9AD, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_4_1[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_oxide_south[] = {
|
||||||
{ 0x9AA, PAL_NONE }, { 0x9A0, PAL_NONE }, { 0x9B2, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9AA, PAL_NONE }, { 0x9A0, PAL_NONE }, { 0x9B2, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A6, PAL_NONE }, { 0x998, PAL_NONE }, { 0x9AE, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9A6, PAL_NONE }, { 0x998, PAL_NONE }, { 0x9AE, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x99E, PAL_NONE }, { 0x9A0, PAL_NONE }, { 0x9B2, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x99E, PAL_NONE }, { 0x9A0, PAL_NONE }, { 0x9B2, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -69,7 +69,7 @@ static const PalSpriteID _bridge_sprite_table_4_1[] = {
|
||||||
{ 0x1117, PAL_NONE }, { 0x998, PAL_NONE }, { 0x9AE, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1117, PAL_NONE }, { 0x998, PAL_NONE }, { 0x9AE, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_4_2[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_oxide_inner_north[] = {
|
||||||
{ 0x9AC, PAL_NONE }, { 0x9A4, PAL_NONE }, { 0x9B4, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9AC, PAL_NONE }, { 0x9A4, PAL_NONE }, { 0x9B4, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A8, PAL_NONE }, { 0x99C, PAL_NONE }, { 0x9B0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9A8, PAL_NONE }, { 0x99C, PAL_NONE }, { 0x9B0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A2, PAL_NONE }, { 0x9A4, PAL_NONE }, { 0x9B4, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9A2, PAL_NONE }, { 0x9A4, PAL_NONE }, { 0x9B4, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -80,7 +80,7 @@ static const PalSpriteID _bridge_sprite_table_4_2[] = {
|
||||||
{ 0x1119, PAL_NONE }, { 0x99C, PAL_NONE }, { 0x9B0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1119, PAL_NONE }, { 0x99C, PAL_NONE }, { 0x9B0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_4_3[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_oxide_inner_south[] = {
|
||||||
{ 0x9AB, PAL_NONE }, { 0x9A3, PAL_NONE }, { 0x9B3, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9AB, PAL_NONE }, { 0x9A3, PAL_NONE }, { 0x9B3, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A7, PAL_NONE }, { 0x99B, PAL_NONE }, { 0x9AF, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9A7, PAL_NONE }, { 0x99B, PAL_NONE }, { 0x9AF, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A1, PAL_NONE }, { 0x9A3, PAL_NONE }, { 0x9B3, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9A1, PAL_NONE }, { 0x9A3, PAL_NONE }, { 0x9B3, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -91,7 +91,7 @@ static const PalSpriteID _bridge_sprite_table_4_3[] = {
|
||||||
{ 0x1118, PAL_NONE }, { 0x99B, PAL_NONE }, { 0x9AF, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1118, PAL_NONE }, { 0x99B, PAL_NONE }, { 0x9AF, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_4_4[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_oxide_middle_odd[] = {
|
||||||
{ 0x9B6, PAL_NONE }, { 0x9BA, PAL_NONE }, { 0x9BC, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9B6, PAL_NONE }, { 0x9BA, PAL_NONE }, { 0x9BC, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9B5, PAL_NONE }, { 0x9B9, PAL_NONE }, { 0x9BB, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9B5, PAL_NONE }, { 0x9B9, PAL_NONE }, { 0x9BB, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9B8, PAL_NONE }, { 0x9BA, PAL_NONE }, { 0x9BC, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9B8, PAL_NONE }, { 0x9BA, PAL_NONE }, { 0x9BC, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -102,7 +102,7 @@ static const PalSpriteID _bridge_sprite_table_4_4[] = {
|
||||||
{ 0x111E, PAL_NONE }, { 0x9B9, PAL_NONE }, { 0x9BB, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x111E, PAL_NONE }, { 0x9B9, PAL_NONE }, { 0x9BB, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_4_5[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_middle_even[] = {
|
||||||
{ 0x9BD, PAL_NONE }, { 0x9C1, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9BD, PAL_NONE }, { 0x9C1, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9BE, PAL_NONE }, { 0x9C2, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9BE, PAL_NONE }, { 0x9C2, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9BF, PAL_NONE }, { 0x9C1, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9BF, PAL_NONE }, { 0x9C1, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -113,7 +113,7 @@ static const PalSpriteID _bridge_sprite_table_4_5[] = {
|
||||||
{ 0x1121, PAL_NONE }, { 0x9C2, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1121, PAL_NONE }, { 0x9C2, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_4_6[] = {
|
static const PalSpriteID _bridge_sprite_table_generic_oxide_heads[] = {
|
||||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||||
{ 0x98E, PAL_NONE }, { 0x990, PAL_NONE }, { 0x98D, PAL_NONE }, { 0x98F, PAL_NONE },
|
{ 0x98E, PAL_NONE }, { 0x990, PAL_NONE }, { 0x98D, PAL_NONE }, { 0x98F, PAL_NONE },
|
||||||
|
@ -124,7 +124,7 @@ static const PalSpriteID _bridge_sprite_table_4_6[] = {
|
||||||
{ 0x1113, PAL_NONE }, { 0x1115, PAL_NONE }, { 0x1112, PAL_NONE }, { 0x1114, PAL_NONE },
|
{ 0x1113, PAL_NONE }, { 0x1115, PAL_NONE }, { 0x1112, PAL_NONE }, { 0x1114, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_5_0[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_yellow_north[] = {
|
||||||
{ 0x9A9, PALETTE_TO_STRUCT_YELLOW }, { 0x99F, PALETTE_TO_STRUCT_YELLOW }, { 0x9B1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9A9, PALETTE_TO_STRUCT_YELLOW }, { 0x99F, PALETTE_TO_STRUCT_YELLOW }, { 0x9B1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A5, PALETTE_TO_STRUCT_YELLOW }, { 0x997, PALETTE_TO_STRUCT_YELLOW }, { 0x9AD, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9A5, PALETTE_TO_STRUCT_YELLOW }, { 0x997, PALETTE_TO_STRUCT_YELLOW }, { 0x9AD, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x99D, PALETTE_TO_STRUCT_YELLOW }, { 0x99F, PALETTE_TO_STRUCT_YELLOW }, { 0x9B1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x99D, PALETTE_TO_STRUCT_YELLOW }, { 0x99F, PALETTE_TO_STRUCT_YELLOW }, { 0x9B1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
|
@ -135,7 +135,7 @@ static const PalSpriteID _bridge_sprite_table_5_0[] = {
|
||||||
{ 0x1116, PALETTE_TO_STRUCT_YELLOW }, { 0x997, PALETTE_TO_STRUCT_YELLOW }, { 0x9AD, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x1116, PALETTE_TO_STRUCT_YELLOW }, { 0x997, PALETTE_TO_STRUCT_YELLOW }, { 0x9AD, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_5_1[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_yellow_south[] = {
|
||||||
{ 0x9AA, PALETTE_TO_STRUCT_YELLOW }, { 0x9A0, PALETTE_TO_STRUCT_YELLOW }, { 0x9B2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9AA, PALETTE_TO_STRUCT_YELLOW }, { 0x9A0, PALETTE_TO_STRUCT_YELLOW }, { 0x9B2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A6, PALETTE_TO_STRUCT_YELLOW }, { 0x998, PALETTE_TO_STRUCT_YELLOW }, { 0x9AE, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9A6, PALETTE_TO_STRUCT_YELLOW }, { 0x998, PALETTE_TO_STRUCT_YELLOW }, { 0x9AE, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x99E, PALETTE_TO_STRUCT_YELLOW }, { 0x9A0, PALETTE_TO_STRUCT_YELLOW }, { 0x9B2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x99E, PALETTE_TO_STRUCT_YELLOW }, { 0x9A0, PALETTE_TO_STRUCT_YELLOW }, { 0x9B2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
|
@ -146,7 +146,7 @@ static const PalSpriteID _bridge_sprite_table_5_1[] = {
|
||||||
{ 0x1117, PALETTE_TO_STRUCT_YELLOW }, { 0x998, PALETTE_TO_STRUCT_YELLOW }, { 0x9AE, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x1117, PALETTE_TO_STRUCT_YELLOW }, { 0x998, PALETTE_TO_STRUCT_YELLOW }, { 0x9AE, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_5_2[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_yellow_inner_north[] = {
|
||||||
{ 0x9AC, PALETTE_TO_STRUCT_YELLOW }, { 0x9A4, PALETTE_TO_STRUCT_YELLOW }, { 0x9B4, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9AC, PALETTE_TO_STRUCT_YELLOW }, { 0x9A4, PALETTE_TO_STRUCT_YELLOW }, { 0x9B4, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A8, PALETTE_TO_STRUCT_YELLOW }, { 0x99C, PALETTE_TO_STRUCT_YELLOW }, { 0x9B0, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9A8, PALETTE_TO_STRUCT_YELLOW }, { 0x99C, PALETTE_TO_STRUCT_YELLOW }, { 0x9B0, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A2, PALETTE_TO_STRUCT_YELLOW }, { 0x9A4, PALETTE_TO_STRUCT_YELLOW }, { 0x9B4, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9A2, PALETTE_TO_STRUCT_YELLOW }, { 0x9A4, PALETTE_TO_STRUCT_YELLOW }, { 0x9B4, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
|
@ -157,7 +157,7 @@ static const PalSpriteID _bridge_sprite_table_5_2[] = {
|
||||||
{ 0x1119, PALETTE_TO_STRUCT_YELLOW }, { 0x99C, PALETTE_TO_STRUCT_YELLOW }, { 0x9B0, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x1119, PALETTE_TO_STRUCT_YELLOW }, { 0x99C, PALETTE_TO_STRUCT_YELLOW }, { 0x9B0, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_5_3[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_yellow_inner_south[] = {
|
||||||
{ 0x9AB, PALETTE_TO_STRUCT_YELLOW }, { 0x9A3, PALETTE_TO_STRUCT_YELLOW }, { 0x9B3, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9AB, PALETTE_TO_STRUCT_YELLOW }, { 0x9A3, PALETTE_TO_STRUCT_YELLOW }, { 0x9B3, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A7, PALETTE_TO_STRUCT_YELLOW }, { 0x99B, PALETTE_TO_STRUCT_YELLOW }, { 0x9AF, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9A7, PALETTE_TO_STRUCT_YELLOW }, { 0x99B, PALETTE_TO_STRUCT_YELLOW }, { 0x9AF, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x9A1, PALETTE_TO_STRUCT_YELLOW }, { 0x9A3, PALETTE_TO_STRUCT_YELLOW }, { 0x9B3, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9A1, PALETTE_TO_STRUCT_YELLOW }, { 0x9A3, PALETTE_TO_STRUCT_YELLOW }, { 0x9B3, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
|
@ -168,7 +168,7 @@ static const PalSpriteID _bridge_sprite_table_5_3[] = {
|
||||||
{ 0x1118, PALETTE_TO_STRUCT_YELLOW }, { 0x99B, PALETTE_TO_STRUCT_YELLOW }, { 0x9AF, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x1118, PALETTE_TO_STRUCT_YELLOW }, { 0x99B, PALETTE_TO_STRUCT_YELLOW }, { 0x9AF, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_5_4[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_yellow_middle_odd[] = {
|
||||||
{ 0x9B6, PALETTE_TO_STRUCT_YELLOW }, { 0x9BA, PALETTE_TO_STRUCT_YELLOW }, { 0x9BC, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9B6, PALETTE_TO_STRUCT_YELLOW }, { 0x9BA, PALETTE_TO_STRUCT_YELLOW }, { 0x9BC, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x9B5, PALETTE_TO_STRUCT_YELLOW }, { 0x9B9, PALETTE_TO_STRUCT_YELLOW }, { 0x9BB, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9B5, PALETTE_TO_STRUCT_YELLOW }, { 0x9B9, PALETTE_TO_STRUCT_YELLOW }, { 0x9BB, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0x9B8, PALETTE_TO_STRUCT_YELLOW }, { 0x9BA, PALETTE_TO_STRUCT_YELLOW }, { 0x9BC, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x9B8, PALETTE_TO_STRUCT_YELLOW }, { 0x9BA, PALETTE_TO_STRUCT_YELLOW }, { 0x9BC, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
|
@ -179,7 +179,7 @@ static const PalSpriteID _bridge_sprite_table_5_4[] = {
|
||||||
{ 0x111E, PALETTE_TO_STRUCT_YELLOW }, { 0x9B9, PALETTE_TO_STRUCT_YELLOW }, { 0x9BB, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0x111E, PALETTE_TO_STRUCT_YELLOW }, { 0x9B9, PALETTE_TO_STRUCT_YELLOW }, { 0x9BB, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_5_5[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_yellow_middle_even[] = {
|
||||||
{ 0x9BD, PALETTE_TO_STRUCT_YELLOW }, { 0x9C1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9BD, PALETTE_TO_STRUCT_YELLOW }, { 0x9C1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9BE, PALETTE_TO_STRUCT_YELLOW }, { 0x9C2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9BE, PALETTE_TO_STRUCT_YELLOW }, { 0x9C2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9BF, PALETTE_TO_STRUCT_YELLOW }, { 0x9C1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9BF, PALETTE_TO_STRUCT_YELLOW }, { 0x9C1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -190,7 +190,7 @@ static const PalSpriteID _bridge_sprite_table_5_5[] = {
|
||||||
{ 0x1121, PALETTE_TO_STRUCT_YELLOW }, { 0x9C2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1121, PALETTE_TO_STRUCT_YELLOW }, { 0x9C2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_5_6[] = {
|
static const PalSpriteID _bridge_sprite_table_generic_yellow_heads[] = {
|
||||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||||
{ 0x98E, PALETTE_TO_STRUCT_YELLOW }, { 0x990, PALETTE_TO_STRUCT_YELLOW }, { 0x98D, PALETTE_TO_STRUCT_YELLOW }, { 0x98F, PALETTE_TO_STRUCT_YELLOW },
|
{ 0x98E, PALETTE_TO_STRUCT_YELLOW }, { 0x990, PALETTE_TO_STRUCT_YELLOW }, { 0x98D, PALETTE_TO_STRUCT_YELLOW }, { 0x98F, PALETTE_TO_STRUCT_YELLOW },
|
||||||
|
@ -201,7 +201,7 @@ static const PalSpriteID _bridge_sprite_table_5_6[] = {
|
||||||
{ 0x1113, PALETTE_TO_STRUCT_YELLOW }, { 0x1115, PALETTE_TO_STRUCT_YELLOW }, { 0x1112, PALETTE_TO_STRUCT_YELLOW }, { 0x1114, PALETTE_TO_STRUCT_YELLOW },
|
{ 0x1113, PALETTE_TO_STRUCT_YELLOW }, { 0x1115, PALETTE_TO_STRUCT_YELLOW }, { 0x1112, PALETTE_TO_STRUCT_YELLOW }, { 0x1114, PALETTE_TO_STRUCT_YELLOW },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_6_0[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_oxide_north[] = {
|
||||||
{ 0x9CD, PAL_NONE }, { 0x9D9, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9CD, PAL_NONE }, { 0x9D9, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9CE, PAL_NONE }, { 0x9DA, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9CE, PAL_NONE }, { 0x9DA, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D3, PAL_NONE }, { 0x9D9, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9D3, PAL_NONE }, { 0x9D9, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -212,7 +212,7 @@ static const PalSpriteID _bridge_sprite_table_6_0[] = {
|
||||||
{ 0x1125, PAL_NONE }, { 0x9DA, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1125, PAL_NONE }, { 0x9DA, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_6_1[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_oxide_south[] = {
|
||||||
{ 0x9CB, PAL_NONE }, { 0x9D7, PAL_NONE }, { 0x9DD, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9CB, PAL_NONE }, { 0x9D7, PAL_NONE }, { 0x9DD, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D0, PAL_NONE }, { 0x9DC, PAL_NONE }, { 0x9E0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9D0, PAL_NONE }, { 0x9DC, PAL_NONE }, { 0x9E0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D1, PAL_NONE }, { 0x9D7, PAL_NONE }, { 0x9DD, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9D1, PAL_NONE }, { 0x9D7, PAL_NONE }, { 0x9DD, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -223,7 +223,7 @@ static const PalSpriteID _bridge_sprite_table_6_1[] = {
|
||||||
{ 0x1127, PAL_NONE }, { 0x9DC, PAL_NONE }, { 0x9E0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1127, PAL_NONE }, { 0x9DC, PAL_NONE }, { 0x9E0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_6_2[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_oxide_middle[] = {
|
||||||
{ 0x9CC, PAL_NONE }, { 0x9D8, PAL_NONE }, { 0x9DE, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9CC, PAL_NONE }, { 0x9D8, PAL_NONE }, { 0x9DE, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9CF, PAL_NONE }, { 0x9DB, PAL_NONE }, { 0x9DF, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9CF, PAL_NONE }, { 0x9DB, PAL_NONE }, { 0x9DF, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D2, PAL_NONE }, { 0x9D8, PAL_NONE }, { 0x9DE, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9D2, PAL_NONE }, { 0x9D8, PAL_NONE }, { 0x9DE, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -234,7 +234,7 @@ static const PalSpriteID _bridge_sprite_table_6_2[] = {
|
||||||
{ 0x1126, PAL_NONE }, { 0x9DB, PAL_NONE }, { 0x9DF, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1126, PAL_NONE }, { 0x9DB, PAL_NONE }, { 0x9DF, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_6_3[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_oxide_heads[] = {
|
||||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||||
{ 0x98E, PAL_NONE }, { 0x990, PAL_NONE }, { 0x98D, PAL_NONE }, { 0x98F, PAL_NONE },
|
{ 0x98E, PAL_NONE }, { 0x990, PAL_NONE }, { 0x98D, PAL_NONE }, { 0x98F, PAL_NONE },
|
||||||
|
@ -245,7 +245,7 @@ static const PalSpriteID _bridge_sprite_table_6_3[] = {
|
||||||
{ 0x1113, PAL_NONE }, { 0x1115, PAL_NONE }, { 0x1112, PAL_NONE }, { 0x1114, PAL_NONE },
|
{ 0x1113, PAL_NONE }, { 0x1115, PAL_NONE }, { 0x1112, PAL_NONE }, { 0x1114, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_7_0[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_brown_north[] = {
|
||||||
{ 0x9CD, PALETTE_TO_STRUCT_BROWN }, { 0x9D9, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9CD, PALETTE_TO_STRUCT_BROWN }, { 0x9D9, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9CE, PALETTE_TO_STRUCT_BROWN }, { 0x9DA, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9CE, PALETTE_TO_STRUCT_BROWN }, { 0x9DA, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D3, PALETTE_TO_STRUCT_BROWN }, { 0x9D9, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9D3, PALETTE_TO_STRUCT_BROWN }, { 0x9D9, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -256,7 +256,7 @@ static const PalSpriteID _bridge_sprite_table_7_0[] = {
|
||||||
{ 0x1125, PALETTE_TO_STRUCT_BROWN }, { 0x9DA, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1125, PALETTE_TO_STRUCT_BROWN }, { 0x9DA, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_7_1[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_brown_south[] = {
|
||||||
{ 0x9CB, PALETTE_TO_STRUCT_BROWN }, { 0x9D7, PALETTE_TO_STRUCT_BROWN }, { 0x9DD, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
{ 0x9CB, PALETTE_TO_STRUCT_BROWN }, { 0x9D7, PALETTE_TO_STRUCT_BROWN }, { 0x9DD, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D0, PALETTE_TO_STRUCT_BROWN }, { 0x9DC, PALETTE_TO_STRUCT_BROWN }, { 0x9E0, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
{ 0x9D0, PALETTE_TO_STRUCT_BROWN }, { 0x9DC, PALETTE_TO_STRUCT_BROWN }, { 0x9E0, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D1, PALETTE_TO_STRUCT_BROWN }, { 0x9D7, PALETTE_TO_STRUCT_BROWN }, { 0x9DD, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
{ 0x9D1, PALETTE_TO_STRUCT_BROWN }, { 0x9D7, PALETTE_TO_STRUCT_BROWN }, { 0x9DD, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||||
|
@ -267,7 +267,7 @@ static const PalSpriteID _bridge_sprite_table_7_1[] = {
|
||||||
{ 0x1127, PALETTE_TO_STRUCT_BROWN }, { 0x9DC, PALETTE_TO_STRUCT_BROWN }, { 0x9E0, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
{ 0x1127, PALETTE_TO_STRUCT_BROWN }, { 0x9DC, PALETTE_TO_STRUCT_BROWN }, { 0x9E0, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_7_2[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_brown_middle[] = {
|
||||||
{ 0x9CC, PALETTE_TO_STRUCT_BROWN }, { 0x9D8, PALETTE_TO_STRUCT_BROWN }, { 0x9DE, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
{ 0x9CC, PALETTE_TO_STRUCT_BROWN }, { 0x9D8, PALETTE_TO_STRUCT_BROWN }, { 0x9DE, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||||
{ 0x9CF, PALETTE_TO_STRUCT_BROWN }, { 0x9DB, PALETTE_TO_STRUCT_BROWN }, { 0x9DF, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
{ 0x9CF, PALETTE_TO_STRUCT_BROWN }, { 0x9DB, PALETTE_TO_STRUCT_BROWN }, { 0x9DF, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D2, PALETTE_TO_STRUCT_BROWN }, { 0x9D8, PALETTE_TO_STRUCT_BROWN }, { 0x9DE, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
{ 0x9D2, PALETTE_TO_STRUCT_BROWN }, { 0x9D8, PALETTE_TO_STRUCT_BROWN }, { 0x9DE, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||||
|
@ -278,7 +278,7 @@ static const PalSpriteID _bridge_sprite_table_7_2[] = {
|
||||||
{ 0x1126, PALETTE_TO_STRUCT_BROWN }, { 0x9DB, PALETTE_TO_STRUCT_BROWN }, { 0x9DF, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
{ 0x1126, PALETTE_TO_STRUCT_BROWN }, { 0x9DB, PALETTE_TO_STRUCT_BROWN }, { 0x9DF, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_7_3[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_brown_heads[] = {
|
||||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||||
{ 0x98E, PALETTE_TO_STRUCT_BROWN }, { 0x990, PALETTE_TO_STRUCT_BROWN }, { 0x98D, PALETTE_TO_STRUCT_BROWN }, { 0x98F, PALETTE_TO_STRUCT_BROWN },
|
{ 0x98E, PALETTE_TO_STRUCT_BROWN }, { 0x990, PALETTE_TO_STRUCT_BROWN }, { 0x98D, PALETTE_TO_STRUCT_BROWN }, { 0x98F, PALETTE_TO_STRUCT_BROWN },
|
||||||
|
@ -289,7 +289,7 @@ static const PalSpriteID _bridge_sprite_table_7_3[] = {
|
||||||
{ 0x1113, PALETTE_TO_STRUCT_BROWN }, { 0x1115, PALETTE_TO_STRUCT_BROWN }, { 0x1112, PALETTE_TO_STRUCT_BROWN }, { 0x1114, PALETTE_TO_STRUCT_BROWN },
|
{ 0x1113, PALETTE_TO_STRUCT_BROWN }, { 0x1115, PALETTE_TO_STRUCT_BROWN }, { 0x1112, PALETTE_TO_STRUCT_BROWN }, { 0x1114, PALETTE_TO_STRUCT_BROWN },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_8_0[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_red_north[] = {
|
||||||
{ 0x9CD, PALETTE_TO_STRUCT_RED }, { 0x9D9, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9CD, PALETTE_TO_STRUCT_RED }, { 0x9D9, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9CE, PALETTE_TO_STRUCT_RED }, { 0x9DA, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9CE, PALETTE_TO_STRUCT_RED }, { 0x9DA, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D3, PALETTE_TO_STRUCT_RED }, { 0x9D9, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9D3, PALETTE_TO_STRUCT_RED }, { 0x9D9, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -300,7 +300,7 @@ static const PalSpriteID _bridge_sprite_table_8_0[] = {
|
||||||
{ 0x1125, PALETTE_TO_STRUCT_RED }, { 0x9DA, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1125, PALETTE_TO_STRUCT_RED }, { 0x9DA, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_8_1[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_red_south[] = {
|
||||||
{ 0x9CB, PALETTE_TO_STRUCT_RED }, { 0x9D7, PALETTE_TO_STRUCT_RED }, { 0x9DD, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
{ 0x9CB, PALETTE_TO_STRUCT_RED }, { 0x9D7, PALETTE_TO_STRUCT_RED }, { 0x9DD, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D0, PALETTE_TO_STRUCT_RED }, { 0x9DC, PALETTE_TO_STRUCT_RED }, { 0x9E0, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
{ 0x9D0, PALETTE_TO_STRUCT_RED }, { 0x9DC, PALETTE_TO_STRUCT_RED }, { 0x9E0, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D1, PALETTE_TO_STRUCT_RED }, { 0x9D7, PALETTE_TO_STRUCT_RED }, { 0x9DD, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
{ 0x9D1, PALETTE_TO_STRUCT_RED }, { 0x9D7, PALETTE_TO_STRUCT_RED }, { 0x9DD, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||||
|
@ -311,7 +311,7 @@ static const PalSpriteID _bridge_sprite_table_8_1[] = {
|
||||||
{ 0x1127, PALETTE_TO_STRUCT_RED }, { 0x9DC, PALETTE_TO_STRUCT_RED }, { 0x9E0, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
{ 0x1127, PALETTE_TO_STRUCT_RED }, { 0x9DC, PALETTE_TO_STRUCT_RED }, { 0x9E0, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_8_2[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_red_middle[] = {
|
||||||
{ 0x9CC, PALETTE_TO_STRUCT_RED }, { 0x9D8, PALETTE_TO_STRUCT_RED }, { 0x9DE, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
{ 0x9CC, PALETTE_TO_STRUCT_RED }, { 0x9D8, PALETTE_TO_STRUCT_RED }, { 0x9DE, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||||
{ 0x9CF, PALETTE_TO_STRUCT_RED }, { 0x9DB, PALETTE_TO_STRUCT_RED }, { 0x9DF, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
{ 0x9CF, PALETTE_TO_STRUCT_RED }, { 0x9DB, PALETTE_TO_STRUCT_RED }, { 0x9DF, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||||
{ 0x9D2, PALETTE_TO_STRUCT_RED }, { 0x9D8, PALETTE_TO_STRUCT_RED }, { 0x9DE, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
{ 0x9D2, PALETTE_TO_STRUCT_RED }, { 0x9D8, PALETTE_TO_STRUCT_RED }, { 0x9DE, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||||
|
@ -322,7 +322,7 @@ static const PalSpriteID _bridge_sprite_table_8_2[] = {
|
||||||
{ 0x1126, PALETTE_TO_STRUCT_RED }, { 0x9DB, PALETTE_TO_STRUCT_RED }, { 0x9DF, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
{ 0x1126, PALETTE_TO_STRUCT_RED }, { 0x9DB, PALETTE_TO_STRUCT_RED }, { 0x9DF, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_8_3[] = {
|
static const PalSpriteID _bridge_sprite_table_cantilever_red_heads[] = {
|
||||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||||
{ 0x98E, PALETTE_TO_STRUCT_RED }, { 0x990, PALETTE_TO_STRUCT_RED }, { 0x98D, PALETTE_TO_STRUCT_RED }, { 0x98F, PALETTE_TO_STRUCT_RED },
|
{ 0x98E, PALETTE_TO_STRUCT_RED }, { 0x990, PALETTE_TO_STRUCT_RED }, { 0x98D, PALETTE_TO_STRUCT_RED }, { 0x98F, PALETTE_TO_STRUCT_RED },
|
||||||
|
@ -399,7 +399,7 @@ static const PalSpriteID _bridge_sprite_table_archgirder_heads[] = {
|
||||||
MW( SPR_BTGEN_MGLV_RAMP_X_DOWN ), MW( SPR_BTGEN_MGLV_RAMP_Y_DOWN ), MW( SPR_BTGEN_MGLV_RAMP_X_UP ), MW( SPR_BTGEN_MGLV_RAMP_Y_UP ),
|
MW( SPR_BTGEN_MGLV_RAMP_X_DOWN ), MW( SPR_BTGEN_MGLV_RAMP_Y_DOWN ), MW( SPR_BTGEN_MGLV_RAMP_X_UP ), MW( SPR_BTGEN_MGLV_RAMP_Y_UP ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_A[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_concrete_north[] = {
|
||||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_A ), MC( SPR_BTSUS_X_FRONT_TILE_A ), MC( SPR_BTSUS_X_PILLAR_TILE_A ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_X_REAR_TILE_A ), MC( SPR_BTSUS_X_FRONT_TILE_A ), MC( SPR_BTSUS_X_PILLAR_TILE_A ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_A ), MC( SPR_BTSUS_Y_FRONT_TILE_A ), MC( SPR_BTSUS_Y_PILLAR_TILE_A ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_A ), MC( SPR_BTSUS_Y_FRONT_TILE_A ), MC( SPR_BTSUS_Y_PILLAR_TILE_A ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_A ), MC( SPR_BTSUS_X_FRONT_TILE_A ), MC( SPR_BTSUS_X_PILLAR_TILE_A ), MN( 0x0 ),
|
MC( SPR_BTSUS_ROAD_X_REAR_TILE_A ), MC( SPR_BTSUS_X_FRONT_TILE_A ), MC( SPR_BTSUS_X_PILLAR_TILE_A ), MN( 0x0 ),
|
||||||
|
@ -410,7 +410,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_A[] = {
|
||||||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_A ), MC( SPR_BTSUS_Y_FRONT_TILE_A ), MC( SPR_BTSUS_Y_PILLAR_TILE_A ), MN( 0x0 ),
|
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_A ), MC( SPR_BTSUS_Y_FRONT_TILE_A ), MC( SPR_BTSUS_Y_PILLAR_TILE_A ), MN( 0x0 ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_B[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_concrete_south[] = {
|
||||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_B ), MC( SPR_BTSUS_X_FRONT_TILE_B ), MC( SPR_BTSUS_X_PILLAR_TILE_B ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_X_REAR_TILE_B ), MC( SPR_BTSUS_X_FRONT_TILE_B ), MC( SPR_BTSUS_X_PILLAR_TILE_B ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_B ), MC( SPR_BTSUS_Y_FRONT_TILE_B ), MC( SPR_BTSUS_Y_PILLAR_TILE_B ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_B ), MC( SPR_BTSUS_Y_FRONT_TILE_B ), MC( SPR_BTSUS_Y_PILLAR_TILE_B ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_B ), MC( SPR_BTSUS_X_FRONT_TILE_B ), MC( SPR_BTSUS_X_PILLAR_TILE_B ), MN( 0x0 ),
|
MC( SPR_BTSUS_ROAD_X_REAR_TILE_B ), MC( SPR_BTSUS_X_FRONT_TILE_B ), MC( SPR_BTSUS_X_PILLAR_TILE_B ), MN( 0x0 ),
|
||||||
|
@ -421,7 +421,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_B[] = {
|
||||||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_B ), MC( SPR_BTSUS_Y_FRONT_TILE_B ), MC( SPR_BTSUS_Y_PILLAR_TILE_B ), MN( 0x0 ),
|
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_B ), MC( SPR_BTSUS_Y_FRONT_TILE_B ), MC( SPR_BTSUS_Y_PILLAR_TILE_B ), MN( 0x0 ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_C[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_concrete_inner_north[] = {
|
||||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_C ), MC( SPR_BTSUS_X_FRONT_TILE_C ), MC( SPR_BTSUS_X_PILLAR_TILE_C ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_X_REAR_TILE_C ), MC( SPR_BTSUS_X_FRONT_TILE_C ), MC( SPR_BTSUS_X_PILLAR_TILE_C ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_C ), MC( SPR_BTSUS_Y_FRONT_TILE_C ), MC( SPR_BTSUS_Y_PILLAR_TILE_C ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_C ), MC( SPR_BTSUS_Y_FRONT_TILE_C ), MC( SPR_BTSUS_Y_PILLAR_TILE_C ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_C ), MC( SPR_BTSUS_X_FRONT_TILE_C ), MC( SPR_BTSUS_X_PILLAR_TILE_C ), MN( 0x0 ),
|
MC( SPR_BTSUS_ROAD_X_REAR_TILE_C ), MC( SPR_BTSUS_X_FRONT_TILE_C ), MC( SPR_BTSUS_X_PILLAR_TILE_C ), MN( 0x0 ),
|
||||||
|
@ -432,7 +432,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_C[] = {
|
||||||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_C ), MC( SPR_BTSUS_Y_FRONT_TILE_C ), MC( SPR_BTSUS_Y_PILLAR_TILE_C ), MN( 0x0 ),
|
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_C ), MC( SPR_BTSUS_Y_FRONT_TILE_C ), MC( SPR_BTSUS_Y_PILLAR_TILE_C ), MN( 0x0 ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_D[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_concrete_inner_south[] = {
|
||||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_D ), MC( SPR_BTSUS_X_FRONT_TILE_D ), MC( SPR_BTSUS_X_PILLAR_TILE_D ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_X_REAR_TILE_D ), MC( SPR_BTSUS_X_FRONT_TILE_D ), MC( SPR_BTSUS_X_PILLAR_TILE_D ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_D ), MC( SPR_BTSUS_Y_FRONT_TILE_D ), MC( SPR_BTSUS_Y_PILLAR_TILE_D ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_D ), MC( SPR_BTSUS_Y_FRONT_TILE_D ), MC( SPR_BTSUS_Y_PILLAR_TILE_D ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_D ), MC( SPR_BTSUS_X_FRONT_TILE_D ), MC( SPR_BTSUS_X_PILLAR_TILE_D ), MN( 0x0 ),
|
MC( SPR_BTSUS_ROAD_X_REAR_TILE_D ), MC( SPR_BTSUS_X_FRONT_TILE_D ), MC( SPR_BTSUS_X_PILLAR_TILE_D ), MN( 0x0 ),
|
||||||
|
@ -443,7 +443,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_D[] = {
|
||||||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_D ), MC( SPR_BTSUS_Y_FRONT_TILE_D ), MC( SPR_BTSUS_Y_PILLAR_TILE_D ), MN( 0x0 ),
|
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_D ), MC( SPR_BTSUS_Y_FRONT_TILE_D ), MC( SPR_BTSUS_Y_PILLAR_TILE_D ), MN( 0x0 ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_E[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_concrete_middle_odd[] = {
|
||||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_E ), MC( SPR_BTSUS_X_FRONT_TILE_E ), MC( SPR_BTSUS_X_PILLAR_TILE_E ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_X_REAR_TILE_E ), MC( SPR_BTSUS_X_FRONT_TILE_E ), MC( SPR_BTSUS_X_PILLAR_TILE_E ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_E ), MC( SPR_BTSUS_Y_FRONT_TILE_E ), MC( SPR_BTSUS_Y_PILLAR_TILE_E ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_E ), MC( SPR_BTSUS_Y_FRONT_TILE_E ), MC( SPR_BTSUS_Y_PILLAR_TILE_E ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_E ), MC( SPR_BTSUS_X_FRONT_TILE_E ), MC( SPR_BTSUS_X_PILLAR_TILE_E ), MN( 0x0 ),
|
MC( SPR_BTSUS_ROAD_X_REAR_TILE_E ), MC( SPR_BTSUS_X_FRONT_TILE_E ), MC( SPR_BTSUS_X_PILLAR_TILE_E ), MN( 0x0 ),
|
||||||
|
@ -454,7 +454,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_E[] = {
|
||||||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_E ), MC( SPR_BTSUS_Y_FRONT_TILE_E ), MC( SPR_BTSUS_Y_PILLAR_TILE_E ), MN( 0x0 ),
|
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_E ), MC( SPR_BTSUS_Y_FRONT_TILE_E ), MC( SPR_BTSUS_Y_PILLAR_TILE_E ), MN( 0x0 ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_F[] = {
|
static const PalSpriteID _bridge_sprite_table_suspension_concrete_middle_even[] = {
|
||||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_F ), MC( SPR_BTSUS_X_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_X_REAR_TILE_F ), MC( SPR_BTSUS_X_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_F ), MC( SPR_BTSUS_Y_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_F ), MC( SPR_BTSUS_Y_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
||||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_F ), MC( SPR_BTSUS_X_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
MC( SPR_BTSUS_ROAD_X_REAR_TILE_F ), MC( SPR_BTSUS_X_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
||||||
|
@ -465,7 +465,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_F[] = {
|
||||||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_F ), MC( SPR_BTSUS_Y_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_F ), MC( SPR_BTSUS_Y_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_heads[] = {
|
static const PalSpriteID _bridge_sprite_table_generic_concrete_heads[] = {
|
||||||
MN( SPR_BTGEN_RAIL_X_SLOPE_UP ), MN( SPR_BTGEN_RAIL_Y_SLOPE_UP ), MN( SPR_BTGEN_RAIL_X_SLOPE_DOWN ), MN( SPR_BTGEN_RAIL_Y_SLOPE_DOWN ),
|
MN( SPR_BTGEN_RAIL_X_SLOPE_UP ), MN( SPR_BTGEN_RAIL_Y_SLOPE_UP ), MN( SPR_BTGEN_RAIL_X_SLOPE_DOWN ), MN( SPR_BTGEN_RAIL_Y_SLOPE_DOWN ),
|
||||||
MN( SPR_BTGEN_RAIL_RAMP_X_DOWN ), MN( SPR_BTGEN_RAIL_RAMP_Y_DOWN ), MN( SPR_BTGEN_RAIL_RAMP_X_UP ), MN( SPR_BTGEN_RAIL_RAMP_Y_UP ),
|
MN( SPR_BTGEN_RAIL_RAMP_X_DOWN ), MN( SPR_BTGEN_RAIL_RAMP_Y_DOWN ), MN( SPR_BTGEN_RAIL_RAMP_X_UP ), MN( SPR_BTGEN_RAIL_RAMP_Y_UP ),
|
||||||
MC( SPR_BTGEN_ROAD_X_SLOPE_UP ), MC( SPR_BTGEN_ROAD_Y_SLOPE_UP ), MC( SPR_BTGEN_ROAD_X_SLOPE_DOWN ), MC( SPR_BTGEN_ROAD_Y_SLOPE_DOWN ),
|
MC( SPR_BTGEN_ROAD_X_SLOPE_UP ), MC( SPR_BTGEN_ROAD_Y_SLOPE_UP ), MC( SPR_BTGEN_ROAD_X_SLOPE_DOWN ), MC( SPR_BTGEN_ROAD_Y_SLOPE_DOWN ),
|
||||||
|
@ -476,7 +476,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_heads[] = {
|
||||||
MC( SPR_BTGEN_MGLV_RAMP_X_DOWN ), MC( SPR_BTGEN_MGLV_RAMP_Y_DOWN ), MC( SPR_BTGEN_MGLV_RAMP_X_UP ), MC( SPR_BTGEN_MGLV_RAMP_Y_UP ),
|
MC( SPR_BTGEN_MGLV_RAMP_X_DOWN ), MC( SPR_BTGEN_MGLV_RAMP_Y_DOWN ), MC( SPR_BTGEN_MGLV_RAMP_X_UP ), MC( SPR_BTGEN_MGLV_RAMP_Y_UP ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_9_0[] = {
|
static const PalSpriteID _bridge_sprite_table_girder_middle[] = {
|
||||||
{ 0x9F9, PAL_NONE }, { 0x9FD, PAL_NONE }, { 0x9C9, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9F9, PAL_NONE }, { 0x9FD, PAL_NONE }, { 0x9C9, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9FA, PAL_NONE }, { 0x9FE, PAL_NONE }, { 0x9CA, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9FA, PAL_NONE }, { 0x9FE, PAL_NONE }, { 0x9CA, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0x9FB, PAL_NONE }, { 0x9FD, PAL_NONE }, { 0x9C9, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x9FB, PAL_NONE }, { 0x9FD, PAL_NONE }, { 0x9C9, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -487,7 +487,7 @@ static const PalSpriteID _bridge_sprite_table_9_0[] = {
|
||||||
{ 0x1133, PAL_NONE }, { 0x9FE, PAL_NONE }, { 0x9CA, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0x1133, PAL_NONE }, { 0x9FE, PAL_NONE }, { 0x9CA, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_10_0[] = {
|
static const PalSpriteID _bridge_sprite_table_tubular_oxide_north[] = {
|
||||||
{ 0xA0B, PAL_NONE }, { 0xA01, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0B, PAL_NONE }, { 0xA01, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0C, PAL_NONE }, { 0xA02, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0C, PAL_NONE }, { 0xA02, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA11, PAL_NONE }, { 0xA01, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA11, PAL_NONE }, { 0xA01, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -498,7 +498,7 @@ static const PalSpriteID _bridge_sprite_table_10_0[] = {
|
||||||
{ 0xA1E, PAL_NONE }, { 0xA02, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA1E, PAL_NONE }, { 0xA02, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_10_1[] = {
|
static const PalSpriteID _bridge_sprite_table_tubular_oxide_south[] = {
|
||||||
{ 0xA09, PAL_NONE }, { 0x9FF, PAL_NONE }, { 0xA05, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA09, PAL_NONE }, { 0x9FF, PAL_NONE }, { 0xA05, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0E, PAL_NONE }, { 0xA04, PAL_NONE }, { 0xA08, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0E, PAL_NONE }, { 0xA04, PAL_NONE }, { 0xA08, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0F, PAL_NONE }, { 0x9FF, PAL_NONE }, { 0xA05, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0F, PAL_NONE }, { 0x9FF, PAL_NONE }, { 0xA05, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -509,7 +509,7 @@ static const PalSpriteID _bridge_sprite_table_10_1[] = {
|
||||||
{ 0xA20, PAL_NONE }, { 0xA04, PAL_NONE }, { 0xA08, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA20, PAL_NONE }, { 0xA04, PAL_NONE }, { 0xA08, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_10_2[] = {
|
static const PalSpriteID _bridge_sprite_table_tubular_oxide_middle[] = {
|
||||||
{ 0xA0A, PAL_NONE }, { 0xA00, PAL_NONE }, { 0xA06, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0A, PAL_NONE }, { 0xA00, PAL_NONE }, { 0xA06, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0D, PAL_NONE }, { 0xA03, PAL_NONE }, { 0xA07, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0D, PAL_NONE }, { 0xA03, PAL_NONE }, { 0xA07, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA10, PAL_NONE }, { 0xA00, PAL_NONE }, { 0xA06, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA10, PAL_NONE }, { 0xA00, PAL_NONE }, { 0xA06, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -520,7 +520,7 @@ static const PalSpriteID _bridge_sprite_table_10_2[] = {
|
||||||
{ 0xA1F, PAL_NONE }, { 0xA03, PAL_NONE }, { 0xA07, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA1F, PAL_NONE }, { 0xA03, PAL_NONE }, { 0xA07, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_11_0[] = {
|
static const PalSpriteID _bridge_sprite_table_tubular_yellow_north[] = {
|
||||||
{ 0xA0B, PALETTE_TO_STRUCT_YELLOW }, { 0xA01, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0B, PALETTE_TO_STRUCT_YELLOW }, { 0xA01, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0C, PALETTE_TO_STRUCT_YELLOW }, { 0xA02, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0C, PALETTE_TO_STRUCT_YELLOW }, { 0xA02, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA11, PALETTE_TO_STRUCT_YELLOW }, { 0xA01, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA11, PALETTE_TO_STRUCT_YELLOW }, { 0xA01, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -531,7 +531,7 @@ static const PalSpriteID _bridge_sprite_table_11_0[] = {
|
||||||
{ 0xA1E, PALETTE_TO_STRUCT_YELLOW }, { 0xA02, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA1E, PALETTE_TO_STRUCT_YELLOW }, { 0xA02, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_11_1[] = {
|
static const PalSpriteID _bridge_sprite_table_tubular_yellow_south[] = {
|
||||||
{ 0xA09, PALETTE_TO_STRUCT_YELLOW }, { 0x9FF, PALETTE_TO_STRUCT_YELLOW }, { 0xA05, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0xA09, PALETTE_TO_STRUCT_YELLOW }, { 0x9FF, PALETTE_TO_STRUCT_YELLOW }, { 0xA05, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0E, PALETTE_TO_STRUCT_YELLOW }, { 0xA04, PALETTE_TO_STRUCT_YELLOW }, { 0xA08, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0xA0E, PALETTE_TO_STRUCT_YELLOW }, { 0xA04, PALETTE_TO_STRUCT_YELLOW }, { 0xA08, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0F, PALETTE_TO_STRUCT_YELLOW }, { 0x9FF, PALETTE_TO_STRUCT_YELLOW }, { 0xA05, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0xA0F, PALETTE_TO_STRUCT_YELLOW }, { 0x9FF, PALETTE_TO_STRUCT_YELLOW }, { 0xA05, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
|
@ -542,7 +542,7 @@ static const PalSpriteID _bridge_sprite_table_11_1[] = {
|
||||||
{ 0xA20, PALETTE_TO_STRUCT_YELLOW }, { 0xA04, PALETTE_TO_STRUCT_YELLOW }, { 0xA08, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0xA20, PALETTE_TO_STRUCT_YELLOW }, { 0xA04, PALETTE_TO_STRUCT_YELLOW }, { 0xA08, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_11_2[] = {
|
static const PalSpriteID _bridge_sprite_table_tubular_yellow_middle[] = {
|
||||||
{ 0xA0A, PALETTE_TO_STRUCT_YELLOW }, { 0xA00, PALETTE_TO_STRUCT_YELLOW }, { 0xA06, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0xA0A, PALETTE_TO_STRUCT_YELLOW }, { 0xA00, PALETTE_TO_STRUCT_YELLOW }, { 0xA06, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0D, PALETTE_TO_STRUCT_YELLOW }, { 0xA03, PALETTE_TO_STRUCT_YELLOW }, { 0xA07, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0xA0D, PALETTE_TO_STRUCT_YELLOW }, { 0xA03, PALETTE_TO_STRUCT_YELLOW }, { 0xA07, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
{ 0xA10, PALETTE_TO_STRUCT_YELLOW }, { 0xA00, PALETTE_TO_STRUCT_YELLOW }, { 0xA06, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0xA10, PALETTE_TO_STRUCT_YELLOW }, { 0xA00, PALETTE_TO_STRUCT_YELLOW }, { 0xA06, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
|
@ -553,7 +553,7 @@ static const PalSpriteID _bridge_sprite_table_11_2[] = {
|
||||||
{ 0xA1F, PALETTE_TO_STRUCT_YELLOW }, { 0xA03, PALETTE_TO_STRUCT_YELLOW }, { 0xA07, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
{ 0xA1F, PALETTE_TO_STRUCT_YELLOW }, { 0xA03, PALETTE_TO_STRUCT_YELLOW }, { 0xA07, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_12_0[] = {
|
static const PalSpriteID _bridge_sprite_table_tubular_silicon_north[] = {
|
||||||
{ 0xA0B, PALETTE_TO_STRUCT_CONCRETE }, { 0xA01, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0B, PALETTE_TO_STRUCT_CONCRETE }, { 0xA01, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0C, PALETTE_TO_STRUCT_CONCRETE }, { 0xA02, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA0C, PALETTE_TO_STRUCT_CONCRETE }, { 0xA02, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA11, PALETTE_TO_STRUCT_CONCRETE }, { 0xA01, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA11, PALETTE_TO_STRUCT_CONCRETE }, { 0xA01, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
|
@ -564,7 +564,7 @@ static const PalSpriteID _bridge_sprite_table_12_0[] = {
|
||||||
{ 0xA1E, PALETTE_TO_STRUCT_CONCRETE }, { 0xA02, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
{ 0xA1E, PALETTE_TO_STRUCT_CONCRETE }, { 0xA02, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_12_1[] = {
|
static const PalSpriteID _bridge_sprite_table_tubular_silicon_south[] = {
|
||||||
{ 0xA09, PALETTE_TO_STRUCT_CONCRETE }, { 0x9FF, PALETTE_TO_STRUCT_CONCRETE }, { 0xA05, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
{ 0xA09, PALETTE_TO_STRUCT_CONCRETE }, { 0x9FF, PALETTE_TO_STRUCT_CONCRETE }, { 0xA05, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0E, PALETTE_TO_STRUCT_CONCRETE }, { 0xA04, PALETTE_TO_STRUCT_CONCRETE }, { 0xA08, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
{ 0xA0E, PALETTE_TO_STRUCT_CONCRETE }, { 0xA04, PALETTE_TO_STRUCT_CONCRETE }, { 0xA08, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0F, PALETTE_TO_STRUCT_CONCRETE }, { 0x9FF, PALETTE_TO_STRUCT_CONCRETE }, { 0xA05, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
{ 0xA0F, PALETTE_TO_STRUCT_CONCRETE }, { 0x9FF, PALETTE_TO_STRUCT_CONCRETE }, { 0xA05, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||||
|
@ -575,7 +575,7 @@ static const PalSpriteID _bridge_sprite_table_12_1[] = {
|
||||||
{ 0xA20, PALETTE_TO_STRUCT_CONCRETE }, { 0xA04, PALETTE_TO_STRUCT_CONCRETE }, { 0xA08, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
{ 0xA20, PALETTE_TO_STRUCT_CONCRETE }, { 0xA04, PALETTE_TO_STRUCT_CONCRETE }, { 0xA08, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PalSpriteID _bridge_sprite_table_12_2[] = {
|
static const PalSpriteID _bridge_sprite_table_tubular_silicon_middle[] = {
|
||||||
{ 0xA0A, PALETTE_TO_STRUCT_CONCRETE }, { 0xA00, PALETTE_TO_STRUCT_CONCRETE }, { 0xA06, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
{ 0xA0A, PALETTE_TO_STRUCT_CONCRETE }, { 0xA00, PALETTE_TO_STRUCT_CONCRETE }, { 0xA06, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA0D, PALETTE_TO_STRUCT_CONCRETE }, { 0xA03, PALETTE_TO_STRUCT_CONCRETE }, { 0xA07, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
{ 0xA0D, PALETTE_TO_STRUCT_CONCRETE }, { 0xA03, PALETTE_TO_STRUCT_CONCRETE }, { 0xA07, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||||
{ 0xA10, PALETTE_TO_STRUCT_CONCRETE }, { 0xA00, PALETTE_TO_STRUCT_CONCRETE }, { 0xA06, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
{ 0xA10, PALETTE_TO_STRUCT_CONCRETE }, { 0xA00, PALETTE_TO_STRUCT_CONCRETE }, { 0xA06, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||||
|
@ -596,64 +596,64 @@ static const std::span<const PalSpriteID> _bridge_sprite_table_archgirder[] = {
|
||||||
_bridge_sprite_table_archgirder_heads,
|
_bridge_sprite_table_archgirder_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_4[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_suspension_oxide[] = {
|
||||||
_bridge_sprite_table_4_0,
|
_bridge_sprite_table_suspension_oxide_north,
|
||||||
_bridge_sprite_table_4_1,
|
_bridge_sprite_table_suspension_oxide_south,
|
||||||
_bridge_sprite_table_4_2,
|
_bridge_sprite_table_suspension_oxide_inner_north,
|
||||||
_bridge_sprite_table_4_3,
|
_bridge_sprite_table_suspension_oxide_inner_south,
|
||||||
_bridge_sprite_table_4_4,
|
_bridge_sprite_table_suspension_oxide_middle_odd,
|
||||||
_bridge_sprite_table_4_5,
|
_bridge_sprite_table_suspension_middle_even,
|
||||||
_bridge_sprite_table_4_6,
|
_bridge_sprite_table_generic_oxide_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_5[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_suspension_yellow[] = {
|
||||||
_bridge_sprite_table_5_0,
|
_bridge_sprite_table_suspension_yellow_north,
|
||||||
_bridge_sprite_table_5_1,
|
_bridge_sprite_table_suspension_yellow_south,
|
||||||
_bridge_sprite_table_5_2,
|
_bridge_sprite_table_suspension_yellow_inner_north,
|
||||||
_bridge_sprite_table_5_3,
|
_bridge_sprite_table_suspension_yellow_inner_south,
|
||||||
_bridge_sprite_table_5_4,
|
_bridge_sprite_table_suspension_yellow_middle_odd,
|
||||||
_bridge_sprite_table_5_5,
|
_bridge_sprite_table_suspension_yellow_middle_even,
|
||||||
_bridge_sprite_table_5_6,
|
_bridge_sprite_table_generic_yellow_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_concrete_suspended[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_suspension_concrete[] = {
|
||||||
_bridge_sprite_table_concrete_suspended_A,
|
_bridge_sprite_table_suspension_concrete_north,
|
||||||
_bridge_sprite_table_concrete_suspended_B,
|
_bridge_sprite_table_suspension_concrete_south,
|
||||||
_bridge_sprite_table_concrete_suspended_C,
|
_bridge_sprite_table_suspension_concrete_inner_north,
|
||||||
_bridge_sprite_table_concrete_suspended_D,
|
_bridge_sprite_table_suspension_concrete_inner_south,
|
||||||
_bridge_sprite_table_concrete_suspended_E,
|
_bridge_sprite_table_suspension_concrete_middle_odd,
|
||||||
_bridge_sprite_table_concrete_suspended_F,
|
_bridge_sprite_table_suspension_concrete_middle_even,
|
||||||
_bridge_sprite_table_concrete_suspended_heads,
|
_bridge_sprite_table_generic_concrete_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_6[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_cantilever_oxide[] = {
|
||||||
_bridge_sprite_table_6_0,
|
_bridge_sprite_table_cantilever_oxide_north,
|
||||||
_bridge_sprite_table_6_1,
|
_bridge_sprite_table_cantilever_oxide_south,
|
||||||
_bridge_sprite_table_6_2,
|
_bridge_sprite_table_cantilever_oxide_middle,
|
||||||
_bridge_sprite_table_6_2,
|
_bridge_sprite_table_cantilever_oxide_middle,
|
||||||
_bridge_sprite_table_6_2,
|
_bridge_sprite_table_cantilever_oxide_middle,
|
||||||
_bridge_sprite_table_6_2,
|
_bridge_sprite_table_cantilever_oxide_middle,
|
||||||
_bridge_sprite_table_6_3,
|
_bridge_sprite_table_cantilever_oxide_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_7[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_cantilever_brown[] = {
|
||||||
_bridge_sprite_table_7_0,
|
_bridge_sprite_table_cantilever_brown_north,
|
||||||
_bridge_sprite_table_7_1,
|
_bridge_sprite_table_cantilever_brown_south,
|
||||||
_bridge_sprite_table_7_2,
|
_bridge_sprite_table_cantilever_brown_middle,
|
||||||
_bridge_sprite_table_7_2,
|
_bridge_sprite_table_cantilever_brown_middle,
|
||||||
_bridge_sprite_table_7_2,
|
_bridge_sprite_table_cantilever_brown_middle,
|
||||||
_bridge_sprite_table_7_2,
|
_bridge_sprite_table_cantilever_brown_middle,
|
||||||
_bridge_sprite_table_7_3,
|
_bridge_sprite_table_cantilever_brown_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_8[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_cantilever_red[] = {
|
||||||
_bridge_sprite_table_8_0,
|
_bridge_sprite_table_cantilever_red_north,
|
||||||
_bridge_sprite_table_8_1,
|
_bridge_sprite_table_cantilever_red_south,
|
||||||
_bridge_sprite_table_8_2,
|
_bridge_sprite_table_cantilever_red_middle,
|
||||||
_bridge_sprite_table_8_2,
|
_bridge_sprite_table_cantilever_red_middle,
|
||||||
_bridge_sprite_table_8_2,
|
_bridge_sprite_table_cantilever_red_middle,
|
||||||
_bridge_sprite_table_8_2,
|
_bridge_sprite_table_cantilever_red_middle,
|
||||||
_bridge_sprite_table_8_3,
|
_bridge_sprite_table_cantilever_red_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_wood[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_wood[] = {
|
||||||
|
@ -676,60 +676,60 @@ static const std::span<const PalSpriteID> _bridge_sprite_table_concrete[] = {
|
||||||
_bridge_sprite_table_concrete_heads,
|
_bridge_sprite_table_concrete_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_9[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_girder[] = {
|
||||||
_bridge_sprite_table_9_0,
|
_bridge_sprite_table_girder_middle,
|
||||||
_bridge_sprite_table_9_0,
|
_bridge_sprite_table_girder_middle,
|
||||||
_bridge_sprite_table_9_0,
|
_bridge_sprite_table_girder_middle,
|
||||||
_bridge_sprite_table_9_0,
|
_bridge_sprite_table_girder_middle,
|
||||||
_bridge_sprite_table_9_0,
|
_bridge_sprite_table_girder_middle,
|
||||||
_bridge_sprite_table_9_0,
|
_bridge_sprite_table_girder_middle,
|
||||||
_bridge_sprite_table_4_6,
|
_bridge_sprite_table_generic_oxide_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_10[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_tubular_oxide[] = {
|
||||||
_bridge_sprite_table_10_0,
|
_bridge_sprite_table_tubular_oxide_north,
|
||||||
_bridge_sprite_table_10_1,
|
_bridge_sprite_table_tubular_oxide_south,
|
||||||
_bridge_sprite_table_10_2,
|
_bridge_sprite_table_tubular_oxide_middle,
|
||||||
_bridge_sprite_table_10_2,
|
_bridge_sprite_table_tubular_oxide_middle,
|
||||||
_bridge_sprite_table_10_2,
|
_bridge_sprite_table_tubular_oxide_middle,
|
||||||
_bridge_sprite_table_10_2,
|
_bridge_sprite_table_tubular_oxide_middle,
|
||||||
_bridge_sprite_table_4_6,
|
_bridge_sprite_table_generic_oxide_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_11[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_tubular_yellow[] = {
|
||||||
_bridge_sprite_table_11_0,
|
_bridge_sprite_table_tubular_yellow_north,
|
||||||
_bridge_sprite_table_11_1,
|
_bridge_sprite_table_tubular_yellow_south,
|
||||||
_bridge_sprite_table_11_2,
|
_bridge_sprite_table_tubular_yellow_middle,
|
||||||
_bridge_sprite_table_11_2,
|
_bridge_sprite_table_tubular_yellow_middle,
|
||||||
_bridge_sprite_table_11_2,
|
_bridge_sprite_table_tubular_yellow_middle,
|
||||||
_bridge_sprite_table_11_2,
|
_bridge_sprite_table_tubular_yellow_middle,
|
||||||
_bridge_sprite_table_5_6,
|
_bridge_sprite_table_generic_yellow_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const PalSpriteID> _bridge_sprite_table_12[] = {
|
static const std::span<const PalSpriteID> _bridge_sprite_table_tubular_silicon[] = {
|
||||||
_bridge_sprite_table_12_0,
|
_bridge_sprite_table_tubular_silicon_north,
|
||||||
_bridge_sprite_table_12_1,
|
_bridge_sprite_table_tubular_silicon_south,
|
||||||
_bridge_sprite_table_12_2,
|
_bridge_sprite_table_tubular_silicon_middle,
|
||||||
_bridge_sprite_table_12_2,
|
_bridge_sprite_table_tubular_silicon_middle,
|
||||||
_bridge_sprite_table_12_2,
|
_bridge_sprite_table_tubular_silicon_middle,
|
||||||
_bridge_sprite_table_12_2,
|
_bridge_sprite_table_tubular_silicon_middle,
|
||||||
_bridge_sprite_table_concrete_suspended_heads,
|
_bridge_sprite_table_generic_concrete_heads,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::span<const std::span<const PalSpriteID>> _bridge_sprite_table[MAX_BRIDGES] = {
|
static const std::span<const std::span<const PalSpriteID>> _bridge_sprite_table[MAX_BRIDGES] = {
|
||||||
_bridge_sprite_table_wood,
|
_bridge_sprite_table_wood,
|
||||||
_bridge_sprite_table_concrete,
|
_bridge_sprite_table_concrete,
|
||||||
_bridge_sprite_table_archgirder,
|
_bridge_sprite_table_archgirder,
|
||||||
_bridge_sprite_table_concrete_suspended,
|
_bridge_sprite_table_suspension_concrete,
|
||||||
_bridge_sprite_table_4,
|
_bridge_sprite_table_suspension_oxide,
|
||||||
_bridge_sprite_table_5,
|
_bridge_sprite_table_suspension_yellow,
|
||||||
_bridge_sprite_table_6,
|
_bridge_sprite_table_cantilever_oxide,
|
||||||
_bridge_sprite_table_7,
|
_bridge_sprite_table_cantilever_brown,
|
||||||
_bridge_sprite_table_8,
|
_bridge_sprite_table_cantilever_red,
|
||||||
_bridge_sprite_table_9,
|
_bridge_sprite_table_girder,
|
||||||
_bridge_sprite_table_10,
|
_bridge_sprite_table_tubular_oxide,
|
||||||
_bridge_sprite_table_11,
|
_bridge_sprite_table_tubular_yellow,
|
||||||
_bridge_sprite_table_12
|
_bridge_sprite_table_tubular_silicon,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -621,7 +621,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||||
if (!IsInsideMM(size, 1, 8 + 1)) return;
|
if (!IsInsideMM(size, 1, 8 + 1)) return;
|
||||||
_terraform_size = size;
|
_terraform_size = size;
|
||||||
|
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ public:
|
||||||
static void PopupMainToolbarMenu(Window *w, WidgetID widget, DropDownList &&list, int def)
|
static void PopupMainToolbarMenu(Window *w, WidgetID widget, DropDownList &&list, int def)
|
||||||
{
|
{
|
||||||
ShowDropDownList(w, std::move(list), def, widget, 0, true);
|
ShowDropDownList(w, std::move(list), def, widget, 0, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -204,7 +204,7 @@ static CallBackFunction ToolbarPauseClick(Window *)
|
||||||
if (_networking && !_network_server) return CBF_NONE; // only server can pause the game
|
if (_networking && !_network_server) return CBF_NONE; // only server can pause the game
|
||||||
|
|
||||||
if (Command<CMD_PAUSE>::Post(PauseMode::Normal, _pause_mode.None())) {
|
if (Command<CMD_PAUSE>::Post(PauseMode::Normal, _pause_mode.None())) {
|
||||||
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
SndConfirmBeep();
|
||||||
}
|
}
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ static CallBackFunction ToolbarFastForwardClick(Window *)
|
||||||
|
|
||||||
ChangeGameSpeed(_game_speed == 100);
|
ChangeGameSpeed(_game_speed == 100);
|
||||||
|
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ static CallBackFunction ToolbarOptionsClick(Window *w)
|
||||||
list.push_back(MakeDropDownListCheckedItem(IsTransparencySet(TO_SIGNS), STR_SETTINGS_MENU_TRANSPARENT_SIGNS, OME_SHOW_STATIONSIGNS));
|
list.push_back(MakeDropDownListCheckedItem(IsTransparencySet(TO_SIGNS), STR_SETTINGS_MENU_TRANSPARENT_SIGNS, OME_SHOW_STATIONSIGNS));
|
||||||
|
|
||||||
ShowDropDownList(w, std::move(list), 0, WID_TN_SETTINGS, 140, true);
|
ShowDropDownList(w, std::move(list), 0, WID_TN_SETTINGS, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ static CallBackFunction ToolbarGraphsClick(Window *w)
|
||||||
if (_toolbar_mode != TB_NORMAL) AddDropDownLeagueTableOptions(list);
|
if (_toolbar_mode != TB_NORMAL) AddDropDownLeagueTableOptions(list);
|
||||||
|
|
||||||
ShowDropDownList(w, std::move(list), GRMN_OPERATING_PROFIT_GRAPH, WID_TN_GRAPHS, 140, true);
|
ShowDropDownList(w, std::move(list), GRMN_OPERATING_PROFIT_GRAPH, WID_TN_GRAPHS, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
|
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
@ -697,7 +697,7 @@ static CallBackFunction ToolbarLeagueClick(Window *w)
|
||||||
|
|
||||||
int selected = list[0]->result;
|
int selected = list[0]->result;
|
||||||
ShowDropDownList(w, std::move(list), selected, WID_TN_LEAGUE, 140, true);
|
ShowDropDownList(w, std::move(list), selected, WID_TN_LEAGUE, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
|
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
@ -857,7 +857,7 @@ static CallBackFunction ToolbarZoomInClick(Window *w)
|
||||||
{
|
{
|
||||||
if (DoZoomInOutWindow(ZOOM_IN, GetMainWindow())) {
|
if (DoZoomInOutWindow(ZOOM_IN, GetMainWindow())) {
|
||||||
w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_IN : (WidgetID)WID_TN_ZOOM_IN);
|
w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_IN : (WidgetID)WID_TN_ZOOM_IN);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
}
|
}
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
@ -868,7 +868,7 @@ static CallBackFunction ToolbarZoomOutClick(Window *w)
|
||||||
{
|
{
|
||||||
if (DoZoomInOutWindow(ZOOM_OUT, GetMainWindow())) {
|
if (DoZoomInOutWindow(ZOOM_OUT, GetMainWindow())) {
|
||||||
w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_OUT : (WidgetID)WID_TN_ZOOM_OUT);
|
w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_OUT : (WidgetID)WID_TN_ZOOM_OUT);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
}
|
}
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
@ -878,7 +878,7 @@ static CallBackFunction ToolbarZoomOutClick(Window *w)
|
||||||
static CallBackFunction ToolbarBuildRailClick(Window *w)
|
static CallBackFunction ToolbarBuildRailClick(Window *w)
|
||||||
{
|
{
|
||||||
ShowDropDownList(w, GetRailTypeDropDownList(), _last_built_railtype, WID_TN_RAILS, 140, true);
|
ShowDropDownList(w, GetRailTypeDropDownList(), _last_built_railtype, WID_TN_RAILS, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -900,7 +900,7 @@ static CallBackFunction MenuClickBuildRail(int index)
|
||||||
static CallBackFunction ToolbarBuildRoadClick(Window *w)
|
static CallBackFunction ToolbarBuildRoadClick(Window *w)
|
||||||
{
|
{
|
||||||
ShowDropDownList(w, GetRoadTypeDropDownList(RTTB_ROAD), _last_built_roadtype, WID_TN_ROADS, 140, true);
|
ShowDropDownList(w, GetRoadTypeDropDownList(RTTB_ROAD), _last_built_roadtype, WID_TN_ROADS, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -922,7 +922,7 @@ static CallBackFunction MenuClickBuildRoad(int index)
|
||||||
static CallBackFunction ToolbarBuildTramClick(Window *w)
|
static CallBackFunction ToolbarBuildTramClick(Window *w)
|
||||||
{
|
{
|
||||||
ShowDropDownList(w, GetRoadTypeDropDownList(RTTB_TRAM), _last_built_tramtype, WID_TN_TRAMS, 140, true);
|
ShowDropDownList(w, GetRoadTypeDropDownList(RTTB_TRAM), _last_built_tramtype, WID_TN_TRAMS, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,7 +946,7 @@ static CallBackFunction ToolbarBuildWaterClick(Window *w)
|
||||||
DropDownList list;
|
DropDownList list;
|
||||||
list.push_back(MakeDropDownListIconItem(SPR_IMG_BUILD_CANAL, PAL_NONE, STR_WATERWAYS_MENU_WATERWAYS_CONSTRUCTION, 0));
|
list.push_back(MakeDropDownListIconItem(SPR_IMG_BUILD_CANAL, PAL_NONE, STR_WATERWAYS_MENU_WATERWAYS_CONSTRUCTION, 0));
|
||||||
ShowDropDownList(w, std::move(list), 0, WID_TN_WATER, 140, true);
|
ShowDropDownList(w, std::move(list), 0, WID_TN_WATER, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -968,7 +968,7 @@ static CallBackFunction ToolbarBuildAirClick(Window *w)
|
||||||
DropDownList list;
|
DropDownList list;
|
||||||
list.push_back(MakeDropDownListIconItem(SPR_IMG_AIRPORT, PAL_NONE, STR_AIRCRAFT_MENU_AIRPORT_CONSTRUCTION, 0));
|
list.push_back(MakeDropDownListIconItem(SPR_IMG_AIRPORT, PAL_NONE, STR_AIRCRAFT_MENU_AIRPORT_CONSTRUCTION, 0));
|
||||||
ShowDropDownList(w, std::move(list), 0, WID_TN_AIR, 140, true);
|
ShowDropDownList(w, std::move(list), 0, WID_TN_AIR, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -992,7 +992,7 @@ static CallBackFunction ToolbarForestClick(Window *w)
|
||||||
list.push_back(MakeDropDownListIconItem(SPR_IMG_PLANTTREES, PAL_NONE, STR_LANDSCAPING_MENU_PLANT_TREES, 1));
|
list.push_back(MakeDropDownListIconItem(SPR_IMG_PLANTTREES, PAL_NONE, STR_LANDSCAPING_MENU_PLANT_TREES, 1));
|
||||||
list.push_back(MakeDropDownListIconItem(SPR_IMG_SIGN, PAL_NONE, STR_LANDSCAPING_MENU_PLACE_SIGN, 2));
|
list.push_back(MakeDropDownListIconItem(SPR_IMG_SIGN, PAL_NONE, STR_LANDSCAPING_MENU_PLACE_SIGN, 2));
|
||||||
ShowDropDownList(w, std::move(list), 0, WID_TN_LANDSCAPE, 100, true);
|
ShowDropDownList(w, std::move(list), 0, WID_TN_LANDSCAPE, 100, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1188,7 +1188,7 @@ static CallBackFunction ToolbarSwitchClick(Window *w)
|
||||||
|
|
||||||
w->ReInit();
|
w->ReInit();
|
||||||
w->SetWidgetLoweredState(_game_mode == GM_EDITOR ? (WidgetID)WID_TE_SWITCH_BAR : (WidgetID)WID_TN_SWITCH_BAR, _toolbar_mode == TB_LOWER);
|
w->SetWidgetLoweredState(_game_mode == GM_EDITOR ? (WidgetID)WID_TE_SWITCH_BAR : (WidgetID)WID_TN_SWITCH_BAR, _toolbar_mode == TB_LOWER);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1232,7 +1232,7 @@ static CallBackFunction ToolbarScenDateForward(Window *w)
|
||||||
static CallBackFunction ToolbarScenGenLand(Window *w)
|
static CallBackFunction ToolbarScenGenLand(Window *w)
|
||||||
{
|
{
|
||||||
w->HandleButtonClick(WID_TE_LAND_GENERATE);
|
w->HandleButtonClick(WID_TE_LAND_GENERATE);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
|
|
||||||
ShowEditorTerraformToolbar();
|
ShowEditorTerraformToolbar();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
|
@ -1256,7 +1256,7 @@ static CallBackFunction ToolbarScenGenTown(int index)
|
||||||
static CallBackFunction ToolbarScenGenIndustry(Window *w)
|
static CallBackFunction ToolbarScenGenIndustry(Window *w)
|
||||||
{
|
{
|
||||||
w->HandleButtonClick(WID_TE_INDUSTRY);
|
w->HandleButtonClick(WID_TE_INDUSTRY);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
ShowBuildIndustryWindow();
|
ShowBuildIndustryWindow();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
@ -1264,7 +1264,7 @@ static CallBackFunction ToolbarScenGenIndustry(Window *w)
|
||||||
static CallBackFunction ToolbarScenBuildRoadClick(Window *w)
|
static CallBackFunction ToolbarScenBuildRoadClick(Window *w)
|
||||||
{
|
{
|
||||||
ShowDropDownList(w, GetScenRoadTypeDropDownList(RTTB_ROAD), _last_built_roadtype, WID_TE_ROADS, 140, true);
|
ShowDropDownList(w, GetScenRoadTypeDropDownList(RTTB_ROAD), _last_built_roadtype, WID_TE_ROADS, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1284,7 +1284,7 @@ static CallBackFunction ToolbarScenBuildRoad(int index)
|
||||||
static CallBackFunction ToolbarScenBuildTramClick(Window *w)
|
static CallBackFunction ToolbarScenBuildTramClick(Window *w)
|
||||||
{
|
{
|
||||||
ShowDropDownList(w, GetScenRoadTypeDropDownList(RTTB_TRAM), _last_built_tramtype, WID_TE_TRAMS, 140, true);
|
ShowDropDownList(w, GetScenRoadTypeDropDownList(RTTB_TRAM), _last_built_tramtype, WID_TE_TRAMS, 140, true);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1304,7 +1304,7 @@ static CallBackFunction ToolbarScenBuildTram(int index)
|
||||||
static CallBackFunction ToolbarScenBuildDocks(Window *w)
|
static CallBackFunction ToolbarScenBuildDocks(Window *w)
|
||||||
{
|
{
|
||||||
w->HandleButtonClick(WID_TE_WATER);
|
w->HandleButtonClick(WID_TE_WATER);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
ShowBuildDocksScenToolbar();
|
ShowBuildDocksScenToolbar();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
@ -1312,7 +1312,7 @@ static CallBackFunction ToolbarScenBuildDocks(Window *w)
|
||||||
static CallBackFunction ToolbarScenPlantTrees(Window *w)
|
static CallBackFunction ToolbarScenPlantTrees(Window *w)
|
||||||
{
|
{
|
||||||
w->HandleButtonClick(WID_TE_TREES);
|
w->HandleButtonClick(WID_TE_TREES);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
ShowBuildTreesToolbar();
|
ShowBuildTreesToolbar();
|
||||||
return CBF_NONE;
|
return CBF_NONE;
|
||||||
}
|
}
|
||||||
|
@ -1320,7 +1320,7 @@ static CallBackFunction ToolbarScenPlantTrees(Window *w)
|
||||||
static CallBackFunction ToolbarScenPlaceSign(Window *w)
|
static CallBackFunction ToolbarScenPlaceSign(Window *w)
|
||||||
{
|
{
|
||||||
w->HandleButtonClick(WID_TE_SIGNS);
|
w->HandleButtonClick(WID_TE_SIGNS);
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
return SelectSignTool();
|
return SelectSignTool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2407,7 +2407,7 @@ struct ScenarioEditorToolbarWindow : Window {
|
||||||
{
|
{
|
||||||
CallBackFunction cbf = _scen_toolbar_dropdown_procs[widget](index);
|
CallBackFunction cbf = _scen_toolbar_dropdown_procs[widget](index);
|
||||||
if (cbf != CBF_NONE) _last_started_action = cbf;
|
if (cbf != CBF_NONE) _last_started_action = cbf;
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
}
|
}
|
||||||
|
|
||||||
EventState OnHotkey(int hotkey) override
|
EventState OnHotkey(int hotkey) override
|
||||||
|
|
|
@ -1739,7 +1739,7 @@ struct BuildHouseWindow : public PickerWindow {
|
||||||
this->SetWidgetLoweredState(WID_BH_PROTECT_OFF, !BuildHouseWindow::house_protected);
|
this->SetWidgetLoweredState(WID_BH_PROTECT_OFF, !BuildHouseWindow::house_protected);
|
||||||
this->SetWidgetLoweredState(WID_BH_PROTECT_ON, BuildHouseWindow::house_protected);
|
this->SetWidgetLoweredState(WID_BH_PROTECT_ON, BuildHouseWindow::house_protected);
|
||||||
|
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ struct Train final : public GroundVehicle<Train, VEH_TRAIN> {
|
||||||
uint Crash(bool flooded = false) override;
|
uint Crash(bool flooded = false) override;
|
||||||
Trackdir GetVehicleTrackdir() const override;
|
Trackdir GetVehicleTrackdir() const override;
|
||||||
TileIndex GetOrderStationLocation(StationID station) override;
|
TileIndex GetOrderStationLocation(StationID station) override;
|
||||||
ClosestDepot FindClosestDepot() override;
|
ClosestDepot FindClosestDepot(bool may_reverse = false) override;
|
||||||
|
|
||||||
void ReserveTrackUnderConsist() const;
|
void ReserveTrackUnderConsist() const;
|
||||||
|
|
||||||
|
|
|
@ -2185,7 +2185,7 @@ static FindDepotData FindClosestTrainDepot(Train *v, int max_distance)
|
||||||
return YapfTrainFindNearestDepot(v, max_distance);
|
return YapfTrainFindNearestDepot(v, max_distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClosestDepot Train::FindClosestDepot()
|
ClosestDepot Train::FindClosestDepot([[maybe_unused]] bool may_reverse)
|
||||||
{
|
{
|
||||||
FindDepotData tfdd = FindClosestTrainDepot(this, 0);
|
FindDepotData tfdd = FindClosestTrainDepot(this, 0);
|
||||||
if (tfdd.best_length == UINT_MAX) return ClosestDepot();
|
if (tfdd.best_length == UINT_MAX) return ClosestDepot();
|
||||||
|
|
|
@ -80,7 +80,7 @@ public:
|
||||||
} else {
|
} else {
|
||||||
/* toggle the bit of the transparencies variable and play a sound */
|
/* toggle the bit of the transparencies variable and play a sound */
|
||||||
ToggleTransparency((TransparencyOption)(widget - WID_TT_BEGIN));
|
ToggleTransparency((TransparencyOption)(widget - WID_TT_BEGIN));
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
MarkWholeScreenDirty();
|
MarkWholeScreenDirty();
|
||||||
}
|
}
|
||||||
} else if (widget == WID_TT_BUTTONS) {
|
} else if (widget == WID_TT_BUTTONS) {
|
||||||
|
@ -94,7 +94,7 @@ public:
|
||||||
if (i == WID_TT_TEXT|| i == WID_TT_END) return;
|
if (i == WID_TT_TEXT|| i == WID_TT_END) return;
|
||||||
|
|
||||||
ToggleInvisibility((TransparencyOption)(i - WID_TT_BEGIN));
|
ToggleInvisibility((TransparencyOption)(i - WID_TT_BEGIN));
|
||||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
SndClickBeep();
|
||||||
|
|
||||||
/* Redraw whole screen only if transparency is set */
|
/* Redraw whole screen only if transparency is set */
|
||||||
if (IsTransparencySet((TransparencyOption)(i - WID_TT_BEGIN))) {
|
if (IsTransparencySet((TransparencyOption)(i - WID_TT_BEGIN))) {
|
||||||
|
|
|
@ -102,7 +102,7 @@ class BuildTreesWindow : public Window
|
||||||
|
|
||||||
if (this->tree_to_plant >= 0) {
|
if (this->tree_to_plant >= 0) {
|
||||||
/* Activate placement */
|
/* Activate placement */
|
||||||
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
SndConfirmBeep();
|
||||||
SetObjectToPlace(SPR_CURSOR_TREE, PAL_NONE, HT_RECT | HT_DIAGONAL, this->window_class, this->window_number);
|
SetObjectToPlace(SPR_CURSOR_TREE, PAL_NONE, HT_RECT | HT_DIAGONAL, this->window_class, this->window_number);
|
||||||
this->tree_to_plant = current_tree; // SetObjectToPlace may call ResetObjectToPlace which may reset tree_to_plant to -1
|
this->tree_to_plant = current_tree; // SetObjectToPlace may call ResetObjectToPlace which may reset tree_to_plant to -1
|
||||||
} else {
|
} else {
|
||||||
|
@ -180,7 +180,7 @@ public:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_BT_MANY_RANDOM: // place trees randomly over the landscape
|
case WID_BT_MANY_RANDOM: // place trees randomly over the landscape
|
||||||
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
SndConfirmBeep();
|
||||||
PlaceTreesRandomly();
|
PlaceTreesRandomly();
|
||||||
MarkWholeScreenDirty();
|
MarkWholeScreenDirty();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2594,7 +2594,7 @@ CommandCost Vehicle::SendToDepot(DoCommandFlags flags, DepotCommandFlags command
|
||||||
return CommandCost();
|
return CommandCost();
|
||||||
}
|
}
|
||||||
|
|
||||||
ClosestDepot closest_depot = this->FindClosestDepot();
|
ClosestDepot closest_depot = this->FindClosestDepot(true);
|
||||||
static const StringID no_depot[] = {STR_ERROR_UNABLE_TO_FIND_ROUTE_TO, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT, STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR};
|
static const StringID no_depot[] = {STR_ERROR_UNABLE_TO_FIND_ROUTE_TO, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT, STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR};
|
||||||
if (!closest_depot.found) return CommandCost(no_depot[this->type]);
|
if (!closest_depot.found) return CommandCost(no_depot[this->type]);
|
||||||
|
|
||||||
|
|
|
@ -787,9 +787,10 @@ public:
|
||||||
/**
|
/**
|
||||||
* Find the closest depot for this vehicle and tell us the location,
|
* Find the closest depot for this vehicle and tell us the location,
|
||||||
* DestinationID and whether we should reverse.
|
* DestinationID and whether we should reverse.
|
||||||
|
* @param may_reverse Whether the vehicle is allowed to reverse.
|
||||||
* @return A structure with information about the closest depot, if found.
|
* @return A structure with information about the closest depot, if found.
|
||||||
*/
|
*/
|
||||||
virtual ClosestDepot FindClosestDepot() { return {}; }
|
virtual ClosestDepot FindClosestDepot([[maybe_unused]] bool may_reverse = false) { return {}; }
|
||||||
|
|
||||||
virtual void SetDestTile(TileIndex tile) { this->dest_tile = tile; }
|
virtual void SetDestTile(TileIndex tile) { this->dest_tile = tile; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue