From 100af18955b86faa473318c806b6b5ce029f471e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Oct 2019 12:02:40 +1100 Subject: Docs: clarify writefile.c format text --- source/blender/blenloader/intern/writefile.c | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'source/blender/blenloader/intern/writefile.c') diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index aae5072c8de..d24fca4391a 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -26,35 +26,36 @@ * FILE FORMAT * =========== * - * IFF-style structure (but not IFF compatible!) + * IFF-style structure (but not IFF compatible!) * - * start file: + * Start file: *
- *     BLENDER_V100    12 bytes  (version 1.00)
- *                     V = big endian, v = little endian
- *                     _ = 4 byte pointer, - = 8 byte pointer
+ * `BLENDER_V100`  `12` bytes  (version 1.00 is just an example).
+ *                 `V` = big endian, `v` = little endian.
+ *                 `_` = 4 byte pointer, `-` = 8 byte pointer.
  * 
* * data-blocks: (also see struct #BHead). *
- *                4 chars
- *                 int,  len data after BHead
- *                 void,  old pointer
- *              int
- *                  int, in case of array: number of structs
- *     data
- *     ...
- *     ...
+ * `bh.code`       `char[4]` see `BLO_blend_defs.h` for a list of known types.
+ * `bh.len`        `int32` length data after #BHead in bytes.
+ * `bh.old`        `void *` old pointer (the address at the time of writing the file).
+ * `bh.SDNAnr`     `int32` struct index of structs stored in #DNA1 data.
+ * `bh.nr`         `int32` in case of array: number of structs.
+ * data
+ * ...
+ * ...
  * 
* * Almost all data in Blender are structures. Each struct saved * gets a BHead header. With BHead the struct can be linked again - * and compared with StructDNA . + * and compared with #StructDNA. + * WRITE * ===== * * Preferred writing order: (not really a must, but why would you do it random?) - * Any case: direct data is ALWAYS after the lib block + * Any case: direct data is ALWAYS after the lib block. * * (Local file data) * - for each LibBlock -- cgit v1.2.3