summaryrefslogtreecommitdiff
path: root/src/mapnode.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-02-10 02:13:03 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-02-10 02:13:03 +0200
commit1704badc306fc8c7c6609aff9f809aee3ac00d3a (patch)
tree76e1ba37bb0ec12bb744a6015f56613ba088e148 /src/mapnode.h
parent949383a2f7c0707667f76615fc748ff4879e2cc1 (diff)
downloadminetest-1704badc306fc8c7c6609aff9f809aee3ac00d3a.tar.gz
minetest-1704badc306fc8c7c6609aff9f809aee3ac00d3a.tar.bz2
minetest-1704badc306fc8c7c6609aff9f809aee3ac00d3a.zip
work-in-progress texture atlas optimization
Diffstat (limited to 'src/mapnode.h')
-rw-r--r--src/mapnode.h39
1 files changed, 25 insertions, 14 deletions
diff --git a/src/mapnode.h b/src/mapnode.h
index 0aaa4dc78..3de170598 100644
--- a/src/mapnode.h
+++ b/src/mapnode.h
@@ -132,9 +132,11 @@ struct ContentFeatures
5: front
*/
TileSpec tiles[6];
-
+
+ // TODO: Somehow specify inventory image
//std::string inventory_image_path;
- TextureSpec inventory_texture;
+ //TextureSpec inventory_texture;
+ //u32 inventory_texture_id;
bool is_ground_content; //TODO: Remove, use walkable instead
bool light_propagates;
@@ -167,27 +169,36 @@ struct ContentFeatures
~ContentFeatures();
- // Quickhands for simple materials
- void setTexture(u16 i, const TextureSpec &spec, u8 alpha=255)
+ /*
+ Quickhands for simple materials
+ */
+
+ void setTexture(u16 i, std::string name, u8 alpha=255);
+
+ void setAllTextures(std::string name, u8 alpha=255)
{
- tiles[i].spec = spec;
+ for(u16 i=0; i<6; i++)
+ {
+ setTexture(i, name, alpha);
+ }
+ }
+
+ /*void setTexture(u16 i, AtlasPointer p, u8 alpha=255)
+ {
+ tiles[i].texture = p;
if(alpha != 255)
{
tiles[i].alpha = alpha;
tiles[i].material_type = MATERIAL_ALPHA_VERTEX;
}
}
- void setAllTextures(const TextureSpec &spec, u8 alpha=255)
+ void setAllTextures(AtlasPointer p, u8 alpha=255)
{
for(u16 i=0; i<6; i++)
{
- setTexture(i, spec, alpha);
+ setTexture(i, p, alpha);
}
-
- // Set this too so it can be left as is most times
- if(inventory_texture.empty())
- inventory_texture = spec;
- }
+ }*/
void setTile(u16 i, const TileSpec &tile)
{
@@ -201,10 +212,10 @@ struct ContentFeatures
}
}
- void setInventoryTexture(const TextureSpec &spec)
+ /*void setInventoryTexture(const TextureSpec &spec)
{
inventory_texture = spec;
- }
+ }*/
/*void setInventoryImage(std::string imgname)
{