mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-10 10:20:44 -07:00
Doubled view distance
This commit is contained in:
parent
83a07e779e
commit
fec94fe629
8 changed files with 38 additions and 34 deletions
|
|
@ -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++) {
|
||||
PathFinder.collisionMaps[i].resetFlags();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -934,7 +934,7 @@ public final class GlModel extends Model {
|
|||
return;
|
||||
}
|
||||
@Pc(70) int local70 = local41 + (-local13 * arg2 + local17 * arg1 >> 16);
|
||||
if (local70 >= 3584) {
|
||||
if (local70 >= GlobalConfig.VIEW_DISTANCE) {
|
||||
return;
|
||||
}
|
||||
@Pc(84) int local84 = arg7 * arg3 + arg5 * arg4 >> 16;
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@ public final class GlRenderer {
|
|||
@Pc(35) int local35 = (arg1 + arg3 - arg5 << 8) / arg9;
|
||||
gl.glMatrixMode(GL2.GL_PROJECTION);
|
||||
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);
|
||||
gl.glMatrixMode(GL2.GL_MODELVIEW);
|
||||
gl.glLoadIdentity();
|
||||
|
|
@ -767,7 +767,7 @@ public final class GlRenderer {
|
|||
@Pc(23) float local23 = (float) arg2 / 512.0F;
|
||||
@Pc(30) float local30 = local23 * (256.0F / (float) arg4);
|
||||
@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);
|
||||
gl.glMatrixMode(GL2.GL_MODELVIEW);
|
||||
gl.glLoadIdentity();
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ public class GlobalConfig {
|
|||
public static boolean USE_ISAAC = false;
|
||||
//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;
|
||||
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ public final class Static120 {
|
|||
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.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);
|
||||
GlRenderer.method4173();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public final class Static156 {
|
|||
}
|
||||
@Pc(99) short local99;
|
||||
if (GlRenderer.enabled) {
|
||||
local99 = 3584;
|
||||
local99 = (short)GlobalConfig.VIEW_DISTANCE;
|
||||
} else {
|
||||
local99 = 3500;
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ public final class Static156 {
|
|||
GlRenderer.setLightingEnabled(false);
|
||||
local1.glDisable(GL2.GL_DEPTH_TEST);
|
||||
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();
|
||||
for (@Pc(19) int local19 = 0; local19 < Static36.surfaceHdTiles[0].length; local19++) {
|
||||
@Pc(31) GlTile local31 = Static36.surfaceHdTiles[0][local19];
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public final class Static161 {
|
|||
private static float aFloat20 = -1.0F;
|
||||
|
||||
@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")
|
||||
private static final float[] aFloatArray20 = new float[4];
|
||||
|
|
@ -41,10 +41,10 @@ public final class Static161 {
|
|||
public static int anInt3923 = 16777215;
|
||||
|
||||
@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")
|
||||
private static int anInt3925 = -1;
|
||||
private static int fogColorRGB = -1;
|
||||
|
||||
@OriginalMember(owner = "client!mk", name = "a", descriptor = "()V")
|
||||
public static void method3058() {
|
||||
|
|
@ -80,26 +80,27 @@ public final class Static161 {
|
|||
}
|
||||
|
||||
@OriginalMember(owner = "client!mk", name = "a", descriptor = "(II)V")
|
||||
public static void method3062(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) {
|
||||
if (anInt3925 == arg0 && anInt3924 == arg1) {
|
||||
public static void method3062(@OriginalArg(0) int color, @OriginalArg(1) int offset) {
|
||||
if (fogColorRGB == color && fogOffset == offset) {
|
||||
return;
|
||||
}
|
||||
anInt3925 = arg0;
|
||||
anInt3924 = arg1;
|
||||
@Pc(12) GL2 local12 = GlRenderer.gl;
|
||||
aFloatArray19[0] = (float) (arg0 >> 16 & 0xFF) / 255.0F;
|
||||
aFloatArray19[1] = (float) (arg0 >> 8 & 0xFF) / 255.0F;
|
||||
aFloatArray19[2] = (float) (arg0 & 0xFF) / 255.0F;
|
||||
local12.glFogi(GL2.GL_FOG_MODE, GL2.GL_LINEAR);
|
||||
local12.glFogf(GL2.GL_FOG_DENSITY, 0.95F);
|
||||
local12.glHint(GL2.GL_FOG_HINT, GL2.GL_FASTEST);
|
||||
@Pc(65) int local65 = 3072 - arg1;
|
||||
if (local65 < 50) {
|
||||
local65 = 50;
|
||||
fogColorRGB = color;
|
||||
fogOffset = offset;
|
||||
@Pc(12) GL2 gl = GlRenderer.gl;
|
||||
fogColor[0] = (float) (color >> 16 & 0xFF) / 255.0F;
|
||||
fogColor[1] = (float) (color >> 8 & 0xFF) / 255.0F;
|
||||
fogColor[2] = (float) (color & 0xFF) / 255.0F;
|
||||
gl.glFogi(GL2.GL_FOG_MODE, GL2.GL_LINEAR);
|
||||
gl.glFogf(GL2.GL_FOG_DENSITY, 0.95F);
|
||||
gl.glHint(GL2.GL_FOG_HINT, GL2.GL_FASTEST);
|
||||
int fogEnd = GlobalConfig.VIEW_DISTANCE;
|
||||
@Pc(65) int fogStart = fogEnd - 512 - offset;
|
||||
if (fogStart < 50) {
|
||||
fogStart = 50;
|
||||
}
|
||||
local12.glFogf(GL2.GL_FOG_START, (float) local65);
|
||||
local12.glFogf(GL2.GL_FOG_END, (float) 3328);
|
||||
local12.glFogfv(GL2.GL_FOG_COLOR, aFloatArray19, 0);
|
||||
gl.glFogf(GL2.GL_FOG_START, (float) fogStart);
|
||||
gl.glFogf(GL2.GL_FOG_END, (float) fogEnd - 256.0f);
|
||||
gl.glFogfv(GL2.GL_FOG_COLOR, fogColor, 0);
|
||||
}
|
||||
|
||||
@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.glEnable(GL2.GL_LIGHT1);
|
||||
anInt3919 = -1;
|
||||
anInt3925 = -1;
|
||||
fogColorRGB = -1;
|
||||
method3067();
|
||||
}
|
||||
|
||||
@OriginalMember(owner = "client!mk", name = "a", descriptor = "([F)V")
|
||||
public static void method3066(@OriginalArg(0) float[] arg0) {
|
||||
if (arg0 == null) {
|
||||
arg0 = aFloatArray19;
|
||||
arg0 = fogColor;
|
||||
}
|
||||
@Pc(5) GL2 local5 = GlRenderer.gl;
|
||||
local5.glFogfv(GL2.GL_FOG_COLOR, arg0, 0);
|
||||
|
|
|
|||
|
|
@ -176,13 +176,14 @@ public final class WaterMaterialRenderer implements MaterialRenderer {
|
|||
local1.glCallList(this.anInt4440);
|
||||
@Pc(12) float local12 = 2662.4001F;
|
||||
local12 += (float) (Static254.anInt5559 - 128) * 0.5F;
|
||||
if (local12 >= 3328.0F) {
|
||||
local12 = 3327.0F;
|
||||
float max = (float) GlobalConfig.VIEW_DISTANCE - 256.0f;
|
||||
if (local12 >= max) {
|
||||
local12 = max - 1.0f;
|
||||
}
|
||||
this.aFloatArray23[0] = 0.0F;
|
||||
this.aFloatArray23[1] = 0.0F;
|
||||
this.aFloatArray23[2] = 1.0F / (local12 - 3328.0F);
|
||||
this.aFloatArray23[3] = local12 / (local12 - 3328.0F);
|
||||
this.aFloatArray23[2] = 1.0F / (local12 - max);
|
||||
this.aFloatArray23[3] = local12 / (local12 - max);
|
||||
local1.glTexGenfv(GL2.GL_S, GL2.GL_EYE_PLANE, this.aFloatArray23, 0);
|
||||
local1.glPopMatrix();
|
||||
local1.glActiveTexture(GL2.GL_TEXTURE0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue