public void clear () { if (iterating > 0) { clear = size; return; } super.clear(); }
public void dispose () { // OK to call multiple times. synchronized (threadLock) { if (thread == this) thread = null; instances.clear(); threadLock.notifyAll(); } Gdx.app.removeLifecycleListener(this); } }
/** Cancels all tasks. */ public synchronized void clear () { for (int i = 0, n = tasks.size; i < n; i++) { Task task = tasks.get(i); synchronized (task) { task.executeTimeMillis = 0; task.timer = null; } } tasks.clear(); }
private void clearDebugRects () { if (debugRects == null) return; DebugRect.pool.freeAll(debugRects); debugRects.clear(); }
/** @return all bodies currently in the simulation */ public void getBodies (Array<Body> bodies) { bodies.clear(); bodies.ensureCapacity(this.bodies.size); for (Iterator<Body> iter = this.bodies.values(); iter.hasNext();) { bodies.add(iter.next()); } }
protected Array<TextureRegion> getRegions (Texture texture, Array<AtlasRegion> atlasRegions, Array<TextureRegion> out) { out.clear(); for(TextureRegion region : atlasRegions){ if(region.getTexture() == texture) out.add(region); } return out; }
public void clearSelection(){ unselectedRegions.addAll(selectedRegions); selectedRegions.clear(); repaint(); }
public void selectAll () { selectedRegions.addAll(unselectedRegions); unselectedRegions.clear(); repaint(); }
public void reset () { Pools.get(GlyphRun.class).freeAll(runs); runs.clear(); width = 0; height = 0; }
public Array<Contact> getContactList () { // FIXME pool contacts org.jbox2d.dynamics.contacts.Contact contactList = world.getContactList(); contacts.clear(); while (contactList != null) { Contact contact = new Contact(this, contactList); contacts.add(contact); contactList = contactList.m_next; } return contacts; }
public static btCollisionShape obtainStaticNodeShape (final Node node, final boolean applyTransform) { getShapeParts(node, applyTransform, shapePartArray, 0, shapePartPool); btCollisionShape result = obtainStaticShape(shapePartArray); shapePartPool.freeAll(shapePartArray); shapePartArray.clear(); return result; }
/** Invalidates all cache IDs and resets the SpriteCache so new caches can be added. */ public void clear () { caches.clear(); mesh.getVerticesBuffer().clear().flip(); }
private void clearRenderablesPool () { renderablePool.freeAll(renderables); for (int i = 0, free = renderablePool.getFree(); i < free; ++i) { Renderable renderable = renderablePool.obtain(); renderable.meshPart.mesh.dispose(); } renderables.clear(); }
/** Set the backing Array that makes up the choices available in the SelectBox */ public void setItems (T... newItems) { if (newItems == null) throw new IllegalArgumentException("newItems cannot be null."); float oldPrefWidth = getPrefWidth(); items.clear(); items.addAll(newItems); selection.validate(); selectBoxList.list.setItems(items); invalidate(); if (oldPrefWidth != getPrefWidth()) invalidateHierarchy(); }
protected boolean delegate (float delta) { Array<Action> currentActions = target.getActions(); if (currentActions.size == 1) waitForActions.clear(); for (int i = waitForActions.size - 1; i >= 0; i--) { Action action = waitForActions.get(i); int index = currentActions.indexOf(action, true); if (index == -1) waitForActions.removeIndex(i); } if (waitForActions.size > 0) return false; return action.act(delta); } }
@Override protected void onLoaded () { if (currentlyLoading == null || currentlyLoading.isEmpty()) return; instances.clear(); animationControllers.clear(); final ModelInstance instance = new ModelInstance(assets.get(currentlyLoading, Model.class)); for (Material m : instance.materials) m.set(new BlendingAttribute(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, 0.8f)); instances.add(instance); if (instance.animations.size > 0) animationControllers.put(instance, new AnimationController(instance)); currentlyLoading = null; }
@Override public void actionPerformed (ActionEvent e) { final ParticleEmitter emitter = editor.getEmitter(); emitter.setImagePaths(new Array<String>(new String[] { ParticleEditor.DEFAULT_PARTICLE })); emitter.getSprites().clear(); updateImageList(emitter.getImagePaths()); } });
@Override public void actionPerformed (ActionEvent e) { final ParticleEmitter emitter = editor.getEmitter(); emitter.setImagePaths(new Array<String>(new String[] { ParticleEditor.DEFAULT_PREMULT_PARTICLE })); emitter.getSprites().clear(); updateImageList(emitter.getImagePaths()); } });