Example usage for com.badlogic.gdx.utils IntArray ensureCapacity

List of usage examples for com.badlogic.gdx.utils IntArray ensureCapacity

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils IntArray ensureCapacity.

Prototype

public int[] ensureCapacity(int additionalCapacity) 

Source Link

Document

Increases the size of the backing array to accommodate the specified number of additional items.

Usage

From source file:com.github.antag99.retinazer.util.Mask.java

License:Open Source License

public void getIndices(IntArray out) {
    int offset = out.size;
    int count = cardinality();
    out.ensureCapacity(count);
    int[] items = out.items;
    for (int i = 0, b = nextSetBit(0); i < count; i++, b = nextSetBit(b + 1)) {
        items[offset + i] = b;//from  ww  w  .  j a  v  a 2s  . co  m
    }
    out.size += count;
}