From 2290205cd746e3264623fde8dfe02e629aa4387e Mon Sep 17 00:00:00 2001 From: TurtleP Date: Sat, 14 Oct 2023 19:29:28 -0400 Subject: [PATCH] push Body shape properly --- source/modules/graphics/wrap_graphics.cpp | 3 --- source/objects/body/wrap_body.cpp | 6 +++++- source/objects/joint/wrap_joint.cpp | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/modules/graphics/wrap_graphics.cpp b/source/modules/graphics/wrap_graphics.cpp index d2f7c425..c2bd5060 100644 --- a/source/modules/graphics/wrap_graphics.cpp +++ b/source/modules/graphics/wrap_graphics.cpp @@ -1674,7 +1674,6 @@ int Wrap_Graphics::IsGammaCorrect(lua_State* L) return 1; } -/* todo */ int Wrap_Graphics::GetPixelWidth(lua_State* L) { auto screenName = luax::OptString(L, 1, love::GetDefaultScreen()); @@ -1688,7 +1687,6 @@ int Wrap_Graphics::GetPixelWidth(lua_State* L) return 1; } -/* todo */ int Wrap_Graphics::GetPixelHeight(lua_State* L) { auto screenName = luax::OptString(L, 1, love::GetDefaultScreen()); @@ -1702,7 +1700,6 @@ int Wrap_Graphics::GetPixelHeight(lua_State* L) return 1; } -/* todo */ int Wrap_Graphics::GetPixelDimensions(lua_State* L) { auto screenName = luax::OptString(L, 1, love::GetDefaultScreen()); diff --git a/source/objects/body/wrap_body.cpp b/source/objects/body/wrap_body.cpp index c73463b0..e29e28b7 100644 --- a/source/objects/body/wrap_body.cpp +++ b/source/objects/body/wrap_body.cpp @@ -715,7 +715,11 @@ int Wrap_Body::GetShape(lua_State* L) auto* self = Wrap_Body::CheckBody(L, 1); auto* shape = self->GetShape(); - luax::PushType(L, shape); + + if (shape) + Wrap_Shape::PushShape(L, shape); + else + lua_pushnil(L); return 1; } diff --git a/source/objects/joint/wrap_joint.cpp b/source/objects/joint/wrap_joint.cpp index a694bd67..5bf88d01 100644 --- a/source/objects/joint/wrap_joint.cpp +++ b/source/objects/joint/wrap_joint.cpp @@ -16,7 +16,6 @@ using namespace love; -// TODO: Finish this void Wrap_Joint::PushJoint(lua_State* L, Joint* joint) { if (joint == nullptr)