Some small fixes to make LOVE compilable in MSVC2010.

This commit is contained in:
rude
2010-09-05 12:05:05 +02:00
parent 2107f6810b
commit 8c721ceb6a
5 changed files with 21 additions and 8 deletions
+5
View File
@@ -309,6 +309,11 @@ namespace box2d
return (body->m_flags & b2Body::e_fixedRotationFlag) != 0;
}
World * Body::getWorld() const
{
return world;
}
b2Vec2 Body::getVector(lua_State * L)
{
love::luax_assert_argc(L, 2, 2);
+5
View File
@@ -341,6 +341,11 @@ namespace box2d
void setFixedRotation(bool fixed);
bool getFixedRotation() const;
/**
* Get the World this Body resides in.
*/
World * getWorld() const;
private:
/**
+6 -6
View File
@@ -115,7 +115,7 @@ namespace box2d
bool Shape::testPoint(float x, float y) const
{
return shape->TestPoint(shape->GetBody()->GetXForm(), body->world->scaleDown(b2Vec2(x, y)));
return shape->TestPoint(shape->GetBody()->GetXForm(), body->getWorld()->scaleDown(b2Vec2(x, y)));
}
int Shape::testSegment(lua_State * L)
@@ -129,8 +129,8 @@ namespace box2d
s.p2.x = (float)lua_tonumber(L, 3);
s.p2.y = (float)lua_tonumber(L, 4);
s.p1 = body->world->scaleDown(s.p1);
s.p2 = body->world->scaleDown(s.p2);
s.p1 = body->getWorld()->scaleDown(s.p1);
s.p2 = body->getWorld()->scaleDown(s.p2);
float lambda;
b2Vec2 normal;
@@ -138,7 +138,7 @@ namespace box2d
if(shape->TestSegment(shape->GetBody()->GetXForm(), &lambda, &normal, s, 1.0f))
{
lua_pushnumber(L, lambda);
normal = body->world->scaleUp(normal);
normal = body->getWorld()->scaleUp(normal);
lua_pushnumber(L, normal.x);
lua_pushnumber(L, normal.y);
return 3;
@@ -229,7 +229,7 @@ namespace box2d
int Shape::pushBits(lua_State * L, uint16 bits)
{
// Create a bitset.
std::bitset<16> b((unsigned long)bits);
std::bitset<16> b((int)bits);
// Push all set bits.
for(int i = 0;i<16;i++)
@@ -270,7 +270,7 @@ namespace box2d
love::luax_assert_argc(L, 0, 0);
b2AABB bb;
shape->ComputeAABB(&bb, shape->GetBody()->GetXForm());
bb = body->world->scaleUp(bb);
bb = body->getWorld()->scaleUp(bb);
// Top left.
lua_pushnumber(L, bb.lowerBound.x);
@@ -1,6 +1,7 @@
#include "GrahamScanConvexHull.h"
#include <cmath>
#include <iterator>
bool GrahamScanConvexHull::operator()(const std::vector < point2d >& pnt, std::vector< point2d >& final_hull)
{