Fix rotateZ (#1253)

This commit is contained in:
Krzysztof Wiśniewski 2025-03-29 14:26:43 +01:00 committed by GitHub
parent 21409df5a1
commit 34558a2906
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 7 additions and 7 deletions

View File

@ -312,7 +312,7 @@ pub fn model(block: Block) ModelIndex {
return .{.index = blocks.meshes.modelIndexStart(block).index + (block.data & 63)};
}
fn rotateZ(data: u16, angle: Degrees) u16 {
pub fn rotateZ(data: u16, angle: Degrees) u16 {
@setEvalBranchQuota(65_536);
comptime var rotationTable: [4][16]u8 = undefined;

View File

@ -28,7 +28,7 @@ const CarpetData = packed struct(u6) {
posZ: bool,
};
fn rotateZ(data: u16, angle: Degrees) u16 {
pub fn rotateZ(data: u16, angle: Degrees) u16 {
comptime var rotationTable: [4][64]u8 = undefined;
comptime for(0..64) |i| {
rotationTable[0][i] = @intCast(i);

View File

@ -34,7 +34,7 @@ pub fn reset() void {
fenceModels.clearRetainingCapacity();
}
fn rotateZ(data: u16, angle: Degrees) u16 {
pub fn rotateZ(data: u16, angle: Degrees) u16 {
comptime var rotationTable: [4][16]u8 = undefined;
comptime for(0..16) |i| {
rotationTable[0][i] = @intCast(i);

View File

@ -47,7 +47,7 @@ pub fn model(block: Block) ModelIndex {
return .{.index = blocks.meshes.modelIndexStart(block).index + @min(block.data, 5)};
}
fn rotateZ(data: u16, angle: Degrees) u16 {
pub fn rotateZ(data: u16, angle: Degrees) u16 {
comptime var rotationTable: [4][6]u8 = undefined;
comptime for(0..6) |i| {
rotationTable[0][i] = i;

View File

@ -45,7 +45,7 @@ pub fn model(block: Block) ModelIndex {
return .{.index = blocks.meshes.modelIndexStart(block).index + @min(block.data, 3)};
}
fn rotateZ(data: u16, angle: Degrees) u16 {
pub fn rotateZ(data: u16, angle: Degrees) u16 {
comptime var rotationTable: [4][4]u8 = undefined;
comptime for(0..4) |i| {
rotationTable[0][i] = i;

View File

@ -25,7 +25,7 @@ fn hasSubBlock(stairData: u8, x: u1, y: u1, z: u1) bool {
return stairData & subBlockMask(x, y, z) == 0;
}
fn rotateZ(data: u16, angle: Degrees) u16 {
pub fn rotateZ(data: u16, angle: Degrees) u16 {
@setEvalBranchQuota(65_536);
comptime var rotationTable: [4][256]u8 = undefined;

View File

@ -97,7 +97,7 @@ pub fn model(block: Block) ModelIndex {
return .{.index = blocks.meshes.modelIndexStart(block).index + (@as(u5, @truncate(block.data)) -| 1)};
}
fn rotateZ(data: u16, angle: Degrees) u16 {
pub fn rotateZ(data: u16, angle: Degrees) u16 {
comptime var rotationTable: [4][32]u8 = undefined;
comptime for(0..32) |i| {
rotationTable[0][i] = @intCast(i);