summaryrefslogtreecommitdiff
path: root/src/mapblock.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/mapblock.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/mapblock.cpp')
-rw-r--r--src/mapblock.cpp87
1 files changed, 3 insertions, 84 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp
index b436378da..70cb0e370 100644
--- a/src/mapblock.cpp
+++ b/src/mapblock.cpp
@@ -59,10 +59,8 @@ MapBlock::MapBlock(Map *parent, v3s16 pos, IGameDef *gamedef, bool dummy):
reallocate();
#ifndef SERVER
- m_mesh_expired = false;
- mesh_mutex.Init();
+ //mesh_mutex.Init();
mesh = NULL;
- m_temp_mods_mutex.Init();
#endif
}
@@ -70,11 +68,11 @@ MapBlock::~MapBlock()
{
#ifndef SERVER
{
- JMutexAutoLock lock(mesh_mutex);
+ //JMutexAutoLock lock(mesh_mutex);
if(mesh)
{
- mesh->drop();
+ delete mesh;
mesh = NULL;
}
}
@@ -147,78 +145,6 @@ MapNode MapBlock::getNodeParentNoEx(v3s16 p)
}
}
-#ifndef SERVER
-
-#if 1
-void MapBlock::updateMesh(u32 daynight_ratio)
-{
-#if 0
- /*
- DEBUG: If mesh has been generated, don't generate it again
- */
- {
- JMutexAutoLock meshlock(mesh_mutex);
- if(mesh != NULL)
- return;
- }
-#endif
-
- MeshMakeData data;
- data.fill(daynight_ratio, this);
-
- scene::SMesh *mesh_new = makeMapBlockMesh(&data, m_gamedef);
-
- /*
- Replace the mesh
- */
-
- replaceMesh(mesh_new);
-
-}
-#endif
-
-void MapBlock::replaceMesh(scene::SMesh *mesh_new)
-{
- mesh_mutex.Lock();
-
- //scene::SMesh *mesh_old = mesh[daynight_i];
- //mesh[daynight_i] = mesh_new;
-
- scene::SMesh *mesh_old = mesh;
- mesh = mesh_new;
- setMeshExpired(false);
-
- if(mesh_old != NULL)
- {
- // Remove hardware buffers of meshbuffers of mesh
- // NOTE: No way, this runs in a different thread and everything
- /*u32 c = mesh_old->getMeshBufferCount();
- for(u32 i=0; i<c; i++)
- {
- IMeshBuffer *buf = mesh_old->getMeshBuffer(i);
- }*/
-
- /*infostream<<"mesh_old->getReferenceCount()="
- <<mesh_old->getReferenceCount()<<std::endl;
- u32 c = mesh_old->getMeshBufferCount();
- for(u32 i=0; i<c; i++)
- {
- scene::IMeshBuffer *buf = mesh_old->getMeshBuffer(i);
- infostream<<"buf->getReferenceCount()="
- <<buf->getReferenceCount()<<std::endl;
- }*/
-
- // Drop the mesh
- mesh_old->drop();
-
- //delete mesh_old;
- }
-
- mesh_mutex.Unlock();
-}
-
-#endif // !SERVER
-
/*
Propagates sunlight down through the block.
Doesn't modify nodes that are not affected by sunlight.
@@ -1232,13 +1158,6 @@ std::string analyze_block(MapBlock *block)
else
desc<<"is_ug [ ], ";
-#ifndef SERVER
- if(block->getMeshExpired())
- desc<<"mesh_exp [X], ";
- else
- desc<<"mesh_exp [ ], ";
-#endif
-
if(block->getLightingExpired())
desc<<"lighting_exp [X], ";
else