Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
TileLayer Struct Reference

Defines a layer of a tile. More...

#include <tile.h>

+ Collaboration diagram for TileLayer:

Public Member Functions

 TileLayer ()=default
 
bool operator== (const TileLayer &other) const
 
bool operator!= (const TileLayer &other) const
 
void applyMaterialOptions (video::SMaterial &material, int layer) const
 Set some material parameters accordingly.
 
bool empty () const
 
bool isTransparent () const
 

Public Attributes

video::ITexture * texture = nullptr
 
u32 shader_id = 0
 
u32 texture_id = 0
 
u16 animation_frame_length_ms = 0
 
u16 animation_frame_count = 1
 
u16 texture_layer_idx = 0
 Layer index to use, if the texture is an array texture.
 
MaterialType material_type = TILE_MATERIAL_BASIC
 
u8 material_flags
 
u8 scale = 1
 Texture scale in both directions (used for world-align)
 
bool need_polygon_offset = false
 does this tile need to have a positive polygon offset set?
 
std::vector< FrameSpec > * frames = nullptr
 
video::SColor color
 
bool has_color = false
 If true, the tile has its own color.
 

Detailed Description

Defines a layer of a tile.

Constructor & Destructor Documentation

◆ TileLayer()

TileLayer::TileLayer ( )
default

Member Function Documentation

◆ applyMaterialOptions()

void TileLayer::applyMaterialOptions ( video::SMaterial & material,
int layer ) const

Set some material parameters accordingly.

Note
does not set MaterialType!
Parameters
materialmaterial to mody
layerindex of this layer in the TileSpec

References MATERIAL_FLAG_BACKFACE_CULLING, MATERIAL_FLAG_TILEABLE_HORIZONTAL, MATERIAL_FLAG_TILEABLE_VERTICAL, material_flags, need_polygon_offset, and texture.

◆ empty()

bool TileLayer::empty ( ) const
inline
Returns
is this layer uninitalized?

References shader_id, and texture_id.

Referenced by MeshCollector::append(), extractTexture(), extractTexture(), MapblockMeshGenerator::getSpecialTile(), and NodeVisuals::updateTextures().

+ Here is the caller graph for this function:

◆ isTransparent()

bool TileLayer::isTransparent ( ) const
inline

◆ operator!=()

bool TileLayer::operator!= ( const TileLayer & other) const
inline

Two layers are not equal if they must have different vertices.

◆ operator==()

bool TileLayer::operator== ( const TileLayer & other) const
inline

Two layers are equal if they can be merged (same material).

References color, has_color, material_flags, need_polygon_offset, shader_id, and texture_id.

Member Data Documentation

◆ animation_frame_count

u16 TileLayer::animation_frame_count = 1

◆ animation_frame_length_ms

u16 TileLayer::animation_frame_length_ms = 0

◆ color

video::SColor TileLayer::color

The color of the tile, or if the tile does not own a color then the color of the node owning this tile.

Referenced by PreMeshBuffer::applyTileColor(), fillTileAttribs(), ParticleManager::getNodeParticleParams(), MapblockMeshGenerator::getSpecialTile(), and operator==().

◆ frames

std::vector<FrameSpec>* TileLayer::frames = nullptr

◆ has_color

bool TileLayer::has_color = false

◆ material_flags

u8 TileLayer::material_flags
Initial value:
=
#define MATERIAL_FLAG_BACKFACE_CULLING
Definition tile.h:45
#define MATERIAL_FLAG_TILEABLE_VERTICAL
Definition tile.h:51
#define MATERIAL_FLAG_TILEABLE_HORIZONTAL
Definition tile.h:50

Referenced by applyMaterialOptions(), extractTexture(), extractTexture(), fillTileAttribs(), MapblockMeshGenerator::getSpecialTile(), and operator==().

◆ material_type

MaterialType TileLayer::material_type = TILE_MATERIAL_BASIC

Referenced by fillTileAttribs(), and isTransparent().

◆ need_polygon_offset

bool TileLayer::need_polygon_offset = false

does this tile need to have a positive polygon offset set?

See also
TileLayer::applyMaterialOptions

Referenced by applyMaterialOptions(), operator==(), and NodeVisuals::updateTextures().

◆ scale

u8 TileLayer::scale = 1

Texture scale in both directions (used for world-align)

Referenced by fillTileAttribs(), ParticleManager::getNodeParticleParams(), and setupCuboidVertices().

◆ shader_id

u32 TileLayer::shader_id = 0

Referenced by empty(), fillTileAttribs(), and operator==().

◆ texture

video::ITexture* TileLayer::texture = nullptr

◆ texture_id

u32 TileLayer::texture_id = 0

Referenced by empty(), fillTileAttribs(), and operator==().

◆ texture_layer_idx

u16 TileLayer::texture_layer_idx = 0

Layer index to use, if the texture is an array texture.

Referenced by MeshCollector::append(), fillTileAttribs(), and getArrayTextureMax().


The documentation for this struct was generated from the following files: