当前位置: 首页>>代码示例>>C++>>正文


C++ ContentFeatures::setAllTextureTypes方法代码示例

本文整理汇总了C++中ContentFeatures::setAllTextureTypes方法的典型用法代码示例。如果您正苦于以下问题:C++ ContentFeatures::setAllTextureTypes方法的具体用法?C++ ContentFeatures::setAllTextureTypes怎么用?C++ ContentFeatures::setAllTextureTypes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContentFeatures的用法示例。


在下文中一共展示了ContentFeatures::setAllTextureTypes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: content_mapnode_plants


//.........这里部分代码省略.........
	f->setInventoryTexture("junglegrass.png");
	f->setAllTextures("junglegrass.png");
	f->setAllTextureFlags(0);
	f->light_propagates = true;
	f->param_type = CPT_LIGHT;
	f->draw_type = CDT_PLANTLIKE_LGE;
	//f->is_ground_content = true;
	f->air_equivalent = true;
	f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
	f->solidness = 0; // drawn separately, makes no faces
	f->walkable = false;
	f->flammable = 1; // can be replaced by fire if the node under it is set on fire
	f->fuel_time = 30/32;
	f->type = CMT_PLANT;
	f->hardness = 0.20;
	f->pressure_type = CST_CRUSHABLE;
	f->suffocation_per_second = 0;
	lists::add("creative",i);

	i = CONTENT_LEAVES;
	f = &content_features(i);
	f->description = wgettext("Leaves");
	f->light_propagates = true;
	f->air_equivalent = true;
	f->walkable = false;
	f->climbable = true;
	f->param_type = CPT_LIGHT;
	//f->is_ground_content = true;
	if (new_style_leaves) {
		f->draw_type = CDT_LEAFLIKE;
		f->solidness = 0; // drawn separately, makes no faces
		f->setAllTextures("leaves.png");
#ifndef SERVER
		f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
		f->setAllTextureFlags(0);
#endif
	}else{
		f->draw_type = CDT_CUBELIKE;
		f->setAllTextures("[noalpha:leaves.png");
	}
	f->flammable = 1; // can be replaced by fire if the node under it is set on fire
	f->fuel_time = 30/16;
	f->cook_result = std::string("CraftItem lump_of_resin 1");
	f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAPLING)+" 1";
	f->extra_dug_item_rarity = 20;
	f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
	f->ondig_special_drop = CONTENT_TRIMMED_LEAVES;
	f->ondig_special_drop_count = 1;
	f->ondig_special_tool = TT_SHEAR;
	f->type = CMT_PLANT;
	f->hardness = 0.15;
	f->pressure_type = CST_CRUSHABLE;
	f->suffocation_per_second = 0;
	lists::add("decrafting",i);
	lists::add("cooking",i);

	i = CONTENT_LEAVES_AUTUMN;
	f = &content_features(i);
	f->description = wgettext("Leaves");
	f->light_propagates = true;
	f->air_equivalent = true;
	f->walkable = false;
	f->climbable = true;
	f->param_type = CPT_LIGHT;
	//f->is_ground_content = true;
	if (new_style_leaves) {
开发者ID:Jobava,项目名称:Voxelands,代码行数:67,代码来源:content_mapnode_plants.cpp


注:本文中的ContentFeatures::setAllTextureTypes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。