aboutsummaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2012-03-13 18:56:12 +0100
committerPerttu Ahola <celeron55@gmail.com>2012-03-15 21:45:44 +0200
commit807a0d313ba667356ee8af8ef5ae82b6c4881d15 (patch)
treec4674e1c193cfcf8359c788ed5894d3cc1849648 /src/nodedef.cpp
parentf9a66c5d46b225d0ddbbad939232348bc5ebf959 (diff)
downloadminetest-807a0d313ba667356ee8af8ef5ae82b6c4881d15.tar.gz
minetest-807a0d313ba667356ee8af8ef5ae82b6c4881d15.tar.bz2
minetest-807a0d313ba667356ee8af8ef5ae82b6c4881d15.zip
MapBlockMesh, mesh animation system, urgent mesh updates, athmospheric light, removed footprints
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r--src/nodedef.cpp49
1 files changed, 11 insertions, 38 deletions
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; j<CF_SPECIAL_COUNT; j++){
- delete special_materials[j];
- delete special_aps[j];
- }
-#endif
}
void ContentFeatures::reset()
@@ -103,10 +97,6 @@ void ContentFeatures::reset()
Cached stuff
*/
#ifndef SERVER
- for(u16 j=0; j<CF_SPECIAL_COUNT; j++){
- special_materials[j] = NULL;
- special_aps[j] = NULL;
- }
solidness = 2;
visual_solidness = 0;
backface_culling = true;
@@ -526,38 +516,21 @@ public:
f->tiles[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; j<CF_SPECIAL_COUNT; j++){
- // Remove all stuff
- if(f->special_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