| 43 | using namespace bParse; |
| 44 | |
| 45 | btBulletFile::btBulletFile() |
| 46 | : bFile("", "BULLET ") |
| 47 | { |
| 48 | mMemoryDNA = new bDNA(); //this memory gets released in the bFile::~bFile destructor,@todo not consistent with the rule 'who allocates it, has to deallocate it" |
| 49 | |
| 50 | m_DnaCopy = 0; |
| 51 | |
| 52 | #ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES |
| 53 | #ifdef _WIN64 |
| 54 | m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen64, 16); |
| 55 | memcpy(m_DnaCopy, sBulletDNAstr64, sBulletDNAlen64); |
| 56 | mMemoryDNA->init(m_DnaCopy, sBulletDNAlen64); |
| 57 | #else //_WIN64 |
| 58 | m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen, 16); |
| 59 | memcpy(m_DnaCopy, sBulletDNAstr, sBulletDNAlen); |
| 60 | mMemoryDNA->init(m_DnaCopy, sBulletDNAlen); |
| 61 | #endif //_WIN64 |
| 62 | #else //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES |
| 63 | if (VOID_IS_8) |
| 64 | { |
| 65 | m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen64, 16); |
| 66 | memcpy(m_DnaCopy, sBulletDNAstr64, sBulletDNAlen64); |
| 67 | mMemoryDNA->init(m_DnaCopy, sBulletDNAlen64); |
| 68 | } |
| 69 | else |
| 70 | { |
| 71 | m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen, 16); |
| 72 | memcpy(m_DnaCopy, sBulletDNAstr, sBulletDNAlen); |
| 73 | mMemoryDNA->init(m_DnaCopy, sBulletDNAlen); |
| 74 | } |
| 75 | #endif //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES |
| 76 | } |
| 77 | |
| 78 | btBulletFile::btBulletFile(const char* fileName) |
| 79 | : bFile(fileName, "BULLET ") |