mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Removed Quad:flip (resolves issue #770)
This commit is contained in:
@@ -74,37 +74,6 @@ Quad::Viewport Quad::getViewport() const
|
|||||||
return viewport;
|
return viewport;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Quad::flip(bool x, bool y)
|
|
||||||
{
|
|
||||||
Vertex temp[NUM_VERTICES];
|
|
||||||
|
|
||||||
if (x)
|
|
||||||
{
|
|
||||||
memcpy(temp, vertices, sizeof(Vertex) * NUM_VERTICES);
|
|
||||||
vertices[0].s = temp[3].s;
|
|
||||||
vertices[0].t = temp[3].t;
|
|
||||||
vertices[1].s = temp[2].s;
|
|
||||||
vertices[1].t = temp[2].t;
|
|
||||||
vertices[2].s = temp[1].s;
|
|
||||||
vertices[2].t = temp[1].t;
|
|
||||||
vertices[3].s = temp[0].s;
|
|
||||||
vertices[3].t = temp[0].t;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (y)
|
|
||||||
{
|
|
||||||
memcpy(temp, vertices, sizeof(Vertex) * NUM_VERTICES);
|
|
||||||
vertices[0].s = temp[1].s;
|
|
||||||
vertices[0].t = temp[1].t;
|
|
||||||
vertices[1].s = temp[0].s;
|
|
||||||
vertices[1].t = temp[0].t;
|
|
||||||
vertices[2].s = temp[3].s;
|
|
||||||
vertices[2].t = temp[3].t;
|
|
||||||
vertices[3].s = temp[2].s;
|
|
||||||
vertices[3].t = temp[2].t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const Vertex *Quad::getVertices() const
|
const Vertex *Quad::getVertices() const
|
||||||
{
|
{
|
||||||
return vertices;
|
return vertices;
|
||||||
|
|||||||
@@ -49,8 +49,6 @@ public:
|
|||||||
void setViewport(const Viewport &v);
|
void setViewport(const Viewport &v);
|
||||||
Viewport getViewport() const;
|
Viewport getViewport() const;
|
||||||
|
|
||||||
void flip(bool x, bool y);
|
|
||||||
|
|
||||||
const Vertex *getVertices() const;
|
const Vertex *getVertices() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ Quad *luax_checkquad(lua_State *L, int idx)
|
|||||||
return luax_checktype<Quad>(L, idx, "Quad", GRAPHICS_QUAD_T);
|
return luax_checktype<Quad>(L, idx, "Quad", GRAPHICS_QUAD_T);
|
||||||
}
|
}
|
||||||
|
|
||||||
int w_Quad_flip(lua_State *L)
|
|
||||||
{
|
|
||||||
Quad *quad = luax_checkquad(L, 1);
|
|
||||||
quad->flip(luax_toboolean(L, 2), luax_toboolean(L, 3));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int w_Quad_setViewport(lua_State *L)
|
int w_Quad_setViewport(lua_State *L)
|
||||||
{
|
{
|
||||||
Quad *quad = luax_checkquad(L, 1);
|
Quad *quad = luax_checkquad(L, 1);
|
||||||
@@ -75,7 +68,6 @@ int w_Quad_getViewport(lua_State *L)
|
|||||||
|
|
||||||
static const luaL_Reg functions[] =
|
static const luaL_Reg functions[] =
|
||||||
{
|
{
|
||||||
{ "flip", w_Quad_flip },
|
|
||||||
{ "setViewport", w_Quad_setViewport },
|
{ "setViewport", w_Quad_setViewport },
|
||||||
{ "getViewport", w_Quad_getViewport },
|
{ "getViewport", w_Quad_getViewport },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ namespace opengl
|
|||||||
{
|
{
|
||||||
|
|
||||||
Quad *luax_checkquad(lua_State *L, int idx);
|
Quad *luax_checkquad(lua_State *L, int idx);
|
||||||
int w_Quad_flip(lua_State *L);
|
|
||||||
int w_Quad_setViewport(lua_State *L);
|
int w_Quad_setViewport(lua_State *L);
|
||||||
int w_Quad_getViewport(lua_State *L);
|
int w_Quad_getViewport(lua_State *L);
|
||||||
extern "C" int luaopen_quad(lua_State *L);
|
extern "C" int luaopen_quad(lua_State *L);
|
||||||
|
|||||||
Reference in New Issue
Block a user