本文整理汇总了C++中ContentFeatures::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ ContentFeatures::reset方法的具体用法?C++ ContentFeatures::reset怎么用?C++ ContentFeatures::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentFeatures
的用法示例。
在下文中一共展示了ContentFeatures::reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_mapnode
/*
See mapnode.h for description.
*/
void init_mapnode()
{
if(g_texturesource == NULL)
{
dstream<<"INFO: Initial run of init_mapnode with "
"g_texturesource=NULL. If this segfaults, "
"there is a bug with something not checking for "
"the NULL value."<<std::endl;
}
else
{
dstream<<"INFO: Full run of init_mapnode with "
"g_texturesource!=NULL"<<std::endl;
}
/*// Read some settings
bool new_style_water = g_settings.getBool("new_style_water");
bool new_style_leaves = g_settings.getBool("new_style_leaves");*/
/*
Initialize content feature table
*/
#ifndef SERVER
/*
Set initial material type to same in all tiles, so that the
same material can be used in more stuff.
This is set according to the leaves because they are the only
differing material to which all materials can be changed to
get this optimization.
*/
u8 initial_material_type = MATERIAL_ALPHA_SIMPLE;
/*if(new_style_leaves)
initial_material_type = MATERIAL_ALPHA_SIMPLE;
else
initial_material_type = MATERIAL_ALPHA_NONE;*/
for(u16 i=0; i<MAX_CONTENT+1; i++)
{
ContentFeatures *f = &g_content_features[i];
// Re-initialize
f->reset();
for(u16 j=0; j<6; j++)
f->tiles[j].material_type = initial_material_type;
}
#endif
/*
Initially set every block to be shown as an unknown block.
Don't touch CONTENT_IGNORE or CONTENT_AIR.
*/
for(u16 i=0; i<MAX_CONTENT+1; i++)
{
if(i == CONTENT_IGNORE || i == CONTENT_AIR)
continue;
ContentFeatures *f = &g_content_features[i];
f->setAllTextures("unknown_block.png");
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
}
// Make CONTENT_IGNORE to not block the view when occlusion culling
content_features(CONTENT_IGNORE).solidness = 0;
/*
Initialize mapnode content
*/
content_mapnode_init();
}