예제 #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));
    }
  }
예제 #2
0
파일: GameMain.java 프로젝트: cping/LGame
  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;
  }
예제 #3
0
파일: BMFont.java 프로젝트: lwxcool/LGame
 public BMFont(String file, String imgFile) throws Exception {
   this.displayList = BaseIO.loadTexture(imgFile);
   this.parse(BaseIO.loadText(file));
 }
예제 #4
0
파일: BMFont.java 프로젝트: lwxcool/LGame
 public BMFont(String file, LTexture image) throws Exception {
   this.displayList = image;
   this.parse(BaseIO.loadText(file));
 }
예제 #5
0
 public LTextureRegion(String file, int x, int y, int width, int height) {
   this(BaseIO.loadTexture(file), x, y, width, height);
 }
예제 #6
0
 public LTextureRegion(String file) {
   this(BaseIO.loadTexture(file));
 }