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__
bParse::ChunkUtils::getOffset
static int getOffset(int flags)
Definition: bChunk.cpp:49
bParse::bChunkPtr4::nr
int nr
Definition: bChunk.h:41
bParse::bChunkInd::oldPtr
void * oldPtr
Definition: bChunk.h:63
bParse::bChunkPtr8::nr
int nr
Definition: bChunk.h:54
bParse::ChunkUtils::swapInt
static int swapInt(int inte)
Definition: bChunk.cpp:35
bParse::bChunkPtr4::bChunkPtr4
bChunkPtr4()
Definition: bChunk.h:34
bParse::bChunkPtr4::code
int code
Definition: bChunk.h:35
bParse::bChunkInd::nr
int nr
Definition: bChunk.h:64
bParse::bChunkPtr8::len
int len
Definition: bChunk.h:49
bParse::bChunkPtr4::m_uniqueInt
int m_uniqueInt
Definition: bChunk.h:38
bParse::bChunkPtr8::bChunkPtr8
bChunkPtr8()
Definition: bChunk.h:48
bParse::ChunkUtils::swapLong64
static long64 swapLong64(long64 lng)
Definition: bChunk.cpp:42
bParse::bChunkInd
Definition: bChunk.h:58
bParse::bChunkPtr8::code
int code
Definition: bChunk.h:49
bParse::VOID_IS_8
const bool VOID_IS_8
Definition: bChunk.h:81
bParse::bChunkPtr8::oldPrev
long64 oldPrev
Definition: bChunk.h:51
bParse::bChunkInd::code
int code
Definition: bChunk.h:62
bParse::bChunkInd::len
int len
Definition: bChunk.h:62
long64
#define long64
Definition: bChunk.h:20
bParse::ChunkUtils
Definition: bChunk.h:68
bParse::bChunkPtr8::m_uniqueInts
int m_uniqueInts[2]
Definition: bChunk.h:52
bParse::bChunkPtr4
Definition: bChunk.h:31
bParse::bChunkPtr4::dna_nr
int dna_nr
Definition: bChunk.h:40
bParse::bChunkPtr8::dna_nr
int dna_nr
Definition: bChunk.h:54
bParse
Definition: btBulletWorldImporter.h:23
bParse::bChunkInd::bChunkInd
bChunkInd()
Definition: bChunk.h:61
bParse::bChunkPtr8
Definition: bChunk.h:45
bParse::bChunkInd::dna_nr
int dna_nr
Definition: bChunk.h:64
bParse::CHUNK_HEADER_LEN
const int CHUNK_HEADER_LEN
Definition: bChunk.h:80
bParse::ChunkUtils::swapShort
static short swapShort(short sht)
Definition: bChunk.cpp:28
bParse::bChunkPtr4::len
int len
Definition: bChunk.h:36