summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-04-10 22:50:31 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-04-10 22:50:31 +0300
commitb0b5c432542ea5f9292f428bb59e2670c0d7c53d (patch)
tree60b280856a266c0bebef81a79cd5c2e72dcb50af /src/map.h
parent3d25fe42f34589bd10a92929c442c2cd7f607309 (diff)
downloadminetest-b0b5c432542ea5f9292f428bb59e2670c0d7c53d.tar.gz
minetest-b0b5c432542ea5f9292f428bb59e2670c0d7c53d.tar.bz2
minetest-b0b5c432542ea5f9292f428bb59e2670c0d7c53d.zip
better support for old maps
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/map.h b/src/map.h
index e2cd432be..cb48cb32b 100644
--- a/src/map.h
+++ b/src/map.h
@@ -341,6 +341,8 @@ public:
// Returns the position of the chunk where the sector is in
v2s16 sector_to_chunk(v2s16 sectorpos)
{
+ if(m_chunksize == 0)
+ return v2s16(0,0);
sectorpos.X += m_chunksize / 2;
sectorpos.Y += m_chunksize / 2;
v2s16 chunkpos = getContainerPos(sectorpos, m_chunksize);
@@ -350,6 +352,8 @@ public:
// Returns the position of the (0,0) sector of the chunk
v2s16 chunk_to_sector(v2s16 chunkpos)
{
+ if(m_chunksize == 0)
+ return v2s16(0,0);
v2s16 sectorpos(
chunkpos.X * m_chunksize,
chunkpos.Y * m_chunksize
@@ -378,6 +382,9 @@ public:
*/
bool chunkNonVolatile(v2s16 chunkpos)
{
+ if(m_chunksize == 0)
+ return true;
+
/*for(s16 x=-1; x<=1; x++)
for(s16 y=-1; y<=1; y++)*/
s16 x=0;
@@ -393,6 +400,9 @@ public:
return true;
}
+ /*
+ Chunks are generated by using these and makeChunk().
+ */
void initChunkMake(ChunkMakeData &data, v2s16 chunkpos);
MapChunk* finishChunkMake(ChunkMakeData &data,
core::map<v3s16, MapBlock*> &changed_blocks);
@@ -402,16 +412,16 @@ public:
All chunks touching this one can be altered also.
*/
- MapChunk* generateChunkRaw(v2s16 chunkpos,
+ /*MapChunk* generateChunkRaw(v2s16 chunkpos,
core::map<v3s16, MapBlock*> &changed_blocks,
- bool force=false);
+ bool force=false);*/
/*
Generate a chunk and its neighbors so that it won't be touched
anymore.
*/
- MapChunk* generateChunk(v2s16 chunkpos,
- core::map<v3s16, MapBlock*> &changed_blocks);
+ /*MapChunk* generateChunk(v2s16 chunkpos,
+ core::map<v3s16, MapBlock*> &changed_blocks);*/
/*
Generate a sector.
@@ -434,14 +444,14 @@ public:
- Check disk (loads blocks also)
- Generate chunk
*/
- MapSector * emergeSector(v2s16 p,
- core::map<v3s16, MapBlock*> &changed_blocks);
+ /*MapSector * emergeSector(v2s16 p,
+ core::map<v3s16, MapBlock*> &changed_blocks);*/
- MapSector * emergeSector(v2s16 p)
+ /*MapSector * emergeSector(v2s16 p)
{
core::map<v3s16, MapBlock*> changed_blocks;
return emergeSector(p, changed_blocks);
- }
+ }*/
MapBlock * generateBlock(
v3s16 p,
@@ -516,7 +526,7 @@ public:
v3s16 getBlockPos(std::string sectordir, std::string blockfile);
void save(bool only_changed);
- void loadAll();
+ //void loadAll();
// Saves map seed and possibly other stuff
void saveMapMeta();
@@ -557,6 +567,7 @@ private:
bool m_map_saving_enabled;
// Chunk size in MapSectors
+ // If 0, chunks are disabled.
s16 m_chunksize;
// Chunks
core::map<v2s16, MapChunk*> m_chunks;
@@ -754,6 +765,7 @@ protected:
struct ChunkMakeData
{
+ bool no_op;
ManualMapVoxelManipulator vmanip;
u64 seed;
v2s16 chunkpos;
@@ -764,8 +776,10 @@ struct ChunkMakeData
v2s16 sectorpos_bigbase;
s16 sectorpos_bigbase_size;
s16 max_spread_amount;
+ UniqueQueue<v3s16> transforming_liquid;
ChunkMakeData():
+ no_op(false),
vmanip(NULL)
{}
};