mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 03:06:55 -04:00
Unlock the mutex and fix formatting
This commit is contained in:
parent
b57fa6666f
commit
ec7f259cf6
@ -81,7 +81,6 @@ pub const ChannelChunk = struct {
|
||||
};
|
||||
|
||||
pub fn getValue(self: *ChannelChunk, x: i32, y: i32, z: i32) [3]u8 {
|
||||
self.lock.assertLockedRead();
|
||||
const index = chunk.getIndex(x, y, z);
|
||||
return self.data.getValue(index).toArray();
|
||||
}
|
||||
|
@ -197,10 +197,6 @@ pub fn getLight(wx: i32, wy: i32, wz: i32) ?[6]u8 {
|
||||
const x = (wx >> mesh.chunk.voxelSizeShift) & chunk.chunkMask;
|
||||
const y = (wy >> mesh.chunk.voxelSizeShift) & chunk.chunkMask;
|
||||
const z = (wz >> mesh.chunk.voxelSizeShift) & chunk.chunkMask;
|
||||
mesh.lightingData[0].lock.lockRead();
|
||||
defer mesh.lightingData[0].lock.unlockRead();
|
||||
mesh.lightingData[1].lock.lockRead();
|
||||
defer mesh.lightingData[1].lock.unlockRead();
|
||||
return mesh.lightingData[1].getValue(x, y, z) ++ mesh.lightingData[0].getValue(x, y, z);
|
||||
}
|
||||
|
||||
|
@ -1261,7 +1261,10 @@ pub fn PaletteCompressedRegion(T: type, size: comptime_int) type { // MARK: Pale
|
||||
var iNew: u32 = 0;
|
||||
var iOld: u32 = 0;
|
||||
const len: u32 = impl.paletteLength;
|
||||
while(iOld < len) : ({iNew += 1; iOld += 1;}) outer: {
|
||||
while(iOld < len) : ({
|
||||
iNew += 1;
|
||||
iOld += 1;
|
||||
}) outer: {
|
||||
while(impl.paletteOccupancy[iOld] == 0) {
|
||||
iOld += 1;
|
||||
if(iOld >= len) break :outer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user