mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Removed love.graphics.drawTest
This commit is contained in:
@@ -1144,31 +1144,6 @@ void Graphics::shear(float kx, float ky)
|
||||
glMultMatrixf((const GLfloat *)t.getElements());
|
||||
}
|
||||
|
||||
void Graphics::drawTest(Image *image, float x, float y, float a, float sx, float sy, float ox, float oy)
|
||||
{
|
||||
image->bind();
|
||||
|
||||
// Buffer for transforming the image.
|
||||
vertex buf[4];
|
||||
|
||||
Matrix t;
|
||||
t.translate(x, y);
|
||||
t.rotate(a);
|
||||
t.scale(sx, sy);
|
||||
t.translate(ox, oy);
|
||||
t.transform(buf, image->getVertices(), 4);
|
||||
|
||||
const vertex *vertices = image->getVertices();
|
||||
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&buf[0].x);
|
||||
glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&vertices[0].s);
|
||||
glDrawArrays(GL_QUADS, 0, 4);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
}
|
||||
|
||||
bool Graphics::hasFocus()
|
||||
{
|
||||
return currentWindow->hasFocus();
|
||||
|
||||
@@ -511,8 +511,6 @@ public:
|
||||
void translate(float x, float y);
|
||||
void shear(float kx, float ky);
|
||||
|
||||
void drawTest(Image *image, float x, float y, float a, float sx, float sy, float ox, float oy);
|
||||
|
||||
bool hasFocus();
|
||||
private:
|
||||
|
||||
|
||||
@@ -956,20 +956,6 @@ int w_drawq(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_drawTest(lua_State *L)
|
||||
{
|
||||
Image *image = luax_checktype<Image>(L, 1, "Image", GRAPHICS_IMAGE_T);
|
||||
float x = (float)luaL_optnumber(L, 2, 0.0f);
|
||||
float y = (float)luaL_optnumber(L, 3, 0.0f);
|
||||
float angle = (float)luaL_optnumber(L, 4, 0.0f);
|
||||
float sx = (float)luaL_optnumber(L, 5, 1.0f);
|
||||
float sy = (float)luaL_optnumber(L, 6, sx);
|
||||
float ox = (float)luaL_optnumber(L, 7, 0);
|
||||
float oy = (float)luaL_optnumber(L, 8, 0);
|
||||
instance->drawTest(image, x, y, angle, sx, sy, ox, oy);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_print(lua_State *L)
|
||||
{
|
||||
const char *str = luaL_checkstring(L, 1);
|
||||
@@ -1327,7 +1313,6 @@ static const luaL_Reg functions[] =
|
||||
|
||||
{ "draw", w_draw },
|
||||
{ "drawq", w_drawq },
|
||||
{ "drawTest", w_drawTest },
|
||||
|
||||
{ "print", w_print },
|
||||
{ "printf", w_printf },
|
||||
|
||||
@@ -95,7 +95,6 @@ int w_getShader(lua_State *L);
|
||||
int w_isSupported(lua_State *L);
|
||||
int w_draw(lua_State *L);
|
||||
int w_drawq(lua_State *L);
|
||||
int w_drawTest(lua_State *L);
|
||||
int w_print(lua_State *L);
|
||||
int w_printf(lua_State *L);
|
||||
int w_point(lua_State *L);
|
||||
|
||||
Reference in New Issue
Block a user