Bullet Collision Detection & Physics Library: bChunk.h Source File

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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
29 namespace bParse {
30
31
32 // ----------------------------------------------------- //
33 class bChunkPtr4
34 {
35 public:
36 bChunkPtr4(){}
37 int code;
38 int len;
39 union
40 {
41 int m_uniqueInt;
42 };
43 int dna_nr;
44 int nr;
45 };
46
47 // ----------------------------------------------------- //
48 class bChunkPtr8
49 {
50 public:
51 bChunkPtr8(){}
52 int code, len;
53 union
54 {
55 long64 oldPrev;
56 int m_uniqueInts[2];
57 };
58 int dna_nr, nr;
59 };
60
61 // ----------------------------------------------------- //
62 class bChunkInd
63 {
64 public:
65 bChunkInd(){}
66 int code, len;
67 void *oldPtr;
68 int dna_nr, nr;
69 };
70
71
72 // ----------------------------------------------------- //
73 class ChunkUtils
74 {
75 public:
76
77 // file chunk offset
78 static int getOffset(int flags);
79
80 // endian utils
81 static short swapShort(short sht);
82 static int swapInt(int inte);
83 static long64 swapLong64(long64 lng);
84
85 };
86
87
88 const int CHUNK_HEADER_LEN = ((sizeof(bChunkInd)));
89 const bool VOID_IS_8 = ((sizeof(void*)==8));
90 }
91
92 #endif//__BCHUNK_H__
bParse::bChunkPtr8::len
int len
Definition: bChunk.h:52
bParse::bChunkPtr8::bChunkPtr8
bChunkPtr8()
Definition: bChunk.h:51
bParse::bChunkPtr4::code
int code
Definition: bChunk.h:37
bParse::bChunkPtr4::bChunkPtr4
bChunkPtr4()
Definition: bChunk.h:36
bParse::bChunkInd::nr
int nr
Definition: bChunk.h:68
bParse::bChunkInd::len
int len
Definition: bChunk.h:66
bParse::bChunkInd
Definition: bChunk.h:62
bParse::ChunkUtils
Definition: bChunk.h:73
bParse::bChunkPtr4::m_uniqueInt
int m_uniqueInt
Definition: bChunk.h:41
bParse::bChunkPtr4
Definition: bChunk.h:33
bParse::bChunkPtr4::nr
int nr
Definition: bChunk.h:44
bParse::bChunkInd::oldPtr
void * oldPtr
Definition: bChunk.h:67
bParse::bChunkPtr8
Definition: bChunk.h:48
bParse::VOID_IS_8
const bool VOID_IS_8
Definition: bChunk.h:89
bParse::bChunkPtr8::oldPrev
long64 oldPrev
Definition: bChunk.h:55
bParse::bChunkPtr8::nr
int nr
Definition: bChunk.h:58
bParse::bChunkInd::bChunkInd
bChunkInd()
Definition: bChunk.h:65
bParse::CHUNK_HEADER_LEN
const int CHUNK_HEADER_LEN
Definition: bChunk.h:88
bParse
Definition: btBulletWorldImporter.h:29
bParse::bChunkPtr4::len
int len
Definition: bChunk.h:38
bParse::bChunkPtr4::dna_nr
int dna_nr
Definition: bChunk.h:43
long64
#define long64
Definition: bChunk.h:20