]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapblock.h
Remove no virtual dtor warnings, make MapgenParams contain actual NoiseParams
[minetest.git] / src / mapblock.h
index 7f901e5d35ec24ca48663f6556e7021310383c4e..05bb944a68727b7dcafbbb051d63575168cc5adc 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <jmutex.h>
 #include <jmutexautolock.h>
 #include <exception>
+#include <set>
 #include "debug.h"
 #include "irrlichttypes.h"
 #include "irr_v3d.h"
@@ -352,7 +353,7 @@ class MapBlock /*: public NodeContainer*/
        }
 
        // See comments in mapblock.cpp
-       bool propagateSunlight(core::map<v3s16, bool> & light_sources,
+       bool propagateSunlight(std::set<v3s16> & light_sources,
                        bool remove_light=false, bool *black_air_left=NULL);
        
        // Copies data to VoxelManipulator to getPosRelative()
@@ -430,6 +431,22 @@ class MapBlock /*: public NodeContainer*/
        {
                return m_usage_timer;
        }
+
+       /*
+               See m_refcount
+       */
+       void refGrab()
+       {
+               m_refcount++;
+       }
+       void refDrop()
+       {
+               m_refcount--;
+       }
+       int refGet()
+       {
+               return m_refcount;
+       }
        
        /*
                Node Timers
@@ -566,6 +583,12 @@ class MapBlock /*: public NodeContainer*/
                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)