#include <nodedef.h>
Public Member Functions | |
ContentFeatures () | |
~ContentFeatures () | |
void | reset () |
void | serialize (std::ostream &os, u16 protocol_version) const |
void | deSerialize (std::istream &is) |
void | setDefaultAlphaMode () |
bool | needsBackfaceCulling () const |
bool | isLiquid () const |
bool | sameLiquid (const ContentFeatures &f) const |
int | getGroup (const std::string &group) const |
void | updateTextures (ITextureSource *tsrc, IShaderSource *shdsrc, scene::IMeshManipulator *meshmanip, Client *client, const TextureSettings &tsettings) |
Private Member Functions | |
bool | textureAlphaCheck (ITextureSource *tsrc, const TileDef *tiles, int length) |
void | setAlphaFromLegacy (u8 legacy_alpha) |
u8 | getAlphaForLegacy () const |
ContentFeatures::ContentFeatures | ( | ) |
ContentFeatures::~ContentFeatures | ( | ) |
References CF_SPECIAL_COUNT, TileLayer::frames, TileSpec::layers, special_tiles, and tiles.
void ContentFeatures::deSerialize | ( | std::istream & | is | ) |
References alpha, buildable_to, CF_SPECIAL_COUNT, climbable, collision_box, color, connect_sides, connects_to_ids, CONTENTFEATURES_VERSION, damage_per_second, NodeBox::deSerialize(), SimpleSoundSpec::deSerialize(), 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_range, liquid_renewable, liquid_type, liquid_viscosity, mesh, MYMIN, name, node_box, node_dig_prediction, palette_name, param_type, param_type_2, pointable, post_effect_color, 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 TestNodeDef::testContentFeaturesSerialization().
|
private |
References alpha, and ALPHAMODE_OPAQUE.
Referenced by serialize().
|
inline |
References groups, and itemgroup_get().
Referenced by MapblockMeshGenerator::drawRaillikeNode(), and MapblockMeshGenerator::isSameRail().
|
inline |
References LIQUID_NONE, and liquid_type.
Referenced by Map::addNodeAndUpdate(), face_contents(), Mapgen::findLiquidSurface(), Mapgen::isLiquidHorizontallyFlowable(), isPointableNode(), LocalPlayer::move(), LocalPlayer::old_move(), VoxelManipulator::print(), push_content_features(), sameLiquid(), ReflowScan::scanColumn(), and Mapgen::updateLiquid().
|
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().
void ContentFeatures::reset | ( | ) |
References alpha, ALPHAMODE_OPAQUE, backface_culling, buildable_to, climbable, collision_box, color, connect_sides, connects_to, connects_to_ids, CONTENT_IGNORE, CPT2_NONE, CPT_NONE, damage_per_second, diggable, drawtype, drowning, floodable, groups, has_after_destruct, has_on_construct, has_on_destruct, is_ground_content, legacy_facedir_simple, legacy_wallmounted, leveled, LEVELED_MAX, leveled_max, light_propagates, light_source, liquid_alternative_flowing, liquid_alternative_flowing_id, liquid_alternative_source, liquid_alternative_source_id, LIQUID_LEVEL_MAX, LIQUID_NONE, liquid_range, liquid_renewable, liquid_type, liquid_viscosity, mesh, mesh_ptr, minimap_color, name, NDT_NORMAL, node_box, node_dig_prediction, palette, palette_name, param_type, param_type_2, pointable, post_effect_color, rightclickable, selection_box, solidness, sound_dig, sound_dug, sound_footstep, sunlight_propagates, tiledef, tiledef_special, visual_scale, visual_solidness, walkable, and waving.
Referenced by ContentFeatures().
|
inline |
References isLiquid(), and liquid_alternative_flowing_id.
Referenced by face_contents().
void ContentFeatures::serialize | ( | std::ostream & | os, |
u16 | protocol_version | ||
) | const |
References alpha, buildable_to, CF_SPECIAL_COUNT, climbable, collision_box, color, connect_sides, connects_to_ids, CONTENTFEATURES_VERSION, damage_per_second, diggable, drawtype, drowning, floodable, getAlphaForLegacy(), groups, is_ground_content, legacy_facedir_simple, legacy_wallmounted, leveled, leveled_max, light_propagates, light_source, liquid_alternative_flowing, liquid_alternative_source, liquid_range, liquid_renewable, liquid_type, liquid_viscosity, mesh, name, node_box, node_dig_prediction, palette_name, param_type, param_type_2, pointable, post_effect_color, rightclickable, selection_box, NodeBox::serialize(), SimpleSoundSpec::serialize(), serializeString16(), sound_dig, sound_dug, sound_footstep, sunlight_propagates, tiledef, tiledef_overlay, tiledef_special, visual_scale, walkable, waving, writeARGB8(), writeF32(), writeS16(), writeU16(), writeU32(), and writeU8().
Referenced by NodeDefManager::serialize(), and TestNodeDef::testContentFeaturesSerialization().
|
private |
References alpha, ALPHAMODE_BLEND, ALPHAMODE_CLIP, ALPHAMODE_OPAQUE, drawtype, NDT_FLOWINGLIQUID, NDT_LIQUID, and NDT_NORMAL.
Referenced by deSerialize().
|
inline |
References alpha, ALPHAMODE_CLIP, ALPHAMODE_LEGACY_COMPAT, ALPHAMODE_OPAQUE, drawtype, NDT_FLOWINGLIQUID, NDT_LIQUID, NDT_MESH, NDT_NODEBOX, and NDT_NORMAL.
Referenced by read_content_features().
|
private |
References RenderingEngine::get_video_driver(), ITextureSource::getTexture(), name, tiles, and warningstream.
Referenced by updateTextures().
void ContentFeatures::updateTextures | ( | ITextureSource * | tsrc, |
IShaderSource * | shdsrc, | ||
scene::IMeshManipulator * | meshmanip, | ||
Client * | client, | ||
const TextureSettings & | tsettings | ||
) |
References alpha, ALPHAMODE_CLIP, ALPHAMODE_LEGACY_COMPAT, ALPHAMODE_OPAQUE, backface_culling, BS, CF_SPECIAL_COUNT, cloneMesh(), color, TextureSettings::connected_glass, CPT2_COLOR, CPT2_COLORED_FACEDIR, CPT2_COLORED_WALLMOUNTED, CPT2_FACEDIR, CPT2_WALLMOUNTED, drawtype, TextureSettings::enable_mesh_cache, TextureSettings::enable_minimap, fillTileAttribs(), ITextureSource::getPalette(), IShaderSource::getShader(), ITextureSource::getTextureAverageColor(), isWorldAligned(), LEAVES_FANCY, LEAVES_SIMPLE, TextureSettings::leaves_style, mesh, mesh_ptr, minimap_color, TileDef::name, name, NDT_AIRLIKE, NDT_ALLFACES, NDT_ALLFACES_OPTIONAL, NDT_FENCELIKE, NDT_FIRELIKE, NDT_FLOWINGLIQUID, NDT_GLASSLIKE, NDT_GLASSLIKE_FRAMED, NDT_GLASSLIKE_FRAMED_OPTIONAL, NDT_LIQUID, NDT_MESH, NDT_NODEBOX, NDT_NORMAL, NDT_PLANTLIKE, NDT_PLANTLIKE_ROOTED, NDT_RAILLIKE, NDT_SIGNLIKE, NDT_TORCHLIKE, TextureSettings::opaque_water, palette, palette_name, param_type_2, recalculateBoundingBox(), rotateMeshBy6dFacedir(), scaleMesh(), solidness, special_tiles, textureAlphaCheck(), TILE_MATERIAL_ALPHA, TILE_MATERIAL_BASIC, TILE_MATERIAL_LIQUID_OPAQUE, TILE_MATERIAL_LIQUID_TRANSPARENT, TILE_MATERIAL_OPAQUE, TILE_MATERIAL_WAVING_LEAVES, TILE_MATERIAL_WAVING_LIQUID_BASIC, TILE_MATERIAL_WAVING_LIQUID_OPAQUE, TILE_MATERIAL_WAVING_LIQUID_TRANSPARENT, TILE_MATERIAL_WAVING_PLANTS, tiledef, tiledef_overlay, tiledef_special, tiles, visual_scale, visual_solidness, waving, TileSpec::world_aligned, and TextureSettings::world_aligned_mode.
Referenced by NodeDefManager::updateTextures().
AlphaMode ContentFeatures::alpha |
bool ContentFeatures::backface_culling |
Referenced by reset(), and updateTextures().
bool ContentFeatures::buildable_to |
Referenced by NodeDefManager::clear(), deSerialize(), Game::nodePlacement(), push_content_features(), read_content_features(), reset(), and serialize().
bool ContentFeatures::climbable |
Referenced by deSerialize(), LocalPlayer::move(), LocalPlayer::old_move(), push_content_features(), read_content_features(), reset(), and serialize().
NodeBox ContentFeatures::collision_box |
Referenced by deSerialize(), MapNode::getCollisionBoxes(), push_content_features(), read_content_features(), reset(), and serialize().
video::SColor ContentFeatures::color |
Referenced by deSerialize(), MapNode::getColor(), push_content_features(), read_content_features(), reset(), serialize(), and updateTextures().
u8 ContentFeatures::connect_sides |
Referenced by deSerialize(), NodeDefManager::nodeboxConnects(), push_content_features(), read_content_features(), reset(), and serialize().
std::vector<std::string> ContentFeatures::connects_to |
Referenced by push_content_features(), read_content_features(), and reset().
std::vector<content_t> ContentFeatures::connects_to_ids |
Referenced by deSerialize(), NodeDefManager::nodeboxConnects(), reset(), and serialize().
u32 ContentFeatures::damage_per_second |
Referenced by deSerialize(), push_content_features(), read_content_features(), reset(), serialize(), and PlayerSAO::step().
bool ContentFeatures::diggable |
Referenced by NodeDefManager::clear(), deSerialize(), push_content_features(), read_content_features(), reset(), and serialize().
enum NodeDrawType ContentFeatures::drawtype |
Referenced by ParticleManager::addDiggingParticles(), NodeDefManager::clear(), collisionMoveSimple(), createSpecialNodeMesh(), deSerialize(), MapblockMeshGenerator::drawFencelikeNode(), MapblockMeshGenerator::drawNode(), MapgenBasic::dustTopNodes(), MapblockMeshGenerator::errorUnknownDrawtype(), Server::findSpawnPos(), DungeonGen::generate(), getItemMesh(), MapNode::getNeighbors(), ParticleManager::getNodeParticleParams(), MapblockMeshGenerator::isSameRail(), needsBackfaceCulling(), NodeDefManager::nodeboxConnects(), push_content_features(), read_content_features(), reset(), serialize(), setAlphaFromLegacy(), setDefaultAlphaMode(), WieldMeshSceneNode::setItem(), and updateTextures().
u8 ContentFeatures::drowning |
Referenced by deSerialize(), push_content_features(), read_content_features(), reset(), serialize(), and PlayerSAO::step().
bool ContentFeatures::floodable |
ItemGroupList ContentFeatures::groups |
Referenced by collisionMoveSimple(), TestGameDef::defineSomeNodes(), deSerialize(), getGroup(), LocalPlayer::getSlipFactor(), Server::handleCommand_Interact(), Game::handleDigging(), LocalPlayer::move(), Game::nodePlacement(), LocalPlayer::old_move(), push_content_features(), read_content_features(), reset(), serialize(), NodeDefManager::set(), and ClientEnvironment::step().
bool ContentFeatures::has_after_destruct |
bool ContentFeatures::has_on_construct |
Referenced by push_content_features(), read_content_features(), reset(), and ServerEnvironment::setNode().
bool ContentFeatures::has_on_destruct |
bool ContentFeatures::is_ground_content |
Referenced by CavesRandomWalk::carveRoute(), CavesV6::carveRoute(), NodeDefManager::clear(), TestGameDef::defineSomeNodes(), deSerialize(), DungeonGen::generate(), CavernsNoise::generateCaverns(), CavesNoiseIntersection::generateCaves(), push_content_features(), read_content_features(), reset(), serialize(), and TestNodeDef::testContentFeaturesSerialization().
bool ContentFeatures::legacy_facedir_simple |
Referenced by deSerialize(), MapBlock::deSerialize_pre22(), push_content_features(), read_content_features(), reset(), and serialize().
bool ContentFeatures::legacy_wallmounted |
Referenced by deSerialize(), MapBlock::deSerialize_pre22(), push_content_features(), read_content_features(), reset(), and serialize().
u8 ContentFeatures::leveled |
Referenced by deSerialize(), MapNode::getLevel(), MapNode::getMaxLevel(), push_content_features(), read_content_features(), reset(), and serialize().
u8 ContentFeatures::leveled_max |
bool ContentFeatures::light_propagates |
Referenced by NodeDefManager::clear(), TestGameDef::defineSomeNodes(), deSerialize(), getSmoothLightCombined(), Map::isOccluded(), Mapgen::lightSpread(), VoxelManipulator::print(), read_content_features(), reset(), serialize(), voxalgo::spread_light(), Mapgen::spreadLight(), TestMapNode::testNodeProperties(), voxalgo::unspread_light(), and voxalgo::update_lighting_nodes().
u8 ContentFeatures::light_source |
Referenced by MapblockMeshGenerator::blendLightColor(), voxalgo::blit_back_with_light(), TestGameDef::defineSomeNodes(), deSerialize(), MapblockMeshGenerator::drawCuboid(), MapblockMeshGenerator::drawGlasslikeFramedNode(), MapblockMeshGenerator::drawMeshNode(), MapblockMeshGenerator::drawQuad(), voxalgo::finish_bulk_light_update(), getFaceLight(), MapNode::getLight(), MapNode::getLightBanks(), getSmoothLightCombined(), getTileInfo(), voxalgo::is_light_locally_correct(), MapNode::isLightDayNightEq(), MapblockMeshGenerator::prepareLiquidNodeDrawing(), VoxelManipulator::print(), push_content_features(), read_content_features(), voxalgo::repair_block_light(), reset(), serialize(), Mapgen::spreadLight(), voxalgo::unspread_light(), voxalgo::update_lighting_nodes(), and MapblockMeshGenerator::useTile().
std::string ContentFeatures::liquid_alternative_flowing |
Referenced by deSerialize(), push_content_features(), read_content_features(), reset(), and serialize().
content_t ContentFeatures::liquid_alternative_flowing_id |
std::string ContentFeatures::liquid_alternative_source |
Referenced by deSerialize(), push_content_features(), read_content_features(), reset(), and serialize().
content_t ContentFeatures::liquid_alternative_source_id |
Referenced by MapblockMeshGenerator::prepareLiquidNodeDrawing(), reset(), MapNode::setLevel(), and Map::transformLiquids().
u8 ContentFeatures::liquid_range |
bool ContentFeatures::liquid_renewable |
Referenced by deSerialize(), push_content_features(), read_content_features(), reset(), serialize(), and Map::transformLiquids().
enum LiquidType ContentFeatures::liquid_type |
Referenced by TestGameDef::defineSomeNodes(), deSerialize(), MapNode::getLevel(), MapNode::getMaxLevel(), MapgenV6::growGrass(), RollbackAction::isImportant(), isLiquid(), push_content_features(), read_content_features(), reset(), ReflowScan::scanColumn(), serialize(), MapNode::setLevel(), and Map::transformLiquids().
u8 ContentFeatures::liquid_viscosity |
std::string ContentFeatures::mesh |
Referenced by deSerialize(), push_content_features(), read_content_features(), reset(), serialize(), and updateTextures().
scene::IMesh* ContentFeatures::mesh_ptr[24] |
Referenced by MapblockMeshGenerator::drawMeshNode(), reset(), and updateTextures().
video::SColor ContentFeatures::minimap_color |
Referenced by Minimap::blitMinimapPixelsToImageSurface(), push_content_features(), reset(), and updateTextures().
std::string ContentFeatures::name |
Referenced by RollbackNode::RollbackNode(), NodeDefManager::allocateDummy(), NodeDefManager::allocateId(), RollbackAction::applyRevert(), NodeDefManager::clear(), TestGameDef::defineSomeNodes(), deSerialize(), NodeDefManager::deSerialize(), generate_nodelist_and_update_ids(), getBlockNodeIdMapping(), Game::handlePointingAtNode(), ModApiEnvMod::l_find_nodes_in_area(), ModApiItemMod::l_get_name_from_content_id(), ModApiClient::l_get_node_def(), ModApiEnvMod::l_place_node(), ModApiItemMod::l_register_item_raw(), ScriptApiNode::node_after_destruct(), ScriptApiNode::node_on_construct(), ScriptApiNode::node_on_destruct(), ScriptApiNode::node_on_dig(), ScriptApiNode::node_on_flood(), ScriptApiNode::node_on_punch(), ScriptApiNode::node_on_receive_fields(), ScriptApiNode::node_on_timer(), ScriptApiNodemeta::nodemeta_inventory_AllowMove(), ScriptApiNodemeta::nodemeta_inventory_AllowPut(), ScriptApiNodemeta::nodemeta_inventory_AllowTake(), ScriptApiNodemeta::nodemeta_inventory_OnMove(), ScriptApiNodemeta::nodemeta_inventory_OnPut(), ScriptApiNodemeta::nodemeta_inventory_OnTake(), LocalPlayer::old_move(), push_content_features(), pushnode(), read_content_features(), reset(), serialize(), NodeDefManager::serialize(), NodeDefManager::set(), Map::setNode(), PlayerSAO::step(), TestNodeDef::testContentFeaturesSerialization(), textureAlphaCheck(), GameUI::update(), and updateTextures().
NodeBox ContentFeatures::node_box |
Referenced by collisionMoveSimple(), deSerialize(), MapblockMeshGenerator::drawNodeboxNode(), MapNode::getCollisionBoxes(), MapNode::getNeighbors(), MapNode::getNodeBoxes(), NodeDefManager::nodeboxConnects(), push_content_features(), read_content_features(), reset(), serialize(), and TestNodeDef::testContentFeaturesSerialization().
std::string ContentFeatures::node_dig_prediction |
Referenced by deSerialize(), Game::handleDigging(), push_content_features(), read_content_features(), reset(), and serialize().
std::vector<video::SColor>* ContentFeatures::palette |
Referenced by MapNode::getColor(), push_content_features(), reset(), and updateTextures().
std::string ContentFeatures::palette_name |
Referenced by deSerialize(), push_content_features(), read_content_features(), reset(), serialize(), and updateTextures().
ContentParamType ContentFeatures::param_type |
Referenced by voxalgo::blit_back_with_light(), NodeDefManager::clear(), TestGameDef::defineSomeNodes(), deSerialize(), voxalgo::finish_bulk_light_update(), ClientMap::getBackgroundBrightness(), MapNode::getLight(), MapNode::getLightBanks(), getSmoothLightCombined(), getVisibleBrightness(), MapgenV6::growGrass(), voxalgo::is_light_locally_correct(), MapNode::isLightDayNightEq(), MapblockMeshGenerator::prepareLiquidNodeDrawing(), push_content_features(), read_content_features(), voxalgo::repair_block_light(), reset(), and serialize().
ContentParamType2 ContentFeatures::param_type_2 |
Referenced by createSpecialNodeMesh(), deSerialize(), MapblockMeshGenerator::drawGlasslikeFramedNode(), MapblockMeshGenerator::drawMeshNode(), MapblockMeshGenerator::drawPlantlike(), MapNode::getFaceDir(), MapNode::getLevel(), MapNode::getMaxLevel(), getNodeBoxUnion(), MapNode::getWallMounted(), NodeDefManager::nodeboxConnects(), Game::nodePlacement(), push_content_features(), read_content_features(), reset(), MapNode::rotateAlongYAxis(), serialize(), MapNode::setLevel(), and updateTextures().
bool ContentFeatures::pointable |
Referenced by NodeDefManager::clear(), deSerialize(), isPointableNode(), push_content_features(), read_content_features(), reset(), and serialize().
video::SColor ContentFeatures::post_effect_color |
Referenced by deSerialize(), push_content_features(), read_content_features(), ClientMap::renderPostFx(), reset(), and serialize().
bool ContentFeatures::rightclickable |
Referenced by deSerialize(), Game::nodePlacement(), push_content_features(), read_content_features(), reset(), and serialize().
NodeBox ContentFeatures::selection_box |
u8 ContentFeatures::solidness |
SimpleSoundSpec ContentFeatures::sound_dig |
Referenced by deSerialize(), Game::handleDigging(), push_content_features(), read_content_features(), reset(), and serialize().
SimpleSoundSpec ContentFeatures::sound_dug |
Referenced by deSerialize(), SoundMaker::nodeDug(), push_content_features(), read_content_features(), reset(), and serialize().
SimpleSoundSpec ContentFeatures::sound_footstep |
Referenced by deSerialize(), push_content_features(), read_content_features(), reset(), serialize(), GenericCAO::step(), and Game::updateSound().
TileSpec ContentFeatures::special_tiles[CF_SPECIAL_COUNT] |
bool ContentFeatures::sunlight_propagates |
Referenced by MapgenSinglenode::MapgenSinglenode(), NodeDefManager::clear(), TestGameDef::defineSomeNodes(), deSerialize(), voxalgo::fill_with_sunlight(), ServerEnvironment::findSunlight(), getVisibleBrightness(), voxalgo::propagate_block_sunlight(), Mapgen::propagateSunlight(), push_content_features(), read_content_features(), reset(), serialize(), and voxalgo::update_lighting_nodes().
TileDef ContentFeatures::tiledef[6] |
TileDef ContentFeatures::tiledef_overlay[6] |
Referenced by deSerialize(), read_content_features(), serialize(), and updateTextures().
TileDef ContentFeatures::tiledef_special[CF_SPECIAL_COUNT] |
Referenced by NodeDefManager::applyTextureOverrides(), deSerialize(), read_content_features(), reset(), serialize(), and updateTextures().
TileSpec ContentFeatures::tiles[6] |
float ContentFeatures::visual_scale |
Referenced by deSerialize(), MapblockMeshGenerator::drawAutoLightedCuboid(), MapblockMeshGenerator::drawFirelikeNode(), MapblockMeshGenerator::drawPlantlike(), MapblockMeshGenerator::drawSignlikeNode(), MapblockMeshGenerator::drawTorchlikeNode(), getItemMesh(), push_content_features(), read_content_features(), reset(), serialize(), WieldMeshSceneNode::setItem(), and updateTextures().
u8 ContentFeatures::visual_solidness |
Referenced by face_contents(), reset(), and updateTextures().
bool ContentFeatures::walkable |
Referenced by Pathfinder::calcCost(), NodeDefManager::clear(), collisionMoveSimple(), deSerialize(), MapgenBasic::dustTopNodes(), Mapgen::findGroundLevel(), Mapgen::findLiquidSurface(), MapgenV6::flowMud(), MapBlock::getGroundLevel(), Pathfinder::getPath(), LocalPlayer::getSlipFactor(), Mapgen::getSurfaces(), LocalPlayer::handleAutojump(), GridNodeContainer::initNode(), LocalPlayer::move(), Game::nodePlacement(), LocalPlayer::old_move(), push_content_features(), read_content_features(), reset(), serialize(), TestNodeDef::testContentFeaturesSerialization(), Camera::update(), LocalPlayer::updateSneakNode(), and Pathfinder::walkDownwards().
u8 ContentFeatures::waving |
Referenced by deSerialize(), getTileInfo(), push_content_features(), read_content_features(), reset(), serialize(), and updateTextures().