summaryrefslogtreecommitdiff
path: root/src/mapchunk.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-02-11 19:55:42 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-02-11 19:55:42 +0200
commit52d99fef31daa60903053bc565b6b9d3a31a2bc8 (patch)
tree248831e2e4f78df073f667c3d843d1695e3926b3 /src/mapchunk.h
parent804b2647ced20b8af1e632f1e99d54f905fa8ce0 (diff)
downloadminetest-52d99fef31daa60903053bc565b6b9d3a31a2bc8.tar.gz
minetest-52d99fef31daa60903053bc565b6b9d3a31a2bc8.tar.bz2
minetest-52d99fef31daa60903053bc565b6b9d3a31a2bc8.zip
fully working i guess
Diffstat (limited to 'src/mapchunk.h')
-rw-r--r--src/mapchunk.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/mapchunk.h b/src/mapchunk.h
index 1f89b38a7..1819fa13e 100644
--- a/src/mapchunk.h
+++ b/src/mapchunk.h
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
some MapSectors. (something like 16x16)
*/
+// These should fit in 8 bits, as they are saved as such.
enum{
GENERATED_FULLY = 0,
GENERATED_PARTLY = 10,
@@ -35,22 +36,11 @@ class MapChunk
{
public:
MapChunk():
- //m_is_volatile(true)
m_generation_level(GENERATED_NOT)
{
}
/*
- If is_volatile is true, chunk can be modified when
- neighboring chunks are generated.
-
- It is set to false when all the 8 neighboring chunks have
- been generated.
- */
- /*bool getIsVolatile(){ return m_is_volatile; }
- void setIsVolatile(bool is){ m_is_volatile = is; }*/
-
- /*
Generation level. Possible values:
GENERATED_FULLY = 0 = fully generated
GENERATED_PARTLY = partly generated
@@ -59,9 +49,17 @@ public:
u16 getGenLevel(){ return m_generation_level; }
void setGenLevel(u16 lev){ m_generation_level = lev; }
+ void serialize(std::ostream &os, u8 version)
+ {
+ os.write((char*)&m_generation_level, 1);
+ }
+ void deSerialize(std::istream &is, u8 version)
+ {
+ is.read((char*)&m_generation_level, 1);
+ }
+
private:
- //bool m_is_volatile;
- u16 m_generation_level;
+ u8 m_generation_level;
};
#endif