summaryrefslogtreecommitdiff
path: root/src/mapblock.h
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.h
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.h')
-rw-r--r--src/mapblock.h109
1 files changed, 3 insertions, 106 deletions
diff --git a/src/mapblock.h b/src/mapblock.h
index c9ff36679..272da8ce3 100644
--- a/src/mapblock.h
+++ b/src/mapblock.h
@@ -31,13 +31,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "constants.h"
#include "voxel.h"
#include "staticobject.h"
-#include "mapblock_nodemod.h"
#include "modifiedstate.h"
class Map;
class NodeMetadataList;
class IGameDef;
-class IWritableNodeDefManager;
+class MapBlockMesh;
#define BLOCK_TIMESTAMP_UNDEFINED 0xffffffff
@@ -193,18 +192,6 @@ public:
raiseModified(MOD_STATE_WRITE_NEEDED, "setIsUnderground");
}
-#ifndef SERVER
- void setMeshExpired(bool expired)
- {
- m_mesh_expired = expired;
- }
-
- bool getMeshExpired()
- {
- return m_mesh_expired;
- }
-#endif
-
void setLightingExpired(bool expired)
{
if(expired != m_lighting_expired){
@@ -359,33 +346,6 @@ public:
setNode(x0+x, y0+y, z0+z, node);
}
- /*
- Graphics-related methods
- */
-
-#ifndef SERVER // Only on client
-
- u8 getFaceLight2(u32 daynight_ratio, v3s16 p, v3s16 face_dir,
- INodeDefManager *nodemgr)
- {
- return getFaceLight(daynight_ratio,
- getNodeParentNoEx(p),
- getNodeParentNoEx(p + face_dir),
- face_dir, nodemgr);
- }
-
-#if 1
- /*
- Thread-safely updates the whole mesh of the mapblock.
- NOTE: Prefer generating the mesh separately and then using
- replaceMesh().
- */
- void updateMesh(u32 daynight_ratio);
-#endif
- // Replace the mesh with a new one
- void replaceMesh(scene::SMesh *mesh_new);
-#endif
-
// See comments in mapblock.cpp
bool propagateSunlight(core::map<v3s16, bool> & light_sources,
bool remove_light=false, bool *black_air_left=NULL);
@@ -395,59 +355,10 @@ public:
// Copies data from VoxelManipulator getPosRelative()
void copyFrom(VoxelManipulator &dst);
-#ifndef SERVER // Only on client
- /*
- Methods for setting temporary modifications to nodes for
- drawing
-
- returns true if the mod was different last time
- */
- bool setTempMod(v3s16 p, const NodeMod &mod)
- {
- /*dstream<<"setTempMod called on block"
- <<" ("<<p.X<<","<<p.Y<<","<<p.Z<<")"
- <<", mod.type="<<mod.type
- <<", mod.param="<<mod.param
- <<std::endl;*/
- JMutexAutoLock lock(m_temp_mods_mutex);
-
- return m_temp_mods.set(p, mod);
- }
- // Returns true if there was one
- bool getTempMod(v3s16 p, NodeMod *mod)
- {
- JMutexAutoLock lock(m_temp_mods_mutex);
-
- return m_temp_mods.get(p, mod);
- }
- bool clearTempMod(v3s16 p)
- {
- JMutexAutoLock lock(m_temp_mods_mutex);
-
- return m_temp_mods.clear(p);
- }
- bool clearTempMods()
- {
- JMutexAutoLock lock(m_temp_mods_mutex);
-
- return m_temp_mods.clear();
- }
- void copyTempMods(NodeModMap &dst)
- {
- JMutexAutoLock lock(m_temp_mods_mutex);
- m_temp_mods.copy(dst);
- }
-#endif
-
/*
Update day-night lighting difference flag.
-
Sets m_day_night_differs to appropriate value.
-
These methods don't care about neighboring blocks.
- It means that to know if a block really doesn't need a mesh
- update between day and night, the neighboring blocks have
- to be taken into account. Use Map::dayNightDiffed().
*/
void updateDayNightDiff();
@@ -551,8 +462,8 @@ public:
*/
#ifndef SERVER // Only on client
- scene::SMesh *mesh;
- JMutex mesh_mutex;
+ MapBlockMesh *mesh;
+ //JMutex mesh_mutex;
#endif
NodeMetadataList *m_node_metadata;
@@ -609,20 +520,6 @@ private:
bool m_generated;
-#ifndef SERVER // Only on client
- /*
- Set to true if the mesh has been ordered to be updated
- sometime in the background.
- In practice this is set when the day/night lighting switches.
- */
- bool m_mesh_expired;
-
- // Temporary modifications to nodes
- // These are only used when drawing
- NodeModMap m_temp_mods;
- JMutex m_temp_mods_mutex;
-#endif
-
/*
When block is removed from active blocks, this is set to gametime.
Value BLOCK_TIMESTAMP_UNDEFINED=0xffffffff means there is no timestamp.