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:
parent
c07499ccfc
commit
42ac5b2f40
3 changed files with 25 additions and 7 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue