mirror of
https://github.com/love2d/love.git
synced 2026-08-21 13:09:56 +02:00
keeping a consistent coding style and apparently fixing broken compilation on systems that aren't mine.
This commit is contained in:
@@ -1834,7 +1834,7 @@
|
|||||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||||
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES;
|
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = NO;
|
GCC_WARN_ABOUT_RETURN_TYPE = NO;
|
||||||
GCC_WARN_CHECK_SWITCH_STATEMENTS = NO;
|
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
|
||||||
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES;
|
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES;
|
||||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
|
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
|
||||||
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO;
|
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO;
|
||||||
|
|||||||
@@ -31,18 +31,17 @@ namespace box2d
|
|||||||
|
|
||||||
int w_newWorld(lua_State * L)
|
int w_newWorld(lua_State * L)
|
||||||
{
|
{
|
||||||
World * w;
|
int top = lua_gettop(L);
|
||||||
switch(lua_gettop(L))
|
if (top == 2)
|
||||||
{
|
{
|
||||||
case 2:
|
|
||||||
float x = (float)luaL_checknumber(L, 1);
|
float x = (float)luaL_checknumber(L, 1);
|
||||||
float y = (float)luaL_checknumber(L, 2);
|
float y = (float)luaL_checknumber(L, 2);
|
||||||
w = instance->newWorld(x, y);
|
World * w = instance->newWorld(x, y);
|
||||||
luax_newtype(L, "World", PHYSICS_WORLD_T, (void*)w);
|
luax_newtype(L, "World", PHYSICS_WORLD_T, (void*)w);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
case 6:
|
else if (top == 6 || top == 7)
|
||||||
case 7:
|
{
|
||||||
float lx = (float)luaL_checknumber(L, 1);
|
float lx = (float)luaL_checknumber(L, 1);
|
||||||
float ly = (float)luaL_checknumber(L, 2);
|
float ly = (float)luaL_checknumber(L, 2);
|
||||||
float ux = (float)luaL_checknumber(L, 3);
|
float ux = (float)luaL_checknumber(L, 3);
|
||||||
@@ -50,13 +49,12 @@ namespace box2d
|
|||||||
float gx = (float)luaL_checknumber(L, 5);
|
float gx = (float)luaL_checknumber(L, 5);
|
||||||
float gy = (float)luaL_checknumber(L, 6);
|
float gy = (float)luaL_checknumber(L, 6);
|
||||||
bool sleep = luax_optboolean(L, 7, true);
|
bool sleep = luax_optboolean(L, 7, true);
|
||||||
w = instance->newWorld(lx, ly, ux, uy, gx, gy, sleep);
|
World * w = instance->newWorld(lx, ly, ux, uy, gx, gy, sleep);
|
||||||
luax_newtype(L, "World", PHYSICS_WORLD_T, (void*)w);
|
luax_newtype(L, "World", PHYSICS_WORLD_T, (void*)w);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
default:
|
|
||||||
return luaL_error(L, "Incorrect number of parameters");
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return luaL_error(L, "Incorrect number of parameters");
|
||||||
}
|
}
|
||||||
|
|
||||||
int w_newBody(lua_State * L)
|
int w_newBody(lua_State * L)
|
||||||
|
|||||||
Reference in New Issue
Block a user