示例#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));
 }