mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
3 Commits
a8cca81d0e
...
bd63db2944
Author | SHA1 | Date |
---|---|---|
|
bd63db2944 | |
|
03672ed8eb | |
|
38462627db |
|
@ -84,7 +84,7 @@ struct EnginePreviewWindow : Window {
|
||||||
|
|
||||||
/* Get size of engine sprite, on loan from depot_gui.cpp */
|
/* Get size of engine sprite, on loan from depot_gui.cpp */
|
||||||
EngineID engine = static_cast<EngineID>(this->window_number);
|
EngineID engine = static_cast<EngineID>(this->window_number);
|
||||||
EngineImageType image_type = EIT_PURCHASE;
|
EngineImageType image_type = EIT_PREVIEW;
|
||||||
uint x, y;
|
uint x, y;
|
||||||
int x_offs, y_offs;
|
int x_offs, y_offs;
|
||||||
|
|
||||||
|
|
|
@ -120,12 +120,14 @@ int GetTileZ(TileIndex tile)
|
||||||
uint x2 = std::min(x1 + 1, Map::MaxX());
|
uint x2 = std::min(x1 + 1, Map::MaxX());
|
||||||
uint y2 = std::min(y1 + 1, Map::MaxY());
|
uint y2 = std::min(y1 + 1, Map::MaxY());
|
||||||
|
|
||||||
return std::min({
|
return std::min(
|
||||||
TileHeight(tile), // N corner
|
std::min(
|
||||||
TileHeight(TileXY(x2, y1)), // W corner
|
TileHeight(tile), // N corner
|
||||||
TileHeight(TileXY(x1, y2)), // E corner
|
TileHeight(TileXY(x2, y1))), // W corner
|
||||||
TileHeight(TileXY(x2, y2)), // S corner
|
std::min(
|
||||||
});
|
TileHeight(TileXY(x1, y2)), // E corner
|
||||||
|
TileHeight(TileXY(x2, y2))) // S corner
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -140,10 +142,12 @@ int GetTileMaxZ(TileIndex t)
|
||||||
uint x2 = std::min(x1 + 1, Map::MaxX());
|
uint x2 = std::min(x1 + 1, Map::MaxX());
|
||||||
uint y2 = std::min(y1 + 1, Map::MaxY());
|
uint y2 = std::min(y1 + 1, Map::MaxY());
|
||||||
|
|
||||||
return std::max({
|
return std::max(
|
||||||
TileHeight(t), // N corner
|
std::max(
|
||||||
TileHeight(TileXY(x2, y1)), // W corner
|
TileHeight(t), // N corner
|
||||||
TileHeight(TileXY(x1, y2)), // E corner
|
TileHeight(TileXY(x2, y1))), // W corner
|
||||||
TileHeight(TileXY(x2, y2)), // S corner
|
std::max(
|
||||||
});
|
TileHeight(TileXY(x1, y2)), // E corner
|
||||||
|
TileHeight(TileXY(x2, y2))) // S corner
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue