use of com.watabou.utils.PointF in project pixel-dungeon-remix by NYRDS.
the class CustomLayerTilemap method updateVertices.
@Override
protected void updateVertices() {
super.updateVertices();
// FIXME
if (Dungeon.hero == null) {
return;
}
PointF hpos = Dungeon.hero.getHeroSprite().worldCoords();
float hx = hpos.x;
float hy = hpos.y;
Arrays.fill(maskData, 0);
mask.position(0);
for (int i = 0; i < level.getHeight(); i++) {
for (int j = 0; j < level.getWidth(); j++) {
int p = (i * level.getWidth() + j) * 8;
maskData[p + 0] = getTCoord(hx, j - 0.5f);
maskData[p + 1] = getTCoord(hy, i - 0.5f);
maskData[p + 2] = getTCoord(hx, j + 0.5f);
maskData[p + 3] = getTCoord(hy, i - 0.5f);
maskData[p + 4] = getTCoord(hx, j + 0.5f);
maskData[p + 5] = getTCoord(hy, i + 0.5f);
maskData[p + 6] = getTCoord(hx, j - 0.5f);
maskData[p + 7] = getTCoord(hy, i + 0.5f);
}
}
mask.put(maskData);
}
Aggregations