Skip to content

Commit

Permalink
rename love.graphics.setCustomProjection to setProjection.
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Apr 1, 2024
1 parent 44a6a81 commit b48d81d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/modules/graphics/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ void Graphics::restoreStateChecked(const DisplayState &s)
setDefaultSamplerState(s.defaultSamplerState);

if (s.useCustomProjection)
setCustomProjection(s.customProjection);
setProjection(s.customProjection);
else if (cur.useCustomProjection)
resetProjection();
}
Expand Down Expand Up @@ -2802,7 +2802,7 @@ Vector2 Graphics::inverseTransformPoint(Vector2 point)
return p;
}

void Graphics::setCustomProjection(const Matrix4 &m)
void Graphics::setProjection(const Matrix4 &m)
{
flushBatchedDraws();

Expand Down
2 changes: 1 addition & 1 deletion src/modules/graphics/Graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ class Graphics : public Module
Vector2 transformPoint(Vector2 point);
Vector2 inverseTransformPoint(Vector2 point);

void setCustomProjection(const Matrix4 &m);
void setProjection(const Matrix4 &m);
void resetProjection();

virtual void draw(const DrawCommand &cmd) = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/modules/graphics/wrap_Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3900,12 +3900,12 @@ int w_inverseTransformPoint(lua_State *L)
return 2;
}

int w_setCustomProjection(lua_State *L)
int w_setProjection(lua_State *L)
{
math::Transform *transform = luax_totype<math::Transform>(L, 1);
if (transform != nullptr)
{
instance()->setCustomProjection(transform->getMatrix());
instance()->setProjection(transform->getMatrix());
return 0;
}

Expand All @@ -3924,7 +3924,7 @@ int w_setCustomProjection(lua_State *L)
float elements[16];
love::math::luax_checkmatrix(L, idx, layout, elements);

instance()->setCustomProjection(Matrix4(elements));
instance()->setProjection(Matrix4(elements));
return 0;
}

Expand Down Expand Up @@ -4080,7 +4080,7 @@ static const luaL_Reg functions[] =
{ "transformPoint", w_transformPoint },
{ "inverseTransformPoint", w_inverseTransformPoint },

{ "setCustomProjection", w_setCustomProjection },
{ "setProjection", w_setProjection },
{ "resetProjection", w_resetProjection },

// Deprecated
Expand Down

0 comments on commit b48d81d

Please sign in to comment.