mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
parent
c2a9ac24ac
commit
35929d27e3
5 changed files with 208 additions and 695 deletions
|
@ -254,12 +254,6 @@ struct TileLayer
|
|||
}
|
||||
}
|
||||
|
||||
bool isTileable() const
|
||||
{
|
||||
return (material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL)
|
||||
&& (material_flags & MATERIAL_FLAG_TILEABLE_VERTICAL);
|
||||
}
|
||||
|
||||
bool isTransparent() const
|
||||
{
|
||||
switch (material_type) {
|
||||
|
@ -312,22 +306,6 @@ struct TileSpec
|
|||
{
|
||||
TileSpec() = default;
|
||||
|
||||
/*!
|
||||
* Returns true if this tile can be merged with the other tile.
|
||||
*/
|
||||
bool isTileable(const TileSpec &other) const {
|
||||
for (int layer = 0; layer < MAX_TILE_LAYERS; layer++) {
|
||||
if (layers[layer] != other.layers[layer])
|
||||
return false;
|
||||
// Only non-transparent tiles can be merged into fast faces
|
||||
if (layers[layer].isTransparent() || !layers[layer].isTileable())
|
||||
return false;
|
||||
}
|
||||
return rotation == 0
|
||||
&& rotation == other.rotation
|
||||
&& emissive_light == other.emissive_light;
|
||||
}
|
||||
|
||||
//! If true, the tile rotation is ignored.
|
||||
bool world_aligned = false;
|
||||
//! Tile rotation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue