From 804b2647ced20b8af1e632f1e99d54f905fa8ce0 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 11 Feb 2011 16:43:26 +0200 Subject: new texture stuff quite working --- src/mapblock.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/mapblock.cpp') diff --git a/src/mapblock.cpp b/src/mapblock.cpp index e66d4dd8f..e0b8965b4 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -341,20 +341,21 @@ TileSpec MapBlock::getNodeTile(MapNode mn, v3s16 p, v3s16 face_dir, Get texture id, translate it to name, append stuff to name, get texture id */ + // Get original texture name u32 orig_id = spec.texture.id; std::string orig_name = g_texturesource->getTextureName(orig_id); + // Create new texture name std::ostringstream os; os<getTextureId(os.str()); - dstream<<"MapBlock::getNodeTile(): Switching from " + /*dstream<<"MapBlock::getNodeTile(): Switching from " <getTexture(new_id); } @@ -864,20 +865,20 @@ void MapBlock::updateMesh(u32 daynight_ratio) //material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; - //TODO - /*if(dir == v3s16(0,-1,0)) + + if(dir == v3s16(0,-1,0)) material.setTexture(0, - g_irrlicht->getTexture("torch_on_floor.png")); + g_texturesource->getTextureRaw("torch_on_floor.png")); else if(dir == v3s16(0,1,0)) material.setTexture(0, - g_irrlicht->getTexture("torch_on_ceiling.png")); + g_texturesource->getTextureRaw("torch_on_ceiling.png")); // For backwards compatibility else if(dir == v3s16(0,0,0)) material.setTexture(0, - g_irrlicht->getTexture("torch_on_floor.png")); + g_texturesource->getTextureRaw("torch_on_floor.png")); else material.setTexture(0, - g_irrlicht->getTexture("torch.png"));*/ + g_texturesource->getTextureRaw("torch.png")); u16 indices[] = {0,1,2,2,3,0}; // Add to mesh collector -- cgit v1.2.3