allow the Bullet world importer to save a copy with swapped endianness
See http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=8191
This commit is contained in:
@@ -37,12 +37,18 @@ btBulletWorldImporter::~btBulletWorldImporter()
|
||||
}
|
||||
|
||||
|
||||
bool btBulletWorldImporter::loadFile( const char* fileName)
|
||||
bool btBulletWorldImporter::loadFile( const char* fileName, const char* preSwapFilenameOut)
|
||||
{
|
||||
bParse::btBulletFile* bulletFile2 = new bParse::btBulletFile(fileName);
|
||||
|
||||
|
||||
|
||||
|
||||
bool result = loadFileFromMemory(bulletFile2);
|
||||
|
||||
if (preSwapFilenameOut)
|
||||
bulletFile2->preSwap(preSwapFilenameOut);
|
||||
|
||||
delete bulletFile2;
|
||||
|
||||
return result;
|
||||
|
||||
@@ -47,7 +47,9 @@ public:
|
||||
|
||||
virtual ~btBulletWorldImporter();
|
||||
|
||||
bool loadFile(const char* fileName);
|
||||
///if you pass a valid preSwapFilenameOut, it will save a new file with a different endianness
|
||||
///this pre-swapped file can be loaded without swapping on a target platform of different endianness
|
||||
bool loadFile(const char* fileName, const char* preSwapFilenameOut=0);
|
||||
|
||||
///the memoryBuffer might be modified (for example if endian swaps are necessary)
|
||||
bool loadFileFromMemory(char *memoryBuffer, int len);
|
||||
|
||||
Reference in New Issue
Block a user