rCos = Math.cos(rot);
rSin = Math.sin(rot);
fov = height;
Level level = game.level;
int r = 6;
int xCenter = (int) (Math.floor(xCam));
int zCenter = (int) (Math.floor(yCam));
for (int zb = zCenter - r; zb <= zCenter + r; zb++) {
for (int xb = xCenter - r; xb <= xCenter + r; xb++) {
Block c = level.getBlock(xb, zb);
Block e = level.getBlock(xb + 1, zb);
Block s = level.getBlock(xb, zb + 1);
if (c instanceof DoorBlock) {
double rr = 1 / 8.0;
double openness = 1 - ((DoorBlock) c).openness * 7 / 8;
if (e.solidRender) {
renderWall(xb + openness, zb + 0.5 - rr, xb, zb + 0.5 - rr, c.tex, (c.col & 0xfefefe) >> 1, 0, openness);
renderWall(xb, zb + 0.5 + rr, xb + openness, zb + 0.5 + rr, c.tex, (c.col & 0xfefefe) >> 1, openness, 0);
renderWall(xb + openness, zb + 0.5 + rr, xb + openness, zb + 0.5 - rr, c.tex, c.col, 0.5 - rr, 0.5 + rr);
} else {
renderWall(xb + 0.5 - rr, zb, xb + 0.5 - rr, zb + openness, c.tex, c.col, openness, 0);
renderWall(xb + 0.5 + rr, zb + openness, xb + 0.5 + rr, zb, c.tex, c.col, 0, openness);
renderWall(xb + 0.5 - rr, zb + openness, xb + 0.5 + rr, zb + openness, c.tex, (c.col & 0xfefefe) >> 1, 0.5 - rr, 0.5 + rr);
}
}
if (c.solidRender) {
if (!e.solidRender) {
renderWall(xb + 1, zb + 1, xb + 1, zb, c.tex, c.col);
}
if (!s.solidRender) {
renderWall(xb, zb + 1, xb + 1, zb + 1, c.tex, (c.col & 0xfefefe) >> 1);
}
} else {
if (e.solidRender) {
renderWall(xb + 1, zb, xb + 1, zb + 1, e.tex, e.col);
}
if (s.solidRender) {
renderWall(xb + 1, zb + 1, xb, zb + 1, s.tex, (s.col & 0xfefefe) >> 1);
}
}
}
}
for (int zb = zCenter - r; zb <= zCenter + r; zb++) {
for (int xb = xCenter - r; xb <= xCenter + r; xb++) {
Block c = level.getBlock(xb, zb);
for (int j = 0; j < c.entities.size(); j++) {
Entity e = c.entities.get(j);
for (int i = 0; i < e.sprites.size(); i++) {
Sprite sprite = e.sprites.get(i);