From b3794c0826c18588b53ca53c50ad92ac4458477a Mon Sep 17 00:00:00 2001 From: Pazaz Date: Fri, 22 Jul 2022 10:36:17 -0400 Subject: [PATCH] Renamed variables in ProjAnim and SeqType --- .../src/main/java/rt4/AttachLocRequest.java | 14 +- client/src/main/java/rt4/Camera.java | 14 +- client/src/main/java/rt4/Cs1ScriptRunner.java | 12 +- .../src/main/java/rt4/HintArrowManager.java | 8 +- client/src/main/java/rt4/InterfaceList.java | 16 +- client/src/main/java/rt4/Loc.java | 76 +++---- .../rt4/{Loc_Class139.java => LocEntity.java} | 7 +- client/src/main/java/rt4/LocType.java | 38 ++-- client/src/main/java/rt4/LoginManager.java | 12 +- client/src/main/java/rt4/MiniMap.java | 6 +- client/src/main/java/rt4/MiniMenu.java | 14 +- client/src/main/java/rt4/NpcList.java | 34 +-- client/src/main/java/rt4/NpcType.java | 8 +- client/src/main/java/rt4/PathFinder.java | 24 +-- client/src/main/java/rt4/PathingEntity.java | 12 +- client/src/main/java/rt4/Player.java | 12 +- .../src/main/java/rt4/PlayerAppearance.java | 22 +- client/src/main/java/rt4/ProjAnim.java | 168 +++++++-------- client/src/main/java/rt4/Protocol.java | 84 ++++---- client/src/main/java/rt4/SceneGraph.java | 80 +++---- client/src/main/java/rt4/ScriptRunner.java | 138 ++++++------ client/src/main/java/rt4/SeqType.java | 197 +++++++++--------- client/src/main/java/rt4/SeqTypeList.java | 5 + client/src/main/java/rt4/ShadowModelList.java | 8 +- client/src/main/java/rt4/SoundPlayer.java | 10 +- client/src/main/java/rt4/SpotAnim.java | 4 +- .../src/main/java/rt4/SpotAnimTypeList.java | 22 +- client/src/main/java/rt4/client.java | 12 +- 28 files changed, 536 insertions(+), 521 deletions(-) rename client/src/main/java/rt4/{Loc_Class139.java => LocEntity.java} (73%) diff --git a/client/src/main/java/rt4/AttachLocRequest.java b/client/src/main/java/rt4/AttachLocRequest.java index 0ad5e2b..df6f4a8 100644 --- a/client/src/main/java/rt4/AttachLocRequest.java +++ b/client/src/main/java/rt4/AttachLocRequest.java @@ -69,7 +69,7 @@ public final class AttachLocRequest extends Node { } if (entity != null) { @Pc(63) LocType type = LocTypeList.get(request.locId); - if (Player.level < 3) { + if (Player.plane < 3) { } @Pc(86) int width; @Pc(83) int length; @@ -84,33 +84,33 @@ public final class AttachLocRequest extends Node { @Pc(110) int centerX0 = (width >> 1) + request.x; @Pc(117) int centerZ0 = (length >> 1) + request.z; @Pc(126) int centerZ1 = (length + 1 >> 1) + request.z; - @Pc(130) int[][] tileHeights = SceneGraph.tileHeights[Player.level]; + @Pc(130) int[][] tileHeights = SceneGraph.tileHeights[Player.plane]; @Pc(157) int y = tileHeights[centerX1][centerZ1] + tileHeights[centerX0][centerZ1] + tileHeights[centerX0][centerZ0] + tileHeights[centerX1][centerZ0] >> 2; @Pc(159) Entity attachment = null; @Pc(164) int layer = Loc.LAYERS[request.shape]; if (layer == 0) { - @Pc(176) Wall wall = SceneGraph.getWall(Player.level, request.x, request.z); + @Pc(176) Wall wall = SceneGraph.getWall(Player.plane, request.x, request.z); if (wall != null) { attachment = wall.primary; } } else if (layer == 1) { - @Pc(231) WallDecor wallDecor = SceneGraph.getWallDecor(Player.level, request.x, request.z); + @Pc(231) WallDecor wallDecor = SceneGraph.getWallDecor(Player.plane, request.x, request.z); if (wallDecor != null) { attachment = wallDecor.primary; } } else if (layer == 2) { - @Pc(198) Scenery scenery = SceneGraph.getScenery(Player.level, request.x, request.z); + @Pc(198) Scenery scenery = SceneGraph.getScenery(Player.plane, request.x, request.z); if (scenery != null) { attachment = scenery.entity; } } else if (layer == 3) { - @Pc(216) GroundDecor groundDecor = SceneGraph.getGroundDecor(Player.level, request.x, request.z); + @Pc(216) GroundDecor groundDecor = SceneGraph.getGroundDecor(Player.plane, request.x, request.z); if (groundDecor != null) { attachment = groundDecor.entity; } } if (attachment != null) { - ChangeLocRequest.push(Player.level, request.z, 0, request.x, request.resetLoops + 1, -1, layer, 0, request.setLoops + 1); + ChangeLocRequest.push(Player.plane, request.z, 0, request.x, request.resetLoops + 1, -1, layer, 0, request.setLoops + 1); entity.attachmentResetAt = request.resetLoops + client.loop; entity.attachmentZFine = length * 64 + request.z * 128; entity.attachmentXFine = width * 64 + request.x * 128; diff --git a/client/src/main/java/rt4/Camera.java b/client/src/main/java/rt4/Camera.java index 6ff72f9..c4ba543 100644 --- a/client/src/main/java/rt4/Camera.java +++ b/client/src/main/java/rt4/Camera.java @@ -113,13 +113,13 @@ public class Camera { yawTarget = mod(yawTarget, 2047.0d); @Pc(33) int local33 = cameraX >> 7; @Pc(37) int local37 = cameraZ >> 7; - @Pc(43) int local43 = SceneGraph.getTileHeight(Player.level, cameraX, cameraZ); + @Pc(43) int local43 = SceneGraph.getTileHeight(Player.plane, cameraX, cameraZ); @Pc(45) int local45 = 0; @Pc(64) int local64; if (local33 > 3 && local37 > 3 && local33 < 100 && local37 < 100) { for (local64 = local33 - 4; local64 <= local33 + 4; local64++) { for (@Pc(73) int local73 = local37 - 4; local73 <= local37 + 4; local73++) { - @Pc(80) int local80 = Player.level; + @Pc(80) int local80 = Player.plane; if (local80 < 3 && (SceneGraph.renderFlags[1][local64][local73] & 0x2) == 2) { local80++; } @@ -148,11 +148,11 @@ public class Camera { public static void updateLockedCamera() { @Pc(9) int local9 = anInt4232 * 128 + 64; @Pc(15) int local15 = anInt5375 * 128 + 64; - @Pc(23) int local23 = SceneGraph.getTileHeight(Player.level, local15, local9) - anInt5203; + @Pc(23) int local23 = SceneGraph.getTileHeight(Player.plane, local15, local9) - anInt5203; if (anInt4612 >= 100) { renderX = anInt5375 * 128 + 64; renderZ = anInt4232 * 128 + 64; - anInt40 = SceneGraph.getTileHeight(Player.level, renderX, renderZ) - anInt5203; + anInt40 = SceneGraph.getTileHeight(Player.plane, renderX, renderZ) - anInt5203; } else { if (renderX < local15) { renderX += anInt5225 + anInt4612 * (local15 - renderX) / 1000; @@ -193,7 +193,7 @@ public class Camera { } local9 = anInt5765 * 128 + 64; local15 = anInt5449 * 128 + 64; - local23 = SceneGraph.getTileHeight(Player.level, local15, local9) - anInt1744; + local23 = SceneGraph.getTileHeight(Player.plane, local15, local9) - anInt1744; @Pc(236) int local236 = local23 - anInt40; @Pc(241) int local241 = local9 - renderZ; @Pc(246) int local246 = local15 - renderX; @@ -315,7 +315,7 @@ public class Camera { if (anInt5217 >= 100) { @Pc(30) int local30 = anInt5449 * 128 + 64; @Pc(36) int local36 = anInt5765 * 128 + 64; - @Pc(44) int local44 = SceneGraph.getTileHeight(Player.level, local30, local36) - anInt1744; + @Pc(44) int local44 = SceneGraph.getTileHeight(Player.plane, local30, local36) - anInt1744; @Pc(49) int local49 = local44 - anInt40; @Pc(54) int local54 = local30 - renderX; @Pc(59) int local59 = local36 - renderZ; @@ -342,7 +342,7 @@ public class Camera { if (arg0 && anInt4612 >= 100) { renderX = anInt5375 * 128 + 64; renderZ = anInt4232 * 128 + 64; - anInt40 = SceneGraph.getTileHeight(Player.level, renderX, renderZ) - anInt5203; + anInt40 = SceneGraph.getTileHeight(Player.plane, renderX, renderZ) - anInt5203; } cameraType = 2; } diff --git a/client/src/main/java/rt4/Cs1ScriptRunner.java b/client/src/main/java/rt4/Cs1ScriptRunner.java index c9d39b0..43169a3 100644 --- a/client/src/main/java/rt4/Cs1ScriptRunner.java +++ b/client/src/main/java/rt4/Cs1ScriptRunner.java @@ -661,9 +661,9 @@ public class Cs1ScriptRunner { @Pc(1611) int local1611; if (top > dragY + y && local1571.scrollY > 0) { - local1611 = Protocol.anInt4247 * (top - dragY - y) / 3; - if (local1611 > Protocol.anInt4247 * 10) { - local1611 = Protocol.anInt4247 * 10; + local1611 = Protocol.sceneDelta * (top - dragY - y) / 3; + if (local1611 > Protocol.sceneDelta * 10) { + local1611 = Protocol.sceneDelta * 10; } if (local1611 > local1571.scrollY) { @@ -676,9 +676,9 @@ public class Cs1ScriptRunner { } if (bottom < dragY + y + 32 && local1571.scrollY < local1571.scrollMaxV - local1571.height) { - local1611 = (y + dragY + 32 - bottom) * Protocol.anInt4247 / 3; - if (local1611 > Protocol.anInt4247 * 10) { - local1611 = Protocol.anInt4247 * 10; + local1611 = (y + dragY + 32 - bottom) * Protocol.sceneDelta / 3; + if (local1611 > Protocol.sceneDelta * 10) { + local1611 = Protocol.sceneDelta * 10; } if (local1571.scrollMaxV - local1571.scrollY - local1571.height < local1611) { diff --git a/client/src/main/java/rt4/HintArrowManager.java b/client/src/main/java/rt4/HintArrowManager.java index aaddd18..aff04ad 100644 --- a/client/src/main/java/rt4/HintArrowManager.java +++ b/client/src/main/java/rt4/HintArrowManager.java @@ -46,18 +46,18 @@ public class HintArrowManager { @Pc(94) int local94; if (GlRenderer.enabled) { @Pc(68) GlModel local68 = (GlModel) model; - if (arg5 != SceneGraph.getTileHeight(Player.level, arg3 + minX, arg1 + minZ) || arg5 != SceneGraph.getTileHeight(Player.level, arg3 + maxX, maxZ + arg1)) { + if (arg5 != SceneGraph.getTileHeight(Player.plane, arg3 + minX, arg1 + minZ) || arg5 != SceneGraph.getTileHeight(Player.plane, arg3 + maxX, maxZ + arg1)) { for (local94 = 0; local94 < local68.vertexCount; local94++) { - local68.vertexY[local94] += SceneGraph.getTileHeight(Player.level, local68.vertexX[local94] + arg3, local68.vertexZ[local94] + arg1) - arg5; + local68.vertexY[local94] += SceneGraph.getTileHeight(Player.plane, local68.vertexX[local94] + arg3, local68.vertexZ[local94] + arg1) - arg5; } local68.vertexBuffer.valid = false; local68.bounds.valid = false; } } else { @Pc(142) SoftwareModel local142 = (SoftwareModel) model; - if (arg5 != SceneGraph.getTileHeight(Player.level, minX + arg3, minZ + arg1) || arg5 != SceneGraph.getTileHeight(Player.level, arg3 + maxX, maxZ + arg1)) { + if (arg5 != SceneGraph.getTileHeight(Player.plane, minX + arg3, minZ + arg1) || arg5 != SceneGraph.getTileHeight(Player.plane, arg3 + maxX, maxZ + arg1)) { for (local94 = 0; local94 < local142.vertexCount; local94++) { - local142.vertexY[local94] += SceneGraph.getTileHeight(Player.level, arg3 + local142.vertexX[local94], local142.vertexZ[local94] + arg1) - arg5; + local142.vertexY[local94] += SceneGraph.getTileHeight(Player.plane, arg3 + local142.vertexX[local94], local142.vertexZ[local94] + arg1) - arg5; } local142.boundsValid = false; } diff --git a/client/src/main/java/rt4/InterfaceList.java b/client/src/main/java/rt4/InterfaceList.java index 6e48981..0fc9f2a 100644 --- a/client/src/main/java/rt4/InterfaceList.java +++ b/client/src/main/java/rt4/InterfaceList.java @@ -1141,7 +1141,7 @@ public class InterfaceList { } else { SoftwareRaster.method2503(); } - Protocol.anInt4247 = 0; + Protocol.sceneDelta = 0; } @OriginalMember(owner = "client!client", name = "a", descriptor = "(Lclient!be;)Lclient!be;") @@ -1247,19 +1247,19 @@ public class InterfaceList { if (local105 != -1) { @Pc(118) SeqType local118 = SeqTypeList.get(local105); if (local118 != null) { - local15.anInt500 += Protocol.anInt4247; - while (local15.anInt500 > local118.anIntArray474[local15.anInt510]) { - local15.anInt500 -= local118.anIntArray474[local15.anInt510]; + local15.anInt500 += Protocol.sceneDelta; + while (local15.anInt500 > local118.frameDelay[local15.anInt510]) { + local15.anInt500 -= local118.frameDelay[local15.anInt510]; local15.anInt510++; if (local118.frames.length <= local15.anInt510) { - local15.anInt510 -= local118.anInt5362; + local15.anInt510 -= local118.replayoff; if (local15.anInt510 < 0 || local118.frames.length <= local15.anInt510) { local15.anInt510 = 0; } } local15.anInt496 = local15.anInt510 + 1; if (local118.frames.length <= local15.anInt496) { - local15.anInt496 -= local118.anInt5362; + local15.anInt496 -= local118.replayoff; if (local15.anInt496 < 0 || local118.frames.length <= local15.anInt496) { local15.anInt496 = -1; } @@ -1271,10 +1271,10 @@ public class InterfaceList { } if (local15.modelRotationSpeed != 0 && !local15.if3) { @Pc(239) int local239 = local15.modelRotationSpeed >> 16; - @Pc(243) int local243 = local239 * Protocol.anInt4247; + @Pc(243) int local243 = local239 * Protocol.sceneDelta; local105 = local15.modelRotationSpeed << 16 >> 16; local15.modelXAngle = local243 + local15.modelXAngle & 0x7FF; - local105 *= Protocol.anInt4247; + local105 *= Protocol.sceneDelta; local15.modelYAngle = local15.modelYAngle + local105 & 0x7FF; redraw(local15); } diff --git a/client/src/main/java/rt4/Loc.java b/client/src/main/java/rt4/Loc.java index 5294b02..c44bb34 100644 --- a/client/src/main/java/rt4/Loc.java +++ b/client/src/main/java/rt4/Loc.java @@ -12,10 +12,10 @@ public final class Loc extends Entity { public static final int[] LAYERS = new int[]{0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3}; @OriginalMember(owner = "client!ci", name = "q", descriptor = "Lclient!ek;") - public static SoftwareIndexedSprite aClass36_Sub1_1 = null; + public static SoftwareIndexedSprite sprite1 = null; @OriginalMember(owner = "client!dc", name = "U", descriptor = "Lclient!ga;") - private ParticleSystem aClass47_Sub1_2; + private ParticleSystem particles; @OriginalMember(owner = "client!dc", name = "x", descriptor = "I") private int anInt1296 = 0; @@ -30,7 +30,7 @@ public final class Loc extends Entity { private boolean aBoolean81 = true; @OriginalMember(owner = "client!dc", name = "Q", descriptor = "Lclient!ek;") - private SoftwareIndexedSprite aClass36_Sub1_2 = null; + private SoftwareIndexedSprite sprite2 = null; @OriginalMember(owner = "client!dc", name = "T", descriptor = "I") private final int anInt1311 = -32768; @@ -78,7 +78,7 @@ public final class Loc extends Entity { private int anInt1320; @OriginalMember(owner = "client!dc", name = "", descriptor = "(IIIIIIIZLclient!th;)V") - public Loc(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) boolean arg7, @OriginalArg(8) Entity arg8) { + public Loc(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int seqId, @OriginalArg(7) boolean arg7, @OriginalArg(8) Entity arg8) { this.anInt1303 = arg3; this.anInt1295 = arg2; this.anInt1308 = arg4; @@ -99,8 +99,8 @@ public final class Loc extends Entity { } } } - if (arg6 != -1) { - this.aClass144_2 = SeqTypeList.get(arg6); + if (seqId != -1) { + this.aClass144_2 = SeqTypeList.get(seqId); this.anInt1297 = 0; if (this.aClass144_2.frames.length <= 1) { this.anInt1304 = 0; @@ -109,7 +109,7 @@ public final class Loc extends Entity { } this.anInt1317 = 1; this.anInt1320 = client.loop - 1; - if (this.aClass144_2.anInt5347 == 0 && arg8 != null && arg8 instanceof Loc) { + if (this.aClass144_2.exactmove == 0 && arg8 != null && arg8 instanceof Loc) { @Pc(142) Loc local142 = (Loc) arg8; if (this.aClass144_2 == local142.aClass144_2) { this.anInt1297 = local142.anInt1297; @@ -119,16 +119,16 @@ public final class Loc extends Entity { return; } } - if (arg7 && this.aClass144_2.anInt5362 != -1) { + if (arg7 && this.aClass144_2.replayoff != -1) { this.anInt1297 = (int) (Math.random() * (double) this.aClass144_2.frames.length); this.anInt1304 = this.anInt1297 + 1; if (this.anInt1304 >= this.aClass144_2.frames.length) { - this.anInt1304 -= this.aClass144_2.anInt5362; + this.anInt1304 -= this.aClass144_2.replayoff; if (this.anInt1304 < 0 || this.anInt1304 >= this.aClass144_2.frames.length) { this.anInt1304 = -1; } } - this.anInt1317 = (int) (Math.random() * (double) this.aClass144_2.anIntArray474[this.anInt1297]) + 1; + this.anInt1317 = (int) (Math.random() * (double) this.aClass144_2.frameDelay[this.anInt1297]) + 1; this.anInt1320 = client.loop - this.anInt1317; } } @@ -187,8 +187,8 @@ public final class Loc extends Entity { if (arg7 < 3) { local158 = SceneGraph.tileHeights[arg7 + 1]; } - @Pc(215) Loc_Class139 local215 = arg0.method3428(arg2, local80, local120, arg4, local148, local158, false, null, true, local88); - ShadowManager.method4207(local215.aClass36_Sub1_3, local80 - arg3, local122, local88 - arg1); + @Pc(215) LocEntity local215 = arg0.method3428(arg2, local80, local120, arg4, local148, local158, false, null, true, local88); + ShadowManager.method4207(local215.sprite, local80 - arg3, local122, local88 - arg1); } @OriginalMember(owner = "client!dc", name = "a", descriptor = "(IIIII)V") @@ -206,18 +206,18 @@ public final class Loc extends Entity { public final void render(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(8) long arg8, @OriginalArg(9) int arg9, @OriginalArg(10) ParticleSystem arg10) { @Pc(3) Entity local3 = this.method1049(); if (local3 != null) { - local3.render(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, this.aClass47_Sub1_2); + local3.render(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, this.particles); } } @OriginalMember(owner = "client!dc", name = "c", descriptor = "(I)V") public final void method1046() { - if (this.aClass36_Sub1_2 != null) { - ShadowManager.method4207(this.aClass36_Sub1_2, this.anInt1296, this.anInt1294, this.anInt1319); + if (this.sprite2 != null) { + ShadowManager.method4207(this.sprite2, this.anInt1296, this.anInt1294, this.anInt1319); } this.anInt1321 = -1; this.anInt1322 = -1; - this.aClass36_Sub1_2 = null; + this.sprite2 = null; } @OriginalMember(owner = "client!dc", name = "finalize", descriptor = "()V") @@ -231,33 +231,33 @@ public final class Loc extends Entity { return; } @Pc(10) int local10 = client.loop - this.anInt1320; - if (local10 > 100 && this.aClass144_2.anInt5362 > 0) { - @Pc(29) int local29 = this.aClass144_2.frames.length - this.aClass144_2.anInt5362; - while (this.anInt1297 < local29 && this.aClass144_2.anIntArray474[this.anInt1297] < local10) { - local10 -= this.aClass144_2.anIntArray474[this.anInt1297]; + if (local10 > 100 && this.aClass144_2.replayoff > 0) { + @Pc(29) int local29 = this.aClass144_2.frames.length - this.aClass144_2.replayoff; + while (this.anInt1297 < local29 && this.aClass144_2.frameDelay[this.anInt1297] < local10) { + local10 -= this.aClass144_2.frameDelay[this.anInt1297]; this.anInt1297++; } if (this.anInt1297 >= local29) { @Pc(77) int local77 = 0; for (@Pc(79) int local79 = local29; local79 < this.aClass144_2.frames.length; local79++) { - local77 += this.aClass144_2.anIntArray474[local79]; + local77 += this.aClass144_2.frameDelay[local79]; } local10 %= local77; } this.anInt1304 = this.anInt1297 + 1; if (this.anInt1304 >= this.aClass144_2.frames.length) { - this.anInt1304 -= this.aClass144_2.anInt5362; + this.anInt1304 -= this.aClass144_2.replayoff; if (this.anInt1304 < 0 || this.aClass144_2.frames.length <= this.anInt1304) { this.anInt1304 = -1; } } } - while (local10 > this.aClass144_2.anIntArray474[this.anInt1297]) { + while (local10 > this.aClass144_2.frameDelay[this.anInt1297]) { SoundPlayer.playSeqSound(arg0, this.aClass144_2, arg1, false, this.anInt1297); - local10 -= this.aClass144_2.anIntArray474[this.anInt1297]; + local10 -= this.aClass144_2.frameDelay[this.anInt1297]; this.anInt1297++; if (this.aClass144_2.frames.length <= this.anInt1297) { - this.anInt1297 -= this.aClass144_2.anInt5362; + this.anInt1297 -= this.aClass144_2.replayoff; if (this.anInt1297 < 0 || this.aClass144_2.frames.length <= this.anInt1297) { this.aClass144_2 = null; break; @@ -265,7 +265,7 @@ public final class Loc extends Entity { } this.anInt1304 = this.anInt1297 + 1; if (this.aClass144_2.frames.length <= this.anInt1304) { - this.anInt1304 -= this.aClass144_2.anInt5362; + this.anInt1304 -= this.aClass144_2.replayoff; if (this.anInt1304 < 0 || this.anInt1304 >= this.aClass144_2.frames.length) { this.anInt1304 = -1; } @@ -301,9 +301,9 @@ public final class Loc extends Entity { this.aClass144_2 = SeqTypeList.get(local69); } if (this.aClass144_2 != null) { - if (local19.aBoolean209 && this.aClass144_2.anInt5362 != -1) { + if (local19.aBoolean209 && this.aClass144_2.replayoff != -1) { this.anInt1297 = (int) (Math.random() * (double) this.aClass144_2.frames.length); - this.anInt1320 -= (int) (Math.random() * (double) this.aClass144_2.anIntArray474[this.anInt1297]); + this.anInt1320 -= (int) (Math.random() * (double) this.aClass144_2.frameDelay[this.anInt1297]); } else { this.anInt1297 = 0; this.anInt1320 = client.loop - 1; @@ -340,37 +340,37 @@ public final class Loc extends Entity { local314 = SceneGraph.tileHeights[this.anInt1303 + 1]; } if (GlRenderer.enabled && local256) { - ShadowManager.method4207(this.aClass36_Sub1_2, this.anInt1296, this.anInt1294, this.anInt1319); + ShadowManager.method4207(this.sprite2, this.anInt1296, this.anInt1294, this.anInt1319); } - @Pc(356) boolean local356 = this.aClass36_Sub1_2 == null; - @Pc(389) Loc_Class139 local389; + @Pc(356) boolean local356 = this.sprite2 == null; + @Pc(389) LocEntity local389; if (this.aClass144_2 == null) { - local389 = local19.method3428(this.anInt1295, local302, local267, this.anInt1307, local293, local314, false, local356 ? aClass36_Sub1_1 : this.aClass36_Sub1_2, local256, local311); + local389 = local19.method3428(this.anInt1295, local302, local267, this.anInt1307, local293, local314, false, local356 ? sprite1 : this.sprite2, local256, local311); } else { - local389 = local19.method3429(local311, local302, local356 ? aClass36_Sub1_1 : this.aClass36_Sub1_2, local293, this.aClass144_2, this.anInt1295, local267, local256, this.anInt1297, local314, this.anInt1304, this.anInt1307, this.anInt1317); + local389 = local19.method3429(local311, local302, local356 ? sprite1 : this.sprite2, local293, this.aClass144_2, this.anInt1295, local267, local256, this.anInt1297, local314, this.anInt1304, this.anInt1307, this.anInt1317); } if (local389 == null) { return null; } if (GlRenderer.enabled && local256) { if (local356) { - aClass36_Sub1_1 = local389.aClass36_Sub1_3; + sprite1 = local389.sprite; } @Pc(429) int local429 = 0; if (this.anInt1303 != 0) { @Pc(439) int[][] local439 = SceneGraph.tileHeights[0]; local429 = local293 - (local439[local178][local192] + local439[local185][local192] + local439[local185][local201] + local439[local178][local201] >> 2); } - @Pc(471) SoftwareIndexedSprite local471 = local389.aClass36_Sub1_3; + @Pc(471) SoftwareIndexedSprite local471 = local389.sprite; if (this.aBoolean81 && ShadowManager.method4209(local471, local302, local429, local311)) { this.aBoolean81 = false; } if (!this.aBoolean81) { ShadowManager.method4211(local471, local302, local429, local311); - this.aClass36_Sub1_2 = local471; + this.sprite2 = local471; this.anInt1319 = local311; if (local356) { - aClass36_Sub1_1 = null; + sprite1 = null; } this.anInt1294 = local429; this.anInt1296 = local302; @@ -378,7 +378,7 @@ public final class Loc extends Entity { this.anInt1321 = local19.id; this.anInt1322 = this.anInt1297; } - return local389.aClass8_10; + return local389.model; } @OriginalMember(owner = "client!dc", name = "d", descriptor = "(I)Lclient!th;") diff --git a/client/src/main/java/rt4/Loc_Class139.java b/client/src/main/java/rt4/LocEntity.java similarity index 73% rename from client/src/main/java/rt4/Loc_Class139.java rename to client/src/main/java/rt4/LocEntity.java index 07bcc31..5d84ee3 100644 --- a/client/src/main/java/rt4/Loc_Class139.java +++ b/client/src/main/java/rt4/LocEntity.java @@ -4,11 +4,12 @@ import org.openrs2.deob.annotation.OriginalClass; import org.openrs2.deob.annotation.OriginalMember; @OriginalClass("client!sm") -public final class Loc_Class139 { +public final class LocEntity { @OriginalMember(owner = "client!sm", name = "a", descriptor = "Lclient!ek;") - public SoftwareIndexedSprite aClass36_Sub1_3; + public SoftwareIndexedSprite sprite; @OriginalMember(owner = "client!sm", name = "j", descriptor = "Lclient!th;") - public Entity aClass8_10; + public Entity model; + } diff --git a/client/src/main/java/rt4/LocType.java b/client/src/main/java/rt4/LocType.java index 07153ed..8fe6c29 100644 --- a/client/src/main/java/rt4/LocType.java +++ b/client/src/main/java/rt4/LocType.java @@ -41,7 +41,7 @@ public final class LocType { public static final RawModel[] tempModels = new RawModel[4]; @OriginalMember(owner = "client!ni", name = "n", descriptor = "Lclient!sm;") - public static Loc_Class139 aClass139_1 = new Loc_Class139(); + public static LocEntity aClass139_1 = new LocEntity(); @OriginalMember(owner = "client!pb", name = "a", descriptor = "[S") private short[] retex_d; @@ -764,7 +764,7 @@ public final class LocType { } @OriginalMember(owner = "client!pb", name = "a", descriptor = "(II[[III[[IZLclient!ek;BZI)Lclient!sm;") - public Loc_Class139 method3428(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int[][] arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int[][] arg5, @OriginalArg(6) boolean arg6, @OriginalArg(7) SoftwareIndexedSprite arg7, @OriginalArg(9) boolean arg8, @OriginalArg(10) int arg9) { + public LocEntity method3428(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int[][] arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int[][] arg5, @OriginalArg(6) boolean arg6, @OriginalArg(7) SoftwareIndexedSprite arg7, @OriginalArg(9) boolean arg8, @OriginalArg(10) int arg9) { @Pc(29) long local29; if (GlRenderer.enabled) { if (this.shapes == null) { @@ -772,14 +772,14 @@ public final class LocType { } else { local29 = arg0 + (this.id << 10) + (arg3 << 3); } - @Pc(225) Loc_Class139 local225 = (Loc_Class139) LocTypeList.aClass99_14.get(local29); + @Pc(225) LocEntity local225 = (LocEntity) LocTypeList.aClass99_14.get(local29); @Pc(235) GlModel local235; @Pc(265) SoftwareIndexedSprite local265; if (local225 == null) { local235 = this.getGlModel(arg0, false, arg3); if (local235 == null) { - aClass139_1.aClass8_10 = null; - aClass139_1.aClass36_Sub1_3 = null; + aClass139_1.model = null; + aClass139_1.sprite = null; return aClass139_1; } if (arg3 == 10 && arg0 > 3) { @@ -790,13 +790,13 @@ public final class LocType { } else { local265 = null; } - local225 = new Loc_Class139(); - local225.aClass8_10 = local235; - local225.aClass36_Sub1_3 = local265; + local225 = new LocEntity(); + local225.model = local235; + local225.sprite = local265; LocTypeList.aClass99_14.put(local225, local29); } else { - local235 = (GlModel) local225.aClass8_10; - local265 = local225.aClass36_Sub1_3; + local235 = (GlModel) local225.model; + local265 = local225.sprite; } @Pc(298) boolean local298 = this.computeVertexColors & arg6; @Pc(330) GlModel local330 = local235.method4117(this.hillskew != 3, this.hillskew == 0, true, true, true, !local298, true, true, true); @@ -804,9 +804,9 @@ public final class LocType { local330.method4110(this.hillskew, this.aShort26, local235, arg2, arg5, arg1, arg4, arg9); } local330.method4111(this.interactable == 0 && !this.aBoolean214, true, true, this.interactable == 0, true, false); - aClass139_1.aClass8_10 = local330; + aClass139_1.model = local330; local330.aBoolean259 = local298; - aClass139_1.aClass36_Sub1_3 = local265; + aClass139_1.sprite = local265; return aClass139_1; } if (this.shapes == null) { @@ -825,7 +825,7 @@ public final class LocType { if (local60 == null) { @Pc(69) RawModel local69 = this.getRawModel(arg0, arg3); if (local69 == null) { - aClass139_1.aClass8_10 = null; + aClass139_1.model = null; return aClass139_1; } local69.resetBones(); @@ -852,12 +852,12 @@ public final class LocType { local60 = ((RawModel) local60).method1670(this.hillskew, this.aShort26, arg2, arg5, arg1, arg4, arg9); } } - aClass139_1.aClass8_10 = local60; + aClass139_1.model = local60; return aClass139_1; } @OriginalMember(owner = "client!pb", name = "a", descriptor = "(IILclient!ek;ILclient!tk;I[[IZII[[IIII)Lclient!sm;") - public Loc_Class139 method3429(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) SoftwareIndexedSprite arg2, @OriginalArg(3) int arg3, @OriginalArg(4) SeqType arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int[][] arg6, @OriginalArg(7) boolean arg7, @OriginalArg(8) int arg8, @OriginalArg(10) int[][] arg9, @OriginalArg(11) int arg10, @OriginalArg(12) int arg11, @OriginalArg(13) int arg12) { + public LocEntity method3429(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) SoftwareIndexedSprite arg2, @OriginalArg(3) int arg3, @OriginalArg(4) SeqType arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int[][] arg6, @OriginalArg(7) boolean arg7, @OriginalArg(8) int arg8, @OriginalArg(10) int[][] arg9, @OriginalArg(11) int arg10, @OriginalArg(12) int arg11, @OriginalArg(13) int arg12) { @Pc(30) long local30; if (!GlRenderer.enabled) { if (this.shapes == null) { @@ -892,7 +892,7 @@ public final class LocType { } local195 = local195.method4586(this.hillskew, this.aShort26, arg6, arg9, arg1, arg3, arg0, false); } - aClass139_1.aClass8_10 = local195; + aClass139_1.model = local195; return aClass139_1; } if (this.shapes == null) { @@ -924,9 +924,9 @@ public final class LocType { local82.method4554(256); } if (arg7) { - aClass139_1.aClass36_Sub1_3 = local82.method4124(arg2); + aClass139_1.sprite = local82.method4124(arg2); } else { - aClass139_1.aClass36_Sub1_3 = null; + aClass139_1.sprite = null; } if (this.hillskew != 0) { if (!local80) { @@ -934,7 +934,7 @@ public final class LocType { } local82.method4110(this.hillskew, this.aShort26, local46, arg6, arg9, arg1, arg3, arg0); } - aClass139_1.aClass8_10 = local82; + aClass139_1.model = local82; return aClass139_1; } diff --git a/client/src/main/java/rt4/LoginManager.java b/client/src/main/java/rt4/LoginManager.java index 4cb158a..379c094 100644 --- a/client/src/main/java/rt4/LoginManager.java +++ b/client/src/main/java/rt4/LoginManager.java @@ -763,7 +763,7 @@ public class LoginManager { local265.zFine -= local81 * 128; } } - Player.level = arg0; + Player.plane = arg0; PlayerList.self.teleport(arg5, false, arg3); @Pc(322) byte local322 = 104; @Pc(324) byte local324 = 0; @@ -1053,10 +1053,10 @@ public class LoginManager { } ClientProt.ping(true); i = SceneGraph.firstVisibleLevel; - if (i > Player.level) { - i = Player.level; + if (i > Player.plane) { + i = Player.plane; } - if (i < Player.level - 1) { + if (i < Player.plane - 1) { } if (SceneGraph.allLevelsAreVisible()) { SceneGraph.method2750(0); @@ -1483,8 +1483,8 @@ public class LoginManager { } } } - AreaSoundManager.redraw(Protocol.anInt4247, PlayerList.self.xFine, PlayerList.self.zFine, Player.level); - Protocol.anInt4247 = 0; + AreaSoundManager.redraw(Protocol.sceneDelta, PlayerList.self.xFine, PlayerList.self.zFine, Player.plane); + Protocol.sceneDelta = 0; } @OriginalMember(owner = "client!tb", name = "h", descriptor = "(I)I") diff --git a/client/src/main/java/rt4/MiniMap.java b/client/src/main/java/rt4/MiniMap.java index a29ea60..08d2ba9 100644 --- a/client/src/main/java/rt4/MiniMap.java +++ b/client/src/main/java/rt4/MiniMap.java @@ -136,7 +136,7 @@ public class MiniMap { locs = 0; for (local37 = 0; local37 < 104; local37++) { for (local76 = 0; local76 < 104; local76++) { - @Pc(169) long local169 = SceneGraph.getGroundDecorKey(Player.level, local37 + 0, local76); + @Pc(169) long local169 = SceneGraph.getGroundDecorKey(Player.plane, local37 + 0, local76); if (local169 != 0L) { @Pc(184) LocType local184 = LocTypeList.get((int) (local169 >>> 32) & Integer.MAX_VALUE); @Pc(187) int local187 = local184.mapfunction; @@ -156,7 +156,7 @@ public class MiniMap { @Pc(237) int local237 = local76; local194 = local37; if (local187 != 22 && local187 != 29 && local187 != 34 && local187 != 36 && local187 != 46 && local187 != 47 && local187 != 48) { - @Pc(269) int[][] local269 = PathFinder.collisionMaps[Player.level].flags; + @Pc(269) int[][] local269 = PathFinder.collisionMaps[Player.plane].flags; for (@Pc(271) int local271 = 0; local271 < 10; local271++) { @Pc(281) int local281 = (int) (Math.random() * 4.0D); if (local281 == 0 && local194 > 0 && local37 - 3 < local194 && (local269[local194 - 1][local237] & 0x12C0108) == 0) { @@ -305,7 +305,7 @@ public class MiniMap { } for (local146 = 0; local146 < 104; local146++) { for (local181 = 0; local181 < 104; local181++) { - @Pc(439) LinkedList local439 = SceneGraph.objStacks[Player.level][local146][local181]; + @Pc(439) LinkedList local439 = SceneGraph.objStacks[Player.plane][local146][local181]; if (local439 != null) { local154 = local146 * 4 + 2 - PlayerList.self.xFine / 32; local231 = local181 * 4 + 2 - PlayerList.self.zFine / 32; diff --git a/client/src/main/java/rt4/MiniMenu.java b/client/src/main/java/rt4/MiniMenu.java index 2ad93b0..592be3e 100644 --- a/client/src/main/java/rt4/MiniMenu.java +++ b/client/src/main/java/rt4/MiniMenu.java @@ -524,10 +524,10 @@ public class MiniMenu { } if (local23 == 60) { if (local36 == 0) { - method3556(Player.level, local15, local19); + method3556(Player.plane, local15, local19); } else if (local36 == 1) { if (LoginManager.staffModLevel > 0 && Keyboard.pressedKeys[Keyboard.KEY_CTRL] && Keyboard.pressedKeys[Keyboard.KEY_SHIFT]) { - Cheat.teleport(Camera.originX + local15, Camera.originZ + local19, Player.level); + Cheat.teleport(Camera.originX + local15, Camera.originZ + local19, Player.plane); } else if (PathFinder.findPath(PlayerList.self.movementQueueZ[0], 0, 0, true, 0, local15, 0, 0, 1, local19, PlayerList.self.movementQueueX[0])) { Protocol.outboundBuffer.p1(InterfaceList.anInt5); Protocol.outboundBuffer.p1(anInt2878); @@ -835,7 +835,7 @@ public class MiniMenu { if (local23 == 11) { if (local36 == 0) { anInt3096 = 1; - method3556(Player.level, local15, local19); + method3556(Player.plane, local15, local19); } else if (local36 == 1) { Protocol.outboundBuffer.p1isaac(131); Protocol.outboundBuffer.mp4(anInt2512); @@ -1003,9 +1003,9 @@ public class MiniMenu { if (local23 == 36) { if (local36 == 0) { Protocol.anInt4422 = 1; - method3556(Player.level, local15, local19); + method3556(Player.plane, local15, local19); } else if (LoginManager.staffModLevel > 0 && Keyboard.pressedKeys[Keyboard.KEY_CTRL] && Keyboard.pressedKeys[Keyboard.KEY_SHIFT]) { - Cheat.teleport(local15 + Camera.originX, Camera.originZ - -local19, Player.level); + Cheat.teleport(local15 + Camera.originX, Camera.originZ - -local19, Player.plane); } else { Protocol.outboundBuffer.p1isaac(179); Protocol.outboundBuffer.p2(local19 + Camera.originZ); @@ -1123,7 +1123,7 @@ public class MiniMenu { if (local121 != local112) { local112 = local121; @Pc(240) int local240; - if (local133 == 2 && SceneGraph.isLocValid(Player.level, x, z, local121)) { + if (local133 == 2 && SceneGraph.isLocValid(Player.plane, x, z, local121)) { @Pc(172) LocType local172 = LocTypeList.get(local140); if (local172.multiLocs != null) { local172 = local172.getMultiLoc(); @@ -1231,7 +1231,7 @@ public class MiniMenu { addPlayerEntries(local140, z, player, x); } if (local133 == 3) { - @Pc(931) LinkedList objStacks = SceneGraph.objStacks[Player.level][x][z]; + @Pc(931) LinkedList objStacks = SceneGraph.objStacks[Player.plane][x][z]; if (objStacks != null) { for (@Pc(940) ObjStackNode node = (ObjStackNode) objStacks.tail(); node != null; node = (ObjStackNode) objStacks.prev()) { local240 = node.value.type; diff --git a/client/src/main/java/rt4/NpcList.java b/client/src/main/java/rt4/NpcList.java index 6df02d0..b769978 100644 --- a/client/src/main/java/rt4/NpcList.java +++ b/client/src/main/java/rt4/NpcList.java @@ -78,7 +78,7 @@ public class NpcList { @OriginalMember(owner = "client!wl", name = "a", descriptor = "(Lclient!fe;B)V") public static void method4665(@OriginalArg(0) PathingEntity arg0) { - if (client.loop == arg0.anInt3386 || arg0.seqId == -1 || arg0.anInt3420 != 0 || arg0.anInt3360 + 1 > SeqTypeList.get(arg0.seqId).anIntArray474[arg0.anInt3425]) { + if (client.loop == arg0.anInt3386 || arg0.seqId == -1 || arg0.anInt3420 != 0 || arg0.anInt3360 + 1 > SeqTypeList.get(arg0.seqId).frameDelay[arg0.anInt3425]) { @Pc(35) int local35 = arg0.anInt3386 - arg0.anInt3395; @Pc(41) int local41 = client.loop - arg0.anInt3395; @Pc(52) int local52 = arg0.anInt3380 * 128 + arg0.getSize() * 64; @@ -114,11 +114,11 @@ public class NpcList { } if (arg0.seqId != -1 && arg0.anInt3420 == 0) { @Pc(40) SeqType local40 = SeqTypeList.get(arg0.seqId); - if (arg0.anInt3405 > 0 && local40.anInt5363 == 0) { + if (arg0.anInt3405 > 0 && local40.looptype == 0) { arg0.anInt3417++; return; } - if (arg0.anInt3405 <= 0 && local40.anInt5349 == 0) { + if (arg0.anInt3405 <= 0 && local40.movetype == 0) { arg0.anInt3417++; return; } @@ -486,7 +486,7 @@ public class NpcList { entity.movementSeqId = -1; } else { entity.anInt3396++; - if (local18.frames.length > entity.anInt3407 && entity.anInt3396 > local18.anIntArray474[entity.anInt3407]) { + if (local18.frames.length > entity.anInt3407 && entity.anInt3396 > local18.frameDelay[entity.anInt3407]) { entity.anInt3396 = 1; entity.anInt3407++; entity.anInt3388++; @@ -518,7 +518,7 @@ public class NpcList { SoundPlayer.playSeqSound(entity.zFine, local165, entity.xFine, PlayerList.self == entity, 0); } entity.anInt3361++; - if (entity.anInt3399 < local165.frames.length && local165.anIntArray474[entity.anInt3399] < entity.anInt3361) { + if (entity.anInt3399 < local165.frames.length && local165.frameDelay[entity.anInt3399] < entity.anInt3361) { entity.anInt3399++; entity.anInt3361 = 1; SoundPlayer.playSeqSound(entity.zFine, local165, entity.xFine, PlayerList.self == entity, entity.anInt3399); @@ -535,7 +535,7 @@ public class NpcList { } if (entity.seqId != -1 && entity.anInt3420 <= 1) { local18 = SeqTypeList.get(entity.seqId); - if (local18.anInt5363 == 1 && entity.anInt3405 > 0 && client.loop >= entity.anInt3395 && client.loop > entity.anInt3386) { + if (local18.looptype == 1 && entity.anInt3405 > 0 && client.loop >= entity.anInt3395 && client.loop > entity.anInt3386) { entity.anInt3420 = 1; return; } @@ -546,15 +546,15 @@ public class NpcList { entity.seqId = -1; } else { entity.anInt3360++; - if (entity.anInt3425 < local18.frames.length && entity.anInt3360 > local18.anIntArray474[entity.anInt3425]) { + if (entity.anInt3425 < local18.frames.length && entity.anInt3360 > local18.frameDelay[entity.anInt3425]) { entity.anInt3360 = 1; entity.anInt3425++; SoundPlayer.playSeqSound(entity.zFine, local18, entity.xFine, entity == PlayerList.self, entity.anInt3425); } if (local18.frames.length <= entity.anInt3425) { - entity.anInt3425 -= local18.anInt5362; + entity.anInt3425 -= local18.replayoff; entity.anInt3371++; - if (entity.anInt3371 >= local18.anInt5357) { + if (entity.anInt3371 >= local18.replaycount) { entity.seqId = -1; } else if (entity.anInt3425 >= 0 && local18.frames.length > entity.anInt3425) { SoundPlayer.playSeqSound(entity.zFine, local18, entity.xFine, PlayerList.self == entity, entity.anInt3425); @@ -564,14 +564,14 @@ public class NpcList { } entity.anInt3373 = entity.anInt3425 + 1; if (entity.anInt3373 >= local18.frames.length) { - entity.anInt3373 -= local18.anInt5362; - if (local18.anInt5357 <= entity.anInt3371 + 1) { + entity.anInt3373 -= local18.replayoff; + if (local18.replaycount <= entity.anInt3371 + 1) { entity.anInt3373 = -1; } else if (entity.anInt3373 < 0 || entity.anInt3373 >= local18.frames.length) { entity.anInt3373 = -1; } } - entity.aBoolean171 = local18.aBoolean279; + entity.aBoolean171 = local18.stretches; } } if (entity.anInt3420 > 0) { @@ -589,15 +589,15 @@ public class NpcList { entity.aClass147Array3[local156] = null; } else { c147.anInt5404++; - if (c147.anInt5399 < local570.frames.length && c147.anInt5404 > local570.anIntArray474[c147.anInt5399]) { + if (c147.anInt5399 < local570.frames.length && c147.anInt5404 > local570.frameDelay[c147.anInt5399]) { c147.anInt5399++; c147.anInt5404 = 1; SoundPlayer.playSeqSound(entity.zFine, local570, entity.xFine, entity == PlayerList.self, c147.anInt5399); } if (local570.frames.length <= c147.anInt5399) { c147.anInt5400++; - c147.anInt5399 -= local570.anInt5362; - if (local570.anInt5357 <= c147.anInt5400) { + c147.anInt5399 -= local570.replayoff; + if (local570.replaycount <= c147.anInt5400) { entity.aClass147Array3[local156] = null; } else if (c147.anInt5399 >= 0 && c147.anInt5399 < local570.frames.length) { SoundPlayer.playSeqSound(entity.zFine, local570, entity.xFine, PlayerList.self == entity, c147.anInt5399); @@ -607,8 +607,8 @@ public class NpcList { } c147.anInt5398 = c147.anInt5399 + 1; if (local570.frames.length <= c147.anInt5398) { - c147.anInt5398 -= local570.anInt5362; - if (c147.anInt5400 + 1 >= local570.anInt5357) { + c147.anInt5398 -= local570.replayoff; + if (c147.anInt5400 + 1 >= local570.replaycount) { c147.anInt5398 = -1; } else if (c147.anInt5398 < 0 || local570.frames.length <= c147.anInt5398) { c147.anInt5398 = -1; diff --git a/client/src/main/java/rt4/NpcType.java b/client/src/main/java/rt4/NpcType.java index ae57990..e68cf95 100644 --- a/client/src/main/java/rt4/NpcType.java +++ b/client/src/main/java/rt4/NpcType.java @@ -377,7 +377,7 @@ public final class NpcType { local725 |= local753.aBoolean278; } if ((local753.tween || SeqType.applyTweening) && local207 != -1 && local753.frames.length > local207) { - anIntArray147[local235] = local753.anIntArray474[local200]; + anIntArray147[local235] = local753.frameDelay[local200]; anIntArray492[local235] = seqs[local235].anInt5404; local228 = local753.frames[local207]; aClass3_Sub2_Sub7Array5[local235] = SeqTypeList.getAnimFrameset(local228 >>> 16); @@ -420,7 +420,7 @@ public final class NpcType { local725 |= seqType2.aBoolean278; } if ((seqType2.tween || SeqType.applyTweening) && arg3 != -1 && seqType2.frames.length > arg3) { - local200 = seqType2.anIntArray474[arg5]; + local200 = seqType2.frameDelay[arg5]; local221 = seqType2.frames[arg3]; local1040 = local221 >>> 16; local221 &= 0xFFFF; @@ -451,7 +451,7 @@ public final class NpcType { local725 |= seqType1.aBoolean278; } if ((seqType1.tween || SeqType.applyTweening) && arg1 != -1 && arg1 < seqType1.frames.length) { - local300 = seqType1.anIntArray474[arg2]; + local300 = seqType1.frameDelay[arg2]; local1040 = seqType1.frames[arg1]; local318 = local1040 >>> 16; local1040 &= 0xFFFF; @@ -475,7 +475,7 @@ public final class NpcType { local330 <<= 0x1; } if (local962 != null && local1088 != null) { - local1218.method4570(local962, local235, local964, local221, arg4 - 1, local200, local1088, local228, local1092, local1040, arg7 - 1, local300, seqType2.aBooleanArray123, seqType2.aBoolean278 | seqType1.aBoolean278); + local1218.method4570(local962, local235, local964, local221, arg4 - 1, local200, local1088, local228, local1092, local1040, arg7 - 1, local300, seqType2.framegroup, seqType2.aBoolean278 | seqType1.aBoolean278); } else if (local962 != null) { local1218.method4558(local962, local235, local964, local221, arg4 - 1, local200, seqType2.aBoolean278); } else if (local1088 != null) { diff --git a/client/src/main/java/rt4/PathFinder.java b/client/src/main/java/rt4/PathFinder.java index 3bb53b9..1099042 100644 --- a/client/src/main/java/rt4/PathFinder.java +++ b/client/src/main/java/rt4/PathFinder.java @@ -49,7 +49,7 @@ public class PathFinder { @Pc(61) int local61 = 0; @Pc(64) int queueWriterIndex = local53 + 1; queueZ[0] = arg3; - @Pc(71) int[][] flags = collisionMaps[Player.level].flags; + @Pc(71) int[][] flags = collisionMaps[Player.plane].flags; @Pc(193) int cost; while (local61 != queueWriterIndex) { x = queueX[local61]; @@ -60,16 +60,16 @@ public class PathFinder { break; } if (arg1 != 0) { - if ((arg1 < 5 || arg1 == 10) && collisionMaps[Player.level].isAtWall(arg4, x, z, arg8, arg1 - 1, 2, arg7)) { + if ((arg1 < 5 || arg1 == 10) && collisionMaps[Player.plane].isAtWall(arg4, x, z, arg8, arg1 - 1, 2, arg7)) { local59 = true; break; } - if (arg1 < 10 && collisionMaps[Player.level].isAtWallDecor(arg4, arg1 - 1, arg8, z, 2, arg7, x)) { + if (arg1 < 10 && collisionMaps[Player.plane].isAtWallDecor(arg4, arg1 - 1, arg8, z, 2, arg7, x)) { local59 = true; break; } } - if (arg0 != 0 && arg6 != 0 && collisionMaps[Player.level].isInsideOrOutsideRect(arg8, z, x, 2, arg0, arg2, arg4, arg6)) { + if (arg0 != 0 && arg6 != 0 && collisionMaps[Player.plane].isInsideOrOutsideRect(arg8, z, x, 2, arg0, arg2, arg4, arg6)) { local59 = true; break; } @@ -221,7 +221,7 @@ public class PathFinder { queueX[0] = arg2; @Pc(71) int local71 = local51 + 1; queueZ[0] = arg9; - @Pc(78) int[][] local78 = collisionMaps[Player.level].flags; + @Pc(78) int[][] local78 = collisionMaps[Player.plane].flags; @Pc(198) int local198; while (local71 != local64) { local10 = queueZ[local64]; @@ -232,16 +232,16 @@ public class PathFinder { break; } if (arg8 != 0) { - if ((arg8 < 5 || arg8 == 10) && collisionMaps[Player.level].isAtWall(arg3, local3, local10, arg0, arg8 - 1, 1, arg6)) { + if ((arg8 < 5 || arg8 == 10) && collisionMaps[Player.plane].isAtWall(arg3, local3, local10, arg0, arg8 - 1, 1, arg6)) { local53 = true; break; } - if (arg8 < 10 && collisionMaps[Player.level].isAtWallDecor(arg3, arg8 - 1, arg0, local10, 1, arg6, local3)) { + if (arg8 < 10 && collisionMaps[Player.plane].isAtWallDecor(arg3, arg8 - 1, arg0, local10, 1, arg6, local3)) { local53 = true; break; } } - if (arg10 != 0 && arg5 != 0 && collisionMaps[Player.level].isInsideOrOutsideRect(arg0, local10, local3, 1, arg10, arg1, arg3, arg5)) { + if (arg10 != 0 && arg5 != 0 && collisionMaps[Player.plane].isInsideOrOutsideRect(arg0, local10, local3, 1, arg10, arg1, arg3, arg5)) { local53 = true; break; } @@ -393,7 +393,7 @@ public class PathFinder { queueZ[0] = arg11; @Pc(69) int local69 = 0; @Pc(71) boolean local71 = false; - @Pc(76) int[][] local76 = collisionMaps[Player.level].flags; + @Pc(76) int[][] local76 = collisionMaps[Player.plane].flags; @Pc(201) int local201; @Pc(242) int local242; label397: @@ -406,16 +406,16 @@ public class PathFinder { break; } if (arg6 != 0) { - if ((arg6 < 5 || arg6 == 10) && collisionMaps[Player.level].isAtWall(arg0, local3, local10, arg5, arg6 - 1, arg4, arg3)) { + if ((arg6 < 5 || arg6 == 10) && collisionMaps[Player.plane].isAtWall(arg0, local3, local10, arg5, arg6 - 1, arg4, arg3)) { local71 = true; break; } - if (arg6 < 10 && collisionMaps[Player.level].isAtWallDecor(arg0, arg6 - 1, arg5, local10, arg4, arg3, local3)) { + if (arg6 < 10 && collisionMaps[Player.plane].isAtWallDecor(arg0, arg6 - 1, arg5, local10, arg4, arg3, local3)) { local71 = true; break; } } - if (arg1 != 0 && arg9 != 0 && collisionMaps[Player.level].isInsideOrOutsideRect(arg5, local10, local3, arg4, arg1, arg7, arg0, arg9)) { + if (arg1 != 0 && arg9 != 0 && collisionMaps[Player.plane].isInsideOrOutsideRect(arg5, local10, local3, arg4, arg1, arg7, arg0, arg9)) { local71 = true; break; } diff --git a/client/src/main/java/rt4/PathingEntity.java b/client/src/main/java/rt4/PathingEntity.java index a8b6da5..4d440c1 100644 --- a/client/src/main/java/rt4/PathingEntity.java +++ b/client/src/main/java/rt4/PathingEntity.java @@ -279,7 +279,7 @@ public abstract class PathingEntity extends Entity { @OriginalMember(owner = "client!fe", name = "a", descriptor = "(IIIIZ)V") public final void method2683(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) boolean arg3) { - if (this.seqId != -1 && SeqTypeList.get(this.seqId).anInt5349 == 1) { + if (this.seqId != -1 && SeqTypeList.get(this.seqId).movetype == 1) { this.seqId = -1; } if (!arg3) { @@ -320,7 +320,7 @@ public abstract class PathingEntity extends Entity { local10--; local15++; } - if (this.seqId != -1 && SeqTypeList.get(this.seqId).anInt5349 == 1) { + if (this.seqId != -1 && SeqTypeList.get(this.seqId).movetype == 1) { this.seqId = -1; } if (this.movementQueueSize < 9) { @@ -377,13 +377,13 @@ public abstract class PathingEntity extends Entity { @Pc(53) int local53 = -local27 / 2; @Pc(64) int local64 = local53 * local43 - local48 * local39 >> 16; @Pc(75) int local75 = local39 * local53 + local43 * local48 >> 16; - @Pc(87) int local87 = SceneGraph.getTileHeight(Player.level, local75 + this.xFine, this.zFine + local64); + @Pc(87) int local87 = SceneGraph.getTileHeight(Player.plane, local75 + this.xFine, this.zFine + local64); @Pc(91) int local91 = local24 / 2; @Pc(96) int local96 = -local27 / 2; @Pc(106) int local106 = local91 * local43 + local96 * local39 >> 16; @Pc(110) int local110 = local27 / 2; @Pc(121) int local121 = local96 * local43 - local91 * local39 >> 16; - @Pc(134) int local134 = SceneGraph.getTileHeight(Player.level, local106 + this.xFine, this.zFine - -local121); + @Pc(134) int local134 = SceneGraph.getTileHeight(Player.plane, local106 + this.xFine, this.zFine - -local121); @Pc(139) int local139 = -local24 / 2; @Pc(150) int local150 = local110 * local43 - local39 * local139 >> 16; @Pc(154) int local154 = local27 / 2; @@ -391,9 +391,9 @@ public abstract class PathingEntity extends Entity { @Pc(169) int local169 = local39 * local110 + local43 * local139 >> 16; @Pc(179) int local179 = local154 * local43 - local39 * local158 >> 16; @Pc(189) int local189 = local39 * local154 + local43 * local158 >> 16; - @Pc(201) int local201 = SceneGraph.getTileHeight(Player.level, this.xFine + local169, local150 + this.zFine); + @Pc(201) int local201 = SceneGraph.getTileHeight(Player.plane, this.xFine + local169, local150 + this.zFine); @Pc(212) int local212 = local134 > local87 ? local87 : local134; - @Pc(224) int local224 = SceneGraph.getTileHeight(Player.level, local189 + this.xFine, local179 + this.zFine); + @Pc(224) int local224 = SceneGraph.getTileHeight(Player.plane, local189 + this.xFine, local179 + this.zFine); @Pc(231) int local231 = local224 > local201 ? local201 : local224; @Pc(238) int local238 = local224 > local134 ? local134 : local224; @Pc(245) int local245 = local201 <= local87 ? local201 : local87; diff --git a/client/src/main/java/rt4/Player.java b/client/src/main/java/rt4/Player.java index 11a3409..f70d27e 100644 --- a/client/src/main/java/rt4/Player.java +++ b/client/src/main/java/rt4/Player.java @@ -21,7 +21,7 @@ public final class Player extends PathingEntity { @OriginalMember(owner = "client!ba", name = "w", descriptor = "I") public static int inTutorialIsland = 0; @OriginalMember(owner = "client!ee", name = "b", descriptor = "I") - public static int level; + public static int plane; @OriginalMember(owner = "client!bb", name = "E", descriptor = "I") public static int runEnergy = 0; @OriginalMember(owner = "client!ug", name = "o", descriptor = "I") @@ -90,7 +90,7 @@ public final class Player extends PathingEntity { public static void animate(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) Player arg2) { if (arg1 == arg2.seqId && arg1 != -1) { @Pc(89) SeqType local89 = SeqTypeList.get(arg1); - @Pc(92) int local92 = local89.anInt5347; + @Pc(92) int local92 = local89.exactmove; if (local92 == 1) { arg2.anInt3420 = arg0; arg2.anInt3360 = 0; @@ -102,7 +102,7 @@ public final class Player extends PathingEntity { if (local92 == 2) { arg2.anInt3371 = 0; } - } else if (arg1 == -1 || arg2.seqId == -1 || SeqTypeList.get(arg1).forcedPriority >= SeqTypeList.get(arg2.seqId).forcedPriority) { + } else if (arg1 == -1 || arg2.seqId == -1 || SeqTypeList.get(arg1).priority >= SeqTypeList.get(arg2.seqId).priority) { arg2.anInt3373 = 1; arg2.anInt3425 = 0; arg2.anInt3420 = arg0; @@ -129,7 +129,7 @@ public final class Player extends PathingEntity { arg2.aClass147Array3[local30] = null; } else { @Pc(68) SeqType local68 = SeqTypeList.get(local20); - @Pc(71) int local71 = local68.anInt5347; + @Pc(71) int local71 = local68.exactmove; @Pc(76) PathingEntity_Class147 local76 = arg2.aClass147Array3[local30]; if (local76 != null) { if (local20 == local76.anInt5396) { @@ -145,7 +145,7 @@ public final class Player extends PathingEntity { } else if (local71 == 2) { local76.anInt5400 = 0; } - } else if (local68.forcedPriority >= SeqTypeList.get(local76.anInt5396).forcedPriority) { + } else if (local68.priority >= SeqTypeList.get(local76.anInt5396).priority) { local76 = arg2.aClass147Array3[local30] = null; } } @@ -201,7 +201,7 @@ public final class Player extends PathingEntity { public static void method4359(@OriginalArg(0) Player arg0) { @Pc(12) AreaSound local12 = (AreaSound) AreaSoundManager.playerSounds.get(arg0.username.encode37()); if (local12 == null) { - AreaSoundManager.add(arg0.movementQueueZ[0], null, 0, null, arg0.movementQueueX[0], level, arg0); + AreaSoundManager.add(arg0.movementQueueZ[0], null, 0, null, arg0.movementQueueX[0], plane, arg0); } else { local12.update(); } diff --git a/client/src/main/java/rt4/PlayerAppearance.java b/client/src/main/java/rt4/PlayerAppearance.java index 401f8dd..92bacbd 100644 --- a/client/src/main/java/rt4/PlayerAppearance.java +++ b/client/src/main/java/rt4/PlayerAppearance.java @@ -250,26 +250,26 @@ public final class PlayerAppearance { } @Pc(38) int[] local38 = this.identikit; @Pc(41) long local41 = this.checksum; - if (arg3 != null && (arg3.anInt5353 >= 0 || arg3.anInt5348 >= 0)) { + if (arg3 != null && (arg3.mainhand >= 0 || arg3.offhand >= 0)) { local38 = new int[12]; for (@Pc(61) int local61 = 0; local61 < 12; local61++) { local38[local61] = this.identikit[local61]; } - if (arg3.anInt5353 >= 0) { - if (arg3.anInt5353 == 65535) { + if (arg3.mainhand >= 0) { + if (arg3.mainhand == 65535) { local41 ^= 0xFFFFFFFF00000000L; local38[5] = 0; } else { - local38[5] = arg3.anInt5353 | 0x40000000; + local38[5] = arg3.mainhand | 0x40000000; local41 ^= (long) local38[5] << 32; } } - if (arg3.anInt5348 >= 0) { - if (arg3.anInt5348 == 65535) { + if (arg3.offhand >= 0) { + if (arg3.offhand == 65535) { local38[3] = 0; local41 ^= 0xFFFFFFFFL; } else { - local38[3] = arg3.anInt5348 | 0x40000000; + local38[3] = arg3.offhand | 0x40000000; local41 ^= local38[3]; } } @@ -425,7 +425,7 @@ public final class PlayerAppearance { local838 |= local858.aBoolean278; } if ((local858.tween || SeqType.applyTweening) && local367 != -1 && local367 < local858.frames.length) { - anIntArray515[local353] = local858.anIntArray474[local374]; + anIntArray515[local353] = local858.frameDelay[local374]; anIntArray183[local353] = arg0[local353].anInt5404; local979 = local858.frames[local367]; aClass3_Sub2_Sub7Array7[local353] = SeqTypeList.getAnimFrameset(local979 >>> 16); @@ -466,7 +466,7 @@ public final class PlayerAppearance { local360 = arg3.frames[arg1]; local451 = local360 >>> 16; local360 &= 0xFFFF; - local374 = arg3.anIntArray474[arg7]; + local374 = arg3.frameDelay[arg7]; if (local979 == local451) { local1040 = local1042; } else { @@ -494,7 +494,7 @@ public final class PlayerAppearance { local838 |= arg2.aBoolean278; } if ((arg2.tween || SeqType.applyTweening) && arg5 != -1 && arg2.frames.length > arg5) { - local457 = arg2.anIntArray474[arg8]; + local457 = arg2.frameDelay[arg8]; local451 = arg2.frames[arg5]; local481 = local451 >>> 16; local451 &= 0xFFFF; @@ -520,7 +520,7 @@ public final class PlayerAppearance { local598 <<= 0x1; } if (local1042 != null && local1154 != null) { - local1284.method4570(local1042, local353, local1040, local360, arg6 - 1, local374, local1154, local979, local1156, local451, arg4 - 1, local457, arg3.aBooleanArray123, arg3.aBoolean278 | arg2.aBoolean278); + local1284.method4570(local1042, local353, local1040, local360, arg6 - 1, local374, local1154, local979, local1156, local451, arg4 - 1, local457, arg3.framegroup, arg3.aBoolean278 | arg2.aBoolean278); } else if (local1042 != null) { local1284.method4558(local1042, local353, local1040, local360, arg6 - 1, local374, arg3.aBoolean278); } else if (local1154 != null) { diff --git a/client/src/main/java/rt4/ProjAnim.java b/client/src/main/java/rt4/ProjAnim.java index 7812940..5a69147 100644 --- a/client/src/main/java/rt4/ProjAnim.java +++ b/client/src/main/java/rt4/ProjAnim.java @@ -9,108 +9,108 @@ import org.openrs2.deob.annotation.Pc; public final class ProjAnim extends Entity { @OriginalMember(owner = "client!ra", name = "u", descriptor = "D") - private double aDouble2; + private double velocityX; @OriginalMember(owner = "client!ra", name = "A", descriptor = "D") - public double aDouble3; + public double y; @OriginalMember(owner = "client!ra", name = "N", descriptor = "D") - private double aDouble4; + private double accelerationZ; @OriginalMember(owner = "client!ra", name = "Q", descriptor = "Lclient!ga;") private ParticleSystem particleSystem; @OriginalMember(owner = "client!ra", name = "U", descriptor = "D") - private double aDouble5; + private double velocityZ; @OriginalMember(owner = "client!ra", name = "X", descriptor = "D") - public double aDouble6; + public double z; @OriginalMember(owner = "client!ra", name = "ab", descriptor = "I") - private int anInt4818; + private int pitch; @OriginalMember(owner = "client!ra", name = "bb", descriptor = "D") - private double aDouble7; + private double velocityY; @OriginalMember(owner = "client!ra", name = "db", descriptor = "D") - public double aDouble8; + public double x; @OriginalMember(owner = "client!ra", name = "eb", descriptor = "D") - private double aDouble9; + private double velocity; @OriginalMember(owner = "client!ra", name = "hb", descriptor = "I") - public int anInt4821; + public int yaw; @OriginalMember(owner = "client!ra", name = "v", descriptor = "I") - private int anInt4796 = 0; + private int frameCycle = 0; @OriginalMember(owner = "client!ra", name = "I", descriptor = "Z") - private boolean aBoolean239 = false; + private boolean isMobile = false; @OriginalMember(owner = "client!ra", name = "x", descriptor = "I") private int anInt4798 = -1; @OriginalMember(owner = "client!ra", name = "fb", descriptor = "I") - private int anInt4820 = 0; + private int seqFrame = 0; @OriginalMember(owner = "client!ra", name = "T", descriptor = "I") private int minY = -32768; @OriginalMember(owner = "client!ra", name = "z", descriptor = "I") - public final int anInt4800; + public final int lastCycle; @OriginalMember(owner = "client!ra", name = "E", descriptor = "I") - private final int anInt4804; + private final int sourceX; @OriginalMember(owner = "client!ra", name = "cb", descriptor = "I") - public final int anInt4819; + public final int targetIndex; @OriginalMember(owner = "client!ra", name = "Y", descriptor = "I") - private final int anInt4816; + private final int spotanimId; @OriginalMember(owner = "client!ra", name = "M", descriptor = "I") - public final int anInt4810; + public final int currentPlane; @OriginalMember(owner = "client!ra", name = "mb", descriptor = "I") - private final int anInt4825; + private final int elevationPitch; @OriginalMember(owner = "client!ra", name = "Z", descriptor = "I") - private final int anInt4817; + private final int sourceY; @OriginalMember(owner = "client!ra", name = "F", descriptor = "I") - public final int anInt4805; + public final int baseZ; @OriginalMember(owner = "client!ra", name = "w", descriptor = "I") - private final int anInt4797; + private final int arcScale; @OriginalMember(owner = "client!ra", name = "ib", descriptor = "I") - public final int anInt4822; + public final int firstCycle; @OriginalMember(owner = "client!ra", name = "S", descriptor = "I") - private final int anInt4813; + private final int sourceZ; @OriginalMember(owner = "client!ra", name = "gb", descriptor = "Lclient!tk;") - private final SeqType aClass144_3; + private final SeqType seq; @OriginalMember(owner = "client!ra", name = "", descriptor = "(IIIIIIIIIII)V") public ProjAnim(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(8) int arg8, @OriginalArg(9) int arg9, @OriginalArg(10) int arg10) { - this.anInt4800 = arg6; - this.anInt4804 = arg2; - this.anInt4819 = arg9; - this.anInt4816 = arg0; - this.anInt4810 = arg1; - this.anInt4825 = arg7; - this.anInt4817 = arg3; - this.aBoolean239 = false; - this.anInt4805 = arg10; - this.anInt4797 = arg8; - this.anInt4822 = arg5; - this.anInt4813 = arg4; - @Pc(58) int local58 = SpotAnimTypeList.get(this.anInt4816).seqId; - if (local58 == -1) { - this.aClass144_3 = null; + this.lastCycle = arg6; + this.sourceX = arg2; + this.targetIndex = arg9; + this.spotanimId = arg0; + this.currentPlane = arg1; + this.elevationPitch = arg7; + this.sourceY = arg3; + this.isMobile = false; + this.baseZ = arg10; + this.arcScale = arg8; + this.firstCycle = arg5; + this.sourceZ = arg4; + @Pc(58) int seqId = SpotAnimTypeList.get(this.spotanimId).seqId; + if (seqId == -1) { + this.seq = null; } else { - this.aClass144_3 = SeqTypeList.get(local58); + this.seq = SeqTypeList.get(seqId); } } @@ -121,51 +121,51 @@ public final class ProjAnim extends Entity { @OriginalMember(owner = "client!ra", name = "b", descriptor = "(I)Lclient!ak;") private Model method3703() { - @Pc(14) SpotAnimType local14 = SpotAnimTypeList.get(this.anInt4816); - @Pc(24) Model local24 = local14.constructModel(this.anInt4798, this.anInt4820, this.anInt4796); - if (local24 == null) { + @Pc(14) SpotAnimType seq = SpotAnimTypeList.get(this.spotanimId); + @Pc(24) Model model = seq.constructModel(this.anInt4798, this.seqFrame, this.frameCycle); + if (model == null) { return null; } else { - local24.rotateX(this.anInt4818); - return local24; + model.rotateX(this.pitch); + return model; } } @OriginalMember(owner = "client!ra", name = "b", descriptor = "(BI)V") - public final void method3704(@OriginalArg(1) int arg0) { - this.aDouble8 += this.aDouble2 * (double) arg0; - this.aDouble3 += this.aDouble7 * (double) arg0; - this.aBoolean239 = true; - if (this.anInt4825 == -1) { - this.aDouble6 += this.aDouble5 * (double) arg0; + public final void update(@OriginalArg(1) int arg0) { + this.x += this.velocityX * (double) arg0; + this.y += this.velocityY * (double) arg0; + this.isMobile = true; + if (this.elevationPitch == -1) { + this.z += this.velocityZ * (double) arg0; } else { - this.aDouble6 += (double) arg0 * this.aDouble4 * 0.5D * (double) arg0 + (double) arg0 * this.aDouble5; - this.aDouble5 += this.aDouble4 * (double) arg0; + this.z += (double) arg0 * this.accelerationZ * 0.5D * (double) arg0 + (double) arg0 * this.velocityZ; + this.velocityZ += this.accelerationZ * (double) arg0; } - this.anInt4821 = (int) (Math.atan2(this.aDouble2, this.aDouble7) * 325.949D) + 1024 & 0x7FF; - this.anInt4818 = (int) (Math.atan2(this.aDouble5, this.aDouble9) * 325.949D) & 0x7FF; - if (this.aClass144_3 == null) { + this.yaw = (int) (Math.atan2(this.velocityX, this.velocityY) * 325.949D) + 1024 & 0x7FF; + this.pitch = (int) (Math.atan2(this.velocityZ, this.velocity) * 325.949D) & 0x7FF; + if (this.seq == null) { return; } - this.anInt4796 += arg0; + this.frameCycle += arg0; while (true) { do { do { - if (this.anInt4796 <= this.aClass144_3.anIntArray474[this.anInt4820]) { + if (this.frameCycle <= this.seq.frameDelay[this.seqFrame]) { return; } - this.anInt4796 -= this.aClass144_3.anIntArray474[this.anInt4820]; - this.anInt4820++; - if (this.anInt4820 >= this.aClass144_3.frames.length) { - this.anInt4820 -= this.aClass144_3.anInt5362; - if (this.anInt4820 < 0 || this.aClass144_3.frames.length <= this.anInt4820) { - this.anInt4820 = 0; + this.frameCycle -= this.seq.frameDelay[this.seqFrame]; + this.seqFrame++; + if (this.seqFrame >= this.seq.frames.length) { + this.seqFrame -= this.seq.replayoff; + if (this.seqFrame < 0 || this.seq.frames.length <= this.seqFrame) { + this.seqFrame = 0; } } - this.anInt4798 = this.anInt4820 + 1; - } while (this.aClass144_3.frames.length > this.anInt4798); - this.anInt4798 -= this.aClass144_3.anInt5362; - } while (this.anInt4798 >= 0 && this.anInt4798 < this.aClass144_3.frames.length); + this.anInt4798 = this.seqFrame + 1; + } while (this.seq.frames.length > this.anInt4798); + this.anInt4798 -= this.seq.replayoff; + } while (this.anInt4798 >= 0 && this.anInt4798 < this.seq.frames.length); this.anInt4798 = -1; } } @@ -173,25 +173,25 @@ public final class ProjAnim extends Entity { @OriginalMember(owner = "client!ra", name = "b", descriptor = "(IIIII)V") public final void setTarget(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3) { @Pc(17) double local17; - if (!this.aBoolean239) { - @Pc(10) double local10 = arg0 - this.anInt4817; - local17 = arg3 - this.anInt4804; + if (!this.isMobile) { + @Pc(10) double local10 = arg0 - this.sourceY; + local17 = arg3 - this.sourceX; @Pc(26) double local26 = Math.sqrt(local17 * local17 + local10 * local10); - this.aDouble6 = this.anInt4813; - this.aDouble3 = local10 * (double) this.anInt4797 / local26 + (double) this.anInt4817; - this.aDouble8 = (double) this.anInt4797 * local17 / local26 + (double) this.anInt4804; + this.z = this.sourceZ; + this.y = local10 * (double) this.arcScale / local26 + (double) this.sourceY; + this.x = (double) this.arcScale * local17 / local26 + (double) this.sourceX; } - local17 = this.anInt4800 + 1 - arg1; - this.aDouble7 = ((double) arg0 - this.aDouble3) / local17; - this.aDouble2 = ((double) arg3 - this.aDouble8) / local17; - this.aDouble9 = Math.sqrt(this.aDouble7 * this.aDouble7 + this.aDouble2 * this.aDouble2); - if (this.anInt4825 == -1) { - this.aDouble5 = ((double) arg2 - this.aDouble6) / local17; + local17 = this.lastCycle + 1 - arg1; + this.velocityY = ((double) arg0 - this.y) / local17; + this.velocityX = ((double) arg3 - this.x) / local17; + this.velocity = Math.sqrt(this.velocityY * this.velocityY + this.velocityX * this.velocityX); + if (this.elevationPitch == -1) { + this.velocityZ = ((double) arg2 - this.z) / local17; } else { - if (!this.aBoolean239) { - this.aDouble5 = -this.aDouble9 * Math.tan((double) this.anInt4825 * 0.02454369D); + if (!this.isMobile) { + this.velocityZ = -this.velocity * Math.tan((double) this.elevationPitch * 0.02454369D); } - this.aDouble4 = ((double) arg2 - this.aDouble6 - this.aDouble5 * local17) * 2.0D / (local17 * local17); + this.accelerationZ = ((double) arg2 - this.z - this.velocityZ * local17) * 2.0D / (local17 * local17); } } diff --git a/client/src/main/java/rt4/Protocol.java b/client/src/main/java/rt4/Protocol.java index 74a6d4d..6acd14d 100644 --- a/client/src/main/java/rt4/Protocol.java +++ b/client/src/main/java/rt4/Protocol.java @@ -105,7 +105,7 @@ public class Protocol { @OriginalMember(owner = "client!t", name = "l", descriptor = "Lclient!ma;") public static BufferedSocket aClass95_4; @OriginalMember(owner = "client!od", name = "i", descriptor = "I") - public static int anInt4247 = 0; + public static int sceneDelta = 0; @OriginalMember(owner = "client!bf", name = "G", descriptor = "I") public static int anInt551 = 0; @OriginalMember(owner = "client!pb", name = "ab", descriptor = "I") @@ -132,7 +132,7 @@ public class Protocol { int local39 = (local31 >> 4 & 0x7) + SceneGraph.currentChunkX; int local45 = (local31 & 0x7) + SceneGraph.currentChunkZ; if (local39 >= 0 && local45 >= 0 && local39 < 104 && local45 < 104) { - ChangeLocRequest.push(Player.level, local45, local19, local39, -1, -1, local27, local23, 0); + ChangeLocRequest.push(Player.plane, local45, local19, local39, -1, -1, local27, local23, 0); } } else if (opcode == ServerProt.OBJ_REVEAL) { int local15 = inboundBuffer.ig2(); @@ -144,10 +144,10 @@ public class Protocol { @Pc(122) ObjStack local122 = new ObjStack(); local122.amount = local31; local122.type = local15; - if (SceneGraph.objStacks[Player.level][local19][local27] == null) { - SceneGraph.objStacks[Player.level][local19][local27] = new LinkedList(); + if (SceneGraph.objStacks[Player.plane][local19][local27] == null) { + SceneGraph.objStacks[Player.plane][local19][local27] = new LinkedList(); } - SceneGraph.objStacks[Player.level][local19][local27].addTail(new ObjStackNode(local122)); + SceneGraph.objStacks[Player.plane][local19][local27].addTail(new ObjStackNode(local122)); spawnGroundObject(local27, local19); } } else if (opcode == ServerProt.MAP_PROJANIM_3) { @@ -172,8 +172,8 @@ public class Protocol { local27 = local27 * 64; local19 = local19 * 64; local23 = local23 * 64; - ProjAnim local317 = new ProjAnim(local45, Player.level, local23, local19, SceneGraph.getTileHeight(Player.level, local23, local19) - local218, client.loop + local228, local232 + client.loop, local236, local247, local39, local224); - local317.setTarget(local31, client.loop + local228, -local224 + SceneGraph.getTileHeight(Player.level, local27, local31), local27); + ProjAnim local317 = new ProjAnim(local45, Player.plane, local23, local19, SceneGraph.getTileHeight(Player.plane, local23, local19) - local218, client.loop + local228, local232 + client.loop, local236, local247, local39, local224); + local317.setTarget(local31, client.loop + local228, -local224 + SceneGraph.getTileHeight(Player.plane, local27, local31), local27); SceneGraph.projectiles.addTail(new ProjAnimNode(local317)); } } else if (opcode == ServerProt.SPOTANIM_SPECIFIC) { @@ -186,7 +186,7 @@ public class Protocol { if (local23 >= 0 && local19 >= 0 && local23 < 104 && local19 < 104) { local23 = local23 * 128 + 64; local19 = local19 * 128 + 64; - @Pc(427) SpotAnim local427 = new SpotAnim(local27, Player.level, local23, local19, SceneGraph.getTileHeight(Player.level, local23, local19) - local31, local39, client.loop); + @Pc(427) SpotAnim local427 = new SpotAnim(local27, Player.plane, local23, local19, SceneGraph.getTileHeight(Player.plane, local23, local19) - local31, local39, client.loop); SceneGraph.spotanims.addTail(new SpotAnimNode(local427)); } } else if (opcode == ServerProt.LOC_ADD) { @@ -199,7 +199,7 @@ public class Protocol { int local45 = (local31 & 0x7) + SceneGraph.currentChunkZ; int local218 = inboundBuffer.g2add(); if (local39 >= 0 && local45 >= 0 && local39 < 104 && local45 < 104) { - ChangeLocRequest.push(Player.level, local45, local19, local39, -1, local218, local27, local23, 0); + ChangeLocRequest.push(Player.plane, local45, local19, local39, -1, local218, local27, local23, 0); } } else if (opcode == ServerProt.LOC_ANIM) { int local15 = inboundBuffer.g1sub(); @@ -213,7 +213,7 @@ public class Protocol { if (local218 == 65535) { local218 = -1; } - SceneGraph.method1881(Player.level, local39, local31, local19, local45, local23, local218); + SceneGraph.method1881(Player.plane, local39, local31, local19, local45, local23, local218); } else if (opcode == ServerProt.LOC_ADD_CHANGE) { int local15 = inboundBuffer.g1(); int local23 = local15 >> 2; @@ -240,7 +240,7 @@ public class Protocol { int local31 = inboundBuffer.g2(); int local39 = inboundBuffer.g2(); if (local23 >= 0 && local19 >= 0 && local23 < 104 && local19 < 104) { - @Pc(710) LinkedList local710 = SceneGraph.objStacks[Player.level][local23][local19]; + @Pc(710) LinkedList local710 = SceneGraph.objStacks[Player.plane][local23][local19]; if (local710 != null) { for (@Pc(718) ObjStackNode local718 = (ObjStackNode) local710.head(); local718 != null; local718 = (ObjStackNode) local710.next()) { @Pc(723) ObjStack local723 = local718.value; @@ -263,10 +263,10 @@ public class Protocol { @Pc(812) ObjStack local812 = new ObjStack(); local812.amount = local31; local812.type = local39; - if (SceneGraph.objStacks[Player.level][local19][local27] == null) { - SceneGraph.objStacks[Player.level][local19][local27] = new LinkedList(); + if (SceneGraph.objStacks[Player.plane][local19][local27] == null) { + SceneGraph.objStacks[Player.plane][local19][local27] = new LinkedList(); } - SceneGraph.objStacks[Player.level][local19][local27].addTail(new ObjStackNode(local812)); + SceneGraph.objStacks[Player.plane][local19][local27].addTail(new ObjStackNode(local812)); spawnGroundObject(local27, local19); } } else if (opcode == ServerProt.MAP_PROJANIM_2) { @@ -291,8 +291,8 @@ public class Protocol { local19 = local19 * 128 + 64; local23 = local23 * 128 + 64; local27 = local27 * 128 + 64; - ProjAnim local317 = new ProjAnim(local45, Player.level, local23, local19, SceneGraph.getTileHeight(Player.level, local23, local19) - local218, local228 + client.loop, local232 + client.loop, local236, local247, local39, local224); - local317.setTarget(local31, client.loop + local228, SceneGraph.getTileHeight(Player.level, local27, local31) - local224, local27); + ProjAnim local317 = new ProjAnim(local45, Player.plane, local23, local19, SceneGraph.getTileHeight(Player.plane, local23, local19) - local218, local228 + client.loop, local232 + client.loop, local236, local247, local39, local224); + local317.setTarget(local31, client.loop + local228, SceneGraph.getTileHeight(Player.plane, local27, local31) - local224, local27); SceneGraph.projectiles.addTail(new ProjAnimNode(local317)); } } else if (opcode == ServerProt.MAP_PROJANIM) { @@ -353,8 +353,8 @@ public class Protocol { } } } - @Pc(1331) ProjAnim local1331 = new ProjAnim(local218, Player.level, local23, local19, SceneGraph.getTileHeight(Player.level, local23, local19) - local224, local232 + client.loop, local236 + client.loop, local247, local633, local45, local228); - local1331.setTarget(local31, local232 + client.loop, -local228 + SceneGraph.getTileHeight(Player.level, local27, local31), local27); + @Pc(1331) ProjAnim local1331 = new ProjAnim(local218, Player.plane, local23, local19, SceneGraph.getTileHeight(Player.plane, local23, local19) - local224, local232 + client.loop, local236 + client.loop, local247, local633, local45, local228); + local1331.setTarget(local31, local232 + client.loop, -local228 + SceneGraph.getTileHeight(Player.plane, local27, local31), local27); SceneGraph.projectiles.addTail(new ProjAnimNode(local1331)); } } else if (opcode == ServerProt.SOUND_AREA) { @@ -386,7 +386,7 @@ public class Protocol { int local23 = (local15 >> 4 & 0x7) + SceneGraph.currentChunkX; int local27 = inboundBuffer.g2(); if (local23 >= 0 && local19 >= 0 && local23 < 104 && local19 < 104) { - @Pc(1565) LinkedList local1565 = SceneGraph.objStacks[Player.level][local23][local19]; + @Pc(1565) LinkedList local1565 = SceneGraph.objStacks[Player.plane][local23][local19]; if (local1565 != null) { for (@Pc(1572) ObjStackNode local1572 = (ObjStackNode) local1565.head(); local1572 != null; local1572 = (ObjStackNode) local1565.next()) { if (local1572.value.type == (local27 & 0x7FFF)) { @@ -395,7 +395,7 @@ public class Protocol { } } if (local1565.head() == null) { - SceneGraph.objStacks[Player.level][local23][local19] = null; + SceneGraph.objStacks[Player.plane][local23][local19] = null; } spawnGroundObject(local19, local23); } @@ -671,7 +671,7 @@ public class Protocol { int1 = -1; } int2 = inboundBuffer.mg4(); - @Pc(573) boolean local573 = int1 == -1 || player.spotAnimId == -1 || SeqTypeList.get(SpotAnimTypeList.get(int1).seqId).forcedPriority >= SeqTypeList.get(SpotAnimTypeList.get(player.spotAnimId).seqId).forcedPriority; + @Pc(573) boolean local573 = int1 == -1 || player.spotAnimId == -1 || SeqTypeList.get(SpotAnimTypeList.get(int1).seqId).priority >= SeqTypeList.get(SpotAnimTypeList.get(player.spotAnimId).seqId).priority; if (local573) { player.spotAnimStart = (int2 & 0xFFFF) + client.loop; player.anInt3361 = 0; @@ -765,7 +765,7 @@ public class Protocol { } else if (type == 3) { local54 = inboundBuffer.gBits(7); local64 = inboundBuffer.gBits(1); - Player.level = inboundBuffer.gBits(2); + Player.plane = inboundBuffer.gBits(2); @Pc(163) int local163 = inboundBuffer.gBits(1); if (local163 == 1) { extendedIds[extendedCount++] = 2047; @@ -1367,7 +1367,7 @@ public class Protocol { if (gfxId == 65535) { gfxId = -1; } - boolean animated = gfxId == -1 || npc.spotAnimId == -1 || SeqTypeList.get(SpotAnimTypeList.get(gfxId).seqId).forcedPriority >= SeqTypeList.get(SpotAnimTypeList.get(npc.spotAnimId).seqId).forcedPriority; + boolean animated = gfxId == -1 || npc.spotAnimId == -1 || SeqTypeList.get(SpotAnimTypeList.get(gfxId).seqId).priority >= SeqTypeList.get(SpotAnimTypeList.get(npc.spotAnimId).seqId).priority; if (animated) { npc.anInt3361 = 0; npc.spotAnimId = gfxId; @@ -1401,7 +1401,7 @@ public class Protocol { if (gfxId == 65535) { gfxId = -1; } - boolean animated = gfxId == -1 || player.spotAnimId == -1 || SeqTypeList.get(SpotAnimTypeList.get(gfxId).seqId).forcedPriority >= SeqTypeList.get(SpotAnimTypeList.get(player.spotAnimId).seqId).forcedPriority; + boolean animated = gfxId == -1 || player.spotAnimId == -1 || SeqTypeList.get(SpotAnimTypeList.get(gfxId).seqId).priority >= SeqTypeList.get(SpotAnimTypeList.get(player.spotAnimId).seqId).priority; if (animated) { player.spotAnimStart = delay + client.loop; player.spotAnimY = height; @@ -1509,14 +1509,14 @@ public class Protocol { SceneGraph.currentChunkZ = inboundBuffer.g1neg(); for (int x = SceneGraph.currentChunkX; x < SceneGraph.currentChunkX + 8; x++) { for (int z = SceneGraph.currentChunkZ; z < SceneGraph.currentChunkZ + 8; z++) { - if (SceneGraph.objStacks[Player.level][x][z] != null) { - SceneGraph.objStacks[Player.level][x][z] = null; + if (SceneGraph.objStacks[Player.plane][x][z] != null) { + SceneGraph.objStacks[Player.plane][x][z] = null; spawnGroundObject(z, x); } } } for (@Pc(2604) ChangeLocRequest loc = (ChangeLocRequest) ChangeLocRequest.queue.head(); loc != null; loc = (ChangeLocRequest) ChangeLocRequest.queue.next()) { - if (loc.x >= SceneGraph.currentChunkX && SceneGraph.currentChunkX + 8 > loc.x && loc.z >= SceneGraph.currentChunkZ && loc.z < SceneGraph.currentChunkZ + 8 && loc.level == Player.level) { + if (loc.x >= SceneGraph.currentChunkX && SceneGraph.currentChunkX + 8 > loc.x && loc.z >= SceneGraph.currentChunkZ && loc.z < SceneGraph.currentChunkZ + 8 && loc.level == Player.plane) { loc.resetLoops = 0; } } @@ -1551,7 +1551,7 @@ public class Protocol { int pos1 = inboundBuffer.g1sub(); int flags = inboundBuffer.g1add(); int pos2 = inboundBuffer.g1(); - Player.level = flags >> 1; + Player.plane = flags >> 1; PlayerList.self.teleport(pos1, (flags & 0x1) == 1, pos2); opcode = -1; return true; @@ -2693,7 +2693,7 @@ public class Protocol { Cross.type = 0; } } - anInt4247++; + sceneDelta++; if (MiniMenu.pressedInventoryComponent != null) { MiniMenu.anInt2043++; if (MiniMenu.anInt2043 >= 15) { @@ -2802,7 +2802,7 @@ public class Protocol { Cs1ScriptRunner.method28(); } if (LoginManager.staffModLevel > 0 && Keyboard.pressedKeys[Keyboard.KEY_CTRL] && Keyboard.pressedKeys[Keyboard.KEY_SHIFT] && MouseWheel.wheelRotation != 0) { - y = Player.level - MouseWheel.wheelRotation; + y = Player.plane - MouseWheel.wheelRotation; if (y < 0) { y = 0; } else if (y > 3) { @@ -2813,7 +2813,7 @@ public class Protocol { } if (LoginManager.staffModLevel > 0 && Keyboard.pressedKeys[Keyboard.KEY_CTRL] && Keyboard.pressedKeys[Keyboard.KEY_SHIFT]) { if (MiniMenu.anInt1742 != -1) { - Cheat.teleport(Camera.originX + MiniMenu.anInt1742, Camera.originZ - -MiniMenu.anInt2954, Player.level); + Cheat.teleport(Camera.originX + MiniMenu.anInt1742, Camera.originZ - -MiniMenu.anInt2954, Player.plane); } anInt4422 = 0; MiniMenu.anInt3096 = 0; @@ -3060,7 +3060,7 @@ public class Protocol { local43 = -1; } local47 = inboundBuffer.ig4(); - @Pc(147) boolean local147 = local43 == -1 || npc.spotAnimId == -1 || SeqTypeList.get(SpotAnimTypeList.get(local43).seqId).forcedPriority >= SeqTypeList.get(SpotAnimTypeList.get(npc.spotAnimId).seqId).forcedPriority; + @Pc(147) boolean local147 = local43 == -1 || npc.spotAnimId == -1 || SeqTypeList.get(SpotAnimTypeList.get(local43).seqId).priority >= SeqTypeList.get(SpotAnimTypeList.get(npc.spotAnimId).seqId).priority; if (local147) { npc.spotAnimId = local43; npc.spotAnimStart = (local47 & 0xFFFF) + client.loop; @@ -3092,7 +3092,7 @@ public class Protocol { npc.setSize(npc.type.size); npc.anInt3365 = npc.type.basId; if (npc.type.hasAreaSound()) { - AreaSoundManager.add(npc.movementQueueZ[0], null, 0, npc, npc.movementQueueX[0], Player.level, null); + AreaSoundManager.add(npc.movementQueueZ[0], null, 0, npc, npc.movementQueueX[0], Player.plane, null); } } @@ -3260,7 +3260,7 @@ public class Protocol { } npc.method2683(npc.getSize(), PlayerList.self.movementQueueX[0] + local124, local105 + PlayerList.self.movementQueueZ[0], local66 == 1); if (npc.type.hasAreaSound()) { - AreaSoundManager.add(npc.movementQueueZ[0], null, 0, npc, npc.movementQueueX[0], Player.level, null); + AreaSoundManager.add(npc.movementQueueZ[0], null, 0, npc, npc.movementQueueX[0], Player.plane, null); } continue; } @@ -3339,7 +3339,7 @@ public class Protocol { } else { @Pc(60) SeqType local60 = SeqTypeList.get(local15); @Pc(65) PathingEntity_Class147 local65 = arg1.aClass147Array3[local25]; - @Pc(68) int local68 = local60.anInt5347; + @Pc(68) int local68 = local60.exactmove; if (local65 != null) { if (local15 == local65.anInt5396) { if (local68 == 0) { @@ -3354,7 +3354,7 @@ public class Protocol { } else if (local68 == 2) { local65.anInt5400 = 0; } - } else if (local60.forcedPriority >= SeqTypeList.get(local65.anInt5396).forcedPriority) { + } else if (local60.priority >= SeqTypeList.get(local65.anInt5396).priority) { local65 = arg1.aClass147Array3[local25] = null; } } @@ -3379,7 +3379,7 @@ public class Protocol { public static void animateNpc(@OriginalArg(0) int arg0, @OriginalArg(1) int animationId, @OriginalArg(3) Npc npc) { if (npc.seqId == animationId && animationId != -1) { @Pc(10) SeqType seqType = SeqTypeList.get(animationId); - @Pc(13) int local13 = seqType.anInt5347; + @Pc(13) int local13 = seqType.exactmove; if (local13 == 1) { npc.anInt3373 = 1; npc.anInt3425 = 0; @@ -3391,7 +3391,7 @@ public class Protocol { if (local13 == 2) { npc.anInt3371 = 0; } - } else if (animationId == -1 || npc.seqId == -1 || SeqTypeList.get(animationId).forcedPriority >= SeqTypeList.get(npc.seqId).forcedPriority) { + } else if (animationId == -1 || npc.seqId == -1 || SeqTypeList.get(animationId).priority >= SeqTypeList.get(npc.seqId).priority) { npc.anInt3360 = 0; npc.seqId = animationId; npc.anInt3373 = 1; @@ -3427,9 +3427,9 @@ public class Protocol { @OriginalMember(owner = "client!rm", name = "a", descriptor = "(IBI)V") public static void spawnGroundObject(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1) { - @Pc(9) LinkedList local9 = SceneGraph.objStacks[Player.level][arg1][arg0]; + @Pc(9) LinkedList local9 = SceneGraph.objStacks[Player.plane][arg1][arg0]; if (local9 == null) { - SceneGraph.removeObjStack(Player.level, arg1, arg0); + SceneGraph.removeObjStack(Player.plane, arg1, arg0); return; } @Pc(28) int local28 = -99999999; @@ -3447,7 +3447,7 @@ public class Protocol { } } if (local30 == null) { - SceneGraph.removeObjStack(Player.level, arg1, arg0); + SceneGraph.removeObjStack(Player.plane, arg1, arg0); return; } local9.addHead(local30); @@ -3465,7 +3465,7 @@ public class Protocol { } } @Pc(152) long local152 = (arg0 << 7) + arg1 + 1610612736; - SceneGraph.setObjStack(Player.level, arg1, arg0, SceneGraph.getTileHeight(Player.level, arg1 * 128 + 64, arg0 * 128 + 64), local30.value, local152, local89, local91); + SceneGraph.setObjStack(Player.plane, arg1, arg0, SceneGraph.getTileHeight(Player.plane, arg1 * 128 + 64, arg0 * 128 + 64), local30.value, local152, local89, local91); } @OriginalMember(owner = "client!dh", name = "a", descriptor = "(IIII)Lclient!wk;") diff --git a/client/src/main/java/rt4/SceneGraph.java b/client/src/main/java/rt4/SceneGraph.java index 9ebe4e9..14262f8 100644 --- a/client/src/main/java/rt4/SceneGraph.java +++ b/client/src/main/java/rt4/SceneGraph.java @@ -1397,7 +1397,7 @@ public class SceneGraph { } @OriginalMember(owner = "client!dg", name = "a", descriptor = "(IIIIILclient!th;IJZ)Z") - public static boolean method1141(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) Entity arg5, @OriginalArg(6) int arg6, @OriginalArg(7) long arg7, @OriginalArg(8) boolean arg8) { + public static boolean add(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) Entity arg5, @OriginalArg(6) int arg6, @OriginalArg(7) long arg7, @OriginalArg(8) boolean arg8) { if (arg5 == null) { return true; } @@ -2473,20 +2473,20 @@ public class SceneGraph { @Pc(330) boolean local330 = loc.aBoolean212 & !highmem; bitset |= (long) locIndex << 32; @Pc(387) Entity entity; - @Pc(403) Loc_Class139 local403; + @Pc(403) LocEntity local403; @Pc(1226) int local1226; @Pc(1889) long local1889; @Pc(1934) Entity local1934; - @Pc(1950) Loc_Class139 local1950; + @Pc(1950) LocEntity local1950; if (locType == LocType.GROUNDDECOR) { if (Preferences.showGroundDecorations || loc.interactable != 0 || loc.blockwalk == 1 || loc.forcedecor) { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local403 = loc.method3428(orientation, local165, currentHeightmap, LocType.GROUNDDECOR, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local403.sprite, local165, diffAverageY, local173); } - entity = local403.aClass8_10; + entity = local403.model; } else { entity = new Loc(locIndex, LocType.GROUNDDECOR, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2501,9 +2501,9 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local403 = loc.method3428(locType == LocType.CENTREPIECE_DIAGONAL ? orientation + 4 : orientation, local165, currentHeightmap, LocType.CENTREPIECE_STRAIGHT, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local403.sprite, local165, diffAverageY, local173); } - entity = local403.aClass8_10; + entity = local403.model; } else { entity = new Loc(locIndex, LocType.CENTREPIECE_STRAIGHT, locType == LocType.CENTREPIECE_DIAGONAL ? orientation + 4 : orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2535,9 +2535,9 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local403 = loc.method3428(orientation, local165, currentHeightmap, locType, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local403.sprite, local165, diffAverageY, local173); } - entity = local403.aClass8_10; + entity = local403.model; } else { entity = new Loc(locIndex, locType, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2554,9 +2554,9 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local403 = loc.method3428(orientation, local165, currentHeightmap, LocType.WALL_STRAIGHT, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local403.sprite, local165, diffAverageY, local173); } - entity = local403.aClass8_10; + entity = local403.model; } else { entity = new Loc(locIndex, LocType.WALL_STRAIGHT, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2614,9 +2614,9 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local403 = loc.method3428(orientation, local165, currentHeightmap, LocType.WALL_DIAGONALCORNER, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local403.sprite, local165, diffAverageY, local173); } - entity = local403.aClass8_10; + entity = local403.model; } else { entity = new Loc(locIndex, LocType.WALL_DIAGONALCORNER, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2642,16 +2642,16 @@ public class SceneGraph { @Pc(1269) Entity local1269; @Pc(1254) Entity local1254; if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { - @Pc(1287) Loc_Class139 local1287 = loc.method3428(orientation + 4, local165, currentHeightmap, LocType.WALL_L, averageY, heightmap, lowmem, null, local330, local173); + @Pc(1287) LocEntity local1287 = loc.method3428(orientation + 4, local165, currentHeightmap, LocType.WALL_L, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local1287.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local1287.sprite, local165, diffAverageY, local173); } - local1254 = local1287.aClass8_10; + local1254 = local1287.model; local1287 = loc.method3428(local1226, local165, currentHeightmap, LocType.WALL_L, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local1287.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local1287.sprite, local165, diffAverageY, local173); } - local1269 = local1287.aClass8_10; + local1269 = local1287.model; } else { local1254 = new Loc(locIndex, LocType.WALL_L, orientation + 4, currentPlane, x, z, loc.anim, loc.aBoolean209, null); local1269 = new Loc(locIndex, LocType.WALL_L, local1226, currentPlane, x, z, loc.anim, loc.aBoolean209, null); @@ -2682,9 +2682,9 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local403 = loc.method3428(orientation, local165, currentHeightmap, LocType.WALL_SQUARECORNER, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local403.sprite, local165, diffAverageY, local173); } - entity = local403.aClass8_10; + entity = local403.model; } else { entity = new Loc(locIndex, LocType.WALL_SQUARECORNER, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2707,9 +2707,9 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local403 = loc.method3428(orientation, local165, currentHeightmap, locType, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local403.sprite, local165, diffAverageY, local173); } - entity = local403.aClass8_10; + entity = local403.model; } else { entity = new Loc(locIndex, locType, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2724,9 +2724,9 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local403 = loc.method3428(orientation, local165, currentHeightmap, 4, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local403.sprite, local165, diffAverageY, local173); } - entity = local403.aClass8_10; + entity = local403.model; } else { entity = new Loc(locIndex, 4, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2740,9 +2740,9 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local1950 = loc.method3428(orientation, local165, currentHeightmap, 4, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local1950.aClass36_Sub1_3, local165 - WALL_DECO_ROT_SIZE_X_DIR[orientation] * 8, diffAverageY, local173 - WALL_DECO_ROT_SIZE_Y_DIR[orientation] * 8); + ShadowManager.method4211(local1950.sprite, local165 - WALL_DECO_ROT_SIZE_X_DIR[orientation] * 8, diffAverageY, local173 - WALL_DECO_ROT_SIZE_Y_DIR[orientation] * 8); } - local1934 = local1950.aClass8_10; + local1934 = local1950.model; } else { local1934 = new Loc(locIndex, 4, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2756,9 +2756,9 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { local1950 = loc.method3428(orientation + 4, local165, currentHeightmap, 4, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local1950.aClass36_Sub1_3, local165 - anIntArray565[orientation] * 8, diffAverageY, local173 - anIntArray154[orientation] * 8); + ShadowManager.method4211(local1950.sprite, local165 - anIntArray565[orientation] * 8, diffAverageY, local173 - anIntArray154[orientation] * 8); } - local1934 = local1950.aClass8_10; + local1934 = local1950.model; } else { local1934 = new Loc(locIndex, 4, orientation + 4, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2766,11 +2766,11 @@ public class SceneGraph { } else if (locType == LocType.WALLDECOR_DIAGONAL_ZOFFSET) { @Pc(2137) int local2137 = orientation + 2 & 0x3; if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { - @Pc(2183) Loc_Class139 local2183 = loc.method3428(local2137 + 4, local165, currentHeightmap, 4, averageY, heightmap, lowmem, null, local330, local173); + @Pc(2183) LocEntity local2183 = loc.method3428(local2137 + 4, local165, currentHeightmap, 4, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local2183.aClass36_Sub1_3, local165, diffAverageY, local173); + ShadowManager.method4211(local2183.sprite, local165, diffAverageY, local173); } - entity = local2183.aClass8_10; + entity = local2183.model; } else { entity = new Loc(locIndex, 4, local2137 + 4, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } @@ -2786,16 +2786,16 @@ public class SceneGraph { if (loc.anim == -1 && loc.multiLocs == null && !loc.aBoolean214) { @Pc(2297) int local2297 = anIntArray154[orientation] * 8; @Pc(2303) int local2303 = anIntArray565[orientation] * 8; - @Pc(2319) Loc_Class139 local2319 = loc.method3428(orientation + 4, local165, currentHeightmap, 4, averageY, heightmap, lowmem, null, local330, local173); + @Pc(2319) LocEntity local2319 = loc.method3428(orientation + 4, local165, currentHeightmap, 4, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local2319.aClass36_Sub1_3, local165 - local2303, diffAverageY, local173 - local2297); + ShadowManager.method4211(local2319.sprite, local165 - local2303, diffAverageY, local173 - local2297); } - local1934 = local2319.aClass8_10; + local1934 = local2319.model; local2319 = loc.method3428(local2244 + 4, local165, currentHeightmap, 4, averageY, heightmap, lowmem, null, local330, local173); if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local2319.aClass36_Sub1_3, local165 - local2303, diffAverageY, local173 - local2297); + ShadowManager.method4211(local2319.sprite, local165 - local2303, diffAverageY, local173 - local2297); } - local2289 = local2319.aClass8_10; + local2289 = local2319.model; } else { local1934 = new Loc(locIndex, 4, orientation + 4, currentPlane, x, z, loc.anim, loc.aBoolean209, null); local2289 = new Loc(locIndex, 4, local2244 + 4, currentPlane, x, z, loc.anim, loc.aBoolean209, null); @@ -2806,10 +2806,10 @@ public class SceneGraph { @OriginalMember(owner = "client!ch", name = "c", descriptor = "(I)V") public static void method846() { - if (!allLevelsAreVisible() && centralPlane != Player.level) { - LoginManager.method2463(Player.level, centralZoneZ, centralZoneX, PlayerList.self.movementQueueZ[0], false, PlayerList.self.movementQueueX[0]); - } else if (Player.level != LightingManager.anInt2875 && MiniMap.renderMap(Player.level)) { - LightingManager.anInt2875 = Player.level; + if (!allLevelsAreVisible() && centralPlane != Player.plane) { + LoginManager.method2463(Player.plane, centralZoneZ, centralZoneX, PlayerList.self.movementQueueZ[0], false, PlayerList.self.movementQueueX[0]); + } else if (Player.plane != LightingManager.anInt2875 && MiniMap.renderMap(Player.plane)) { + LightingManager.anInt2875 = Player.plane; ScriptRunner.method2218(); } } diff --git a/client/src/main/java/rt4/ScriptRunner.java b/client/src/main/java/rt4/ScriptRunner.java index 6de398c..8b8713e 100644 --- a/client/src/main/java/rt4/ScriptRunner.java +++ b/client/src/main/java/rt4/ScriptRunner.java @@ -214,7 +214,7 @@ public final class ScriptRunner { } method3240(false); if (!arg1) { - method3532(); + updateSceneProjectiles(); } method4239(); if (GlRenderer.enabled) { @@ -235,7 +235,7 @@ public final class ScriptRunner { if (Camera.customCameraActive[4] && Camera.cameraAmplitude[4] + 128 > local59) { local59 = Camera.cameraAmplitude[4] + 128; } - Camera.method555(Camera.cameraX, arg0, SceneGraph.getTileHeight(Player.level, PlayerList.self.xFine, PlayerList.self.zFine) - 50, Camera.ZOOM - -(local59 * 3), local57, Camera.cameraZ, local59); + Camera.method555(Camera.cameraX, arg0, SceneGraph.getTileHeight(Player.plane, PlayerList.self.xFine, PlayerList.self.zFine) - 50, Camera.ZOOM - -(local59 * 3), local57, Camera.cameraZ, local59); } local57 = Camera.anInt40; local59 = Camera.renderX; @@ -304,15 +304,15 @@ public final class ScriptRunner { GlRenderer.setDepthTestEnabled(true); GlRenderer.setFogEnabled(true); if (client.gameState == 10) { - local171 = FogManager.method2235(Protocol.anInt4247, Camera.renderZ >> 10, Preferences.brightness, Camera.renderX >> 10); + local171 = FogManager.method2235(Protocol.sceneDelta, Camera.renderZ >> 10, Preferences.brightness, Camera.renderX >> 10); } else { - local171 = FogManager.method2235(Protocol.anInt4247, PlayerList.self.movementQueueZ[0] >> 3, Preferences.brightness, PlayerList.self.movementQueueX[0] >> 3); + local171 = FogManager.method2235(Protocol.sceneDelta, PlayerList.self.movementQueueZ[0] >> 3, Preferences.brightness, PlayerList.self.movementQueueX[0] >> 3); } LightingManager.method2394(client.loop, !Preferences.flickeringEffectsOn); GlRenderer.clearColorAndDepthBuffers(local171); MaterialManager.method2731(Camera.cameraPitch, Camera.renderZ, Camera.anInt40, Camera.renderX, Camera.cameraYaw); GlRenderer.anInt5323 = client.loop; - SceneGraph.method2954(Camera.renderX, Camera.anInt40, Camera.renderZ, Camera.cameraPitch, Camera.cameraYaw, aByteArrayArrayArray15, anIntArray205, anIntArray338, anIntArray518, anIntArray134, anIntArray476, Player.level + 1, local387, PlayerList.self.xFine >> 7, PlayerList.self.zFine >> 7); + SceneGraph.method2954(Camera.renderX, Camera.anInt40, Camera.renderZ, Camera.cameraPitch, Camera.cameraYaw, aByteArrayArrayArray15, anIntArray205, anIntArray338, anIntArray518, anIntArray134, anIntArray476, Player.plane + 1, local387, PlayerList.self.xFine >> 7, PlayerList.self.zFine >> 7); aBoolean299 = true; LightingManager.method2390(); MaterialManager.method2731(0, 0, 0, 0, 0); @@ -322,13 +322,13 @@ public final class ScriptRunner { MiniMap.method4000(arg3, arg2, arg0, anInt5029, anInt5029, arg4); } else { SoftwareRaster.fillRect(arg2, arg4, arg3, arg0, 0); - SceneGraph.method2954(Camera.renderX, Camera.anInt40, Camera.renderZ, Camera.cameraPitch, Camera.cameraYaw, aByteArrayArrayArray15, anIntArray205, anIntArray338, anIntArray518, anIntArray134, anIntArray476, Player.level + 1, local387, PlayerList.self.xFine >> 7, PlayerList.self.zFine >> 7); + SceneGraph.method2954(Camera.renderX, Camera.anInt40, Camera.renderZ, Camera.cameraPitch, Camera.cameraYaw, aByteArrayArrayArray15, anIntArray205, anIntArray338, anIntArray518, anIntArray134, anIntArray476, Player.plane + 1, local387, PlayerList.self.xFine >> 7, PlayerList.self.zFine >> 7); client.audioLoop(); method3858(); method2726(arg4, arg3, arg2, 256, arg0, 256); MiniMap.method4000(arg3, arg2, arg0, 256, 256, arg4); } - ((Js5GlTextureProvider) Rasteriser.textureProvider).method3239(Protocol.anInt4247); + ((Js5GlTextureProvider) Rasteriser.textureProvider).method3239(Protocol.sceneDelta); Player.method2310(arg3, arg4, arg0, arg2); Camera.cameraPitch = local123; Camera.renderZ = local121; @@ -783,12 +783,12 @@ public final class ScriptRunner { } } if (local39.attachment == null || client.loop < local39.attachmentSetAt || local39.attachmentResetAt <= client.loop) { - local39.anInt3424 = SceneGraph.getTileHeight(Player.level, local39.xFine, local39.zFine); - SceneGraph.method1141(Player.level, local39.xFine, local39.zFine, local39.anInt3424, (local82 - 1) * 64 + 60, local39, local39.anInt3381, local272, local39.aBoolean171); + local39.anInt3424 = SceneGraph.getTileHeight(Player.plane, local39.xFine, local39.zFine); + SceneGraph.add(Player.plane, local39.xFine, local39.zFine, local39.anInt3424, (local82 - 1) * 64 + 60, local39, local39.anInt3381, local272, local39.aBoolean171); } else { local39.aBoolean98 = false; - local39.anInt3424 = SceneGraph.getTileHeight(Player.level, local39.xFine, local39.zFine); - method3387(Player.level, local39.xFine, local39.zFine, local39.anInt3424, local39, local39.anInt3381, local272, local39.atachmentX0, local39.attachmentZ0, local39.attachmentX1, local39.attachmentZ1); + local39.anInt3424 = SceneGraph.getTileHeight(Player.plane, local39.xFine, local39.zFine); + method3387(Player.plane, local39.xFine, local39.zFine, local39.anInt3424, local39, local39.anInt3381, local272, local39.atachmentX0, local39.attachmentZ0, local39.attachmentX1, local39.attachmentZ1); } } } @@ -904,27 +904,27 @@ public final class ScriptRunner { if (!local16.type.aBoolean183) { local262 |= Long.MIN_VALUE; } - local16.anInt3424 = SceneGraph.getTileHeight(Player.level, local16.xFine, local16.zFine); - SceneGraph.method1141(Player.level, local16.xFine, local16.zFine, local16.anInt3424, local107 * 64 + 60 - 64, local16, local16.anInt3381, local262, local16.aBoolean171); + local16.anInt3424 = SceneGraph.getTileHeight(Player.plane, local16.xFine, local16.zFine); + SceneGraph.add(Player.plane, local16.xFine, local16.zFine, local16.anInt3424, local107 * 64 + 60 - 64, local16, local16.anInt3381, local262, local16.aBoolean171); } } } @OriginalMember(owner = "client!pk", name = "i", descriptor = "(I)V") - public static void method3532() { + public static void updateSceneProjectiles() { for (@Pc(16) ProjAnimNode local16 = (ProjAnimNode) SceneGraph.projectiles.head(); local16 != null; local16 = (ProjAnimNode) SceneGraph.projectiles.next()) { @Pc(21) ProjAnim local21 = local16.value; - if (Player.level != local21.anInt4810 || local21.anInt4800 < client.loop) { + if (Player.plane != local21.currentPlane || local21.lastCycle < client.loop) { local16.unlink(); - } else if (client.loop >= local21.anInt4822) { - if (local21.anInt4819 > 0) { - @Pc(54) Npc local54 = NpcList.npcs[local21.anInt4819 - 1]; + } else if (client.loop >= local21.firstCycle) { + if (local21.targetIndex > 0) { + @Pc(54) Npc local54 = NpcList.npcs[local21.targetIndex - 1]; if (local54 != null && local54.xFine >= 0 && local54.xFine < 13312 && local54.zFine >= 0 && local54.zFine < 13312) { - local21.setTarget(local54.zFine, client.loop, SceneGraph.getTileHeight(local21.anInt4810, local54.xFine, local54.zFine) - local21.anInt4805, local54.xFine); + local21.setTarget(local54.zFine, client.loop, SceneGraph.getTileHeight(local21.currentPlane, local54.xFine, local54.zFine) - local21.baseZ, local54.xFine); } } - if (local21.anInt4819 < 0) { - @Pc(102) int local102 = -local21.anInt4819 - 1; + if (local21.targetIndex < 0) { + @Pc(102) int local102 = -local21.targetIndex - 1; @Pc(107) Player local107; if (PlayerList.selfId == local102) { local107 = PlayerList.self; @@ -932,11 +932,11 @@ public final class ScriptRunner { local107 = PlayerList.players[local102]; } if (local107 != null && local107.xFine >= 0 && local107.xFine < 13312 && local107.zFine >= 0 && local107.zFine < 13312) { - local21.setTarget(local107.zFine, client.loop, SceneGraph.getTileHeight(local21.anInt4810, local107.xFine, local107.zFine) - local21.anInt4805, local107.xFine); + local21.setTarget(local107.zFine, client.loop, SceneGraph.getTileHeight(local21.currentPlane, local107.xFine, local107.zFine) - local21.baseZ, local107.xFine); } } - local21.method3704(Protocol.anInt4247); - SceneGraph.method1141(Player.level, (int) local21.aDouble8, (int) local21.aDouble3, (int) local21.aDouble6, 60, local21, local21.anInt4821, -1L, false); + local21.update(Protocol.sceneDelta); + SceneGraph.add(Player.plane, (int) local21.x, (int) local21.y, (int) local21.z, 60, local21, local21.yaw, -1L, false); } } } @@ -945,14 +945,14 @@ public final class ScriptRunner { public static void method4239() { for (@Pc(9) SpotAnimNode local9 = (SpotAnimNode) SceneGraph.spotanims.head(); local9 != null; local9 = (SpotAnimNode) SceneGraph.spotanims.next()) { @Pc(15) SpotAnim local15 = local9.aClass8_Sub2_1; - if (local15.anInt606 != Player.level || local15.aBoolean41) { + if (local15.anInt606 != Player.plane || local15.aBoolean41) { local9.unlink(); } else if (local15.anInt590 <= client.loop) { - local15.method558(Protocol.anInt4247); + local15.method558(Protocol.sceneDelta); if (local15.aBoolean41) { local9.unlink(); } else { - SceneGraph.method1141(local15.anInt606, local15.anInt604, local15.anInt598, local15.anInt599, 60, local15, 0, -1L, false); + SceneGraph.add(local15.anInt606, local15.anInt604, local15.anInt598, local15.anInt599, 60, local15, 0, -1L, false); } } } @@ -1037,9 +1037,9 @@ public final class ScriptRunner { @OriginalMember(owner = "client!uj", name = "a", descriptor = "(BZII[[[Lclient!bj;I)Z") public static boolean method4348(@OriginalArg(1) boolean arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) Tile[][][] arg3, @OriginalArg(5) int arg4) { @Pc(14) byte local14 = arg0 ? 1 : (byte) (anInt3325 & 0xFF); - if (local14 == aByteArrayArrayArray15[Player.level][arg1][arg2]) { + if (local14 == aByteArrayArrayArray15[Player.plane][arg1][arg2]) { return false; - } else if ((SceneGraph.renderFlags[Player.level][arg1][arg2] & 0x4) == 0) { + } else if ((SceneGraph.renderFlags[Player.plane][arg1][arg2] & 0x4) == 0) { return false; } else { @Pc(47) int local47 = 0; @@ -1047,7 +1047,7 @@ public final class ScriptRunner { PathFinder.queueX[0] = arg1; @Pc(69) int local69 = local49 + 1; PathFinder.queueZ[0] = arg2; - aByteArrayArrayArray15[Player.level][arg1][arg2] = local14; + aByteArrayArrayArray15[Player.plane][arg1][arg2] = local14; while (local47 != local69) { @Pc(94) int local94 = PathFinder.queueX[local47] >> 16 & 0xFF; @Pc(102) int local102 = PathFinder.queueX[local47] >> 24 & 0xFF; @@ -1057,13 +1057,13 @@ public final class ScriptRunner { local47 = local47 + 1 & 0xFFF; @Pc(130) boolean local130 = false; @Pc(132) boolean local132 = false; - if ((SceneGraph.renderFlags[Player.level][local108][local122] & 0x4) == 0) { + if ((SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0) { local130 = true; } @Pc(150) int local150; @Pc(191) int local191; label238: - for (local150 = Player.level + 1; local150 <= 3; local150++) { + for (local150 = Player.plane + 1; local150 <= 3; local150++) { if ((SceneGraph.renderFlags[local150][local108][local122] & 0x8) == 0) { @Pc(227) int local227; @Pc(358) int local358; @@ -1118,8 +1118,8 @@ public final class ScriptRunner { } } if (local132) { - if (SceneGraph.tileHeights[Player.level + 1][local108][local122] > anIntArray205[arg4]) { - anIntArray205[arg4] = SceneGraph.tileHeights[Player.level + 1][local108][local122]; + if (SceneGraph.tileHeights[Player.plane + 1][local108][local122] > anIntArray205[arg4]) { + anIntArray205[arg4] = SceneGraph.tileHeights[Player.plane + 1][local108][local122]; } local150 = local108 << 7; if (local150 < anIntArray338[arg4]) { @@ -1135,58 +1135,58 @@ public final class ScriptRunner { } } if (!local130) { - if (local108 >= 1 && aByteArrayArrayArray15[Player.level][local108 - 1][local122] != local14) { + if (local108 >= 1 && aByteArrayArrayArray15[Player.plane][local108 - 1][local122] != local14) { PathFinder.queueX[local69] = local108 - 1 | 0x120000 | 0xD3000000; PathFinder.queueZ[local69] = local122 | 0x130000; local69 = local69 + 1 & 0xFFF; - aByteArrayArrayArray15[Player.level][local108 - 1][local122] = local14; + aByteArrayArrayArray15[Player.plane][local108 - 1][local122] = local14; } local122++; if (local122 < 104) { - if (local108 - 1 >= 0 && local14 != aByteArrayArrayArray15[Player.level][local108 - 1][local122] && (SceneGraph.renderFlags[Player.level][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.level][local108 - 1][local122 - 1] & 0x4) == 0) { + if (local108 - 1 >= 0 && local14 != aByteArrayArrayArray15[Player.plane][local108 - 1][local122] && (SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.plane][local108 - 1][local122 - 1] & 0x4) == 0) { PathFinder.queueX[local69] = 0x52000000 | 0x120000 | local108 - 1; PathFinder.queueZ[local69] = local122 | 0x130000; - aByteArrayArrayArray15[Player.level][local108 - 1][local122] = local14; + aByteArrayArrayArray15[Player.plane][local108 - 1][local122] = local14; local69 = local69 + 1 & 0xFFF; } - if (local14 != aByteArrayArrayArray15[Player.level][local108][local122]) { + if (local14 != aByteArrayArrayArray15[Player.plane][local108][local122]) { PathFinder.queueX[local69] = local108 | 0x13000000 | 0x520000; PathFinder.queueZ[local69] = local122 | 0x530000; local69 = local69 + 1 & 0xFFF; - aByteArrayArrayArray15[Player.level][local108][local122] = local14; + aByteArrayArrayArray15[Player.plane][local108][local122] = local14; } - if (local108 + 1 < 104 && aByteArrayArrayArray15[Player.level][local108 + 1][local122] != local14 && (SceneGraph.renderFlags[Player.level][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.level][local108 + 1][local122 - 1] & 0x4) == 0) { + if (local108 + 1 < 104 && aByteArrayArrayArray15[Player.plane][local108 + 1][local122] != local14 && (SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.plane][local108 + 1][local122 - 1] & 0x4) == 0) { PathFinder.queueX[local69] = 0x92000000 | 0x520000 | local108 + 1; PathFinder.queueZ[local69] = local122 | 0x530000; - aByteArrayArrayArray15[Player.level][local108 + 1][local122] = local14; + aByteArrayArrayArray15[Player.plane][local108 + 1][local122] = local14; local69 = local69 + 1 & 0xFFF; } } local122--; - if (local108 + 1 < 104 && local14 != aByteArrayArrayArray15[Player.level][local108 + 1][local122]) { + if (local108 + 1 < 104 && local14 != aByteArrayArrayArray15[Player.plane][local108 + 1][local122]) { PathFinder.queueX[local69] = local108 + 1 | 0x920000 | 0x53000000; PathFinder.queueZ[local69] = local122 | 0x930000; - aByteArrayArrayArray15[Player.level][local108 + 1][local122] = local14; + aByteArrayArrayArray15[Player.plane][local108 + 1][local122] = local14; local69 = local69 + 1 & 0xFFF; } local122--; if (local122 >= 0) { - if (local108 - 1 >= 0 && aByteArrayArrayArray15[Player.level][local108 - 1][local122] != local14 && (SceneGraph.renderFlags[Player.level][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.level][local108 - 1][local122 + 1] & 0x4) == 0) { + if (local108 - 1 >= 0 && aByteArrayArrayArray15[Player.plane][local108 - 1][local122] != local14 && (SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.plane][local108 - 1][local122 + 1] & 0x4) == 0) { PathFinder.queueX[local69] = local108 - 1 | 0xD20000 | 0x12000000; PathFinder.queueZ[local69] = local122 | 0xD30000; - aByteArrayArrayArray15[Player.level][local108 - 1][local122] = local14; + aByteArrayArrayArray15[Player.plane][local108 - 1][local122] = local14; local69 = local69 + 1 & 0xFFF; } - if (local14 != aByteArrayArrayArray15[Player.level][local108][local122]) { + if (local14 != aByteArrayArrayArray15[Player.plane][local108][local122]) { PathFinder.queueX[local69] = local108 | 0xD20000 | 0x93000000; PathFinder.queueZ[local69] = local122 | 0xD30000; local69 = local69 + 1 & 0xFFF; - aByteArrayArrayArray15[Player.level][local108][local122] = local14; + aByteArrayArrayArray15[Player.plane][local108][local122] = local14; } - if (local108 + 1 < 104 && aByteArrayArrayArray15[Player.level][local108 + 1][local122] != local14 && (SceneGraph.renderFlags[Player.level][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.level][local108 + 1][local122 + 1] & 0x4) == 0) { + if (local108 + 1 < 104 && aByteArrayArrayArray15[Player.plane][local108 + 1][local122] != local14 && (SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.plane][local108 + 1][local122 + 1] & 0x4) == 0) { PathFinder.queueX[local69] = local108 + 1 | 0xD2000000 | 0x920000; PathFinder.queueZ[local69] = local122 | 0x930000; - aByteArrayArrayArray15[Player.level][local108 + 1][local122] = local14; + aByteArrayArrayArray15[Player.plane][local108 + 1][local122] = local14; local69 = local69 + 1 & 0xFFF; } } @@ -1237,7 +1237,7 @@ public final class ScriptRunner { anInt1951 = -1; return; } - @Pc(38) int local38 = SceneGraph.getTileHeight(Player.level, arg5, arg2) - arg3; + @Pc(38) int local38 = SceneGraph.getTileHeight(Player.plane, arg5, arg2) - arg3; @Pc(42) int local42 = arg2 - Camera.renderZ; @Pc(46) int local46 = local38 - Camera.anInt40; @Pc(50) int local50 = arg5 - Camera.renderX; @@ -1322,7 +1322,7 @@ public final class ScriptRunner { aByteArrayArrayArray15[local33][local31][local40] = local27; } } - if (Player.level == 3) { + if (Player.plane == 3) { return; } for (local33 = 0; local33 < 2; local33++) { @@ -1333,13 +1333,13 @@ public final class ScriptRunner { anIntArray134[local33] = 0; } if (Camera.cameraType != 1) { - local33 = SceneGraph.getTileHeight(Player.level, Camera.renderX, Camera.renderZ); - if (local33 - Camera.anInt40 < 800 && (SceneGraph.renderFlags[Player.level][Camera.renderX >> 7][Camera.renderZ >> 7] & 0x4) != 0) { + local33 = SceneGraph.getTileHeight(Player.plane, Camera.renderX, Camera.renderZ); + if (local33 - Camera.anInt40 < 800 && (SceneGraph.renderFlags[Player.plane][Camera.renderX >> 7][Camera.renderZ >> 7] & 0x4) != 0) { method4348(false, Camera.renderX >> 7, Camera.renderZ >> 7, SceneGraph.tiles, 1); } return; } - if ((SceneGraph.renderFlags[Player.level][PlayerList.self.xFine >> 7][PlayerList.self.zFine >> 7] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.plane][PlayerList.self.xFine >> 7][PlayerList.self.zFine >> 7] & 0x4) != 0) { method4348(false, PlayerList.self.xFine >> 7, PlayerList.self.zFine >> 7, SceneGraph.tiles, 0); } if (Camera.cameraPitch >= 310) { @@ -1372,7 +1372,7 @@ public final class ScriptRunner { } else if (local40 > local135) { local40--; } - if ((SceneGraph.renderFlags[Player.level][local33][local40] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.plane][local33][local40] & 0x4) != 0) { method4348(false, local33, local40, SceneGraph.tiles, 1); break; } @@ -1384,7 +1384,7 @@ public final class ScriptRunner { local33--; } local186 -= 65536; - if ((SceneGraph.renderFlags[Player.level][local33][local40] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.plane][local33][local40] & 0x4) != 0) { method4348(false, local33, local40, SceneGraph.tiles, 1); break; } @@ -1400,7 +1400,7 @@ public final class ScriptRunner { } else if (local33 > local162) { local33--; } - if ((SceneGraph.renderFlags[Player.level][local33][local40] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.plane][local33][local40] & 0x4) != 0) { method4348(false, local33, local40, SceneGraph.tiles, 1); break; } @@ -1412,7 +1412,7 @@ public final class ScriptRunner { local40--; } local186 -= 65536; - if ((SceneGraph.renderFlags[Player.level][local33][local40] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.plane][local33][local40] & 0x4) != 0) { method4348(false, local33, local40, SceneGraph.tiles, 1); break; } @@ -1577,6 +1577,10 @@ public final class ScriptRunner { public static final int itemAttribute = 4208; public static final int searchItem = 4210; + // Params + public static final int getLocParam = 4400; + public static final int getStructParam = 4500; + // Privacy public static final int getPublicChatSetting = 5000; public static final int setChatSettings = 5001; @@ -1590,6 +1594,10 @@ public final class ScriptRunner { public static final int getFirstWorldData = 6501; public static final int getNextWorldData = 6502; public static final int setWorldHost = 6503; + public static final int setLastWorld = 6504; + public static final int getLastWorld = 6505; + public static final int sortWorldList = 6507; + public static final int setChild = 200; public static final int setChild2 = 201; public static final int setBaseIdkit = 403; @@ -3149,7 +3157,7 @@ public final class ScriptRunner { continue; } if (opcode == Cs2Opcodes.getMyLocation) { - int1 = Player.level; + int1 = Player.plane; int3 = Camera.originX + (PlayerList.self.xFine >> 7); int2 = (PlayerList.self.zFine >> 7) + Camera.originZ; intStack[isp++] = (int1 << 28) - (-(int3 << 14) - int2); @@ -5518,13 +5526,13 @@ public final class ScriptRunner { intStack[isp++] = 0; continue; } - if (opcode == 6504) { + if (opcode == Cs2Opcodes.setLastWorld) { isp--; Preferences.lastWorldId = intStack[isp]; Preferences.write(GameShell.signLink); continue; } - if (opcode == 6505) { + if (opcode == Cs2Opcodes.getLastWorld) { intStack[isp++] = Preferences.lastWorldId; continue; } @@ -5548,7 +5556,7 @@ public final class ScriptRunner { } continue; } - if (opcode == 6507) { + if (opcode == Cs2Opcodes.sortWorldList) { isp -= 4; int2 = intStack[isp + 2]; int1 = intStack[isp]; @@ -5570,7 +5578,7 @@ public final class ScriptRunner { } } } - } else if (opcode == 4500) { + } else if (opcode == Cs2Opcodes.getStructParam) { isp -= 2; int1 = intStack[isp]; int3 = intStack[isp + 1]; @@ -5582,7 +5590,7 @@ public final class ScriptRunner { } continue; } - } else if (opcode == 4400) { + } else if (opcode == Cs2Opcodes.getLocParam) { isp -= 2; int3 = intStack[isp + 1]; int1 = intStack[isp]; diff --git a/client/src/main/java/rt4/SeqType.java b/client/src/main/java/rt4/SeqType.java index b0b7e7e..bfb7460 100644 --- a/client/src/main/java/rt4/SeqType.java +++ b/client/src/main/java/rt4/SeqType.java @@ -15,70 +15,70 @@ public final class SeqType { public int[] frames; @OriginalMember(owner = "client!tk", name = "n", descriptor = "[Z") - public boolean[] aBooleanArray123; + public boolean[] framegroup; @OriginalMember(owner = "client!tk", name = "y", descriptor = "I") public int id; @OriginalMember(owner = "client!tk", name = "C", descriptor = "[[I") - public int[][] sounds; + public int[][] soundeffect; @OriginalMember(owner = "client!tk", name = "G", descriptor = "[I") - public int[] anIntArray474; + public int[] frameDelay; @OriginalMember(owner = "client!tk", name = "I", descriptor = "[I") - private int[] anIntArray475; + private int[] frameset; @OriginalMember(owner = "client!tk", name = "a", descriptor = "I") - public int anInt5347 = 2; + public int exactmove = 2; @OriginalMember(owner = "client!tk", name = "b", descriptor = "Z") public boolean tween = false; @OriginalMember(owner = "client!tk", name = "f", descriptor = "I") - public int anInt5349 = -1; + public int movetype = -1; @OriginalMember(owner = "client!tk", name = "e", descriptor = "I") - public int anInt5348 = -1; + public int offhand = -1; @OriginalMember(owner = "client!tk", name = "d", descriptor = "Z") public boolean aBoolean278 = false; @OriginalMember(owner = "client!tk", name = "t", descriptor = "I") - public int anInt5357 = 99; + public int replaycount = 99; @OriginalMember(owner = "client!tk", name = "z", descriptor = "I") - public int anInt5362 = -1; + public int replayoff = -1; @OriginalMember(owner = "client!tk", name = "B", descriptor = "I") - public int anInt5363 = -1; + public int looptype = -1; @OriginalMember(owner = "client!tk", name = "p", descriptor = "I") - public int forcedPriority = 5; + public int priority = 5; @OriginalMember(owner = "client!tk", name = "r", descriptor = "Z") - public boolean aBoolean279 = false; + public boolean stretches = false; @OriginalMember(owner = "client!tk", name = "l", descriptor = "I") - public int anInt5353 = -1; + public int mainhand = -1; @OriginalMember(owner = "client!tk", name = "L", descriptor = "Z") public boolean aBoolean280 = false; @OriginalMember(owner = "client!tk", name = "a", descriptor = "(Lclient!wa;B)V") - public final void decode(@OriginalArg(0) Buffer arg0) { + public void decode(@OriginalArg(0) Buffer buffer) { while (true) { - @Pc(19) int local19 = arg0.g1(); - if (local19 == 0) { + @Pc(19) int opcode = buffer.g1(); + if (opcode == 0) { return; } - this.decode(local19, arg0); + this.decode(opcode, buffer); } } @OriginalMember(owner = "client!tk", name = "a", descriptor = "(IIILclient!ak;II)Lclient!ak;") - public final Model method4214(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) Model arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { - @Pc(10) int local10 = this.anIntArray474[arg0]; + public Model method4214(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) Model arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { + @Pc(10) int local10 = this.frameDelay[arg0]; @Pc(15) int local15 = this.frames[arg0]; @Pc(23) AnimFrameset local23 = SeqTypeList.getAnimFrameset(local15 >> 16); @Pc(27) int local27 = local15 & 0xFFFF; @@ -133,9 +133,9 @@ public final class SeqType { } @OriginalMember(owner = "client!tk", name = "a", descriptor = "(Lclient!ak;BIII)Lclient!ak;") - public final Model method4215(@OriginalArg(0) Model arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3) { + public Model method4215(@OriginalArg(0) Model arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3) { @Pc(8) int local8 = this.frames[arg3]; - @Pc(13) int local13 = this.anIntArray474[arg3]; + @Pc(13) int local13 = this.frameDelay[arg3]; @Pc(19) AnimFrameset local19 = SeqTypeList.getAnimFrameset(local8 >> 16); @Pc(23) int local23 = local8 & 0xFFFF; if (local19 == null) { @@ -151,16 +151,16 @@ public final class SeqType { @Pc(81) AnimFrameset local81 = null; @Pc(83) int local83 = 0; @Pc(85) int local85 = 0; - if (this.anIntArray475 != null) { - if (this.anIntArray475.length > arg3) { - local83 = this.anIntArray475[arg3]; + if (this.frameset != null) { + if (this.frameset.length > arg3) { + local83 = this.frameset[arg3]; if (local83 != 65535) { local71 = SeqTypeList.getAnimFrameset(local83 >> 16); local83 &= 0xFFFF; } } - if ((this.tween || applyTweening) && arg1 != -1 && this.anIntArray475.length > arg1) { - local85 = this.anIntArray475[arg1]; + if ((this.tween || applyTweening) && arg1 != -1 && this.frameset.length > arg1) { + local85 = this.frameset[arg1]; if (local85 != 65535) { local81 = SeqTypeList.getAnimFrameset(local85 >> 16); local85 &= 0xFFFF; @@ -190,8 +190,8 @@ public final class SeqType { } @OriginalMember(owner = "client!tk", name = "a", descriptor = "(IIIILclient!ak;I)Lclient!ak;") - public final Model method4216(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) Model arg4) { - @Pc(6) int local6 = this.anIntArray474[arg1]; + public Model method4216(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) Model arg4) { + @Pc(6) int local6 = this.frameDelay[arg1]; @Pc(11) int local11 = this.frames[arg1]; @Pc(19) AnimFrameset local19 = SeqTypeList.getAnimFrameset(local11 >> 16); @Pc(27) int local27 = local11 & 0xFFFF; @@ -246,27 +246,27 @@ public final class SeqType { } @OriginalMember(owner = "client!tk", name = "b", descriptor = "(B)V") - public final void postDecode() { - if (this.anInt5363 == -1) { - if (this.aBooleanArray123 == null) { - this.anInt5363 = 0; + public void postDecode() { + if (this.looptype == -1) { + if (this.framegroup == null) { + this.looptype = 0; } else { - this.anInt5363 = 2; + this.looptype = 2; } } - if (this.anInt5349 != -1) { - return; - } - if (this.aBooleanArray123 == null) { - this.anInt5349 = 0; - } else { - this.anInt5349 = 2; + + if (this.movetype == -1) { + if (this.framegroup == null) { + this.movetype = 0; + } else { + this.movetype = 2; + } } } @OriginalMember(owner = "client!tk", name = "a", descriptor = "(IIIBLclient!ak;)Lclient!ak;") - public final Model method4219(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(4) Model arg3) { - @Pc(16) int local16 = this.anIntArray474[arg2]; + public Model method4219(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(4) Model arg3) { + @Pc(16) int local16 = this.frameDelay[arg2]; @Pc(21) int local21 = this.frames[arg2]; @Pc(27) AnimFrameset local27 = SeqTypeList.getAnimFrameset(local21 >> 16); @Pc(31) int local31 = local21 & 0xFFFF; @@ -290,73 +290,74 @@ public final class SeqType { } @OriginalMember(owner = "client!tk", name = "a", descriptor = "(IBLclient!wa;)V") - private void decode(@OriginalArg(0) int arg0, @OriginalArg(2) Buffer arg1) { - @Pc(8) int local8; - @Pc(14) int local14; - if (arg0 == 1) { - local8 = arg1.g2(); - this.anIntArray474 = new int[local8]; - for (local14 = 0; local14 < local8; local14++) { - this.anIntArray474[local14] = arg1.g2(); + private void decode(@OriginalArg(0) int opcode, @OriginalArg(2) Buffer buffer) { + @Pc(8) int count; + @Pc(14) int i; + + if (opcode == 1) { + count = buffer.g2(); + this.frameDelay = new int[count]; + for (i = 0; i < count; i++) { + this.frameDelay[i] = buffer.g2(); } - this.frames = new int[local8]; - for (local14 = 0; local14 < local8; local14++) { - this.frames[local14] = arg1.g2(); + this.frames = new int[count]; + for (i = 0; i < count; i++) { + this.frames[i] = buffer.g2(); } - for (local14 = 0; local14 < local8; local14++) { - this.frames[local14] += arg1.g2() << 16; + for (i = 0; i < count; i++) { + this.frames[i] += buffer.g2() << 16; } - } else if (arg0 == 2) { - this.anInt5362 = arg1.g2(); - } else if (arg0 == 3) { - this.aBooleanArray123 = new boolean[256]; - local8 = arg1.g1(); - for (local14 = 0; local14 < local8; local14++) { - this.aBooleanArray123[arg1.g1()] = true; + } else if (opcode == 2) { + this.replayoff = buffer.g2(); + } else if (opcode == 3) { + this.framegroup = new boolean[256]; + count = buffer.g1(); + for (i = 0; i < count; i++) { + this.framegroup[buffer.g1()] = true; } - } else if (arg0 == 4) { - this.aBoolean279 = true; - } else if (arg0 == 5) { - this.forcedPriority = arg1.g1(); - } else if (arg0 == 6) { - this.anInt5353 = arg1.g2(); - } else if (arg0 == 7) { - this.anInt5348 = arg1.g2(); - } else if (arg0 == 8) { - this.anInt5357 = arg1.g1(); - } else if (arg0 == 9) { - this.anInt5363 = arg1.g1(); - } else if (arg0 == 10) { - this.anInt5349 = arg1.g1(); - } else if (arg0 == 11) { - this.anInt5347 = arg1.g1(); - } else if (arg0 == 12) { - local8 = arg1.g1(); - this.anIntArray475 = new int[local8]; - for (local14 = 0; local14 < local8; local14++) { - this.anIntArray475[local14] = arg1.g2(); + } else if (opcode == 4) { + this.stretches = true; + } else if (opcode == 5) { + this.priority = buffer.g1(); + } else if (opcode == 6) { + this.mainhand = buffer.g2(); + } else if (opcode == 7) { + this.offhand = buffer.g2(); + } else if (opcode == 8) { + this.replaycount = buffer.g1(); + } else if (opcode == 9) { // TODO: confirm + this.looptype = buffer.g1(); + } else if (opcode == 10) { // TODO: confirm + this.movetype = buffer.g1(); + } else if (opcode == 11) { // TODO: confirm + this.exactmove = buffer.g1(); + } else if (opcode == 12) { // TODO: confirm + count = buffer.g1(); + this.frameset = new int[count]; + for (i = 0; i < count; i++) { + this.frameset[i] = buffer.g2(); } - for (local14 = 0; local14 < local8; local14++) { - this.anIntArray475[local14] += arg1.g2() << 16; + for (i = 0; i < count; i++) { + this.frameset[i] += buffer.g2() << 16; } - } else if (arg0 == 13) { - local8 = arg1.g2(); - this.sounds = new int[local8][]; - for (local14 = 0; local14 < local8; local14++) { - @Pc(163) int local163 = arg1.g1(); - if (local163 > 0) { - this.sounds[local14] = new int[local163]; - this.sounds[local14][0] = arg1.g3(); - for (@Pc(182) int local182 = 1; local182 < local163; local182++) { - this.sounds[local14][local182] = arg1.g2(); + } else if (opcode == 13) { + count = buffer.g2(); + this.soundeffect = new int[count][]; + for (i = 0; i < count; i++) { + @Pc(163) int count2 = buffer.g1(); + if (count2 > 0) { + this.soundeffect[i] = new int[count2]; + this.soundeffect[i][0] = buffer.g3(); + for (@Pc(182) int j = 1; j < count2; j++) { + this.soundeffect[i][j] = buffer.g2(); } } } - } else if (arg0 == 14) { + } else if (opcode == 14) { this.aBoolean278 = true; - } else if (arg0 == 15) { + } else if (opcode == 15) { // TODO: (probably) not an authentic name this.tween = true; - } else if (arg0 == 16) { + } else if (opcode == 16) { this.aBoolean280 = true; } } diff --git a/client/src/main/java/rt4/SeqTypeList.java b/client/src/main/java/rt4/SeqTypeList.java index 2ab6399..2b113f7 100644 --- a/client/src/main/java/rt4/SeqTypeList.java +++ b/client/src/main/java/rt4/SeqTypeList.java @@ -5,14 +5,19 @@ import org.openrs2.deob.annotation.OriginalMember; import org.openrs2.deob.annotation.Pc; public class SeqTypeList { + @OriginalMember(owner = "client!lc", name = "e", descriptor = "Lclient!n;") public static final SoftLruHashTable types = new SoftLruHashTable(64); + @OriginalMember(owner = "client!vl", name = "a", descriptor = "Lclient!n;") public static final SoftLruHashTable animFramesets = new SoftLruHashTable(100); + @OriginalMember(owner = "client!tk", name = "s", descriptor = "Lclient!ve;") public static Js5 archive; + @OriginalMember(owner = "client!af", name = "a", descriptor = "Lclient!ve;") public static Js5 basesArchive; + @OriginalMember(owner = "client!se", name = "l", descriptor = "Lclient!ve;") public static Js5 animsArchive; diff --git a/client/src/main/java/rt4/ShadowModelList.java b/client/src/main/java/rt4/ShadowModelList.java index 4a96bbf..3c09b5a 100644 --- a/client/src/main/java/rt4/ShadowModelList.java +++ b/client/src/main/java/rt4/ShadowModelList.java @@ -127,18 +127,18 @@ public class ShadowModelList { } if (GlRenderer.enabled) { @Pc(650) GlModel local650 = (GlModel) local33; - if (SceneGraph.getTileHeight(Player.level, arg3 + local384, local126 + arg5) != arg11 || SceneGraph.getTileHeight(Player.level, local115 + arg3, arg5 - -local130) != arg11) { + if (SceneGraph.getTileHeight(Player.plane, arg3 + local384, local126 + arg5) != arg11 || SceneGraph.getTileHeight(Player.plane, local115 + arg3, arg5 - -local130) != arg11) { for (local162 = 0; local162 < local650.vertexCount; local162++) { - local650.vertexY[local162] += SceneGraph.getTileHeight(Player.level, local650.vertexX[local162] + arg3, arg5 + local650.vertexZ[local162]) - arg11; + local650.vertexY[local162] += SceneGraph.getTileHeight(Player.plane, local650.vertexX[local162] + arg3, arg5 + local650.vertexZ[local162]) - arg11; } local650.bounds.valid = false; local650.vertexBuffer.valid = false; } } else { @Pc(574) SoftwareModel local574 = (SoftwareModel) local33; - if (SceneGraph.getTileHeight(Player.level, arg3 + local384, arg5 - -local126) != arg11 || arg11 != SceneGraph.getTileHeight(Player.level, arg3 + local115, arg5 - -local130)) { + if (SceneGraph.getTileHeight(Player.plane, arg3 + local384, arg5 - -local126) != arg11 || arg11 != SceneGraph.getTileHeight(Player.plane, arg3 + local115, arg5 - -local130)) { for (local162 = 0; local162 < local574.vertexCount; local162++) { - local574.vertexY[local162] += SceneGraph.getTileHeight(Player.level, arg3 + local574.vertexX[local162], arg5 + local574.vertexZ[local162]) - arg11; + local574.vertexY[local162] += SceneGraph.getTileHeight(Player.plane, arg3 + local574.vertexX[local162], arg5 + local574.vertexZ[local162]) - arg11; } local574.boundsValid = false; } diff --git a/client/src/main/java/rt4/SoundPlayer.java b/client/src/main/java/rt4/SoundPlayer.java index e61a2f6..1a2f3c7 100644 --- a/client/src/main/java/rt4/SoundPlayer.java +++ b/client/src/main/java/rt4/SoundPlayer.java @@ -20,15 +20,15 @@ public class SoundPlayer { @OriginalMember(owner = "client!ma", name = "a", descriptor = "(ILclient!tk;IIZI)V") public static void playSeqSound(@OriginalArg(0) int zFine, @OriginalArg(1) SeqType seqType, @OriginalArg(3) int xFine, @OriginalArg(4) boolean self, @OriginalArg(5) int index) { - if (size >= 50 || (seqType.sounds == null || index >= seqType.sounds.length || seqType.sounds[index] == null)) { + if (size >= 50 || (seqType.soundeffect == null || index >= seqType.soundeffect.length || seqType.soundeffect[index] == null)) { return; } - @Pc(36) int sound = seqType.sounds[index][0]; + @Pc(36) int sound = seqType.soundeffect[index][0]; @Pc(40) int id = sound >> 8; - if (seqType.sounds[index].length > 1) { - int alternativeIdIndex = (int) ((double) seqType.sounds[index].length * Math.random()); + if (seqType.soundeffect[index].length > 1) { + int alternativeIdIndex = (int) ((double) seqType.soundeffect[index].length * Math.random()); if (alternativeIdIndex > 0) { - id = seqType.sounds[index][alternativeIdIndex]; + id = seqType.soundeffect[index][alternativeIdIndex]; } } @Pc(73) int loops = sound >> 5 & 0x7; diff --git a/client/src/main/java/rt4/SpotAnim.java b/client/src/main/java/rt4/SpotAnim.java index 011a345..747faa7 100644 --- a/client/src/main/java/rt4/SpotAnim.java +++ b/client/src/main/java/rt4/SpotAnim.java @@ -98,8 +98,8 @@ public final class SpotAnim extends Entity { return; } this.anInt607 += arg0; - while (this.anInt607 > this.aClass144_1.anIntArray474[this.anInt593]) { - this.anInt607 -= this.aClass144_1.anIntArray474[this.anInt593]; + while (this.anInt607 > this.aClass144_1.frameDelay[this.anInt593]) { + this.anInt607 -= this.aClass144_1.frameDelay[this.anInt593]; this.anInt593++; if (this.aClass144_1.frames.length <= this.anInt593) { this.aBoolean41 = true; diff --git a/client/src/main/java/rt4/SpotAnimTypeList.java b/client/src/main/java/rt4/SpotAnimTypeList.java index 284477d..137e897 100644 --- a/client/src/main/java/rt4/SpotAnimTypeList.java +++ b/client/src/main/java/rt4/SpotAnimTypeList.java @@ -21,19 +21,19 @@ public class SpotAnimTypeList { } @OriginalMember(owner = "client!ck", name = "a", descriptor = "(BI)Lclient!eg;") - public static SpotAnimType get(@OriginalArg(1) int arg0) { - @Pc(10) SpotAnimType local10 = (SpotAnimType) types.get(arg0); - if (local10 != null) { - return local10; + public static SpotAnimType get(@OriginalArg(1) int id) { + @Pc(10) SpotAnimType type = (SpotAnimType) types.get(id); + if (type != null) { + return type; } - @Pc(26) byte[] local26 = archive.fetchFile(method3681(arg0), method4010(arg0)); - local10 = new SpotAnimType(); - local10.id = arg0; - if (local26 != null) { - local10.decode(new Buffer(local26)); + @Pc(26) byte[] src = archive.fetchFile(method3681(id), method4010(id)); + type = new SpotAnimType(); + type.id = id; + if (src != null) { + type.decode(new Buffer(src)); } - types.put(local10, arg0); - return local10; + types.put(type, id); + return type; } @OriginalMember(owner = "client!qk", name = "a", descriptor = "(ZI)I") diff --git a/client/src/main/java/rt4/client.java b/client/src/main/java/rt4/client.java index b55a93f..791ff6c 100644 --- a/client/src/main/java/rt4/client.java +++ b/client/src/main/java/rt4/client.java @@ -487,7 +487,7 @@ public final class client extends GameShell { LightingManager.anInt2875 = -1; unload(); DeadClass.cache.clear(); - LocType.aClass139_1 = new Loc_Class139(); + LocType.aClass139_1 = new LocEntity(); ((Js5GlTextureProvider) Rasteriser.textureProvider).clear(); LightingManager.lightCount = 0; LightingManager.lights = new Light[255]; @@ -1042,7 +1042,7 @@ public final class client extends GameShell { InterfaceList.keyCodes[InterfaceList.keyQueueSize] = Keyboard.keyCode; InterfaceList.keyChars[InterfaceList.keyQueueSize] = Keyboard.keyChar; } - Protocol.anInt4247++; + Protocol.sceneDelta++; if (InterfaceList.topLevelInterface != -1) { InterfaceList.method1320(0, 0, 0, GameShell.canvasWidth, InterfaceList.topLevelInterface, 0, GameShell.canvasHeight); } @@ -1060,12 +1060,12 @@ public final class client extends GameShell { local66.movementQueueSpeed[0] = 1; local66.movementQueueX[0] = local98 + (local66.xFine >> 7); local66.movementQueueZ[0] = local106 + (local66.zFine >> 7); - PathFinder.collisionMaps[Player.level].unflagScenery(local66.xFine >> 7, local66.getSize(), false, 0, local66.getSize(), local66.zFine >> 7); - if (local66.movementQueueX[0] >= 0 && local66.movementQueueX[0] <= 104 - local66.getSize() && local66.movementQueueZ[0] >= 0 && local66.movementQueueZ[0] <= 104 - local66.getSize() && PathFinder.collisionMaps[Player.level].method3054(local66.zFine >> 7, local66.movementQueueZ[0], local66.movementQueueX[0], local66.xFine >> 7)) { + PathFinder.collisionMaps[Player.plane].unflagScenery(local66.xFine >> 7, local66.getSize(), false, 0, local66.getSize(), local66.zFine >> 7); + if (local66.movementQueueX[0] >= 0 && local66.movementQueueX[0] <= 104 - local66.getSize() && local66.movementQueueZ[0] >= 0 && local66.movementQueueZ[0] <= 104 - local66.getSize() && PathFinder.collisionMaps[Player.plane].method3054(local66.zFine >> 7, local66.movementQueueZ[0], local66.movementQueueX[0], local66.xFine >> 7)) { if (local66.getSize() > 1) { for (@Pc(226) int local226 = local66.movementQueueX[0]; local66.movementQueueX[0] + local66.getSize() > local226; local226++) { for (@Pc(246) int local246 = local66.movementQueueZ[0]; local66.movementQueueZ[0] + local66.getSize() > local246; local246++) { - if ((PathFinder.collisionMaps[Player.level].flags[local226][local246] & 0x12401FF) != 0) { + if ((PathFinder.collisionMaps[Player.plane].flags[local226][local246] & 0x12401FF) != 0) { continue nextNpc; } } @@ -1078,7 +1078,7 @@ public final class client extends GameShell { NpcList.method2247(local66); NpcList.method949(local66); NpcList.method879(local66); - PathFinder.collisionMaps[Player.level].flagScenery(local66.xFine >> 7, false, local66.zFine >> 7, local66.getSize(), local66.getSize()); + PathFinder.collisionMaps[Player.plane].flagScenery(local66.xFine >> 7, false, local66.zFine >> 7, local66.getSize(), local66.getSize()); } } }