Fix scaled world-aligned textures being aligned inconsistently for non-normal drawtypes

This commit is contained in:
Wuzzy 2021-08-19 18:14:04 +00:00 committed by GitHub
parent 24b66dede0
commit 1320c51d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -407,20 +407,20 @@ static void getNodeTextureCoords(v3f base, const v3f &scale, const v3s16 &dir, f
if (dir.X > 0 || dir.Y != 0 || dir.Z < 0) if (dir.X > 0 || dir.Y != 0 || dir.Z < 0)
base -= scale; base -= scale;
if (dir == v3s16(0,0,1)) { if (dir == v3s16(0,0,1)) {
*u = -base.X - 1; *u = -base.X;
*v = -base.Y - 1; *v = -base.Y;
} else if (dir == v3s16(0,0,-1)) { } else if (dir == v3s16(0,0,-1)) {
*u = base.X + 1; *u = base.X + 1;
*v = -base.Y - 2; *v = -base.Y - 1;
} else if (dir == v3s16(1,0,0)) { } else if (dir == v3s16(1,0,0)) {
*u = base.Z + 1; *u = base.Z + 1;
*v = -base.Y - 2;
} else if (dir == v3s16(-1,0,0)) {
*u = -base.Z - 1;
*v = -base.Y - 1; *v = -base.Y - 1;
} else if (dir == v3s16(-1,0,0)) {
*u = -base.Z;
*v = -base.Y;
} else if (dir == v3s16(0,1,0)) { } else if (dir == v3s16(0,1,0)) {
*u = base.X + 1; *u = base.X + 1;
*v = -base.Z - 2; *v = -base.Z - 1;
} else if (dir == v3s16(0,-1,0)) { } else if (dir == v3s16(0,-1,0)) {
*u = base.X + 1; *u = base.X + 1;
*v = base.Z + 1; *v = base.Z + 1;