Beispiel #1
0
  public final void update() {
    chunkUpdates++;
    this.setAllDirty();

    Tesselator t = Tesselator.instance;
    for (int i = 0; i < 3; i++) {
      glNewList(this.glRenderList + i, GL_COMPILE);
      t.begin();

      for (int x = x0; x < x1; x++) {
        for (int y = y0; y < y1; y++) {
          for (int z = z0; z < z1; z++) {
            int type = this.level.getTile(x, y, z);
            if (type > 0) {
              Tile tile = Tile.tiles[type];
              tile.render(i, x, y, z);
            }
          }
        }
      }

      t.end();
      glEndList();
      this.isDirty = false;
    }
  }
  public void renderLevel(Graphics g) {
    // Tile loops

    for (Tile t : tiles) {
      if (t.isVisible && t != null) t.render(g);
    }
  } // End render
  public boolean render(GLGraphics g, float w, float h) {
    if (dimension == null) // ERROR never initialized
    return false;
    float wScale = w / dimension.width;
    float hScale = h / dimension.height;

    g.save();
    // scale to be able to use pixel rendering
    g.gl.glScalef(wScale, hScale, 1.0f);

    g.gl.glEnable(GL.GL_TEXTURE_2D);
    for (Tile tile : tiles) tile.render(g);
    g.restore();
    return true;
  }
 public void render(Screen screen) {
   super.render(screen);
 }
 @Override
 public void render(Screen screen) {
   parent.render(screen);
   screen.blit(Art.rails[img][0], x * Tile.WIDTH, y * Tile.HEIGHT - 6);
 }