Package com.badlogic.gdx.utils

Examples of com.badlogic.gdx.utils.IntArray


      noDevice = true;
      ex.printStackTrace();
      return;
    }

    allSources = new IntArray(false, simultaneousSources);
    for (int i = 0; i < simultaneousSources; i++) {
      int sourceID = alGenSources();
      if (alGetError() != AL_NO_ERROR) break;
      allSources.add(sourceID);
    }
    idleSources = new IntArray(allSources);
    soundIdToSource = new LongMap<Integer>();
    sourceToSoundId = new IntMap<Long>();

    FloatBuffer orientation = (FloatBuffer)BufferUtils.createFloatBuffer(6)
      .put(new float[] {0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f}).flip();
View Full Code Here


    int vertexDataLength = vertexData.length;
    if (vertexDataLength > 1) { // if we have multiple pages...
      // contains the indices of the glyph in the Cache as they are added
      glyphIndices = new IntArray[vertexDataLength];
      for (int i = 0, n = glyphIndices.length; i < n; i++) {
        glyphIndices[i] = new IntArray();
      }

      tmpGlyphCount = new int[vertexDataLength];
    }
  }
View Full Code Here

  /** Sorts x,y pairs of values by the x value, then the y value.
   * @param count Number of indices, must be even. */
  private void sort (float[] values, int count) {
    int lower = 0;
    int upper = count - 1;
    IntArray stack = quicksortStack;
    stack.add(lower);
    stack.add(upper - 1);
    while (stack.size > 0) {
      upper = stack.pop();
      lower = stack.pop();
      if (upper <= lower) continue;
      int i = quicksortPartition(values, lower, upper);
      if (i - lower > upper - i) {
        stack.add(lower);
        stack.add(i - 2);
      }
      stack.add(i + 2);
      stack.add(upper);
      if (upper - i >= i - lower) {
        stack.add(lower);
        stack.add(i - 2);
      }
    }
  }
View Full Code Here

            for (int y = 0; y < mapHeight; ++y) {
              for (int x = 0; x < mapWidth; ++x) {
                if (tlayer.getCell(x, y) != null) {
                  int tileid = tlayer.getCell(x, y).getTile().getId() & ~0xE0000000;
                  String tilesetName = tilesetNameFromTileId(map, tileid);
                  IntArray usedIds = getUsedIdsBucket(tilesetName, bucketSize);
                  usedIds.add(tileid);

                  // track this tileset to be packed if not already tracked
                  if (!tilesetsToPack.containsKey(tilesetName)) {
                    tilesetsToPack.put(tilesetName, map.getTileSets().getTileSet(tilesetName));
                  }
View Full Code Here

    if (size <= 0) {
      return null;
    }

    IntArray bucket = new IntArray(size);
    tilesetUsedIds.put(tilesetName, bucket);
    return bucket;
  }
View Full Code Here

    packer = new TexturePacker(texturePackerSettings);

    for (TiledMapTileSet set : sets.values()) {
      String tilesetName = set.getName();
      System.out.println("Processing tileset " + tilesetName);
      IntArray usedIds = this.settings.stripUnusedTiles ? getUsedIdsBucket(tilesetName, -1) : null;

      int tileWidth = set.getProperties().get("tilewidth", Integer.class);
      int tileHeight = set.getProperties().get("tileheight", Integer.class);
      int firstgid = set.getProperties().get("firstgid", Integer.class);
      String imageName = set.getProperties().get("imagesource", String.class);

      TileSetLayout layout = new TileSetLayout(firstgid, set, inputDirHandle);

      for (int gid = layout.firstgid, i = 0; i < layout.numTiles; gid++, i++) {
        if (usedIds != null && !usedIds.contains(gid)) {
          System.out.println("Stripped id #" + gid + " from tileset \"" + tilesetName + "\"");
          continue;
        }

        tileLocation = layout.getLocation(gid);
View Full Code Here

    } else {
      for (int i = 0, n = vertexCount - 1; i < vertexCount; i++)
        indices[i] = (short)(n - i); // Reversed.
    }

    IntArray vertexTypes = this.vertexTypes;
    vertexTypes.clear();
    vertexTypes.ensureCapacity(vertexCount);
    for (int i = 0, n = vertexCount; i < n; ++i)
      vertexTypes.add(classifyVertex(i));

    // A polygon with n vertices has a triangulation of n-2 triangles.
    ShortArray triangles = this.triangles;
    triangles.clear();
    triangles.ensureCapacity(Math.max(0, vertexCount - 2) * 3);
 
View Full Code Here

    int vertexDataLength = vertexData.length;
    if (vertexDataLength > 1) { // if we have multiple pages...
      // contains the indices of the glyph in the Cache as they are added
      glyphIndices = new IntArray[vertexDataLength];
      for (int i = 0, n = glyphIndices.length; i < n; i++) {
        glyphIndices[i] = new IntArray();
      }

      tmpGlyphCount = new int[vertexDataLength];
    }
  }
View Full Code Here

        int offset = -1;
        int count = 0;

        // we need to loop through the indices and determine where we begin within the start/end bounds
        IntArray currentGlyphIndices = glyphIndices[i];
        for (int j = 0, n = currentGlyphIndices.size; j < n; j++) {
          int glyphIndex = currentGlyphIndices.items[j];

          // break early if the glyph is outside our bounds
          if (glyphIndex >= end) break;
View Full Code Here

      noDevice = true;
      ex.printStackTrace();
      return;
    }

    allSources = new IntArray(false, simultaneousSources);
    for (int i = 0; i < simultaneousSources; i++) {
      int sourceID = alGenSources();
      if (alGetError() != AL_NO_ERROR) break;
      allSources.add(sourceID);
    }
    idleSources = new IntArray(allSources);
    soundIdToSource = new LongMap<Integer>();
    sourceToSoundId = new IntMap<Long>();

    FloatBuffer orientation = (FloatBuffer)BufferUtils.createFloatBuffer(6)
      .put(new float[] {0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f}).flip();
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.utils.IntArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.