Auto-padded NPOT images' texture coordinates are now scaled at draw time via the texture matrix (fixes auto-padded images with Meshes.) Also fixed love.graphics.newQuad.

--HG--
branch : Mesh
This commit is contained in:
Alex Szpakowski
2013-10-06 23:25:29 -03:00
parent d161d5c0fc
commit fb34f5bc9e
7 changed files with 52 additions and 65 deletions
+11 -6
View File
@@ -88,6 +88,14 @@ public:
**/
void drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const;
/**
* Call before using this Image's texture to draw. Binds the texture,
* globally scales texture coordinates if the Image has NPOT dimensions and
* NPOT isn't supported, etc.
**/
void predraw() const;
void postdraw() const;
/**
* Sets the filter mode.
* @param f The filter mode.
@@ -124,12 +132,6 @@ public:
**/
bool refresh();
/**
* Gets the texture coordinate scale used for drawing auto-padded NPOT
* images correctly.
**/
love::Vector getTexCoordScale() const;
static void setDefaultMipmapSharpness(float sharpness);
static float getDefaultMipmapSharpness();
static void setDefaultMipmapFilter(FilterMode f);
@@ -172,6 +174,9 @@ private:
// The source vertices of the image.
Vertex vertices[4];
// The scale applied to texcoords for NPOT images without NPOT support.
love::Vector texCoordScale;
// Mipmap texture LOD bias (sharpness) value.
float mipmapSharpness;