mirror of
https://github.com/love2d/love.git
synced 2026-08-13 17:10:54 +02:00
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:
@@ -97,6 +97,9 @@ ParticleSystem::ParticleSystem(Graphics *gfx, Texture *texture, uint32 size)
|
||||
if (size == 0 || size > MAX_PARTICLES)
|
||||
throw love::Exception("Invalid ParticleSystem size.");
|
||||
|
||||
if (texture->getTextureType() != TEXTURE_2D)
|
||||
throw love::Exception("Only 2D textures can be used with ParticleSystems.");
|
||||
|
||||
sizes.push_back(1.0f);
|
||||
colors.push_back(Colorf(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
|
||||
@@ -434,6 +437,9 @@ ParticleSystem::Particle *ParticleSystem::removeParticle(Particle *p)
|
||||
|
||||
void ParticleSystem::setTexture(Texture *tex)
|
||||
{
|
||||
if (texture->getTextureType() != TEXTURE_2D)
|
||||
throw love::Exception("Only 2D textures can be used with ParticleSystems.");
|
||||
|
||||
texture.set(tex);
|
||||
|
||||
if (defaultOffset)
|
||||
@@ -958,7 +964,7 @@ bool ParticleSystem::prepareDraw(Graphics *gfx, const Matrix4 &m)
|
||||
|
||||
Graphics::TempTransform transform(gfx, m);
|
||||
|
||||
const Vertex *textureVerts = texture->getVertices();
|
||||
const vertex::XYf_STf *textureVerts = texture->getQuad()->getVertices();
|
||||
Vertex *pVerts = (Vertex *) buffer->map();
|
||||
Particle *p = pHead;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user