summaryrefslogtreecommitdiff
path: root/src/mapblock.h
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2012-01-21 00:11:44 +0100
committerPerttu Ahola <celeron55@gmail.com>2012-01-22 17:24:50 +0200
commit157a4cf18cb9c098f465b8baecd7d2cd5705f2dd (patch)
treea194b86e0452d1dc892aec6b3ac940327ce85e2a /src/mapblock.h
parentf22c73f50169b978f13c0b6511805b9d4a1a6871 (diff)
downloadminetest-157a4cf18cb9c098f465b8baecd7d2cd5705f2dd.tar.gz
minetest-157a4cf18cb9c098f465b8baecd7d2cd5705f2dd.tar.bz2
minetest-157a4cf18cb9c098f465b8baecd7d2cd5705f2dd.zip
Node placement / mineral / serialization / iron freq / node_dig callback
- Node placement code moved to Lua - Mineral system removed (added default:stone_with_coal and default:stone_with_iron). - MapBlock and MapNode serialization updated. - Mapgen: Frequency of iron increased. - node_dig callback and related changes.
Diffstat (limited to 'src/mapblock.h')
-rw-r--r--src/mapblock.h31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/mapblock.h b/src/mapblock.h
index f2d94753c..c9ff36679 100644
--- a/src/mapblock.h
+++ b/src/mapblock.h
@@ -363,17 +363,8 @@ public:
Graphics-related methods
*/
- /*// A quick version with nodes passed as parameters
- u8 getFaceLight(u32 daynight_ratio, MapNode n, MapNode n2,
- v3s16 face_dir);*/
- /*// A more convenient version
- u8 getFaceLight(u32 daynight_ratio, v3s16 p, v3s16 face_dir)
- {
- return getFaceLight(daynight_ratio,
- getNodeParentNoEx(p),
- getNodeParentNoEx(p + face_dir),
- face_dir);
- }*/
+#ifndef SERVER // Only on client
+
u8 getFaceLight2(u32 daynight_ratio, v3s16 p, v3s16 face_dir,
INodeDefManager *nodemgr)
{
@@ -383,8 +374,6 @@ public:
face_dir, nodemgr);
}
-#ifndef SERVER // Only on client
-
#if 1
/*
Thread-safely updates the whole mesh of the mapblock.
@@ -524,20 +513,20 @@ public:
*/
// These don't write or read version by itself
- void serialize(std::ostream &os, u8 version);
- void deSerialize(std::istream &is, u8 version);
-
- // Used after the basic ones when writing on disk (serverside)
- void serializeDiskExtra(std::ostream &os, u8 version);
- // In addition to doing other things, will add unknown blocks from
- // id-name mapping to wndef
- void deSerializeDiskExtra(std::istream &is, u8 version);
+ // Set disk to true for on-disk format, false for over-the-network format
+ void serialize(std::ostream &os, u8 version, bool disk);
+ // If disk == true: In addition to doing other things, will add
+ // unknown blocks from id-name mapping to wndef
+ void deSerialize(std::istream &is, u8 version, bool disk);
private:
/*
Private methods
*/
+ void serialize_pre22(std::ostream &os, u8 version, bool disk);
+ void deSerialize_pre22(std::istream &is, u8 version, bool disk);
+
/*
Used only internally, because changes can't be tracked
*/