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/*
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// ----------------------------------------------------- //
31 class bChunkPtr4
32{
33public:
34 bChunkPtr4() {}
35 int code;
36 int len;
37 union {
38 int m_uniqueInt;
39 };
40 int dna_nr;
41 int nr;
42};
43
44// ----------------------------------------------------- //
45 class bChunkPtr8
46{
47public:
48 bChunkPtr8() {}
49 int code, len;
50 union {
51 long64 oldPrev;
52 int m_uniqueInts[2];
53 };
54 int dna_nr, nr;
55};
56
57// ----------------------------------------------------- //
58 class bChunkInd
59{
60public:
61 bChunkInd() {}
62 int code, len;
63 void *oldPtr;
64 int dna_nr, nr;
65};
66
67// ----------------------------------------------------- //
68 class ChunkUtils
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
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__
long64
#define long64
Definition: bChunk.h:20
bParse::ChunkUtils
Definition: bChunk.h:69
bParse::ChunkUtils::getOffset
static int getOffset(int flags)
Definition: bChunk.cpp:49
bParse::ChunkUtils::swapShort
static short swapShort(short sht)
Definition: bChunk.cpp:28
bParse::ChunkUtils::swapInt
static int swapInt(int inte)
Definition: bChunk.cpp:35
bParse::ChunkUtils::swapLong64
static long64 swapLong64(long64 lng)
Definition: bChunk.cpp:42
bParse::bChunkInd
Definition: bChunk.h:59
bParse::bChunkInd::code
int code
Definition: bChunk.h:62
bParse::bChunkInd::bChunkInd
bChunkInd()
Definition: bChunk.h:61
bParse::bChunkInd::len
int len
Definition: bChunk.h:62
bParse::bChunkInd::dna_nr
int dna_nr
Definition: bChunk.h:64
bParse::bChunkInd::oldPtr
void * oldPtr
Definition: bChunk.h:63
bParse::bChunkInd::nr
int nr
Definition: bChunk.h:64
bParse::bChunkPtr4
Definition: bChunk.h:32
bParse::bChunkPtr4::dna_nr
int dna_nr
Definition: bChunk.h:40
bParse::bChunkPtr4::len
int len
Definition: bChunk.h:36
bParse::bChunkPtr4::nr
int nr
Definition: bChunk.h:41
bParse::bChunkPtr4::bChunkPtr4
bChunkPtr4()
Definition: bChunk.h:34
bParse::bChunkPtr4::m_uniqueInt
int m_uniqueInt
Definition: bChunk.h:38
bParse::bChunkPtr4::code
int code
Definition: bChunk.h:35
bParse::bChunkPtr8
Definition: bChunk.h:46
bParse::bChunkPtr8::code
int code
Definition: bChunk.h:49
bParse::bChunkPtr8::dna_nr
int dna_nr
Definition: bChunk.h:54
bParse::bChunkPtr8::len
int len
Definition: bChunk.h:49
bParse::bChunkPtr8::oldPrev
long64 oldPrev
Definition: bChunk.h:51
bParse::bChunkPtr8::nr
int nr
Definition: bChunk.h:54
bParse::bChunkPtr8::bChunkPtr8
bChunkPtr8()
Definition: bChunk.h:48
bParse::bChunkPtr8::m_uniqueInts
int m_uniqueInts[2]
Definition: bChunk.h:52
bParse
Definition: btBulletWorldImporter.h:24
bParse::VOID_IS_8
const bool VOID_IS_8
Definition: bChunk.h:81
bParse::CHUNK_HEADER_LEN
const int CHUNK_HEADER_LEN
Definition: bChunk.h:80