Updated to Box2D 2.2, added new joints, some other updates to match the API changes (still plenty more to go though)

--HG--
branch : box2d-update
This commit is contained in:
Bill Meltsner
2011-09-03 15:39:32 -04:00
parent b3434997bf
commit 915e3e9d86
126 changed files with 8581 additions and 3772 deletions
+15 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2009 Erin Catto http://www.gphysics.com
* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -21,6 +21,7 @@
#include <climits>
#include <cstring>
#include <memory>
using namespace std;
int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] =
{
@@ -100,7 +101,12 @@ void* b2BlockAllocator::Allocate(int32 size)
if (size == 0)
return NULL;
b2Assert(0 < size && size <= b2_maxBlockSize);
b2Assert(0 < size);
if (size > b2_maxBlockSize)
{
return b2Alloc(size);
}
int32 index = s_blockSizeLookup[size];
b2Assert(0 <= index && index < b2_blockSizes);
@@ -155,7 +161,13 @@ void b2BlockAllocator::Free(void* p, int32 size)
return;
}
b2Assert(0 < size && size <= b2_maxBlockSize);
b2Assert(0 < size);
if (size > b2_maxBlockSize)
{
b2Free(p);
return;
}
int32 index = s_blockSizeLookup[size];
b2Assert(0 <= index && index < b2_blockSizes);