Bullet Collision Detection & Physics Library
bChunk.h
Go to the documentation of this file.
1/*
2bParse
3Copyright (c) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16#ifndef __BCHUNK_H__
17#define __BCHUNK_H__
18
19#if defined(_WIN32) && !defined(__MINGW32__)
20#define long64 __int64
21#elif defined(__MINGW32__)
22#include <stdint.h>
23#define long64 int64_t
24#else
25#define long64 long long
26#endif
27
28namespace bParse
29{
30// ----------------------------------------------------- //
32{
33public:
35 int code;
36 int len;
37 union {
39 };
40 int dna_nr;
41 int nr;
42};
43
44// ----------------------------------------------------- //
46{
47public:
49 int code, len;
50 union {
53 };
54 int dna_nr, nr;
55};
56
57// ----------------------------------------------------- //
59{
60public:
62 int code, len;
63 void *oldPtr;
64 int dna_nr, nr;
65};
66
67// ----------------------------------------------------- //
69{
70public:
71 // file chunk offset
72 static int getOffset(int flags);
73
74 // endian utils
75 static short swapShort(short sht);
76 static int swapInt(int inte);
77 static long64 swapLong64(long64 lng);
78};
79
80const int CHUNK_HEADER_LEN = ((sizeof(bChunkInd)));
81const bool VOID_IS_8 = ((sizeof(void *) == 8));
82} // namespace bParse
83
84#endif //__BCHUNK_H__
#define long64
Definition: bChunk.h:20
static int getOffset(int flags)
Definition: bChunk.cpp:49
static short swapShort(short sht)
Definition: bChunk.cpp:28
static int swapInt(int inte)
Definition: bChunk.cpp:35
static long64 swapLong64(long64 lng)
Definition: bChunk.cpp:42
void * oldPtr
Definition: bChunk.h:63
long64 oldPrev
Definition: bChunk.h:51
int m_uniqueInts[2]
Definition: bChunk.h:52
const bool VOID_IS_8
Definition: bChunk.h:81
const int CHUNK_HEADER_LEN
Definition: bChunk.h:80