mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
Code style (tabs)
This commit is contained in:
@@ -172,10 +172,10 @@ bool World::QueryCallback::ReportFixture(b2Fixture *fixture)
|
||||
}
|
||||
|
||||
World::CollectCallback::CollectCallback(World *world, lua_State *L)
|
||||
: world(world)
|
||||
, L(L)
|
||||
: world(world)
|
||||
, L(L)
|
||||
{
|
||||
lua_newtable(L);
|
||||
lua_newtable(L);
|
||||
}
|
||||
|
||||
World::CollectCallback::~CollectCallback()
|
||||
@@ -184,13 +184,13 @@ World::CollectCallback::~CollectCallback()
|
||||
|
||||
bool World::CollectCallback::ReportFixture(b2Fixture *f)
|
||||
{
|
||||
Fixture* fixture = (Fixture*)world->findObject(f);
|
||||
if (!fixture)
|
||||
throw love::Exception("A fixture has escaped Memoizer!");
|
||||
luax_pushtype(L, fixture);
|
||||
lua_rawseti(L, -2, i);
|
||||
i++;
|
||||
return true;
|
||||
Fixture *fixture = (Fixture *)world->findObject(f);
|
||||
if (!fixture)
|
||||
throw love::Exception("A fixture has escaped Memoizer!");
|
||||
luax_pushtype(L, fixture);
|
||||
lua_rawseti(L, -2, i);
|
||||
i++;
|
||||
return true;
|
||||
}
|
||||
|
||||
World::RayCastCallback::RayCastCallback(World *world, lua_State *L, int idx)
|
||||
@@ -580,16 +580,16 @@ int World::queryBoundingBox(lua_State *L)
|
||||
|
||||
int World::getFixturesInArea(lua_State *L)
|
||||
{
|
||||
float lx = (float)luaL_checknumber(L, 1);
|
||||
float ly = (float)luaL_checknumber(L, 2);
|
||||
float ux = (float)luaL_checknumber(L, 3);
|
||||
float uy = (float)luaL_checknumber(L, 4);
|
||||
float lx = (float)luaL_checknumber(L, 1);
|
||||
float ly = (float)luaL_checknumber(L, 2);
|
||||
float ux = (float)luaL_checknumber(L, 3);
|
||||
float uy = (float)luaL_checknumber(L, 4);
|
||||
b2AABB box;
|
||||
box.lowerBound = Physics::scaleDown(b2Vec2(lx, ly));
|
||||
box.upperBound = Physics::scaleDown(b2Vec2(ux, uy));
|
||||
CollectCallback query(this, L);
|
||||
world->QueryAABB(&query, box);
|
||||
return 1;
|
||||
box.lowerBound = Physics::scaleDown(b2Vec2(lx, ly));
|
||||
box.upperBound = Physics::scaleDown(b2Vec2(ux, uy));
|
||||
CollectCallback query(this, L);
|
||||
world->QueryAABB(&query, box);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int World::rayCast(lua_State *L)
|
||||
|
||||
@@ -102,17 +102,17 @@ public:
|
||||
int funcidx;
|
||||
};
|
||||
|
||||
class CollectCallback : public b2QueryCallback
|
||||
{
|
||||
public:
|
||||
CollectCallback(World *world, lua_State *L);
|
||||
~CollectCallback();
|
||||
virtual bool ReportFixture(b2Fixture *fixture);
|
||||
private:
|
||||
World *world;
|
||||
class CollectCallback : public b2QueryCallback
|
||||
{
|
||||
public:
|
||||
CollectCallback(World *world, lua_State *L);
|
||||
~CollectCallback();
|
||||
virtual bool ReportFixture(b2Fixture *fixture);
|
||||
private:
|
||||
World *world;
|
||||
lua_State *L;
|
||||
int i = 1;
|
||||
};
|
||||
int i = 1;
|
||||
};
|
||||
|
||||
class RayCastCallback : public b2RayCastCallback
|
||||
{
|
||||
|
||||
@@ -188,9 +188,9 @@ int w_World_queryBoundingBox(lua_State *L)
|
||||
int w_World_getFixturesInArea(lua_State *L)
|
||||
{
|
||||
World *t = luax_checkworld(L, 1);
|
||||
lua_remove(L, 1);
|
||||
int ret = 0;
|
||||
luax_catchexcept(L, [&](){ ret = t->getFixturesInArea(L); });
|
||||
lua_remove(L, 1);
|
||||
int ret = 0;
|
||||
luax_catchexcept(L, [&](){ ret = t->getFixturesInArea(L); });
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user