Downhill screens no longer shake on screen (t106)
This commit is contained in:
@@ -10,8 +10,7 @@ fn slopeCorner(p: vec2f, a: vec2f, origin: f32) -> vec3f {
|
||||
var d: vec2f = p - a; var radius: f32 = length(d);
|
||||
return vec3f(radius - 1.85, origin + d.x, 2.0 + d.y);
|
||||
}
|
||||
fn slopeShape(inputP: vec2f, worldOrigin: vec2f, grade: f32, joins: i32) -> vec3f { var p=inputP;
|
||||
if ((joins & 64) != 0) { p.y -= 0.45; }
|
||||
fn slopeShape(inputP: vec2f, worldOrigin: vec2f, grade: f32, joins: i32) -> vec3f { let p=inputP;
|
||||
var sy: f32 = select( 0.0, 4.0 , grade < 0.0 );
|
||||
var a: vec2f = vec2f(-grade * 1.30814755, sy + 1.30814755); var b: vec2f = vec2f(4.0 - grade * 1.30814755, 4.0 - sy + 1.30814755);
|
||||
if ((joins & 1) != 0) { a.y = sy + 2.0; a.x = (a.y - sy - 2.61629509) / grade; }
|
||||
|
||||
@@ -33,7 +33,7 @@ function prepareSlopeBelts(x0, y0, x1, y1) {
|
||||
if (c === BP_BELT || c === BP_FILTER) beltCaps[b] = flatBeltCaps(b);
|
||||
if (!isSlopeBelt(c)) continue;
|
||||
const face = beltFaceY(c, bx, by, bx * BS) * W + bx * BS;
|
||||
slopeBeltJoins[b] = slopeBeltConnections(bx, by, c) | (netSat(face) > 0 ? 16 : 0) | (filterCfg.get(b)?.inv ? 32 : 0) | (isFilter(c) && netSat(face) > 0 && screenLoaded(b) && !transportStalled(b) && (tick & 2) ? 64 : 0);
|
||||
slopeBeltJoins[b] = slopeBeltConnections(bx, by, c) | (netSat(face) > 0 ? 16 : 0) | (filterCfg.get(b)?.inv ? 32 : 0);
|
||||
for (let yy = Math.max(0, by - 2); yy <= Math.min(BH - 1, by + 1); yy++)
|
||||
for (let xx = Math.max(0, bx - 1); xx <= Math.min(BW - 1, bx + 1); xx++) slopeBeltHalo[yy * BW + xx] = 1;
|
||||
}
|
||||
@@ -54,7 +54,6 @@ function slopeBeltCorner(x, y, ax, ay, origin) {
|
||||
function slopeBeltShape(x, y, b, joins = slopeBeltJoins[b], code = blockP[b]) {
|
||||
const grade = beltGrade(code), ox = (b % BW) * BS, oy = ((b / BW) | 0) * BS;
|
||||
x -= ox; y -= oy;
|
||||
if (isFilter(code) && (joins & 64)) y -= 0.45;
|
||||
const offset = 1.85 * Math.SQRT2, sy = grade < 0 ? 4 : 0;
|
||||
const normal = 1.85 * Math.SQRT1_2;
|
||||
let ax = -grade * normal, ay = sy + normal, bx = 4 - grade * normal, by = 4 - sy + normal;
|
||||
@@ -118,14 +117,6 @@ function slopeBeltColor(b, x, y, anim, br, bg, bb) {
|
||||
return (r | 0) | ((g | 0) << 8) | ((blue | 0) << 16);
|
||||
}
|
||||
|
||||
function screenLoaded(b) {
|
||||
const bx = b % BW, by = (b / BW) | 0, c = blockP[b];
|
||||
for (let x = bx * BS; x < bx * BS + BS; x++) {
|
||||
const i = (beltFaceY(c, bx, by, x) - 1) * W + x;
|
||||
if (i >= 0 && (PH[mat[i]] === PH_POWDER || occ[i])) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Filled far wall, in belt coordinates. Project onto the face so ends stop at the slope ends.
|
||||
let slopeWallOwner = -1;
|
||||
function slopeWallShape(x, y, b, code = blockP[b]) {
|
||||
|
||||
Reference in New Issue
Block a user