public void reset () { glyphs.clear(); xAdvances.clear(); width = 0; }
public void reset () { glyphs.clear(); xAdvances.clear(); width = 0; }
/** Clears the data being built up until now, including the vertices, indices and all parts. Must be called in between the call * to #begin and #end. Any builder calls made from the last call to #begin up until now are practically discarded. The state * (e.g. UV region, color, vertex transform) will remain unchanged. */ public void clear () { this.vertices.clear(); this.indices.clear(); this.parts.clear(); this.vindex = 0; this.lastIndex = -1; this.istart = 0; this.part = null; }
/** Clears the data being built up until now, including the vertices, indices and all parts. Must be called in between the call * to #begin and #end. Any builder calls made from the last call to #begin up until now are practically discarded. The state * (e.g. UV region, color, vertex transform) will remain unchanged. */ public void clear () { this.vertices.clear(); this.indices.clear(); this.parts.clear(); this.vindex = 0; this.lastIndex = -1; this.istart = 0; this.part = null; }
public void stop () { if (audio.noDevice) return; if (sourceID == -1) return; audio.music.removeValue(this, true); reset(); audio.freeSource(sourceID); sourceID = -1; renderedSeconds = 0; renderedSecondsQueue.clear(); isPlaying = false; }
public void stop () { if (audio.noDevice) return; if (sourceID == -1) return; audio.music.removeValue(this, true); reset(); audio.freeSource(sourceID); sourceID = -1; renderedSeconds = 0; renderedSecondsQueue.clear(); isPlaying = false; }
public void stop () { if (audio.noDevice) return; if (sourceID == -1) return; audio.music.removeValue(this, true); reset(); audio.freeSource(sourceID); sourceID = -1; renderedSeconds = 0; renderedSecondsQueue.clear(); isPlaying = false; }
public void stop () { if (audio.noDevice) return; if (sourceID == -1) return; audio.music.removeValue(this, true); reset(); audio.freeSource(sourceID); sourceID = -1; renderedSeconds = 0; renderedSecondsQueue.clear(); isPlaying = false; }
glyphPositions.clear(); float x = 0; if (layout.runs.size > 0) {
glyphPositions.clear(); float x = 0; if (layout.runs.size > 0) {
hull.clear();
hull.clear();
void triangulate () { // seed = 4139368480425561099l; // seed = 6559652580366669361l; MathUtils.random.setSeed(seed); int pointCount = 100; points.clear(); for (int i = 0; i < pointCount; i++) { float value; do { value = MathUtils.random(10, 400); } while (points.contains(value)); points.add(value); do { value = MathUtils.random(10, 400); } while (points.contains(value)); points.add(value); } points.add(Gdx.input.getX()); points.add(Gdx.graphics.getHeight() - Gdx.input.getY()); triangles = trianglulator.computeTriangles(points, false); }
@Override public void addMesh (Mesh mesh, int indexOffset, int numIndices) { if (!attributes.equals(mesh.getVertexAttributes())) throw new GdxRuntimeException("Vertex attributes do not match"); if (numIndices <= 0) return; // silently ignore an empty mesh part // FIXME don't triple copy, instead move the copy to jni int numFloats = mesh.getNumVertices() * stride; tmpVertices.clear(); tmpVertices.ensureCapacity(numFloats); tmpVertices.size = numFloats; mesh.getVertices(tmpVertices.items); tmpIndices.clear(); tmpIndices.ensureCapacity(numIndices); tmpIndices.size = numIndices; mesh.getIndices(indexOffset, numIndices, tmpIndices.items, 0); addMesh(tmpVertices.items, tmpIndices.items, 0, numIndices); }
@Override public void addMesh (Mesh mesh, int indexOffset, int numIndices) { if (!attributes.equals(mesh.getVertexAttributes())) throw new GdxRuntimeException("Vertex attributes do not match"); if (numIndices <= 0) return; // silently ignore an empty mesh part // FIXME don't triple copy, instead move the copy to jni int numFloats = mesh.getNumVertices() * stride; tmpVertices.clear(); tmpVertices.ensureCapacity(numFloats); tmpVertices.size = numFloats; mesh.getVertices(tmpVertices.items); tmpIndices.clear(); tmpIndices.ensureCapacity(numIndices); tmpIndices.size = numIndices; mesh.getIndices(indexOffset, numIndices, tmpIndices.items, 0); addMesh(tmpVertices.items, tmpIndices.items, 0, numIndices); }
if (this.attributes != null) throw new RuntimeException("Call end() first"); this.attributes = attributes; this.vertices.clear(); this.indices.clear(); this.parts.clear();
if (this.attributes != null) throw new RuntimeException("Call end() first"); this.attributes = attributes; this.vertices.clear(); this.indices.clear(); this.parts.clear();
run.xAdvances.clear(); run.xAdvances.addAll(truncateRun.xAdvances); if (truncateRun.xAdvances.size > 0) run.width += truncateRun.xAdvances.get(0);
/** End building the mesh and returns the mesh * @param mesh The mesh to receive the built vertices and indices, must have the same attributes and must be big enough to hold * the data, any existing data will be overwritten. */ public Mesh end (Mesh mesh) { endpart(); if (attributes == null) throw new GdxRuntimeException("Call begin() first"); if (!attributes.equals(mesh.getVertexAttributes())) throw new GdxRuntimeException("Mesh attributes don't match"); if ((mesh.getMaxVertices() * stride) < vertices.size) throw new GdxRuntimeException("Mesh can't hold enough vertices: " + mesh.getMaxVertices() + " * " + stride + " < " + vertices.size); if (mesh.getMaxIndices() < indices.size) throw new GdxRuntimeException("Mesh can't hold enough indices: " + mesh.getMaxIndices() + " < " + indices.size); mesh.setVertices(vertices.items, 0, vertices.size); mesh.setIndices(indices.items, 0, indices.size); for (MeshPart p : parts) p.mesh = mesh; parts.clear(); attributes = null; vertices.clear(); indices.clear(); return mesh; }
/** End building the mesh and returns the mesh * @param mesh The mesh to receive the built vertices and indices, must have the same attributes and must be big enough to hold * the data, any existing data will be overwritten. */ public Mesh end (Mesh mesh) { endpart(); if (attributes == null) throw new GdxRuntimeException("Call begin() first"); if (!attributes.equals(mesh.getVertexAttributes())) throw new GdxRuntimeException("Mesh attributes don't match"); if ((mesh.getMaxVertices() * stride) < vertices.size) throw new GdxRuntimeException("Mesh can't hold enough vertices: " + mesh.getMaxVertices() + " * " + stride + " < " + vertices.size); if (mesh.getMaxIndices() < indices.size) throw new GdxRuntimeException("Mesh can't hold enough indices: " + mesh.getMaxIndices() + " < " + indices.size); mesh.setVertices(vertices.items, 0, vertices.size); mesh.setIndices(indices.items, 0, indices.size); for (MeshPart p : parts) p.mesh = mesh; parts.clear(); attributes = null; vertices.clear(); indices.clear(); return mesh; }