mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Removed an unused graphics Image method
--HG-- branch : image-CompressedData
This commit is contained in:
@@ -224,11 +224,10 @@ void Graphics::present()
|
||||
|
||||
void Graphics::setIcon(Image *image)
|
||||
{
|
||||
love::image::ImageData *data = image->getData();
|
||||
if (data)
|
||||
currentWindow->setIcon(data);
|
||||
else
|
||||
if (image->isCompressed())
|
||||
throw love::Exception("Cannot use compressed image data to set an icon.");
|
||||
|
||||
currentWindow->setIcon(image->getData());
|
||||
}
|
||||
|
||||
void Graphics::setCaption(const char *caption)
|
||||
@@ -334,9 +333,11 @@ int Graphics::getScissor(lua_State *L) const
|
||||
|
||||
void Graphics::defineStencil()
|
||||
{
|
||||
// Disable color writes but don't save the mask values.
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
|
||||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
glStencilFunc(GL_ALWAYS, 1, 1);
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
}
|
||||
|
||||
@@ -93,40 +93,6 @@ love::image::ImageData *Image::getData() const
|
||||
return data;
|
||||
}
|
||||
|
||||
void Image::getRectangleVertices(int x, int y, int w, int h, vertex *vertices) const
|
||||
{
|
||||
// Check upper.
|
||||
x = (x+w > (int)width) ? (int)width-w : x;
|
||||
y = (y+h > (int)height) ? (int)height-h : y;
|
||||
|
||||
// Check lower.
|
||||
x = (x < 0) ? 0 : x;
|
||||
y = (y < 0) ? 0 : y;
|
||||
|
||||
vertices[0].x = 0;
|
||||
vertices[0].y = 0;
|
||||
vertices[1].x = 0;
|
||||
vertices[1].y = (float)h;
|
||||
vertices[2].x = (float)w;
|
||||
vertices[2].y = (float)h;
|
||||
vertices[3].x = (float)w;
|
||||
vertices[3].y = 0;
|
||||
|
||||
float tx = (float)x/width;
|
||||
float ty = (float)y/height;
|
||||
float tw = (float)w/width;
|
||||
float th = (float)h/height;
|
||||
|
||||
vertices[0].s = tx;
|
||||
vertices[0].t = ty;
|
||||
vertices[1].s = tx;
|
||||
vertices[1].t = ty+th;
|
||||
vertices[2].s = tx+tw;
|
||||
vertices[2].t = ty+th;
|
||||
vertices[3].s = tx+tw;
|
||||
vertices[3].t = ty;
|
||||
}
|
||||
|
||||
void Image::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const
|
||||
{
|
||||
static Matrix t;
|
||||
|
||||
@@ -76,20 +76,6 @@ public:
|
||||
|
||||
love::image::ImageData *getData() const;
|
||||
|
||||
/**
|
||||
* Generate vertices according to a subimage.
|
||||
*
|
||||
* Note: out-of-range values will be clamped.
|
||||
* Note: the vertex colors will not be changed.
|
||||
*
|
||||
* @param x The top-left corner of the subimage along the x-axis.
|
||||
* @param y The top-left corner of the subimage along the y-axis.
|
||||
* @param w The width of the subimage.
|
||||
* @param h The height of the subimage.
|
||||
* @param vertices A vertex array of size four.
|
||||
**/
|
||||
void getRectangleVertices(int x, int y, int w, int h, vertex *vertices) const;
|
||||
|
||||
/**
|
||||
* @copydoc Drawable::draw()
|
||||
**/
|
||||
|
||||
Reference in New Issue
Block a user