Example #1
0
 private static GLState stfor(Tex tex, int z, boolean clip) {
   TexGL gt;
   if (tex instanceof TexGL) gt = (TexGL) tex;
   else if ((tex instanceof TexSI) && (((TexSI) tex).parent instanceof TexGL))
     gt = (TexGL) ((TexSI) tex).parent;
   else throw (new RuntimeException("Cannot use texture for ground-tile rendering: " + tex));
   GLState ret;
   if (clip)
     ret = GLState.compose(Light.deflight, gcol, gt.draw(), gt.clip(), new MapMesh.MLOrder(z));
   else ret = GLState.compose(Light.deflight, gcol, gt.draw(), new MapMesh.MLOrder(z));
   return (ret);
 }
Example #2
0
 private Equ(ED ed) {
   this.desc = ed.clone();
   this.id = desc.id;
   GLState bt = null;
   if (bt == null) {
     Skeleton.BoneOffset bo = ed.res.res.get().layer(Skeleton.BoneOffset.class, ed.at);
     if (bo != null) bt = bo.forpose(pose);
   }
   if ((bt == null) && (skel instanceof Skeleton.ResourceSkeleton)) {
     Skeleton.BoneOffset bo =
         ((Skeleton.ResourceSkeleton) skel).res.layer(Skeleton.BoneOffset.class, ed.at);
     if (bo != null) bt = bo.forpose(pose);
   }
   if (bt == null) {
     Skeleton.Bone bone = skel.bones.get(ed.at);
     if (bone != null) bt = pose.bonetrans(bone.idx);
   }
   if (bt == null)
     throw (new RuntimeException(
         "Transformation "
             + ed.at
             + " for equipment "
             + ed.res
             + " on skeleton "
             + skel
             + " could not be resolved"));
   if ((ed.off.x != 0.0f) || (ed.off.y != 0.0f) || (ed.off.z != 0.0f))
     this.et = GLState.compose(bt, Location.xlate(ed.off));
   else this.et = bt;
 }