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); }