#include <jmutexautolock.h>
#include <exception>
#include "debug.h"
-#include "common_irrlicht.h"
+#include "irrlichttypes.h"
+#include "irr_v3d.h"
+#include "irr_aabb3d.h"
#include "mapnode.h"
#include "exceptions.h"
#include "serialization.h"
return m_usage_timer;
}
+ /*
+ See m_refcount
+ */
+ void refGrab()
+ {
+ m_refcount++;
+ }
+ void refDrop()
+ {
+ m_refcount--;
+ }
+ int refGet()
+ {
+ return m_refcount;
+ }
+
+ /*
+ Node Timers
+ */
+ // Get timer
+ NodeTimer getNodeTimer(v3s16 p){
+ return m_node_timers.get(p);
+ }
+ // Deletes timer
+ void removeNodeTimer(v3s16 p){
+ m_node_timers.remove(p);
+ }
+ // Deletes old timer and sets a new one
+ void setNodeTimer(v3s16 p, NodeTimer t){
+ m_node_timers.set(p,t);
+ }
+ // Deletes all timers
+ void clearNodeTimers(){
+ m_node_timers.clear();
+ }
+
/*
Serialization
*/
Private methods
*/
- void serialize_pre22(std::ostream &os, u8 version, bool disk);
void deSerialize_pre22(std::istream &is, u8 version, bool disk);
/*
Map will unload the block when this reaches a timeout.
*/
float m_usage_timer;
+
+ /*
+ Reference count; currently used for determining if this block is in
+ the list of blocks to be drawn.
+ */
+ int m_refcount;
};
inline bool blockpos_over_limit(v3s16 p)