Doubled view distance

This commit is contained in:
Pazaz 2022-04-27 03:25:02 -04:00
parent 83a07e779e
commit fec94fe629
8 changed files with 38 additions and 34 deletions

View file

@ -994,7 +994,7 @@ public class ClientProt {
} }
} }
} }
Static28.method792(GlRenderer.enabled ? 28 : 25, hasUnderWaterMap); Static28.method792(GlRenderer.enabled ? GlobalConfig.TILE_DISTANCE : 25, hasUnderWaterMap);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
PathFinder.collisionMaps[i].resetFlags(); PathFinder.collisionMaps[i].resetFlags();
} }

View file

@ -934,7 +934,7 @@ public final class GlModel extends Model {
return; return;
} }
@Pc(70) int local70 = local41 + (-local13 * arg2 + local17 * arg1 >> 16); @Pc(70) int local70 = local41 + (-local13 * arg2 + local17 * arg1 >> 16);
if (local70 >= 3584) { if (local70 >= GlobalConfig.VIEW_DISTANCE) {
return; return;
} }
@Pc(84) int local84 = arg7 * arg3 + arg5 * arg4 >> 16; @Pc(84) int local84 = arg7 * arg3 + arg5 * arg4 >> 16;

View file

@ -534,7 +534,7 @@ public final class GlRenderer {
@Pc(35) int local35 = (arg1 + arg3 - arg5 << 8) / arg9; @Pc(35) int local35 = (arg1 + arg3 - arg5 << 8) / arg9;
gl.glMatrixMode(GL2.GL_PROJECTION); gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity(); gl.glLoadIdentity();
method4175((float) local7 * aFloat34, (float) local17 * aFloat34, (float) -local35 * aFloat34, (float) -local25 * aFloat34, 50.0F, 3584.0F); method4175((float) local7 * aFloat34, (float) local17 * aFloat34, (float) -local35 * aFloat34, (float) -local25 * aFloat34, 50.0F, (float) GlobalConfig.VIEW_DISTANCE);
setViewportBounds(arg0, canvasHeight - arg1 - arg3, arg2, arg3); setViewportBounds(arg0, canvasHeight - arg1 - arg3, arg2, arg3);
gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity(); gl.glLoadIdentity();
@ -767,7 +767,7 @@ public final class GlRenderer {
@Pc(23) float local23 = (float) arg2 / 512.0F; @Pc(23) float local23 = (float) arg2 / 512.0F;
@Pc(30) float local30 = local23 * (256.0F / (float) arg4); @Pc(30) float local30 = local23 * (256.0F / (float) arg4);
@Pc(37) float local37 = local23 * (256.0F / (float) arg5); @Pc(37) float local37 = local23 * (256.0F / (float) arg5);
gl.glOrtho((double) ((float) local2 * local30), (double) ((float) local6 * local30), (double) ((float) -local13 * local37), (double) ((float) -local9 * local37), (double) (50 - arg3), (double) (3584 - arg3)); gl.glOrtho((double) ((float) local2 * local30), (double) ((float) local6 * local30), (double) ((float) -local13 * local37), (double) ((float) -local9 * local37), (double) (50 - arg3), (double) (GlobalConfig.VIEW_DISTANCE - arg3));
setViewportBounds(0, 0, canvasWidth, canvasHeight); setViewportBounds(0, 0, canvasWidth, canvasHeight);
gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity(); gl.glLoadIdentity();

View file

@ -41,7 +41,9 @@ public class GlobalConfig {
public static boolean USE_ISAAC = false; public static boolean USE_ISAAC = false;
//endregion //endregion
public static boolean ANIMATED_SD_BACKGROUND = true; // default distance is 28
public static int TILE_DISTANCE = 56;
public static int VIEW_DISTANCE = TILE_DISTANCE * 128;
public static boolean USE_TWEENING = true; public static boolean USE_TWEENING = true;

View file

@ -423,7 +423,7 @@ public final class Static120 {
local4.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND0_RGB, GL2.GL_SRC_COLOR); local4.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND0_RGB, GL2.GL_SRC_COLOR);
local4.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA); local4.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA);
local4.glDepthMask(true); local4.glDepthMask(true);
local4.glFogfv(GL2.GL_FOG_COLOR, Static161.aFloatArray19, 0); local4.glFogfv(GL2.GL_FOG_COLOR, Static161.fogColor, 0);
local4.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY); local4.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
GlRenderer.method4173(); GlRenderer.method4173();
} }

View file

@ -52,7 +52,7 @@ public final class Static156 {
} }
@Pc(99) short local99; @Pc(99) short local99;
if (GlRenderer.enabled) { if (GlRenderer.enabled) {
local99 = 3584; local99 = (short)GlobalConfig.VIEW_DISTANCE;
} else { } else {
local99 = 3500; local99 = 3500;
} }
@ -110,7 +110,7 @@ public final class Static156 {
GlRenderer.setLightingEnabled(false); GlRenderer.setLightingEnabled(false);
local1.glDisable(GL2.GL_DEPTH_TEST); local1.glDisable(GL2.GL_DEPTH_TEST);
local1.glPushAttrib(GL2.GL_FOG_BIT); local1.glPushAttrib(GL2.GL_FOG_BIT);
local1.glFogf(GL2.GL_FOG_START, 3072.0F); local1.glFogf(GL2.GL_FOG_START, (float) GlobalConfig.VIEW_DISTANCE - 512.0f);
GlRenderer.disableDepthMask(); GlRenderer.disableDepthMask();
for (@Pc(19) int local19 = 0; local19 < Static36.surfaceHdTiles[0].length; local19++) { for (@Pc(19) int local19 = 0; local19 < Static36.surfaceHdTiles[0].length; local19++) {
@Pc(31) GlTile local31 = Static36.surfaceHdTiles[0][local19]; @Pc(31) GlTile local31 = Static36.surfaceHdTiles[0][local19];

View file

@ -32,7 +32,7 @@ public final class Static161 {
private static float aFloat20 = -1.0F; private static float aFloat20 = -1.0F;
@OriginalMember(owner = "client!mk", name = "h", descriptor = "[F") @OriginalMember(owner = "client!mk", name = "h", descriptor = "[F")
public static final float[] aFloatArray19 = new float[4]; public static final float[] fogColor = new float[4];
@OriginalMember(owner = "client!mk", name = "j", descriptor = "[F") @OriginalMember(owner = "client!mk", name = "j", descriptor = "[F")
private static final float[] aFloatArray20 = new float[4]; private static final float[] aFloatArray20 = new float[4];
@ -41,10 +41,10 @@ public final class Static161 {
public static int anInt3923 = 16777215; public static int anInt3923 = 16777215;
@OriginalMember(owner = "client!mk", name = "l", descriptor = "I") @OriginalMember(owner = "client!mk", name = "l", descriptor = "I")
private static int anInt3924 = -1; private static int fogOffset = -1;
@OriginalMember(owner = "client!mk", name = "m", descriptor = "I") @OriginalMember(owner = "client!mk", name = "m", descriptor = "I")
private static int anInt3925 = -1; private static int fogColorRGB = -1;
@OriginalMember(owner = "client!mk", name = "a", descriptor = "()V") @OriginalMember(owner = "client!mk", name = "a", descriptor = "()V")
public static void method3058() { public static void method3058() {
@ -80,26 +80,27 @@ public final class Static161 {
} }
@OriginalMember(owner = "client!mk", name = "a", descriptor = "(II)V") @OriginalMember(owner = "client!mk", name = "a", descriptor = "(II)V")
public static void method3062(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) { public static void method3062(@OriginalArg(0) int color, @OriginalArg(1) int offset) {
if (anInt3925 == arg0 && anInt3924 == arg1) { if (fogColorRGB == color && fogOffset == offset) {
return; return;
} }
anInt3925 = arg0; fogColorRGB = color;
anInt3924 = arg1; fogOffset = offset;
@Pc(12) GL2 local12 = GlRenderer.gl; @Pc(12) GL2 gl = GlRenderer.gl;
aFloatArray19[0] = (float) (arg0 >> 16 & 0xFF) / 255.0F; fogColor[0] = (float) (color >> 16 & 0xFF) / 255.0F;
aFloatArray19[1] = (float) (arg0 >> 8 & 0xFF) / 255.0F; fogColor[1] = (float) (color >> 8 & 0xFF) / 255.0F;
aFloatArray19[2] = (float) (arg0 & 0xFF) / 255.0F; fogColor[2] = (float) (color & 0xFF) / 255.0F;
local12.glFogi(GL2.GL_FOG_MODE, GL2.GL_LINEAR); gl.glFogi(GL2.GL_FOG_MODE, GL2.GL_LINEAR);
local12.glFogf(GL2.GL_FOG_DENSITY, 0.95F); gl.glFogf(GL2.GL_FOG_DENSITY, 0.95F);
local12.glHint(GL2.GL_FOG_HINT, GL2.GL_FASTEST); gl.glHint(GL2.GL_FOG_HINT, GL2.GL_FASTEST);
@Pc(65) int local65 = 3072 - arg1; int fogEnd = GlobalConfig.VIEW_DISTANCE;
if (local65 < 50) { @Pc(65) int fogStart = fogEnd - 512 - offset;
local65 = 50; if (fogStart < 50) {
fogStart = 50;
} }
local12.glFogf(GL2.GL_FOG_START, (float) local65); gl.glFogf(GL2.GL_FOG_START, (float) fogStart);
local12.glFogf(GL2.GL_FOG_END, (float) 3328); gl.glFogf(GL2.GL_FOG_END, (float) fogEnd - 256.0f);
local12.glFogfv(GL2.GL_FOG_COLOR, aFloatArray19, 0); gl.glFogfv(GL2.GL_FOG_COLOR, fogColor, 0);
} }
@OriginalMember(owner = "client!mk", name = "a", descriptor = "(FFF)V") @OriginalMember(owner = "client!mk", name = "a", descriptor = "(FFF)V")
@ -134,14 +135,14 @@ public final class Static161 {
local1.glLightfv(GL2.GL_LIGHT1, GL2.GL_AMBIENT, local55, 0); local1.glLightfv(GL2.GL_LIGHT1, GL2.GL_AMBIENT, local55, 0);
local1.glEnable(GL2.GL_LIGHT1); local1.glEnable(GL2.GL_LIGHT1);
anInt3919 = -1; anInt3919 = -1;
anInt3925 = -1; fogColorRGB = -1;
method3067(); method3067();
} }
@OriginalMember(owner = "client!mk", name = "a", descriptor = "([F)V") @OriginalMember(owner = "client!mk", name = "a", descriptor = "([F)V")
public static void method3066(@OriginalArg(0) float[] arg0) { public static void method3066(@OriginalArg(0) float[] arg0) {
if (arg0 == null) { if (arg0 == null) {
arg0 = aFloatArray19; arg0 = fogColor;
} }
@Pc(5) GL2 local5 = GlRenderer.gl; @Pc(5) GL2 local5 = GlRenderer.gl;
local5.glFogfv(GL2.GL_FOG_COLOR, arg0, 0); local5.glFogfv(GL2.GL_FOG_COLOR, arg0, 0);

View file

@ -176,13 +176,14 @@ public final class WaterMaterialRenderer implements MaterialRenderer {
local1.glCallList(this.anInt4440); local1.glCallList(this.anInt4440);
@Pc(12) float local12 = 2662.4001F; @Pc(12) float local12 = 2662.4001F;
local12 += (float) (Static254.anInt5559 - 128) * 0.5F; local12 += (float) (Static254.anInt5559 - 128) * 0.5F;
if (local12 >= 3328.0F) { float max = (float) GlobalConfig.VIEW_DISTANCE - 256.0f;
local12 = 3327.0F; if (local12 >= max) {
local12 = max - 1.0f;
} }
this.aFloatArray23[0] = 0.0F; this.aFloatArray23[0] = 0.0F;
this.aFloatArray23[1] = 0.0F; this.aFloatArray23[1] = 0.0F;
this.aFloatArray23[2] = 1.0F / (local12 - 3328.0F); this.aFloatArray23[2] = 1.0F / (local12 - max);
this.aFloatArray23[3] = local12 / (local12 - 3328.0F); this.aFloatArray23[3] = local12 / (local12 - max);
local1.glTexGenfv(GL2.GL_S, GL2.GL_EYE_PLANE, this.aFloatArray23, 0); local1.glTexGenfv(GL2.GL_S, GL2.GL_EYE_PLANE, this.aFloatArray23, 0);
local1.glPopMatrix(); local1.glPopMatrix();
local1.glActiveTexture(GL2.GL_TEXTURE0); local1.glActiveTexture(GL2.GL_TEXTURE0);