mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
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:
Regular → Executable
+15
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user