clean up
This commit is contained in:
@@ -32,7 +32,6 @@
|
|||||||
uint packed = face._data;
|
uint packed = face._data;
|
||||||
int offset = i * 4;
|
int offset = i * 4;
|
||||||
|
|
||||||
// Write little-endian (important!)
|
|
||||||
result[offset] = (byte)(packed);
|
result[offset] = (byte)(packed);
|
||||||
result[offset + 1] = (byte)(packed >> 8);
|
result[offset + 1] = (byte)(packed >> 8);
|
||||||
result[offset + 2] = (byte)(packed >> 16);
|
result[offset + 2] = (byte)(packed >> 16);
|
||||||
|
|||||||
@@ -103,14 +103,12 @@ namespace Voxel.Core
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// highly optimized getter for the hot-path (Meshing/Raycasting)
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static BlockDefinition Get(Blocks type)
|
public static BlockDefinition Get(Blocks type)
|
||||||
{
|
{
|
||||||
return _definitions[(byte)type];
|
return _definitions[(byte)type];
|
||||||
}
|
}
|
||||||
|
|
||||||
// internal helper to map the array
|
|
||||||
private static void Define(Blocks type, Textures tex)
|
private static void Define(Blocks type, Textures tex)
|
||||||
=> _definitions[(byte)type] = new BlockDefinition(type, tex);
|
=> _definitions[(byte)type] = new BlockDefinition(type, tex);
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,6 @@ namespace Voxel.Core
|
|||||||
|
|
||||||
public void UpdateChunkMesh()
|
public void UpdateChunkMesh()
|
||||||
{
|
{
|
||||||
// Lock or use ThreadLocal for multi-threading later
|
|
||||||
lock (_faceBuffer)
|
lock (_faceBuffer)
|
||||||
{
|
{
|
||||||
_faceBuffer.Clear();
|
_faceBuffer.Clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user