aboutsummaryrefslogtreecommitdiff
path: root/src/mg_schematic.h
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-05-09 01:38:20 -0400
committerkwolekr <kwolekr@minetest.net>2015-05-09 18:44:00 -0400
commit2b99d904f6b8197931954772b6466d8ee56cafc9 (patch)
treeb4d75968c5d0b4072c0110de82aa35d62a1e36df /src/mg_schematic.h
parentd59e6ad004b64d37ac10dddd61a7b35e7baa1f89 (diff)
downloadminetest-2b99d904f6b8197931954772b6466d8ee56cafc9.tar.gz
minetest-2b99d904f6b8197931954772b6466d8ee56cafc9.tar.bz2
minetest-2b99d904f6b8197931954772b6466d8ee56cafc9.zip
Schematics: Add per-node force placement option
Diffstat (limited to 'src/mg_schematic.h')
-rw-r--r--src/mg_schematic.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/mg_schematic.h b/src/mg_schematic.h
index 3d3e328d3..5c732648e 100644
--- a/src/mg_schematic.h
+++ b/src/mg_schematic.h
@@ -36,7 +36,7 @@ class IGameDef;
All values are stored in big-endian byte order.
[u32] signature: 'MTSM'
- [u16] version: 3
+ [u16] version: 4
[u16] size X
[u16] size Y
[u16] size Z
@@ -51,7 +51,9 @@ class IGameDef;
For each node in schematic: (for z, y, x)
[u16] content
For each node in schematic:
- [u8] probability of occurance (param1)
+ [u8] param1
+ bit 0-6: probability
+ bit 7: specific node force placement
For each node in schematic:
[u8] param2
}
@@ -60,17 +62,21 @@ class IGameDef;
1 - Initial version
2 - Fixed messy never/always place; 0 probability is now never, 0xFF is always
3 - Added y-slice probabilities; this allows for variable height structures
+ 4 - Compressed range of node occurence prob., added per-node force placement bit
*/
-/////////////////// Schematic flags
-#define SCHEM_CIDS_UPDATED 0x08
-
+//// Schematic constants
#define MTSCHEM_FILE_SIGNATURE 0x4d54534d // 'MTSM'
-#define MTSCHEM_FILE_VER_HIGHEST_READ 3
-#define MTSCHEM_FILE_VER_HIGHEST_WRITE 3
+#define MTSCHEM_FILE_VER_HIGHEST_READ 4
+#define MTSCHEM_FILE_VER_HIGHEST_WRITE 4
+
+#define MTSCHEM_PROB_MASK 0x7F
+
+#define MTSCHEM_PROB_NEVER 0x00
+#define MTSCHEM_PROB_ALWAYS 0x7F
+#define MTSCHEM_PROB_ALWAYS_OLD 0xFF
-#define MTSCHEM_PROB_NEVER 0x00
-#define MTSCHEM_PROB_ALWAYS 0xFF
+#define MTSCHEM_FORCE_PLACE 0x80
enum SchematicType
{