Bullet Collision Detection & Physics Library
bChunk.h
Go to the documentation of this file.
1 /*
2 bParse
3 Copyright (c) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 1. 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.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. 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 
28 namespace bParse
29 {
30 // ----------------------------------------------------- //
32 {
33 public:
35  int code;
36  int len;
37  union {
39  };
40  int dna_nr;
41  int nr;
42 };
43 
44 // ----------------------------------------------------- //
46 {
47 public:
49  int code, len;
50  union {
52  int m_uniqueInts[2];
53  };
54  int dna_nr, nr;
55 };
56 
57 // ----------------------------------------------------- //
58 class bChunkInd
59 {
60 public:
61  bChunkInd() {}
62  int code, len;
63  void *oldPtr;
64  int dna_nr, nr;
65 };
66 
67 // ----------------------------------------------------- //
69 {
70 public:
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 
80 const int CHUNK_HEADER_LEN = ((sizeof(bChunkInd)));
81 const bool VOID_IS_8 = ((sizeof(void *) == 8));
82 } // namespace bParse
83 
84 #endif //__BCHUNK_H__
int m_uniqueInts[2]
Definition: bChunk.h:52
static long64 swapLong64(long64 lng)
Definition: bChunk.cpp:42
static int swapInt(int inte)
Definition: bChunk.cpp:35
void * oldPtr
Definition: bChunk.h:63
const bool VOID_IS_8
Definition: bChunk.h:81
long64 oldPrev
Definition: bChunk.h:51
const int CHUNK_HEADER_LEN
Definition: bChunk.h:80
static short swapShort(short sht)
Definition: bChunk.cpp:28
#define long64
Definition: bChunk.h:20
static int getOffset(int flags)
Definition: bChunk.cpp:49