private void drawAdjusted (Texture texture, float[] spriteVertices, int offset, int count) { if (!drawing) throw new IllegalStateException("CpuSpriteBatch.begin must be called before draw."); if (texture != lastTexture) switchTexture(texture); Affine2 t = adjustAffine; int copyCount = Math.min(vertices.length - idx, count); do { count -= copyCount; while (copyCount > 0) { float x = spriteVertices[offset]; float y = spriteVertices[offset + 1]; vertices[idx] = t.m00 * x + t.m01 * y + t.m02; // x vertices[idx + 1] = t.m10 * x + t.m11 * y + t.m12; // y vertices[idx + 2] = spriteVertices[offset + 2]; // color vertices[idx + 3] = spriteVertices[offset + 3]; // u vertices[idx + 4] = spriteVertices[offset + 4]; // v idx += Sprite.VERTEX_SIZE; offset += Sprite.VERTEX_SIZE; copyCount -= Sprite.VERTEX_SIZE; } if (count > 0) { super.flush(); copyCount = Math.min(vertices.length, count); } } while (count > 0); }
private void drawAdjusted (Texture texture, float[] spriteVertices, int offset, int count) { if (!drawing) throw new IllegalStateException("CpuSpriteBatch.begin must be called before draw."); if (texture != lastTexture) switchTexture(texture); Affine2 t = adjustAffine; int copyCount = Math.min(vertices.length - idx, count); do { count -= copyCount; while (copyCount > 0) { float x = spriteVertices[offset]; float y = spriteVertices[offset + 1]; vertices[idx] = t.m00 * x + t.m01 * y + t.m02; // x vertices[idx + 1] = t.m10 * x + t.m11 * y + t.m12; // y vertices[idx + 2] = spriteVertices[offset + 2]; // color vertices[idx + 3] = spriteVertices[offset + 3]; // u vertices[idx + 4] = spriteVertices[offset + 4]; // v idx += Sprite.VERTEX_SIZE; offset += Sprite.VERTEX_SIZE; copyCount -= Sprite.VERTEX_SIZE; } if (count > 0) { super.flush(); copyCount = Math.min(vertices.length, count); } } while (count > 0); }
switchTexture(region.texture); else if (idx == vertices.length) super.flush();
switchTexture(region.texture); else if (idx == vertices.length) super.flush();
switchTexture(texture); else if (idx == vertices.length) super.flush();
switchTexture(texture); else if (idx == vertices.length) super.flush();
switchTexture(region.texture); else if (idx == vertices.length) super.flush();
switchTexture(region.texture); else if (idx == vertices.length) super.flush();
private void drawAdjusted (Texture texture, float[] spriteVertices, int offset, int count) { if (!drawing) throw new IllegalStateException("CpuSpriteBatch.begin must be called before draw."); if (texture != lastTexture) switchTexture(texture); Affine2 t = adjustAffine; int copyCount = Math.min(vertices.length - idx, count); do { count -= copyCount; while (copyCount > 0) { float x = spriteVertices[offset]; float y = spriteVertices[offset + 1]; vertices[idx] = t.m00 * x + t.m01 * y + t.m02; // x vertices[idx + 1] = t.m10 * x + t.m11 * y + t.m12; // y vertices[idx + 2] = spriteVertices[offset + 2]; // color vertices[idx + 3] = spriteVertices[offset + 3]; // u vertices[idx + 4] = spriteVertices[offset + 4]; // v idx += Sprite.VERTEX_SIZE; offset += Sprite.VERTEX_SIZE; copyCount -= Sprite.VERTEX_SIZE; } if (count > 0) { super.flush(); copyCount = Math.min(vertices.length, count); } } while (count > 0); }
switchTexture(region.texture); else if (idx == vertices.length) super.flush();
switchTexture(texture); else if (idx == vertices.length) super.flush();
switchTexture(region.texture); else if (idx == vertices.length) super.flush();