From 123e8fdf53ffb40c7464d0559a49e048fed79d7d Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 20 Dec 2010 22:03:49 +0200 Subject: framework for modifying textures --- src/mapblock.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/mapblock.cpp') diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 9372c8fb1..af08cadaa 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -646,7 +646,9 @@ void MapBlock::updateMesh(u32 daynight_ratio) if(f.tile.feature == TILEFEAT_NONE) { - collector.append(g_tile_materials[f.tile.id], f.vertices, 4, + /*collector.append(g_tile_materials[f.tile.id], f.vertices, 4, + indices, 6);*/ + collector.append(tile_material_get(f.tile.id), f.vertices, 4, indices, 6); } else @@ -748,16 +750,21 @@ void MapBlock::updateMesh(u32 daynight_ratio) = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; if(dir == v3s16(0,-1,0)) buf->getMaterial().setTexture(0, - g_texturecache.get("torch_on_floor")); + g_irrlicht->getTexture("../data/torch_on_floor.png")); + //g_texturecache.get("torch_on_floor")); else if(dir == v3s16(0,1,0)) buf->getMaterial().setTexture(0, - g_texturecache.get("torch_on_ceiling")); + g_irrlicht->getTexture("../data/torch_on_ceiling.png")); + //g_texturecache.get("torch_on_ceiling")); // For backwards compatibility else if(dir == v3s16(0,0,0)) buf->getMaterial().setTexture(0, - g_texturecache.get("torch_on_floor")); + g_irrlicht->getTexture("../data/torch_on_floor.png")); + //g_texturecache.get("torch_on_floor")); else - buf->getMaterial().setTexture(0, g_texturecache.get("torch")); + buf->getMaterial().setTexture(0, + g_irrlicht->getTexture("../data/torch.png")); + //buf->getMaterial().setTexture(0, g_texturecache.get("torch")); // Add to mesh mesh_new->addMeshBuffer(buf); -- cgit v1.2.3