コード例 #1
0
ファイル: GobPath.java プロジェクト: romovs/amber
  public void draw(GOut g) {
    Coord2d mc = MapView.pllastcc;
    if (mc == null) return;

    Gob gob = (Gob) owner;
    Coord3f pc = gob.getc();
    double lcx = mc.x;
    double lcy = mc.y;
    double x = lcx - pc.x;
    double y = -lcy + pc.y;
    double z = Math.sqrt(x * x + y * y) >= 44 * 11 ? 0 : gob.glob.map.getcz(lcx, lcy) - pc.z;

    g.apply();
    BGL gl = g.gl;
    gl.glLineWidth(2.0F);
    gl.glEnable(GL2.GL_BLEND);
    gl.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA);
    gl.glEnable(GL2.GL_LINE_SMOOTH);
    gl.glHint(GL2.GL_LINE_SMOOTH_HINT, GL2.GL_NICEST);
    gl.glBegin(GL2.GL_LINES);
    gl.glVertex3f(0, 0, 0);
    gl.glVertex3f((float) x, (float) y, (float) z);
    gl.glEnd();
    gl.glDisable(GL2.GL_LINE_SMOOTH);
  }
コード例 #2
0
ファイル: SpriteLink.java プロジェクト: puruscor/Purus-Pasta
 public Sprite create(Owner owner, Resource res, Message sdt) {
   Gob gob = (Gob) owner;
   Glob glob = gob.glob;
   Tileset t = glob.map.tileset(glob.map.gettile(new Coord2d(gob.getc()).floor(MCache.tilesz)));
   for (int i = 0; i < tag.length; i++) {
     if (Arrays.binarySearch(t.tags, tag[i]) >= 0) return (sub[i].create(owner, res, sdt));
   }
   return ((def == null) ? null : def.create(owner, res, sdt));
 }