Exemplo n.º 1
0
  public void load3ds(String filename, int count, float angle_y, float z_adjust, float scale) {
    if (meshCache.get(filename + ("" + angle_y) + count) == null) {
      ArrayByte is = BaseIO.loadArrayByte(filename);
      byte buffer[] = new byte[is.available()];
      is.read(buffer);
      this.mMeshPosition = new float[3];
      currentcount = 0;
      eatChunk(buffer, 0, count, angle_y, z_adjust, scale);
      is.close();
      this.mMeshName = filename;
      this.mMeshPosition = null;
      D3DMesh.storeMesh(filename + ("" + angle_y) + count, this);

    } else {
      this.copyReference(D3DMesh.getMesh(filename + ("" + angle_y) + count));
    }
  }
Exemplo n.º 2
0
  public final boolean LoadLevel(
      int level,
      RefObject<Integer> speed,
      RefObject<java.util.ArrayList<Tile>> tiles,
      RefObject<java.util.ArrayList<Tile>> caves,
      RefObject<java.util.ArrayList<ScheduleItem>> schedule) {
    try {
      ArrayByte bytes = BaseIO.loadArrayByte("assets/levels/level_" + level + ".lev");
      ArrayByteReader reader = new ArrayByteReader(bytes);
      String record;
      for (; (record = reader.readLine()) != null; ) {

        String tempVar = record.substring(0, 1);
        if (tempVar.equals("t")) {
          Tile tile = new Tile();
          tile.InitWithString(record.substring(2));
          tiles.argvalue.add(tile);
        } else if (tempVar.equals("c")) {
          Tile tile2 = new Tile();
          tile2.InitWithString(record.substring(2));
          caves.argvalue.add(tile2);
        } else if (tempVar.equals("s")) {
          speed.argvalue = Integer.parseInt(record.substring(2));

        } else if (tempVar.equals("x")) {
          String[] strArray = record.substring(2).split("[,]", -1);
          int aCaveId = Integer.parseInt(strArray[0]);
          int aTicks = Integer.parseInt(strArray[1]);
          ScheduleItem item = new ScheduleItem(aCaveId, aTicks);
          schedule.argvalue.add(item);
        }
      }
      reader.close();
    } catch (Exception e) {
      return false;
    }
    return true;
  }
Exemplo n.º 3
0
 public BMFont(String file, String imgFile) throws Exception {
   this.displayList = BaseIO.loadTexture(imgFile);
   this.parse(BaseIO.loadText(file));
 }
Exemplo n.º 4
0
 public BMFont(String file, LTexture image) throws Exception {
   this.displayList = image;
   this.parse(BaseIO.loadText(file));
 }
Exemplo n.º 5
0
 public LTextureRegion(String file, int x, int y, int width, int height) {
   this(BaseIO.loadTexture(file), x, y, width, height);
 }
Exemplo n.º 6
0
 public LTextureRegion(String file) {
   this(BaseIO.loadTexture(file));
 }