Skip to content

Commit

Permalink
chore: Finished renaming local vars in client class
Browse files Browse the repository at this point in the history
  • Loading branch information
Pazaz committed Jan 4, 2024
1 parent 9ad812b commit e603e3f
Show file tree
Hide file tree
Showing 12 changed files with 3,222 additions and 2,745 deletions.
5 changes: 0 additions & 5 deletions TODO.md

This file was deleted.

5,860 changes: 3,186 additions & 2,674 deletions client/src/main/java/client.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
import org.openrs2.deob.annotation.OriginalMember;
import org.openrs2.deob.annotation.Pc;

// Interface Component - doesn't quite belong under config...
@OriginalClass("client!hc")
public class IfType {
public class ComType {

@OriginalMember(owner = "client!hc", name = "c", descriptor = "[Lclient!hc;")
public static IfType[] instances;
public static ComType[] instances;

@OriginalMember(owner = "client!hc", name = "d", descriptor = "[I")
public int[] inventorySlotObjId;
Expand Down Expand Up @@ -201,7 +202,7 @@ public static void unpack(@OriginalArg(0) Jagfile media, @OriginalArg(1) PixFont
@Pc(29) int parentId = -1;

@Pc(32) int count = dat.g2();
instances = new IfType[count];
instances = new ComType[count];

while (dat.pos < dat.data.length) {
@Pc(45) int id = dat.g2();
Expand All @@ -210,7 +211,7 @@ public static void unpack(@OriginalArg(0) Jagfile media, @OriginalArg(1) PixFont
id = dat.g2();
}

@Pc(62) IfType com = instances[id] = new IfType();
@Pc(62) ComType com = instances[id] = new ComType();
com.id = id;
com.parentId = parentId;
com.type = dat.g1();
Expand Down
8 changes: 4 additions & 4 deletions client/src/main/java/jagex2/config/IdkType.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public void decode(@OriginalArg(1) Packet dat) {
if (code == 1) {
this.type = dat.g1();
} else if (code == 2) {
@Pc(26) int local26 = dat.g1();
this.models = new int[local26];
@Pc(26) int count = dat.g1();
this.models = new int[count];

for (@Pc(32) int local32 = 0; local32 < local26; local32++) {
this.models[local32] = dat.g2();
for (@Pc(32) int i = 0; i < count; i++) {
this.models[i] = dat.g2();
}
} else if (code == 3) {
this.disable = true;
Expand Down
14 changes: 7 additions & 7 deletions client/src/main/java/jagex2/dash3d/World3D.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public static void addOccluder(@OriginalArg(0) int maxZ, @OriginalArg(1) int min
}

@OriginalMember(owner = "client!r", name = "a", descriptor = "([IIIBII)V")
public static void init(@OriginalArg(0) int[] pitchDistance, @OriginalArg(1) int arg1, @OriginalArg(2) int viewportWidth, @OriginalArg(4) int viewportHeight, @OriginalArg(5) int arg5) {
public static void init(@OriginalArg(0) int[] pitchDistance, @OriginalArg(1) int constant1, @OriginalArg(2) int viewportWidth, @OriginalArg(4) int viewportHeight, @OriginalArg(5) int constant2) {
viewportLeft = 0;
viewportTop = 0;
viewportRight = viewportWidth;
Expand All @@ -263,7 +263,7 @@ public static void init(@OriginalArg(0) int[] pitchDistance, @OriginalArg(1) int
int x = dx * 128;
int z = dz * 128;
@Pc(80) boolean visible = false;
for (@Pc(83) int y = -arg5; y <= arg1; y += 128) {
for (@Pc(83) int y = -constant2; y <= constant1; y += 128) {
if (testPoint(x, z, pitchDistance[pitchLevel] + y)) {
visible = true;
break;
Expand Down Expand Up @@ -1784,7 +1784,7 @@ private void drawTileUnderlay(@OriginalArg(0) TileUnderlay underlay, @OriginalAr
}

@OriginalMember(owner = "client!r", name = "a", descriptor = "(IILclient!i;IIIIZ)V")
private void drawTileOverlay(@OriginalArg(0) int sinEyeYaw, @OriginalArg(1) int arg1, @OriginalArg(2) TileOverlay overlay, @OriginalArg(3) int arg3, @OriginalArg(4) int cosEyePitch, @OriginalArg(5) int sinEyePitch, @OriginalArg(6) int cosEyeYaw) {
private void drawTileOverlay(@OriginalArg(0) int sinEyeYaw, @OriginalArg(1) int tileZ, @OriginalArg(2) TileOverlay overlay, @OriginalArg(3) int tileX, @OriginalArg(4) int cosEyePitch, @OriginalArg(5) int sinEyePitch, @OriginalArg(6) int cosEyeYaw) {
@Pc(5) int vertexCount = overlay.vertexX.length;

for (@Pc(7) int i = 0; i < vertexCount; i++) {
Expand Down Expand Up @@ -1829,8 +1829,8 @@ private void drawTileOverlay(@OriginalArg(0) int sinEyeYaw, @OriginalArg(1) int
if ((x0 - x1) * (y2 - y1) - (y0 - y1) * (x2 - x1) > 0) {
Draw3D.clipX = x0 < 0 || x1 < 0 || x2 < 0 || x0 > Draw2D.boundX || x1 > Draw2D.boundX || x2 > Draw2D.boundX;
if (takingInput && this.pointInsideTriangle(mouseX, mouseY, y0, y1, y2, x0, x1, x2)) {
clickTileX = arg3;
clickTileZ = arg1;
clickTileX = tileX;
clickTileZ = tileZ;
}
if (overlay.triangleTextureIds == null || overlay.triangleTextureIds[v] == -1) {
if (overlay.triangleColorA[v] != 12345678) {
Expand Down Expand Up @@ -2143,11 +2143,11 @@ private boolean wallVisible(@OriginalArg(0) int level, @OriginalArg(1) int x, @O
}

@OriginalMember(owner = "client!r", name = "j", descriptor = "(IIII)Z")
private boolean visible(@OriginalArg(0) int level, @OriginalArg(1) int tileX, @OriginalArg(2) int tileZ, @OriginalArg(3) int arg3) {
private boolean visible(@OriginalArg(0) int level, @OriginalArg(1) int tileX, @OriginalArg(2) int tileZ, @OriginalArg(3) int y) {
if (this.tileVisible(level, tileX, tileZ)) {
@Pc(11) int x = tileX << 7;
@Pc(15) int z = tileZ << 7;
return this.occluded(x + 1, this.levelHeightmaps[level][tileX][tileZ] - arg3, z + 1) && this.occluded(x + 128 - 1, this.levelHeightmaps[level][tileX + 1][tileZ] - arg3, z + 1) && this.occluded(x + 128 - 1, this.levelHeightmaps[level][tileX + 1][tileZ + 1] - arg3, z + 128 - 1) && this.occluded(x + 1, this.levelHeightmaps[level][tileX][tileZ + 1] - arg3, z + 128 - 1);
return this.occluded(x + 1, this.levelHeightmaps[level][tileX][tileZ] - y, z + 1) && this.occluded(x + 128 - 1, this.levelHeightmaps[level][tileX + 1][tileZ] - y, z + 1) && this.occluded(x + 128 - 1, this.levelHeightmaps[level][tileX + 1][tileZ + 1] - y, z + 128 - 1) && this.occluded(x + 1, this.levelHeightmaps[level][tileX][tileZ + 1] - y, z + 128 - 1);
} else {
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/main/java/jagex2/dash3d/entity/PathingEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class PathingEntity extends Entity {
public int z;

@OriginalMember(owner = "client!x", name = "i", descriptor = "I")
public int seqDelay;
public int yaw;

@OriginalMember(owner = "client!x", name = "j", descriptor = "Z")
public boolean seqStretches = false;
Expand Down Expand Up @@ -163,7 +163,7 @@ public class PathingEntity extends Entity {
public final boolean[] pathRunning = new boolean[10];

@OriginalMember(owner = "client!x", name = "fb", descriptor = "I")
public int seqPathLength;
public int seqTrigger;

@OriginalMember(owner = "client!x", name = "a", descriptor = "(ZZII)V")
public final void move(@OriginalArg(1) boolean teleport, @OriginalArg(2) int x, @OriginalArg(3) int z) {
Expand Down Expand Up @@ -194,7 +194,7 @@ public final void move(@OriginalArg(1) boolean teleport, @OriginalArg(2) int x,
}

this.pathLength = 0;
this.seqPathLength = 0;
this.seqTrigger = 0;
this.pathTileX[0] = x;
this.pathTileZ[0] = z;
this.x = this.pathTileX[0] * 128 + this.size * 64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public ProjectileEntity(@OriginalArg(0) int offsetY, @OriginalArg(1) int peakPit
}

@OriginalMember(owner = "client!ab", name = "a", descriptor = "(IIIII)V")
public void updateVelocity(@OriginalArg(0) int arg0, @OriginalArg(1) int dstZ, @OriginalArg(2) int dstX, @OriginalArg(4) int cycle) {
public void updateVelocity(@OriginalArg(0) int dstY, @OriginalArg(1) int dstZ, @OriginalArg(2) int dstX, @OriginalArg(4) int cycle) {
if (!this.mobile) {
@Pc(8) double dx = dstX - this.srcX;
@Pc(14) double dz = dstZ - this.srcZ;
Expand All @@ -119,7 +119,7 @@ public void updateVelocity(@OriginalArg(0) int arg0, @OriginalArg(1) int dstZ, @
this.velocityY = -this.velocity * Math.tan((double) this.peakPitch * 0.02454369D);
}

this.accelerationY = ((double) arg0 - this.y - this.velocityY * dt) * 2.0D / (dt * dt);
this.accelerationY = ((double) dstY - this.y - this.velocityY * dt) * 2.0D / (dt * dt);
}

@OriginalMember(owner = "client!ab", name = "a", descriptor = "(BI)V")
Expand Down
30 changes: 0 additions & 30 deletions client/src/main/java/jagex2/dash3d/type/TileOverlay.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,35 +319,5 @@ public TileOverlay(@OriginalArg(0) int tileX, @OriginalArg(1) int shape, @Origin
}
}
}

/*int local149 = southwestY;
int local151 = southeastY;
if (southeastY < southwestY) {
local149 = southeastY;
}
if (southeastY > southeastY) {
local151 = southeastY;
}
if (northeastY < local149) {
local149 = northeastY;
}
if (northeastY > southeastY) {
local151 = northeastY;
}
if (northwestY < local149) {
local149 = northwestY;
}
if (northwestY > local151) {
local151 = northwestY;
}
local149 /= 14;
local151 /= 14;*/
}
}
10 changes: 5 additions & 5 deletions client/src/main/java/jagex2/graphics/PixFont.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ public void drawStringCenter(@OriginalArg(0) int y, @OriginalArg(2) int rgb, @Or
}

@OriginalMember(owner = "client!jb", name = "a", descriptor = "(IIZILjava/lang/String;I)V")
public void drawStringTaggableCenter(@OriginalArg(0) int x, @OriginalArg(1) int arg1, @OriginalArg(2) boolean arg2, @OriginalArg(3) int arg3, @OriginalArg(4) String str) {
this.drawStringTaggable(x - this.stringWidth(str) / 2, arg3, str, arg2, arg1);
public void drawStringTaggableCenter(@OriginalArg(0) int x, @OriginalArg(1) int color, @OriginalArg(2) boolean shadowed, @OriginalArg(3) int y, @OriginalArg(4) String str) {
this.drawStringTaggable(x - this.stringWidth(str) / 2, y, str, shadowed, color);
}

@OriginalMember(owner = "client!jb", name = "a", descriptor = "(ZLjava/lang/String;)I")
Expand Down Expand Up @@ -210,15 +210,15 @@ public void drawStringTaggable(@OriginalArg(0) int x, @OriginalArg(2) int y, @Or
}

@OriginalMember(owner = "client!jb", name = "a", descriptor = "(IZBIILjava/lang/String;I)V")
public void drawStringTooltip(@OriginalArg(0) int seed, @OriginalArg(1) boolean shadowed, @OriginalArg(3) int y, @OriginalArg(4) int arg4, @OriginalArg(5) String str, @OriginalArg(6) int x) {
public void drawStringTooltip(@OriginalArg(0) int seed, @OriginalArg(1) boolean shadowed, @OriginalArg(3) int y, @OriginalArg(4) int color, @OriginalArg(5) String str, @OriginalArg(6) int x) {
if (str != null) {
this.random.setSeed(seed);

@Pc(17) int rand = (this.random.nextInt() & 0x1F) + 192;
@Pc(22) int offY = y - this.height;
for (@Pc(30) int i = 0; i < str.length(); i++) {
if (str.charAt(i) == '@' && i + 4 < str.length() && str.charAt(i + 4) == '@') {
arg4 = this.evaluateTag(str.substring(i + 1, i + 4));
color = this.evaluateTag(str.substring(i + 1, i + 4));
i += 4;
} else {
@Pc(71) int c = CHAR_LOOKUP[str.charAt(i)];
Expand All @@ -227,7 +227,7 @@ public void drawStringTooltip(@OriginalArg(0) int seed, @OriginalArg(1) boolean
this.drawCharAlpha(this.charMask[c], x + this.charOffsetX[c] + 1, this.charMaskHeight[c], 0, offY + this.charOffsetY[c] + 1, 192, this.charMaskWidth[c]);
}

this.drawCharAlpha(this.charMask[c], x + this.charOffsetX[c], this.charMaskHeight[c], arg4, offY + this.charOffsetY[c], rand, this.charMaskWidth[c]);
this.drawCharAlpha(this.charMask[c], x + this.charOffsetX[c], this.charMaskHeight[c], color, offY + this.charOffsetY[c], rand, this.charMaskWidth[c]);
}

x += this.charAdvance[c];
Expand Down
10 changes: 5 additions & 5 deletions client/src/main/java/jagex2/graphics/SeqFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public class SeqFrame {
public int[] z;

@OriginalMember(owner = "client!g", name = "a", descriptor = "(ZLclient!ub;)V")
public static void unpack(@OriginalArg(1) Jagfile arg1) {
@Pc(17) Packet head = new Packet(arg1.read("frame_head.dat", null));
@Pc(27) Packet tran1 = new Packet(arg1.read("frame_tran1.dat", null));
@Pc(37) Packet tran2 = new Packet(arg1.read("frame_tran2.dat", null));
@Pc(47) Packet del = new Packet(arg1.read("frame_del.dat", null));
public static void unpack(@OriginalArg(1) Jagfile models) {
@Pc(17) Packet head = new Packet(models.read("frame_head.dat", null));
@Pc(27) Packet tran1 = new Packet(models.read("frame_tran1.dat", null));
@Pc(37) Packet tran2 = new Packet(models.read("frame_tran2.dat", null));
@Pc(47) Packet del = new Packet(models.read("frame_del.dat", null));

@Pc(50) int total = head.g2();
@Pc(53) int count = head.g2();
Expand Down
10 changes: 5 additions & 5 deletions client/src/main/java/jagex2/io/BZip2.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ private static void finish(@OriginalArg(0) BZip2State s) {
}
}

@Pc(64) boolean local64 = true;
@Pc(64) boolean next = true;
@Pc(87) byte k1;
while (local64) {
local64 = false;
while (next) {
next = false;
if (c_nblock_used == s_save_nblockPP) {
c_state_out_len = 0;
break label67;
Expand All @@ -99,7 +99,7 @@ private static void finish(@OriginalArg(0) BZip2State s) {
cs_decompressed[cs_next_out] = c_state_out_ch;
cs_next_out++;
cs_avail_out--;
local64 = true;
next = true;
} else if (c_nblock_used == s_save_nblockPP) {
if (cs_avail_out == 0) {
c_state_out_len = 1;
Expand All @@ -109,7 +109,7 @@ private static void finish(@OriginalArg(0) BZip2State s) {
cs_decompressed[cs_next_out] = c_state_out_ch;
cs_next_out++;
cs_avail_out--;
local64 = true;
next = true;
}
}

Expand Down
1 change: 0 additions & 1 deletion client/src/main/java/jagex2/io/ClientStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public void write(@OriginalArg(0) byte[] src, @OriginalArg(1) int len, @Original
}

@OriginalMember(owner = "client!d", name = "run", descriptor = "()V")
@Override
public void run() {
while (this.writer) {
@Pc(38) int len;
Expand Down

0 comments on commit e603e3f

Please sign in to comment.