Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
ContentFeatures Struct Reference

#include <nodedef.h>

+ Collaboration diagram for ContentFeatures:

Public Member Functions

 ContentFeatures ()
 
 ~ContentFeatures ()
 
void reset ()
 
void serialize (std::ostream &os, u16 protocol_version) const
 
void deSerialize (std::istream &is, u16 protocol_version)
 
void setDefaultAlphaMode ()
 
bool needsBackfaceCulling () const
 
bool isLiquid () const
 
bool isLiquidRender () const
 
bool sameLiquidRender (const ContentFeatures &f) const
 
ContentLightingFlags getLightingFlags () const
 
int getGroup (const std::string &group) const
 

Public Attributes

bool has_on_construct
 
bool has_on_destruct
 
bool has_after_destruct
 
bool floats
 
std::string name
 
ItemGroupList groups
 
ContentParamType param_type
 
ContentParamType2 param_type_2
 
enum NodeDrawType drawtype
 
std::string mesh
 
float visual_scale
 
TileDef tiledef [6]
 
TileDef tiledef_overlay [6]
 
TileDef tiledef_special [CF_SPECIAL_COUNT]
 
AlphaMode alpha
 
video::SColor color
 
std::string palette_name
 
std::vector< video::SColor > * palette
 
u8 waving
 
u8 connect_sides
 
std::vector< std::string > connects_to
 
std::vector< content_tconnects_to_ids
 
video::SColor post_effect_color
 
bool post_effect_color_shaded
 
u8 leveled
 
u8 leveled_max
 
bool light_propagates
 
bool sunlight_propagates
 
u8 light_source
 
bool is_ground_content
 
bool walkable
 
PointabilityType pointable
 
bool diggable
 
bool climbable
 
bool buildable_to
 
bool rightclickable
 
u32 damage_per_second
 
std::string node_dig_prediction
 
u8 move_resistance = 0
 
enum LiquidType liquid_type
 
bool liquid_move_physics
 
std::string liquid_alternative_flowing
 
content_t liquid_alternative_flowing_id
 
std::string liquid_alternative_source
 
content_t liquid_alternative_source_id
 
u8 liquid_viscosity
 
bool liquid_renewable
 
u8 liquid_range
 
u8 drowning
 
bool floodable
 
NodeBox node_box
 
NodeBox selection_box
 
NodeBox collision_box
 
SoundSpec sound_footstep
 
SoundSpec sound_dig
 
SoundSpec sound_dug
 
bool legacy_facedir_simple
 
bool legacy_wallmounted
 

Static Public Attributes

static const u8 CONTENTFEATURES_VERSION = 13
 

Private Member Functions

void setAlphaFromLegacy (u8 legacy_alpha)
 
u8 getAlphaForLegacy () const
 

Constructor & Destructor Documentation

◆ ContentFeatures()

ContentFeatures::ContentFeatures ( )

References reset().

+ Here is the call graph for this function:

◆ ~ContentFeatures()

ContentFeatures::~ContentFeatures ( )

References CF_SPECIAL_COUNT.

Member Function Documentation

◆ deSerialize()

void ContentFeatures::deSerialize ( std::istream & is,
u16 protocol_version )

References alpha, AlphaMode_END, ALPHAMODE_LEGACY_COMPAT, ALPHAMODE_OPAQUE, buildable_to, CF_SPECIAL_COUNT, climbable, collision_box, color, connect_sides, connects_to_ids, CONTENTFEATURES_VERSION, ContentParamType2_END, ContentParamType_END, CPT2_NONE, CPT_NONE, damage_per_second, NodeBox::deSerialize(), Pointabilities::deSerializePointabilityType(), SoundSpec::deSerializeSimple(), deSerializeString16(), diggable, drawtype, drowning, floodable, groups, is_ground_content, legacy_facedir_simple, legacy_wallmounted, leveled, leveled_max, LIGHT_MAX, light_propagates, light_source, liquid_alternative_flowing, liquid_alternative_source, liquid_move_physics, LIQUID_NONE, liquid_range, liquid_renewable, liquid_type, liquid_viscosity, LiquidType_END, mesh, move_resistance, MYMIN, name, NDT_NORMAL, node_box, node_dig_prediction, NodeDrawType_END, palette_name, param_type, param_type_2, pointable, post_effect_color, post_effect_color_shaded, readARGB8(), readF32(), readS16(), readU16(), readU32(), readU8(), rightclickable, selection_box, setAlphaFromLegacy(), sound_dig, sound_dug, sound_footstep, sunlight_propagates, tiledef, tiledef_overlay, tiledef_special, visual_scale, walkable, and waving.

Referenced by NodeDefManager::deSerialize(), and TEST_CASE().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAlphaForLegacy()

u8 ContentFeatures::getAlphaForLegacy ( ) const
private

References alpha, and ALPHAMODE_OPAQUE.

Referenced by serialize().

+ Here is the caller graph for this function:

◆ getGroup()

int ContentFeatures::getGroup ( const std::string & group) const
inline

References groups, and itemgroup_get().

Referenced by MapblockMeshGenerator::isSameRail().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLightingFlags()

ContentLightingFlags ContentFeatures::getLightingFlags ( ) const
inline

◆ isLiquid()

bool ContentFeatures::isLiquid ( ) const
inline

References LIQUID_NONE, and liquid_type.

Referenced by ServerMap::addNodeAndUpdate(), Mapgen::findLiquidSurface(), Mapgen::isLiquidHorizontallyFlowable(), isPointableNode(), MapgenSinglenode::makeChunk(), VoxelManipulator::print(), push_content_features(), ReflowScan::scanColumn(), and Mapgen::updateLiquid().

+ Here is the caller graph for this function:

◆ isLiquidRender()

bool ContentFeatures::isLiquidRender ( ) const
inline

References drawtype, NDT_FLOWINGLIQUID, and NDT_LIQUID.

Referenced by sameLiquidRender().

+ Here is the caller graph for this function:

◆ needsBackfaceCulling()

bool ContentFeatures::needsBackfaceCulling ( ) const
inline

References drawtype, NDT_FIRELIKE, NDT_MESH, NDT_PLANTLIKE, NDT_PLANTLIKE_ROOTED, NDT_RAILLIKE, NDT_SIGNLIKE, and NDT_TORCHLIKE.

Referenced by getItemMesh(), and WieldMeshSceneNode::setItem().

+ Here is the caller graph for this function:

◆ reset()

◆ sameLiquidRender()

bool ContentFeatures::sameLiquidRender ( const ContentFeatures & f) const
inline

References isLiquidRender(), liquid_alternative_flowing_id, and liquid_alternative_source_id.

+ Here is the call graph for this function:

◆ serialize()

◆ setAlphaFromLegacy()

void ContentFeatures::setAlphaFromLegacy ( u8 legacy_alpha)
private

References alpha, ALPHAMODE_BLEND, ALPHAMODE_CLIP, ALPHAMODE_OPAQUE, drawtype, NDT_FLOWINGLIQUID, NDT_LIQUID, and NDT_NORMAL.

Referenced by deSerialize().

+ Here is the caller graph for this function:

◆ setDefaultAlphaMode()

void ContentFeatures::setDefaultAlphaMode ( )
inline

References alpha, ALPHAMODE_CLIP, ALPHAMODE_OPAQUE, drawtype, NDT_FLOWINGLIQUID, NDT_LIQUID, NDT_MESH, NDT_NODEBOX, and NDT_NORMAL.

Referenced by read_content_features().

+ Here is the caller graph for this function:

Member Data Documentation

◆ alpha

◆ buildable_to

◆ climbable

◆ collision_box

◆ color

video::SColor ContentFeatures::color

◆ connect_sides

◆ connects_to

std::vector<std::string> ContentFeatures::connects_to

◆ connects_to_ids

std::vector<content_t> ContentFeatures::connects_to_ids

◆ CONTENTFEATURES_VERSION

const u8 ContentFeatures::CONTENTFEATURES_VERSION = 13
static

Referenced by deSerialize(), and serialize().

◆ damage_per_second

u32 ContentFeatures::damage_per_second

◆ diggable

◆ drawtype

◆ drowning

◆ floats

bool ContentFeatures::floats

◆ floodable

◆ groups

◆ has_after_destruct

◆ has_on_construct

bool ContentFeatures::has_on_construct

◆ has_on_destruct

◆ is_ground_content

◆ legacy_facedir_simple

bool ContentFeatures::legacy_facedir_simple

◆ legacy_wallmounted

bool ContentFeatures::legacy_wallmounted

◆ leveled

◆ leveled_max

◆ light_propagates

◆ light_source

◆ liquid_alternative_flowing

std::string ContentFeatures::liquid_alternative_flowing

◆ liquid_alternative_flowing_id

content_t ContentFeatures::liquid_alternative_flowing_id

◆ liquid_alternative_source

std::string ContentFeatures::liquid_alternative_source

◆ liquid_alternative_source_id

content_t ContentFeatures::liquid_alternative_source_id

◆ liquid_move_physics

◆ liquid_range

◆ liquid_renewable

◆ liquid_type

◆ liquid_viscosity

◆ mesh

std::string ContentFeatures::mesh

◆ move_resistance

◆ name

◆ node_box

◆ node_dig_prediction

std::string ContentFeatures::node_dig_prediction

◆ palette

std::vector<video::SColor>* ContentFeatures::palette

◆ palette_name

std::string ContentFeatures::palette_name

◆ param_type

◆ param_type_2

◆ pointable

◆ post_effect_color

video::SColor ContentFeatures::post_effect_color

◆ post_effect_color_shaded

bool ContentFeatures::post_effect_color_shaded

◆ rightclickable

bool ContentFeatures::rightclickable

◆ selection_box

◆ sound_dig

◆ sound_dug

◆ sound_footstep

◆ sunlight_propagates

◆ tiledef

◆ tiledef_overlay

TileDef ContentFeatures::tiledef_overlay[6]

◆ tiledef_special

◆ visual_scale

◆ walkable

◆ waving

u8 ContentFeatures::waving

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