Examples of TexIdx


Examples of net.sourceforge.dsnk.model.TexIdx

              int index = cells[(k * 8) + m].getIndex();
              int tileGroupIdx = index / 32;
              int tileIdx = index % 32;
              LandTile tile = this.tileGroups[tileGroupIdx].getTiles()[tileIdx];
             
              TexIdx textureIndex = this.texIdxs[(int)tile.getTextureId()];
             
              try {
                Texture texture = this.textureReader.read(textureIndex);
               
                // draw blocks from top to bottom and the left to
View Full Code Here

Examples of net.sourceforge.dsnk.model.TexIdx

    int tileGroupIdx = index / 32;
    int tileIdx = index % 32;

    // fetch the land tile
    LandTile tile = this.tileGroups[tileGroupIdx].getTiles()[tileIdx];
    TexIdx textureIndex = this.texIdxs[(int) tile.getTextureId()];

    // fetch the texture object
    Texture texture = null;
    try {
      texture = this.textureCache.get(textureIndex.getStart());
    } catch (CacheItemNotFoundException e) {
      // not found in cache, so load
      texture = textureReader.read(textureIndex);
      // put texture into cache
      this.textureCache.put(textureIndex.getStart(), texture);
    }

    // and the image of the texture
    Image textureImg = null;
    if (texture != null) {
View Full Code Here

Examples of net.sourceforge.dsnk.model.TexIdx

    if (readBytes != 12) {
      throw new IOException(
          "Cannot read data block from file, not enough bytes available");
    }

    TexIdx idx = getTexIdx(data);

    return idx;
  }
View Full Code Here

Examples of net.sourceforge.dsnk.model.TexIdx

   *             if TexIdx objects cannot be read
   */
  public TexIdx[] readAll() throws IOException {
    ArrayList<TexIdx> list = new ArrayList<TexIdx>();

    TexIdx idx = null;
    while ((idx = read()) != null) {
      list.add(idx);
    }
    TexIdx[] data = new TexIdx[list.size()];
    list.toArray(data);
View Full Code Here

Examples of net.sourceforge.dsnk.model.TexIdx

   * @param data
   *            byte array
   * @return TexIdx object
   */
  private TexIdx getTexIdx(byte[] data) {
    TexIdx idx = new TexIdx();

    int start = getIntValue(data, 0);
    int length = getIntValue(data, 4);
    int unknown = getIntValue(data, 8);

    idx.setStart(start);
    idx.setLength(length);
    idx.setUnknown(unknown);

    return idx;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.