mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Remove some unused love.physics Body methods, and clean up a bit of code.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
**/
|
||||
|
||||
#include "Reference.h"
|
||||
#include "runtime.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
#ifndef LOVE_REFERENCE_H
|
||||
#define LOVE_REFERENCE_H
|
||||
|
||||
// LOVE
|
||||
#include "runtime.h"
|
||||
struct lua_State;
|
||||
|
||||
namespace love
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
public:
|
||||
|
||||
SharedString(const char *string, size_t len)
|
||||
: len(len)
|
||||
: len(len)
|
||||
{
|
||||
str = new char[len+1];
|
||||
memcpy(str, string, len);
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
public:
|
||||
|
||||
SharedTable(std::vector<std::pair<Variant, Variant>> *table)
|
||||
: table(table)
|
||||
: table(table)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -512,21 +512,6 @@ int Body::getContacts(lua_State *L) const
|
||||
return 1;
|
||||
}
|
||||
|
||||
b2Vec2 Body::getVector(lua_State *L)
|
||||
{
|
||||
love::luax_assert_argc(L, 2, 2);
|
||||
b2Vec2 v((float)lua_tonumber(L, 1), (float)lua_tonumber(L, 2));
|
||||
lua_pop(L, 2);
|
||||
return v;
|
||||
}
|
||||
|
||||
int Body::pushVector(lua_State *L, const b2Vec2 &v)
|
||||
{
|
||||
lua_pushnumber(L, v.x);
|
||||
lua_pushnumber(L, v.y);
|
||||
return 2;
|
||||
}
|
||||
|
||||
void Body::destroy()
|
||||
{
|
||||
if (world->world->IsLocked())
|
||||
|
||||
@@ -426,17 +426,6 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Gets a 2d vector from the arguments on the stack.
|
||||
**/
|
||||
b2Vec2 getVector(lua_State *L);
|
||||
|
||||
/**
|
||||
* Pushed the x- and y-components of a vector on
|
||||
* the stack.
|
||||
**/
|
||||
int pushVector(lua_State *L, const b2Vec2 &v);
|
||||
|
||||
// FIXME: This should be a weak reference, rather than being completely
|
||||
// unowned?
|
||||
World *world;
|
||||
|
||||
Reference in New Issue
Block a user