removed NativeImage dependency outside of wrappers. Now LodRenderer only triggers regen without storing lightmap

This commit is contained in:
cola98765
2021-10-26 23:09:31 +02:00
parent 00ac368bba
commit a3db8e50f5
7 changed files with 10 additions and 20 deletions
@@ -49,7 +49,6 @@ import com.seibel.lod.wrappers.MinecraftWrapper;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.texture.NativeImage;
import net.minecraft.client.renderer.vertex.VertexBuffer;
import net.minecraft.potion.Effects;
import net.minecraft.profiler.IProfiler;
@@ -104,9 +103,6 @@ public class LodRenderer
/** This is used to determine if the LODs should be regenerated */
private int[] previousPos = new int[] { 0, 0, 0 };
public NativeImage lightMap = null;
public NativeImage lastLightMap = null;
// these variables are used to determine if the buffers should be rebuilt
private float prevSkyBrightness = 0;
private double prevBrightness = 0;
@@ -866,10 +862,9 @@ public class LodRenderer
// (just in case the minLightingDifference is too large to notice the change)
|| (skyBrightness == 1.0f && prevSkyBrightness != 1.0f) // noon
|| (skyBrightness == 0.2f && prevSkyBrightness != 0.2f) // midnight
|| mc.getOptions().gamma != prevBrightness || lightMap == null)
|| mc.getOptions().gamma != prevBrightness)
{
fullRegen = true;
lightMap = mc.getCurrentLightMap();
prevBrightness = mc.getOptions().gamma;
prevSkyBrightness = skyBrightness;
}