mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 01:55:19 -04:00
Fix chunk loading. (oops).
This commit is contained in:
parent
3294540246
commit
ac3b1b0571
@ -92,13 +92,12 @@ namespace ClassicalSharp {
|
|||||||
return allAir || allSolid;
|
return allAir || allSolid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetDrawInfo( int x, int y, int z, ref ChunkPartInfo[] solidParts,
|
public void GetDrawInfo( int x, int y, int z, ref ChunkPartInfo[] solidParts,
|
||||||
ref ChunkPartInfo[] spriteParts, ref ChunkPartInfo[] translucentParts ) {
|
ref ChunkPartInfo[] spriteParts, ref ChunkPartInfo[] translucentParts ) {
|
||||||
if( !BuildChunk( x, y, z ) )
|
if( !BuildChunk( x, y, z ) )
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
GetChunkInfo( x, y, z, ref solidParts, ref spriteParts, ref translucentParts );
|
GetChunkInfo( x, y, z, ref solidParts, ref spriteParts, ref translucentParts );
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RenderTile( int chunkIndex, int xx, int yy, int zz, int x, int y, int z ) {
|
public void RenderTile( int chunkIndex, int xx, int yy, int zz, int x, int y, int z ) {
|
||||||
|
@ -267,14 +267,15 @@ namespace ClassicalSharp {
|
|||||||
if( info.SolidParts == null && info.SpriteParts == null && info.TranslucentParts == null ) {
|
if( info.SolidParts == null && info.SpriteParts == null && info.TranslucentParts == null ) {
|
||||||
if( inRange && chunksUpdatedThisFrame < 4 ) {
|
if( inRange && chunksUpdatedThisFrame < 4 ) {
|
||||||
Window.ChunkUpdates++;
|
Window.ChunkUpdates++;
|
||||||
if( !builder.GetDrawInfo( info.CentreX - 8, info.CentreY - 8, info.CentreZ - 8,
|
builder.GetDrawInfo( info.CentreX - 8, info.CentreY - 8, info.CentreZ - 8,
|
||||||
ref info.SolidParts, ref info.SpriteParts, ref info.TranslucentParts ) ) {
|
ref info.SolidParts, ref info.SpriteParts, ref info.TranslucentParts );
|
||||||
|
if( info.SolidParts == null && info.SpriteParts == null && info.TranslucentParts == null ) {
|
||||||
info.Empty = true;
|
info.Empty = true;
|
||||||
}
|
}
|
||||||
chunksUpdatedThisFrame++;
|
chunksUpdatedThisFrame++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
info.Visible = inRange &&
|
info.Visible = inRange &&
|
||||||
Window.Culling.SphereInFrustum( info.CentreX, info.CentreY, info.CentreZ, 14 ); // 14 ~ sqrt(3 * 8^2)
|
Window.Culling.SphereInFrustum( info.CentreX, info.CentreY, info.CentreZ, 14 ); // 14 ~ sqrt(3 * 8^2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user