Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BLO_blend_defs.h « blenloader « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a6b06a080ccfc0ea957bee9860f21c72d0743a3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * ***** END GPL LICENSE BLOCK *****
 */
#ifndef __BLO_BLEND_DEFS_H__
#define __BLO_BLEND_DEFS_H__

/** \file BLO_blend_defs.h
 *  \ingroup blenloader
 *  \brief defines for blendfile codes
 */

/* INTEGER CODES */
#ifdef __BIG_ENDIAN__
/* Big Endian */
#  define BLEND_MAKE_ID(a, b, c, d) ( (int)(a) << 24 | (int)(b) << 16 | (c) << 8 | (d) )
#else
/* Little Endian */
#  define BLEND_MAKE_ID(a, b, c, d) ( (int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a) )
#endif

/**
 * Codes used for #BHead.code.
 *
 * These coexist with ID codes such as #ID_OB, #ID_SCE ... etc.
 */
enum {
	/**
	 * Arbitrary allocated memory
	 * (typically owned by #ID's, will be freed when there are no users).
	 */
	DATA = BLEND_MAKE_ID('D', 'A', 'T', 'A'),
	/**
	 * Used for #Global struct.
	 */
	GLOB = BLEND_MAKE_ID('G', 'L', 'O', 'B'),
	/**
	 * Used for storing the encoded SDNA string
	 * (decoded into an #SDNA on load).
	 */
	DNA1 = BLEND_MAKE_ID('D', 'N', 'A', '1'),
	/**
	 * Used to store thumbnail previews, written between #REND and #GLOB blocks,
	 * (ignored for regular file reading).
	 */
	TEST = BLEND_MAKE_ID('T', 'E', 'S', 'T'),
	/**
	 * Used for #RenderInfo, basic Scene and frame range info,
	 * can be easily read by other applications without writing a full blend file parser.
	 */
	REND = BLEND_MAKE_ID('R', 'E', 'N', 'D'),
	/**
	 * Used for #UserDef, (user-preferences data).
	 * (written to #BLENDER_STARTUP_FILE & #BLENDER_USERPREF_FILE).
	 */
	USER = BLEND_MAKE_ID('U', 'S', 'E', 'R'),
	/**
	 * Terminate reading (no data).
	 */
	ENDB = BLEND_MAKE_ID('E', 'N', 'D', 'B'),
};

#define BLEN_THUMB_MEMSIZE_FILE(_x, _y) (sizeof(int) * (size_t)(2 + (_x) * (_y)))

#endif  /* __BLO_BLEND_DEFS_H__ */