1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Mostly deal with problems caused by polygon offset (#15867)

This commit is contained in:
sfan5 2025-03-16 17:56:32 +01:00 committed by GitHub
parent c07499ccfc
commit 42ac5b2f40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 7 deletions

View file

@ -73,7 +73,8 @@ struct TileLayer
material_flags == other.material_flags &&
has_color == other.has_color &&
color == other.color &&
scale == other.scale;
scale == other.scale &&
need_polygon_offset == other.need_polygon_offset;
}
/*!
@ -92,6 +93,12 @@ struct TileLayer
*/
void applyMaterialOptions(video::SMaterial &material, int layer) const;
/// @return is this layer uninitalized?
bool empty() const
{
return !shader_id && !texture_id;
}
/// @return is this layer semi-transparent?
bool isTransparent() const
{
@ -125,6 +132,12 @@ struct TileLayer
MATERIAL_FLAG_TILEABLE_HORIZONTAL|
MATERIAL_FLAG_TILEABLE_VERTICAL;
u8 scale = 1;
/// does this tile need to have a positive polygon offset set?
/// @see TileLayer::applyMaterialOptions
bool need_polygon_offset = false;
/// @note not owned by this struct
std::vector<FrameSpec> *frames = nullptr;
@ -136,8 +149,6 @@ struct TileLayer
//! If true, the tile has its own color.
bool has_color = false;
u8 scale = 1;
};
enum class TileRotation: u8 {