fixed the memory crash problem.

Added config to draw always in generation quality (if true the game will crash with  render distance>256)
This commit is contained in:
Leonardo
2021-09-23 15:18:33 +02:00
parent a2e18de9f3
commit 66728cc1eb
4 changed files with 276 additions and 261 deletions
@@ -18,7 +18,7 @@ public class DetailDistanceUtil
private static double logBase = Math.log(2);
private static int[] maxVerticalData = {
8,
4,
4,
4,
2,
@@ -28,7 +28,7 @@ public class DetailDistanceUtil
1,
1,
1,
1,};
1};
private static HorizontalResolution[] lodGenDetails = {
@@ -121,10 +121,16 @@ public class DetailDistanceUtil
{
if (detail < minDrawDetail)
{
return lodGenDetails[minDrawDetail].detailLevel;
if(LodConfig.CLIENT.graphics.alwaysDrawAtMaxQuality.get())
return getLodGenDetail(minDrawDetail).detailLevel;
else
return (byte) minDrawDetail;
} else
{
return lodGenDetails[detail].detailLevel;
if(LodConfig.CLIENT.graphics.alwaysDrawAtMaxQuality.get())
return getLodGenDetail(detail).detailLevel;
else
return (byte) detail;
}
}