本文整理汇总了C++中ContentFeatures::setTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ ContentFeatures::setTexture方法的具体用法?C++ ContentFeatures::setTexture怎么用?C++ ContentFeatures::setTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentFeatures
的用法示例。
在下文中一共展示了ContentFeatures::setTexture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: content_mapnode_init
void content_mapnode_init()
{
// Read some settings
bool new_style_water = g_settings.getBool("new_style_water");
bool new_style_leaves = g_settings.getBool("new_style_leaves");
bool invisible_stone = g_settings.getBool("invisible_stone");
content_t i;
ContentFeatures *f = NULL;
i = CONTENT_STONE;
f = &content_features(i);
f->setAllTextures("stone.png");
f->setInventoryTextureCube("stone.png", "stone.png", "stone.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COBBLE)+" 1";
setStoneLikeDiggingProperties(f->digging_properties, 1.0);
if(invisible_stone)
f->solidness = 0; // For debugging, hides regular stone
i = CONTENT_GRASS;
f = &content_features(i);
f->setAllTextures("mud.png^grass_side.png");
f->setTexture(0, "grass.png");
f->setTexture(1, "mud.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_MUD)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_GRASS_FOOTSTEPS;
f = &content_features(i);
f->setAllTextures("mud.png^grass_side.png");
f->setTexture(0, "grass_footsteps.png");
f->setTexture(1, "mud.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_MUD)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_MUD;
f = &content_features(i);
f->setAllTextures("mud.png");
f->setInventoryTextureCube("mud.png", "mud.png", "mud.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_SAND;
f = &content_features(i);
f->setAllTextures("sand.png");
f->setInventoryTextureCube("sand.png", "sand.png", "sand.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_GRAVEL;
f = &content_features(i);
f->setAllTextures("gravel.png");
f->setInventoryTextureCube("gravel.png", "gravel.png", "gravel.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.75);
i = CONTENT_SANDSTONE;
f = &content_features(i);
f->setAllTextures("sandstone.png");
f->setInventoryTextureCube("sandstone.png", "sandstone.png", "sandstone.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAND)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_CLAY;
f = &content_features(i);
f->setAllTextures("clay.png");
f->setInventoryTextureCube("clay.png", "clay.png", "clay.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("CraftItem lump_of_clay 4");
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_BRICK;
f = &content_features(i);
f->setAllTextures("brick.png");
f->setInventoryTextureCube("brick.png", "brick.png", "brick.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("CraftItem clay_brick 4");
setStoneLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_TREE;
f = &content_features(i);
f->setAllTextures("tree.png");
f->setTexture(0, "tree_top.png");
f->setTexture(1, "tree_top.png");
//.........这里部分代码省略.........
示例2: content_mapnode_init
void content_mapnode_init()
{
// Read some settings
bool new_style_water = g_settings->getBool("new_style_water");
bool new_style_leaves = g_settings->getBool("new_style_leaves");
bool invisible_stone = g_settings->getBool("invisible_stone");
bool opaque_water = g_settings->getBool("opaque_water");
content_t i;
ContentFeatures *f = NULL;
i = CONTENT_STONE;
f = &content_features(i);
f->setAllTextures("stone.png");
f->setInventoryTextureCube("stone.png", "stone.png", "stone.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->often_contains_mineral = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COBBLE)+" 1";
setStoneLikeDiggingProperties(f->digging_properties, 1.0);
if(invisible_stone)
f->solidness = 0; // For debugging, hides regular stone
i = CONTENT_GRASS;
f = &content_features(i);
f->setAllTextures("mud.png^grass_side.png");
f->setTexture(0, "grass.png");
f->setTexture(1, "mud.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_MUD)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_GRASS_FOOTSTEPS;
f = &content_features(i);
f->setAllTextures("mud.png^grass_side.png");
f->setTexture(0, "grass_footsteps.png");
f->setTexture(1, "mud.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_MUD)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_MUD;
f = &content_features(i);
f->setAllTextures("mud.png");
f->setInventoryTextureCube("mud.png", "mud.png", "mud.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_SAND;
f = &content_features(i);
f->setAllTextures("sand.png");
f->setInventoryTextureCube("sand.png", "sand.png", "sand.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_GRAVEL;
f = &content_features(i);
f->setAllTextures("gravel.png");
f->setInventoryTextureCube("gravel.png", "gravel.png", "gravel.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.75);
i = CONTENT_SANDSTONE;
f = &content_features(i);
f->setAllTextures("sandstone.png");
f->setInventoryTextureCube("sandstone.png", "sandstone.png", "sandstone.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAND)+" 1";
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_CLAY;
f = &content_features(i);
f->setAllTextures("clay.png");
f->setInventoryTextureCube("clay.png", "clay.png", "clay.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("CraftItem lump_of_clay 4");
setDirtLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_BRICK;
f = &content_features(i);
f->setAllTextures("brick.png");
f->setInventoryTextureCube("brick.png", "brick.png", "brick.png");
f->param_type = CPT_MINERAL;
f->is_ground_content = true;
f->dug_item = std::string("CraftItem clay_brick 4");
setStoneLikeDiggingProperties(f->digging_properties, 1.0);
i = CONTENT_TREE;
f = &content_features(i);
f->setAllTextures("tree.png");
//.........这里部分代码省略.........
示例3: content_mapnode_plants
void content_mapnode_plants(bool repeat)
{
bool new_style_leaves = g_settings->getBool("new_style_leaves");
content_t i;
ContentFeatures *f = NULL;
i = CONTENT_TREE;
f = &content_features(i);
f->description = wgettext("Tree");
f->setAllTextures("tree.png");
f->setTexture(0, "tree_top.png");
f->setTexture(1, "tree_top.png");
f->setInventoryTextureCube("tree_top.png", "tree.png", "tree.png");
f->draw_type = CDT_TRUNKLIKE;
f->is_ground_content = true;
f->flammable = 2; // can be set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->cook_result = std::string("CraftItem lump_of_charcoal 1");
f->fuel_time = 30;
f->type = CMT_TREE;
f->hardness = 1.0;
f->ondig_special_drop = CONTENT_WOOD;
f->ondig_special_drop_count = 6;
f->ondig_special_tool = TT_AXE;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_APPLE_TREE;
f = &content_features(i);
f->description = wgettext("Apple Tree");
f->setAllTextures("apple_tree.png");
f->setTexture(0, "apple_tree_top.png");
f->setTexture(1, "apple_tree_top.png");
f->setInventoryTextureCube("apple_tree_top.png", "apple_tree.png", "apple_tree.png");
f->draw_type = CDT_TRUNKLIKE;
f->is_ground_content = true;
f->flammable = 2; // can be set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->cook_result = std::string("CraftItem lump_of_charcoal 1");
f->fuel_time = 30;
f->type = CMT_TREE;
f->hardness = 1.0;
f->ondig_special_drop = CONTENT_WOOD;
f->ondig_special_drop_count = 6;
f->ondig_special_tool = TT_AXE;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_JUNGLETREE;
f = &content_features(i);
f->description = wgettext("Jungle Tree");
f->setAllTextures("jungletree.png");
f->setTexture(0, "jungletree_top.png");
f->setTexture(1, "jungletree_top.png");
f->setInventoryTextureCube("jungletree_top.png", "jungletree.png", "jungletree.png");
f->draw_type = CDT_TRUNKLIKE;
//f->is_ground_content = true;
f->flammable = 2; // can be set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->cook_result = std::string("CraftItem lump_of_charcoal 1");
f->fuel_time = 30;
f->type = CMT_TREE;
f->hardness = 1.0;
f->ondig_special_drop = CONTENT_JUNGLEWOOD;
f->ondig_special_drop_count = 6;
f->ondig_special_tool = TT_AXE;
lists::add("creative",i);
i = CONTENT_CONIFER_TREE;
f = &content_features(i);
f->description = wgettext("Conifer Tree");
f->setAllTextures("conifer_tree.png");
f->setTexture(0, "conifer_tree_top.png");
f->setTexture(1, "conifer_tree_top.png");
f->setInventoryTextureCube("conifer_tree_top.png", "conifer_tree.png", "conifer_tree.png");
f->draw_type = CDT_TRUNKLIKE;
f->is_ground_content = true;
f->flammable = 2; // can be set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->cook_result = std::string("CraftItem lump_of_charcoal 1");
f->fuel_time = 25;
f->type = CMT_TREE;
f->hardness = 0.8;
f->ondig_special_drop = CONTENT_WOOD_PINE;
f->ondig_special_drop_count = 6;
f->ondig_special_tool = TT_AXE;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_YOUNG_TREE;
f = &content_features(i);
f->description = wgettext("Young Tree");
f->setAllTextures("tree.png");
f->setTexture(0, "tree_top.png");
f->setTexture(1, "tree_top.png");
f->draw_type = CDT_NODEBOX;
f->solidness = 0; // drawn separately, makes no faces
f->param_type = CPT_LIGHT;
f->light_propagates = true;
//.........这里部分代码省略.........