Array textures can be easily drawn without a shader (resolves issue #1111).

Added love.graphics.drawLayer(texture, layerindex, …). ‘texture’ must be an array texture.
Added SpriteBatch:add/setLayer.

Added Quad:get/setLayer. This applies to array textures that are drawn without specifying an explicit layer index in the draw call.

Added love.graphics.newQuad variants which have layer arguments.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-02-26 17:11:22 -04:00
parent 9ba7234f14
commit 66b299822a
27 changed files with 559 additions and 295 deletions
+11 -7
View File
@@ -54,7 +54,10 @@ public:
virtual ~SpriteBatch();
int add(const Matrix4 &m, int index = -1);
int addq(Quad *quad, const Matrix4 &m, int index = -1);
int add(Quad *quad, const Matrix4 &m, int index = -1);
int addLayer(int layer, const Matrix4 &m, int index = -1);
int addLayer(int layer, Quad *quad, const Matrix4 &m, int index = -1);
void clear();
void flush();
@@ -78,10 +81,9 @@ public:
void setColor();
/**
* Get the current color for this SpriteBatch. Returns NULL if no color is
* set.
* Get the current color for this SpriteBatch.
**/
const Color *getColor() const;
const Color &getColor(bool &active) const;
/**
* Get the number of sprites currently in this SpriteBatch.
@@ -117,8 +119,6 @@ protected:
**/
void setBufferSize(int newsize);
void addv(const Vertex *v, const Matrix4 &m, int index);
StrongRef<Texture> texture;
// Max number of sprites in the batch.
@@ -129,7 +129,11 @@ protected:
// Current color. This color, if present, will be applied to the next
// added sprite.
Color *color;
Color color;
bool color_active;
vertex::CommonFormat vertex_format;
size_t format_stride;
love::graphics::Buffer *array_buf;
QuadIndices quad_indices;