[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / bullet3 / src / Bullet3Serialize / Bullet2FileLoader / b3Defines.h
1 /* Copyright (C) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
2 *
3 * This software is provided 'as-is', without any express or implied
4 * warranty.  In no event will the authors be held liable for any damages
5 * arising from the use of this software.
6 *
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely, subject to the following restrictions:
10 *
11 * 1. The origin of this software must not be misrepresented; you must not
12 *    claim that you wrote the original software. If you use this software
13 *    in a product, an acknowledgment in the product documentation would be
14 *    appreciated but is not required.
15 * 2. Altered source versions must be plainly marked as such, and must not be
16 *    misrepresented as being the original software.
17 * 3. This notice may not be removed or altered from any source distribution.
18 */
19 #ifndef __B_DEFINES_H__
20 #define __B_DEFINES_H__
21
22 // MISC defines, see BKE_global.h, BKE_utildefines.h
23 #define B3_SIZEOFBLENDERHEADER 12
24
25 // ------------------------------------------------------------
26 #if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined(__PPC__) || defined(__ppc__) || defined(__BIG_ENDIAN__)
27 #define B3_MAKE_ID(a, b, c, d) ((int)(a) << 24 | (int)(b) << 16 | (c) << 8 | (d))
28 #else
29 #define B3_MAKE_ID(a, b, c, d) ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a))
30 #endif
31
32 // ------------------------------------------------------------
33 #if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined(__PPC__) || defined(__ppc__) || defined(__BIG_ENDIAN__)
34 #define B3_MAKE_ID2(c, d) ((c) << 8 | (d))
35 #else
36 #define B3_MAKE_ID2(c, d) ((d) << 8 | (c))
37 #endif
38
39 // ------------------------------------------------------------
40 #define B3_ID_SCE B3_MAKE_ID2('S', 'C')
41 #define B3_ID_LI B3_MAKE_ID2('L', 'I')
42 #define B3_ID_OB B3_MAKE_ID2('O', 'B')
43 #define B3_ID_ME B3_MAKE_ID2('M', 'E')
44 #define B3_ID_CU B3_MAKE_ID2('C', 'U')
45 #define B3_ID_MB B3_MAKE_ID2('M', 'B')
46 #define B3_ID_MA B3_MAKE_ID2('M', 'A')
47 #define B3_ID_TE B3_MAKE_ID2('T', 'E')
48 #define B3_ID_IM B3_MAKE_ID2('I', 'M')
49 #define B3_ID_IK B3_MAKE_ID2('I', 'K')
50 #define B3_ID_WV B3_MAKE_ID2('W', 'V')
51 #define B3_ID_LT B3_MAKE_ID2('L', 'T')
52 #define B3_ID_SE B3_MAKE_ID2('S', 'E')
53 #define B3_ID_LF B3_MAKE_ID2('L', 'F')
54 #define B3_ID_LA B3_MAKE_ID2('L', 'A')
55 #define B3_ID_CA B3_MAKE_ID2('C', 'A')
56 #define B3_ID_IP B3_MAKE_ID2('I', 'P')
57 #define B3_ID_KE B3_MAKE_ID2('K', 'E')
58 #define B3_ID_WO B3_MAKE_ID2('W', 'O')
59 #define B3_ID_SCR B3_MAKE_ID2('S', 'R')
60 #define B3_ID_VF B3_MAKE_ID2('V', 'F')
61 #define B3_ID_TXT B3_MAKE_ID2('T', 'X')
62 #define B3_ID_SO B3_MAKE_ID2('S', 'O')
63 #define B3_ID_SAMPLE B3_MAKE_ID2('S', 'A')
64 #define B3_ID_GR B3_MAKE_ID2('G', 'R')
65 #define B3_ID_ID B3_MAKE_ID2('I', 'D')
66 #define B3_ID_AR B3_MAKE_ID2('A', 'R')
67 #define B3_ID_AC B3_MAKE_ID2('A', 'C')
68 #define B3_ID_SCRIPT B3_MAKE_ID2('P', 'Y')
69 #define B3_ID_FLUIDSIM B3_MAKE_ID2('F', 'S')
70 #define B3_ID_NT B3_MAKE_ID2('N', 'T')
71 #define B3_ID_BR B3_MAKE_ID2('B', 'R')
72
73 #define B3_ID_SEQ B3_MAKE_ID2('S', 'Q')
74 #define B3_ID_CO B3_MAKE_ID2('C', 'O')
75 #define B3_ID_PO B3_MAKE_ID2('A', 'C')
76 #define B3_ID_NLA B3_MAKE_ID2('N', 'L')
77
78 #define B3_ID_VS B3_MAKE_ID2('V', 'S')
79 #define B3_ID_VN B3_MAKE_ID2('V', 'N')
80
81 // ------------------------------------------------------------
82 #define B3_FORM B3_MAKE_ID('F', 'O', 'R', 'M')
83 #define B3_DDG1 B3_MAKE_ID('3', 'D', 'G', '1')
84 #define B3_DDG2 B3_MAKE_ID('3', 'D', 'G', '2')
85 #define B3_DDG3 B3_MAKE_ID('3', 'D', 'G', '3')
86 #define B3_DDG4 B3_MAKE_ID('3', 'D', 'G', '4')
87 #define B3_GOUR B3_MAKE_ID('G', 'O', 'U', 'R')
88 #define B3_BLEN B3_MAKE_ID('B', 'L', 'E', 'N')
89 #define B3_DER_ B3_MAKE_ID('D', 'E', 'R', '_')
90 #define B3_V100 B3_MAKE_ID('V', '1', '0', '0')
91 #define B3_DATA B3_MAKE_ID('D', 'A', 'T', 'A')
92 #define B3_GLOB B3_MAKE_ID('G', 'L', 'O', 'B')
93 #define B3_IMAG B3_MAKE_ID('I', 'M', 'A', 'G')
94 #define B3_TEST B3_MAKE_ID('T', 'E', 'S', 'T')
95 #define B3_USER B3_MAKE_ID('U', 'S', 'E', 'R')
96
97 // ------------------------------------------------------------
98 #define B3_DNA1 B3_MAKE_ID('D', 'N', 'A', '1')
99 #define B3_REND B3_MAKE_ID('R', 'E', 'N', 'D')
100 #define B3_ENDB B3_MAKE_ID('E', 'N', 'D', 'B')
101 #define B3_NAME B3_MAKE_ID('N', 'A', 'M', 'E')
102 #define B3_SDNA B3_MAKE_ID('S', 'D', 'N', 'A')
103 #define B3_TYPE B3_MAKE_ID('T', 'Y', 'P', 'E')
104 #define B3_TLEN B3_MAKE_ID('T', 'L', 'E', 'N')
105 #define B3_STRC B3_MAKE_ID('S', 'T', 'R', 'C')
106
107 // ------------------------------------------------------------
108 #define B3_SWITCH_INT(a)    \
109         {                       \
110                 char s_i, *p_i;     \
111                 p_i = (char *)&(a); \
112                 s_i = p_i[0];       \
113                 p_i[0] = p_i[3];    \
114                 p_i[3] = s_i;       \
115                 s_i = p_i[1];       \
116                 p_i[1] = p_i[2];    \
117                 p_i[2] = s_i;       \
118         }
119
120 // ------------------------------------------------------------
121 #define B3_SWITCH_SHORT(a)  \
122         {                       \
123                 char s_i, *p_i;     \
124                 p_i = (char *)&(a); \
125                 s_i = p_i[0];       \
126                 p_i[0] = p_i[1];    \
127                 p_i[1] = s_i;       \
128         }
129
130 // ------------------------------------------------------------
131 #define B3_SWITCH_LONGINT(a) \
132         {                        \
133                 char s_i, *p_i;      \
134                 p_i = (char *)&(a);  \
135                 s_i = p_i[0];        \
136                 p_i[0] = p_i[7];     \
137                 p_i[7] = s_i;        \
138                 s_i = p_i[1];        \
139                 p_i[1] = p_i[6];     \
140                 p_i[6] = s_i;        \
141                 s_i = p_i[2];        \
142                 p_i[2] = p_i[5];     \
143                 p_i[5] = s_i;        \
144                 s_i = p_i[3];        \
145                 p_i[3] = p_i[4];     \
146                 p_i[4] = s_i;        \
147         }
148
149 #endif  //__B_DEFINES_H__