Browse Source

Remove some unused love.physics Body methods, and clean up a bit of code.

Alex Szpakowski 6 years ago
parent
commit
a7d0c02058

+ 1 - 0
src/common/Reference.cpp

@@ -19,6 +19,7 @@
  **/
  **/
 
 
 #include "Reference.h"
 #include "Reference.h"
+#include "runtime.h"
 
 
 namespace love
 namespace love
 {
 {

+ 1 - 2
src/common/Reference.h

@@ -21,8 +21,7 @@
 #ifndef LOVE_REFERENCE_H
 #ifndef LOVE_REFERENCE_H
 #define LOVE_REFERENCE_H
 #define LOVE_REFERENCE_H
 
 
-// LOVE
-#include "runtime.h"
+struct lua_State;
 
 
 namespace love
 namespace love
 {
 {

+ 2 - 2
src/common/Variant.h

@@ -56,7 +56,7 @@ public:
 	public:
 	public:
 
 
 		SharedString(const char *string, size_t len)
 		SharedString(const char *string, size_t len)
-		: len(len)
+			: len(len)
 		{
 		{
 			str = new char[len+1];
 			str = new char[len+1];
 			memcpy(str, string, len);
 			memcpy(str, string, len);
@@ -72,7 +72,7 @@ public:
 	public:
 	public:
 
 
 		SharedTable(std::vector<std::pair<Variant, Variant>> *table)
 		SharedTable(std::vector<std::pair<Variant, Variant>> *table)
-		: table(table)
+			: table(table)
 		{
 		{
 		}
 		}
 
 

+ 0 - 15
src/modules/physics/box2d/Body.cpp

@@ -512,21 +512,6 @@ int Body::getContacts(lua_State *L) const
 	return 1;
 	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()
 void Body::destroy()
 {
 {
 	if (world->world->IsLocked())
 	if (world->world->IsLocked())

+ 0 - 11
src/modules/physics/box2d/Body.h

@@ -426,17 +426,6 @@ public:
 
 
 private:
 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
 	// FIXME: This should be a weak reference, rather than being completely
 	// unowned?
 	// unowned?
 	World *world;
 	World *world;