From 807a0d313ba667356ee8af8ef5ae82b6c4881d15 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Tue, 13 Mar 2012 18:56:12 +0100 Subject: MapBlockMesh, mesh animation system, urgent mesh updates, athmospheric light, removed footprints --- src/nodedef.cpp | 49 +++++++++++-------------------------------------- 1 file changed, 11 insertions(+), 38 deletions(-) (limited to 'src/nodedef.cpp') diff --git a/src/nodedef.cpp b/src/nodedef.cpp index f24497dd8..e9abc323b 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -89,12 +89,6 @@ ContentFeatures::ContentFeatures() ContentFeatures::~ContentFeatures() { -#ifndef SERVER - for(u16 j=0; jtiles[j].material_type = MATERIAL_ALPHA_SIMPLE; else f->tiles[j].material_type = MATERIAL_ALPHA_VERTEX; + f->tiles[j].material_flags = 0; if(f->backface_culling) f->tiles[j].material_flags |= MATERIAL_FLAG_BACKFACE_CULLING; - else - f->tiles[j].material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING; } - // Special textures + // Special tiles for(u16 j=0; jspecial_aps[j]){ - delete f->special_aps[j]; - f->special_aps[j] = NULL; - } - if(f->special_materials[j]){ - delete f->special_materials[j]; - f->special_materials[j] = NULL; - } - // Skip if should not exist - if(f->mspec_special[j].tname == "") - continue; - // Create all stuff - f->special_aps[j] = new AtlasPointer( - tsrc->getTexture(f->mspec_special[j].tname)); - f->special_materials[j] = new video::SMaterial; - f->special_materials[j]->setFlag(video::EMF_LIGHTING, false); - f->special_materials[j]->setFlag(video::EMF_BACK_FACE_CULLING, - f->mspec_special[j].backface_culling); - f->special_materials[j]->setFlag(video::EMF_BILINEAR_FILTER, false); - f->special_materials[j]->setFlag(video::EMF_FOG_ENABLE, true); - f->special_materials[j]->setTexture(0, f->special_aps[j]->atlas); - if(f->alpha != 255) - f->special_materials[j]->MaterialType = - video::EMT_TRANSPARENT_VERTEX_ALPHA; + f->special_tiles[j].texture = tsrc->getTexture(f->mspec_special[j].tname); + f->special_tiles[j].alpha = f->alpha; + if(f->alpha == 255) + f->special_tiles[j].material_type = MATERIAL_ALPHA_SIMPLE; + else + f->special_tiles[j].material_type = MATERIAL_ALPHA_VERTEX; + f->special_tiles[j].material_flags = 0; + if(f->mspec_special[j].backface_culling) + f->special_tiles[j].material_flags |= MATERIAL_FLAG_BACKFACE_CULLING; } } #endif -- cgit v1.2.3