diff --git a/client/src/main/java/rt4/Camera.java b/client/src/main/java/rt4/Camera.java index 29b65b3d..6ff72f93 100644 --- a/client/src/main/java/rt4/Camera.java +++ b/client/src/main/java/rt4/Camera.java @@ -120,7 +120,7 @@ public class Camera { 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; - if (local80 < 3 && (SceneGraph.tileFlags[1][local64][local73] & 0x2) == 2) { + if (local80 < 3 && (SceneGraph.renderFlags[1][local64][local73] & 0x2) == 2) { local80++; } @Pc(117) int local117 = (SceneGraph.aByteArrayArrayArray13[local80][local64][local73] & 0xFF) * 8 + local43 - SceneGraph.tileHeights[local80][local64][local73]; diff --git a/client/src/main/java/rt4/Loc.java b/client/src/main/java/rt4/Loc.java index f72aabbb..5294b02e 100644 --- a/client/src/main/java/rt4/Loc.java +++ b/client/src/main/java/rt4/Loc.java @@ -279,7 +279,7 @@ public final class Loc extends Entity { private Entity method1048(@OriginalArg(0) boolean arg0) { @Pc(12) boolean local12 = SceneGraph.surfaceTileHeights != SceneGraph.tileHeights; @Pc(19) LocType local19 = LocTypeList.get(this.anInt1299); - @Pc(22) int local22 = local19.anInt4430; + @Pc(22) int local22 = local19.anim; if (local19.multiLocs != null) { local19 = local19.getMultiLoc(); } @@ -290,9 +290,9 @@ public final class Loc extends Entity { return null; } @Pc(69) int local69; - if (client.game != 0 && this.aBoolean80 && (this.aClass144_2 == null || this.aClass144_2 != null && this.aClass144_2.id != local19.anInt4430)) { - local69 = local19.anInt4430; - if (local19.anInt4430 == -1) { + if (client.game != 0 && this.aBoolean80 && (this.aClass144_2 == null || this.aClass144_2 != null && this.aClass144_2.id != local19.anim)) { + local69 = local19.anim; + if (local19.anim == -1) { local69 = local22; } if (local69 == -1) { diff --git a/client/src/main/java/rt4/LocType.java b/client/src/main/java/rt4/LocType.java index f746e8d7..0bd859d9 100644 --- a/client/src/main/java/rt4/LocType.java +++ b/client/src/main/java/rt4/LocType.java @@ -8,27 +8,57 @@ import org.openrs2.deob.annotation.Pc; @OriginalClass("client!pb") public final class LocType { + public static final int WALL_STRAIGHT = 0; + public static final int WALL_DIAGONALCORNER = 1; + public static final int WALL_L = 2; + public static final int WALL_SQUARECORNER = 3; + public static final int WALL_DIAGONAL = 9; + + public static final int WALLDECOR_STRAIGHT_XOFFSET = 4; + public static final int WALLDECOR_STRAIGHT_ZOFFSET = 5; + public static final int WALLDECOR_DIAGONAL_XOFFSET = 6; + public static final int WALLDECOR_DIAGONAL_ZOFFSET = 7; + public static final int WALLDECOR_DIAGONAL_BOTH = 8; + + public static final int ROOF_STRAIGHT = 12; + public static final int ROOF_DIAGONAL_WITH_ROOFEDGE = 13; + public static final int ROOF_DIAGONAL = 14; + public static final int ROOF_L_CONCAVE = 15; + public static final int ROOF_L_CONVEX = 16; + public static final int ROOF_FLAT = 17; + + public static final int ROOFEDGE_STRAIGHT = 18; + public static final int ROOFEDGE_DIAGONALCORNER = 19; + public static final int ROOFEDGE_L = 20; + public static final int ROOFEDGE_SQUARECORNER = 21; + + public static final int CENTREPIECE_STRAIGHT = 10; + public static final int CENTREPIECE_DIAGONAL = 11; + public static final int GROUNDDECOR = 22; + @OriginalMember(owner = "client!wf", name = "o", descriptor = "[Lclient!gb;") 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(); + @OriginalMember(owner = "client!pb", name = "a", descriptor = "[S") - private short[] retextureSource; + private short[] retex_d; @OriginalMember(owner = "client!pb", name = "b", descriptor = "[S") - private short[] recolorSource; + private short[] recol_s; @OriginalMember(owner = "client!pb", name = "n", descriptor = "[I") private int[] shapes; @OriginalMember(owner = "client!pb", name = "v", descriptor = "[S") - private short[] retextureDestination; + private short[] retex_s; @OriginalMember(owner = "client!pb", name = "B", descriptor = "Lclient!sc;") private HashTable params; @OriginalMember(owner = "client!pb", name = "H", descriptor = "[S") - private short[] recolorDestination; + private short[] recol_d; @OriginalMember(owner = "client!pb", name = "P", descriptor = "[B") private byte[] aByteArray63; @@ -49,7 +79,7 @@ public final class LocType { public int width = 1; @OriginalMember(owner = "client!pb", name = "i", descriptor = "Z") - public boolean aBoolean206 = false; + public boolean forcedecor = false; @OriginalMember(owner = "client!pb", name = "l", descriptor = "I") public int length = 1; @@ -58,7 +88,7 @@ public final class LocType { public boolean aBoolean211 = false; @OriginalMember(owner = "client!pb", name = "u", descriptor = "I") - private int anInt4407 = 0; + private int ambient = 0; @OriginalMember(owner = "client!gg", name = "W", descriptor = "Lclient!na;") public static final JagString aClass100_475 = JagString.parse("null"); @@ -78,7 +108,7 @@ public final class LocType { public int mapSceneId = -1; @OriginalMember(owner = "client!pb", name = "G", descriptor = "B") - private byte aByte15 = 0; + private byte hillskew = 0; @OriginalMember(owner = "client!pb", name = "r", descriptor = "Z") public boolean members = false; @@ -93,7 +123,7 @@ public final class LocType { public int anInt4419 = 0; @OriginalMember(owner = "client!pb", name = "h", descriptor = "I") - public int mapElement = -1; + public int mapfunction = -1; @OriginalMember(owner = "client!pb", name = "L", descriptor = "Z") public boolean aBoolean214 = false; @@ -123,13 +153,13 @@ public final class LocType { public boolean breakroutefinding = false; @OriginalMember(owner = "client!pb", name = "kb", descriptor = "I") - public int anInt4429 = -1; + public int interactive = -1; @OriginalMember(owner = "client!pb", name = "lb", descriptor = "Z") public boolean aBoolean216 = false; @OriginalMember(owner = "client!pb", name = "fb", descriptor = "Z") - public boolean aBoolean215 = true; + public boolean active = true; @OriginalMember(owner = "client!pb", name = "nb", descriptor = "I") private int multiLocVarp = -1; @@ -138,10 +168,10 @@ public final class LocType { public int cursor2 = -1; @OriginalMember(owner = "client!pb", name = "pb", descriptor = "I") - public int blockedSides = 0; + public int blockSides = 0; @OriginalMember(owner = "client!pb", name = "m", descriptor = "Z") - public boolean aBoolean207 = true; + public boolean blockrange = true; @OriginalMember(owner = "client!pb", name = "qb", descriptor = "I") private int translateZ = 0; @@ -150,7 +180,7 @@ public final class LocType { public int mapSceneAngleOffset = 0; @OriginalMember(owner = "client!pb", name = "jb", descriptor = "I") - public int wallDecorOffsetScale = 16; + public int walloff = 16; @OriginalMember(owner = "client!pb", name = "tb", descriptor = "Z") public boolean mapSceneRotated = false; @@ -162,10 +192,10 @@ public final class LocType { public int soundRadius = 0; @OriginalMember(owner = "client!pb", name = "p", descriptor = "I") - private int anInt4405 = 0; + private int contrast = 0; @OriginalMember(owner = "client!pb", name = "mb", descriptor = "I") - public int anInt4430 = -1; + public int anim = -1; @OriginalMember(owner = "client!pb", name = "I", descriptor = "Z") public boolean aBoolean213 = false; @@ -174,10 +204,10 @@ public final class LocType { public int sound = -1; @OriginalMember(owner = "client!pb", name = "ub", descriptor = "I") - public int anInt4435 = 2; + public int blockwalk = 2; @OriginalMember(owner = "client!pb", name = "sb", descriptor = "Z") - private boolean aBoolean217 = false; + private boolean mirror = false; @OriginalMember(owner = "client!pb", name = "gb", descriptor = "I") private int multiLocVarbit = -1; @@ -186,10 +216,10 @@ public final class LocType { public int anInt4438 = -1; @OriginalMember(owner = "client!pb", name = "zb", descriptor = "Z") - private boolean aBoolean219 = false; + private boolean computeVertexColors = false; @OriginalMember(owner = "client!pb", name = "Ab", descriptor = "Z") - public boolean aBoolean220 = false; + public boolean occlude = false; @OriginalMember(owner = "client!pb", name = "a", descriptor = "(II)Z") public final boolean isReady(@OriginalArg(1) int arg0) { @@ -232,7 +262,7 @@ public final class LocType { @OriginalMember(owner = "client!pb", name = "a", descriptor = "(III)Lclient!gb;") private RawModel method3418(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) { @Pc(7) RawModel local7 = null; - @Pc(10) boolean local10 = this.aBoolean217; + @Pc(10) boolean local10 = this.mirror; if (arg1 == 2 && arg0 > 3) { local10 = !local10; } @@ -300,7 +330,7 @@ public final class LocType { local211 = this.resizeX != 128 || this.resizeY != 128 || this.resizeZ != 128; @Pc(230) boolean local230; local230 = this.translateX != 0 || this.translateY != 0 || this.translateZ != 0; - @Pc(265) RawModel local265 = new RawModel(local7, arg0 == 0 && !local211 && !local230, this.recolorSource == null, this.retextureSource == null, true); + @Pc(265) RawModel local265 = new RawModel(local7, arg0 == 0 && !local211 && !local230, this.recol_s == null, this.retex_d == null, true); if (arg1 == 4 && arg0 > 3) { local265.method1682(); local265.translate(45, 0, -45); @@ -314,18 +344,18 @@ public final class LocType { local265.method1689(); } @Pc(315) int local315; - if (this.recolorSource != null) { - for (local315 = 0; local315 < this.recolorSource.length; local315++) { + if (this.recol_s != null) { + for (local315 = 0; local315 < this.recol_s.length; local315++) { if (this.aByteArray63 == null || this.aByteArray63.length <= local315) { - local265.recolor(this.recolorSource[local315], this.recolorDestination[local315]); + local265.recolor(this.recol_s[local315], this.recol_d[local315]); } else { - local265.recolor(this.recolorSource[local315], client.aShortArray19[this.aByteArray63[local315] & 0xFF]); + local265.recolor(this.recol_s[local315], client.aShortArray19[this.aByteArray63[local315] & 0xFF]); } } } - if (this.retextureSource != null) { - for (local315 = 0; local315 < this.retextureSource.length; local315++) { - local265.retexture(this.retextureSource[local315], this.retextureDestination[local315]); + if (this.retex_d != null) { + for (local315 = 0; local315 < this.retex_d.length; local315++) { + local265.retexture(this.retex_d[local315], this.retex_s[local315]); } } if (local211) { @@ -339,20 +369,20 @@ public final class LocType { @OriginalMember(owner = "client!pb", name = "c", descriptor = "(I)V") public final void postDecode() { - if (this.anInt4429 == -1) { - this.anInt4429 = 0; + if (this.interactive == -1) { + this.interactive = 0; if (this.models != null && (this.shapes == null || this.shapes[0] == 10)) { - this.anInt4429 = 1; + this.interactive = 1; } for (@Pc(30) int local30 = 0; local30 < 5; local30++) { if (this.ops[local30] != null) { - this.anInt4429 = 1; + this.interactive = 1; break; } } } if (this.anInt4438 == -1) { - this.anInt4438 = this.anInt4435 == 0 ? 0 : 1; + this.anInt4438 = this.blockwalk == 0 ? 0 : 1; } } @@ -394,208 +424,208 @@ public final class LocType { } @OriginalMember(owner = "client!pb", name = "a", descriptor = "(Lclient!wa;II)V") - private void decode(@OriginalArg(0) Buffer arg0, @OriginalArg(1) int arg1) { - @Pc(18) int defaultMultiLoc; + private void decode(@OriginalArg(0) Buffer buffer, @OriginalArg(1) int opcode) { + @Pc(18) int count; @Pc(38) int len; - if (arg1 == 1) { - defaultMultiLoc = arg0.g1(); - if (defaultMultiLoc > 0) { + if (opcode == 1) { + count = buffer.g1(); + if (count > 0) { if (this.models == null || SceneGraph.aBoolean130) { - this.shapes = new int[defaultMultiLoc]; - this.models = new int[defaultMultiLoc]; - for (len = 0; len < defaultMultiLoc; len++) { - this.models[len] = arg0.g2(); - this.shapes[len] = arg0.g1(); + this.shapes = new int[count]; + this.models = new int[count]; + for (len = 0; len < count; len++) { + this.models[len] = buffer.g2(); + this.shapes[len] = buffer.g1(); } } else { - arg0.offset += defaultMultiLoc * 3; + buffer.offset += count * 3; } } - } else if (arg1 == 2) { - this.name = arg0.gjstr(); - } else if (arg1 == 5) { - defaultMultiLoc = arg0.g1(); - if (defaultMultiLoc > 0) { + } else if (opcode == 2) { + this.name = buffer.gjstr(); + } else if (opcode == 5) { + count = buffer.g1(); + if (count > 0) { if (this.models == null || SceneGraph.aBoolean130) { - this.models = new int[defaultMultiLoc]; + this.models = new int[count]; this.shapes = null; - for (len = 0; len < defaultMultiLoc; len++) { - this.models[len] = arg0.g2(); + for (len = 0; len < count; len++) { + this.models[len] = buffer.g2(); } } else { - arg0.offset += defaultMultiLoc * 2; + buffer.offset += count * 2; } } - } else if (arg1 == 14) { - this.width = arg0.g1(); - } else if (arg1 == 15) { - this.length = arg0.g1(); - } else if (arg1 == 17) { - this.anInt4435 = 0; - this.aBoolean207 = false; - } else if (arg1 == 18) { - this.aBoolean207 = false; - } else if (arg1 == 19) { - this.anInt4429 = arg0.g1(); - } else if (arg1 == 21) { - this.aByte15 = 1; - } else if (arg1 == 22) { - this.aBoolean219 = true; - } else if (arg1 == 23) { - this.aBoolean220 = true; - } else if (arg1 == 24) { - this.anInt4430 = arg0.g2(); - if (this.anInt4430 == 65535) { - this.anInt4430 = -1; + } else if (opcode == 14) { + this.width = buffer.g1(); + } else if (opcode == 15) { + this.length = buffer.g1(); + } else if (opcode == 17) { + this.blockwalk = 0; + this.blockrange = false; + } else if (opcode == 18) { + this.blockrange = false; + } else if (opcode == 19) { + this.interactive = buffer.g1(); + } else if (opcode == 21) { + this.hillskew = 1; + } else if (opcode == 22) { // sharelight + this.computeVertexColors = true; + } else if (opcode == 23) { + this.occlude = true; + } else if (opcode == 24) { + this.anim = buffer.g2(); + if (this.anim == 65535) { + this.anim = -1; } - } else if (arg1 == 27) { - this.anInt4435 = 1; - } else if (arg1 == 28) { - this.wallDecorOffsetScale = arg0.g1(); - } else if (arg1 == 29) { - this.anInt4407 = arg0.g1b(); - } else if (arg1 == 39) { - this.anInt4405 = arg0.g1b() * 5; - } else if (arg1 >= 30 && arg1 < 35) { - this.ops[arg1 - 30] = arg0.gjstr(); - if (this.ops[arg1 - 30].equalsIgnoreCase(LocalizedText.HIDDEN)) { - this.ops[arg1 - 30] = null; + } else if (opcode == 27) { + this.blockwalk = 1; + } else if (opcode == 28) { + this.walloff = buffer.g1(); + } else if (opcode == 29) { + this.ambient = buffer.g1b(); + } else if (opcode == 39) { + this.contrast = buffer.g1b() * 5; + } else if (opcode >= 30 && opcode < 35) { + this.ops[opcode - 30] = buffer.gjstr(); + if (this.ops[opcode - 30].equalsIgnoreCase(LocalizedText.HIDDEN)) { + this.ops[opcode - 30] = null; } - } else if (arg1 == 40) { - defaultMultiLoc = arg0.g1(); - this.recolorSource = new short[defaultMultiLoc]; - this.recolorDestination = new short[defaultMultiLoc]; - for (len = 0; len < defaultMultiLoc; len++) { - this.recolorSource[len] = (short) arg0.g2(); - this.recolorDestination[len] = (short) arg0.g2(); + } else if (opcode == 40) { + count = buffer.g1(); + this.recol_s = new short[count]; + this.recol_d = new short[count]; + for (len = 0; len < count; len++) { + this.recol_s[len] = (short) buffer.g2(); + this.recol_d[len] = (short) buffer.g2(); } - } else if (arg1 == 41) { - defaultMultiLoc = arg0.g1(); - this.retextureDestination = new short[defaultMultiLoc]; - this.retextureSource = new short[defaultMultiLoc]; - for (len = 0; len < defaultMultiLoc; len++) { - this.retextureSource[len] = (short) arg0.g2(); - this.retextureDestination[len] = (short) arg0.g2(); + } else if (opcode == 41) { + count = buffer.g1(); + this.retex_s = new short[count]; + this.retex_d = new short[count]; + for (len = 0; len < count; len++) { + this.retex_d[len] = (short) buffer.g2(); + this.retex_s[len] = (short) buffer.g2(); } - } else if (arg1 == 42) { - defaultMultiLoc = arg0.g1(); - this.aByteArray63 = new byte[defaultMultiLoc]; - for (len = 0; len < defaultMultiLoc; len++) { - this.aByteArray63[len] = arg0.g1b(); + } else if (opcode == 42) { + count = buffer.g1(); + this.aByteArray63 = new byte[count]; + for (len = 0; len < count; len++) { + this.aByteArray63[len] = buffer.g1b(); } - } else if (arg1 == 60) { - this.mapElement = arg0.g2(); - } else if (arg1 == 62) { - this.aBoolean217 = true; - } else if (arg1 == 64) { - this.aBoolean215 = false; - } else if (arg1 == 65) { - this.resizeX = arg0.g2(); - } else if (arg1 == 66) { - this.resizeY = arg0.g2(); - } else if (arg1 == 67) { - this.resizeZ = arg0.g2(); - } else if (arg1 == 69) { - this.blockedSides = arg0.g1(); - } else if (arg1 == 70) { - this.translateX = arg0.g2b(); - } else if (arg1 == 71) { - this.translateY = arg0.g2b(); - } else if (arg1 == 72) { - this.translateZ = arg0.g2b(); - } else if (arg1 == 73) { - this.aBoolean206 = true; - } else if (arg1 == 74) { + } else if (opcode == 60) { + this.mapfunction = buffer.g2(); + } else if (opcode == 62) { + this.mirror = true; + } else if (opcode == 64) { + this.active = false; + } else if (opcode == 65) { + this.resizeX = buffer.g2(); + } else if (opcode == 66) { + this.resizeY = buffer.g2(); + } else if (opcode == 67) { + this.resizeZ = buffer.g2(); + } else if (opcode == 69) { + this.blockSides = buffer.g1(); + } else if (opcode == 70) { // xoff + this.translateX = buffer.g2b(); + } else if (opcode == 71) { // yoff + this.translateY = buffer.g2b(); + } else if (opcode == 72) { // zoff + this.translateZ = buffer.g2b(); + } else if (opcode == 73) { + this.forcedecor = true; + } else if (opcode == 74) { this.breakroutefinding = true; - } else if (arg1 == 75) { - this.anInt4438 = arg0.g1(); - } else if (arg1 == 77 || arg1 == 92) { - defaultMultiLoc = -1; - this.multiLocVarbit = arg0.g2(); + } else if (opcode == 75) { + this.anInt4438 = buffer.g1(); + } else if (opcode == 77 || opcode == 92) { + count = -1; + this.multiLocVarbit = buffer.g2(); if (this.multiLocVarbit == 65535) { this.multiLocVarbit = -1; } - this.multiLocVarp = arg0.g2(); + this.multiLocVarp = buffer.g2(); if (this.multiLocVarp == 65535) { this.multiLocVarp = -1; } - if (arg1 == 92) { - defaultMultiLoc = arg0.g2(); - if (defaultMultiLoc == 65535) { - defaultMultiLoc = -1; + if (opcode == 92) { + count = buffer.g2(); + if (count == 65535) { + count = -1; } } - len = arg0.g1(); + len = buffer.g1(); this.multiLocs = new int[len + 2]; for (@Pc(790) int local790 = 0; local790 <= len; local790++) { - this.multiLocs[local790] = arg0.g2(); + this.multiLocs[local790] = buffer.g2(); if (this.multiLocs[local790] == 65535) { this.multiLocs[local790] = -1; } } - this.multiLocs[len + 1] = defaultMultiLoc; - } else if (arg1 == 78) { - this.sound = arg0.g2(); - this.soundRadius = arg0.g1(); - } else if (arg1 == 79) { - this.anInt4419 = arg0.g2(); - this.anInt4414 = arg0.g2(); - this.soundRadius = arg0.g1(); - defaultMultiLoc = arg0.g1(); - this.anIntArray381 = new int[defaultMultiLoc]; - for (len = 0; len < defaultMultiLoc; len++) { - this.anIntArray381[len] = arg0.g2(); + this.multiLocs[len + 1] = count; + } else if (opcode == 78) { + this.sound = buffer.g2(); + this.soundRadius = buffer.g1(); + } else if (opcode == 79) { + this.anInt4419 = buffer.g2(); + this.anInt4414 = buffer.g2(); + this.soundRadius = buffer.g1(); + count = buffer.g1(); + this.anIntArray381 = new int[count]; + for (len = 0; len < count; len++) { + this.anIntArray381[len] = buffer.g2(); } - } else if (arg1 == 81) { - this.aByte15 = 2; - this.aShort26 = (short) (arg0.g1() * 256); - } else if (arg1 == 82) { + } else if (opcode == 81) { + this.hillskew = 2; + this.aShort26 = (short) (buffer.g1() * 256); + } else if (opcode == 82) { this.aBoolean216 = true; - } else if (arg1 == 88) { + } else if (opcode == 88) { this.aBoolean212 = false; - } else if (arg1 == 89) { + } else if (opcode == 89) { this.aBoolean209 = false; - } else if (arg1 == 90) { + } else if (opcode == 90) { this.aBoolean211 = true; - } else if (arg1 == 91) { + } else if (opcode == 91) { this.members = true; - } else if (arg1 == 93) { - this.aByte15 = 3; - this.aShort26 = (short) arg0.g2(); - } else if (arg1 == 94) { - this.aByte15 = 4; - } else if (arg1 == 95) { - this.aByte15 = 5; - } else if (arg1 == 96) { + } else if (opcode == 93) { + this.hillskew = 3; + this.aShort26 = (short) buffer.g2(); + } else if (opcode == 94) { + this.hillskew = 4; + } else if (opcode == 95) { + this.hillskew = 5; + } else if (opcode == 96) { this.aBoolean213 = true; - } else if (arg1 == 97) { + } else if (opcode == 97) { this.mapSceneRotated = true; - } else if (arg1 == 98) { + } else if (opcode == 98) { this.aBoolean214 = true; - } else if (arg1 == 99) { - this.cursor1Op = arg0.g1(); - this.cursor1 = arg0.g2(); - } else if (arg1 == 100) { - this.cursor2Op = arg0.g1(); - this.cursor2 = arg0.g2(); - } else if (arg1 == 101) { - this.mapSceneAngleOffset = arg0.g1(); - } else if (arg1 == 102) { - this.mapSceneId = arg0.g2(); - } else if (arg1 == 249) { - defaultMultiLoc = arg0.g1(); + } else if (opcode == 99) { + this.cursor1Op = buffer.g1(); + this.cursor1 = buffer.g2(); + } else if (opcode == 100) { + this.cursor2Op = buffer.g1(); + this.cursor2 = buffer.g2(); + } else if (opcode == 101) { + this.mapSceneAngleOffset = buffer.g1(); + } else if (opcode == 102) { + this.mapSceneId = buffer.g2(); + } else if (opcode == 249) { + count = buffer.g1(); if (this.params == null) { - len = IntUtils.clp2(defaultMultiLoc); + len = IntUtils.clp2(count); this.params = new HashTable(len); } - for (len = 0; len < defaultMultiLoc; len++) { - @Pc(576) boolean local576 = arg0.g1() == 1; - @Pc(580) int local580 = arg0.g3(); + for (len = 0; len < count; len++) { + @Pc(576) boolean local576 = buffer.g1() == 1; + @Pc(580) int local580 = buffer.g3(); @Pc(589) Node local589; if (local576) { - local589 = new StringNode(arg0.gjstr()); + local589 = new StringNode(buffer.gjstr()); } else { - local589 = new IntNode(arg0.g4()); + local589 = new IntNode(buffer.g4()); } this.params.put(local589, local580); } @@ -616,8 +646,8 @@ public final class LocType { @OriginalMember(owner = "client!pb", name = "a", descriptor = "(IZZI)Lclient!td;") private GlModel method3427(@OriginalArg(0) int arg0, @OriginalArg(1) boolean arg1, @OriginalArg(3) int arg2) { - @Pc(10) int local10 = this.anInt4407 + 64; - @Pc(17) int local17 = this.anInt4405 * 5 + 768; + @Pc(10) int local10 = this.ambient + 64; + @Pc(17) int local17 = this.contrast * 5 + 768; @Pc(79) GlModel local79; @Pc(24) int local24; @Pc(177) int local177; @@ -683,13 +713,13 @@ public final class LocType { LocTypeList.aClass99_24.put(local79, local26); } } - @Pc(236) boolean local236 = this.aBoolean217; + @Pc(236) boolean local236 = this.mirror; if (arg2 == 2 && arg0 > 3) { local236 = !local236; } @Pc(264) boolean local264 = this.resizeY == 128 && this.translateY == 0; @Pc(294) boolean local294 = arg0 == 0 && this.resizeX == 128 && this.resizeZ == 128 && this.translateX == 0 && this.translateZ == 0 && !local236; - @Pc(351) GlModel local351 = local79.method4117(local294, local264, this.recolorSource == null, local79.method4094() == local10, arg0 == 0 && !local236, true, local17 == local79.method4115(), !local236, this.retextureSource == null); + @Pc(351) GlModel local351 = local79.method4117(local294, local264, this.recol_s == null, local79.method4094() == local10, arg0 == 0 && !local236, true, local17 == local79.method4115(), !local236, this.retex_d == null); if (local236) { local351.method4122(); } @@ -705,14 +735,14 @@ public final class LocType { } else if (local374 == 3) { local351.method4093(); } - if (this.recolorSource != null) { - for (local177 = 0; local177 < this.recolorSource.length; local177++) { - local351.method4109(this.recolorSource[local177], this.recolorDestination[local177]); + if (this.recol_s != null) { + for (local177 = 0; local177 < this.recol_s.length; local177++) { + local351.method4109(this.recol_s[local177], this.recol_d[local177]); } } - if (this.retextureSource != null) { - for (local177 = 0; local177 < this.retextureSource.length; local177++) { - local351.method4107(this.retextureSource[local177], this.retextureDestination[local177]); + if (this.retex_d != null) { + for (local177 = 0; local177 < this.retex_d.length; local177++) { + local351.method4107(this.retex_d[local177], this.retex_s[local177]); } } if (this.resizeX != 128 || this.resizeY != 128 || this.resizeZ != 128) { @@ -765,12 +795,12 @@ public final class LocType { local235 = (GlModel) local225.aClass8_10; local265 = local225.aClass36_Sub1_3; } - @Pc(298) boolean local298 = this.aBoolean219 & arg6; - @Pc(330) GlModel local330 = local235.method4117(this.aByte15 != 3, this.aByte15 == 0, true, true, true, !local298, true, true, true); - if (this.aByte15 != 0) { - local330.method4110(this.aByte15, this.aShort26, local235, arg2, arg5, arg1, arg4, arg9); + @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); + if (this.hillskew != 0) { + local330.method4110(this.hillskew, this.aShort26, local235, arg2, arg5, arg1, arg4, arg9); } - local330.method4111(this.anInt4429 == 0 && !this.aBoolean214, true, true, this.anInt4429 == 0, true, false); + local330.method4111(this.interactive == 0 && !this.aBoolean214, true, true, this.interactive == 0, true, false); aClass139_1.aClass8_10 = local330; local330.aBoolean259 = local298; aClass139_1.aClass36_Sub1_3 = local265; @@ -782,7 +812,7 @@ public final class LocType { local29 = (arg3 << 3) + ((this.id << 10) + arg0); } @Pc(50) boolean local50; - if (arg6 && this.aBoolean219) { + if (arg6 && this.computeVertexColors) { local29 |= Long.MIN_VALUE; local50 = true; } else { @@ -800,23 +830,23 @@ public final class LocType { local69.method1682(); } if (local50) { - local69.aShort19 = (short) (this.anInt4407 + 64); + local69.aShort19 = (short) (this.ambient + 64); local60 = local69; - local69.aShort18 = (short) (this.anInt4405 * 5 + 768); + local69.aShort18 = (short) (this.contrast * 5 + 768); local69.calculateNormals(); } else { - local60 = new SoftwareModel(local69, this.anInt4407 + 64, this.anInt4405 * 5 + 768, -50, -10, -50); + local60 = new SoftwareModel(local69, this.ambient + 64, this.contrast * 5 + 768, -50, -10, -50); } LocTypeList.aClass99_14.put(local60, local29); } if (local50) { local60 = ((RawModel) local60).method1675(); } - if (this.aByte15 != 0) { + if (this.hillskew != 0) { if (local60 instanceof SoftwareModel) { - local60 = ((SoftwareModel) local60).method4586(this.aByte15, this.aShort26, arg2, arg5, arg1, arg4, arg9, true); + local60 = ((SoftwareModel) local60).method4586(this.hillskew, this.aShort26, arg2, arg5, arg1, arg4, arg9, true); } else if (local60 instanceof RawModel) { - local60 = ((RawModel) local60).method1670(this.aByte15, this.aShort26, arg2, arg5, arg1, arg4, arg9); + local60 = ((RawModel) local60).method1670(this.hillskew, this.aShort26, arg2, arg5, arg1, arg4, arg9); } } aClass139_1.aClass8_10 = local60; @@ -838,7 +868,7 @@ public final class LocType { if (local204 == null) { return null; } - local195 = new SoftwareModel(local204, this.anInt4407 + 64, this.anInt4405 * 5 + 768, -50, -10, -50); + local195 = new SoftwareModel(local204, this.ambient + 64, this.contrast * 5 + 768, -50, -10, -50); LocTypeList.aClass99_36.put(local195, local30); } @Pc(234) boolean local234 = false; @@ -853,11 +883,11 @@ public final class LocType { } local195.method4554(256); } - if (this.aByte15 != 0) { + if (this.hillskew != 0) { if (!local234) { local195 = (SoftwareModel) local195.method4568(true, true, true); } - local195 = local195.method4586(this.aByte15, this.aShort26, arg6, arg9, arg1, arg3, arg0, false); + local195 = local195.method4586(this.hillskew, this.aShort26, arg6, arg9, arg1, arg3, arg0, false); } aClass139_1.aClass8_10 = local195; return aClass139_1; @@ -895,11 +925,11 @@ public final class LocType { } else { aClass139_1.aClass36_Sub1_3 = null; } - if (this.aByte15 != 0) { + if (this.hillskew != 0) { if (!local80) { local82 = (GlModel) local82.method4568(true, true, true); } - local82.method4110(this.aByte15, this.aShort26, local46, arg6, arg9, arg1, arg3, arg0); + local82.method4110(this.hillskew, this.aShort26, local46, arg6, arg9, arg1, arg3, arg0); } aClass139_1.aClass8_10 = local82; return aClass139_1; diff --git a/client/src/main/java/rt4/LocTypeList.java b/client/src/main/java/rt4/LocTypeList.java index 7eaad5a2..b1b212ee 100644 --- a/client/src/main/java/rt4/LocTypeList.java +++ b/client/src/main/java/rt4/LocTypeList.java @@ -37,8 +37,8 @@ public class LocTypeList { local15.ops = null; } if (local15.breakroutefinding) { - local15.anInt4435 = 0; - local15.aBoolean207 = false; + local15.blockwalk = 0; + local15.blockrange = false; } types.put(local15, id); return local15; diff --git a/client/src/main/java/rt4/LoginManager.java b/client/src/main/java/rt4/LoginManager.java index db0d85ed..53934dec 100644 --- a/client/src/main/java/rt4/LoginManager.java +++ b/client/src/main/java/rt4/LoginManager.java @@ -98,8 +98,6 @@ public class LoginManager { public static int[] locationsMapFileIds; @OriginalMember(owner = "client!bi", name = "Y", descriptor = "[[B") public static byte[][] underWaterLocationsMapFilesBuffer; - @OriginalMember(owner = "client!dc", name = "ab", descriptor = "I") - public static int centralPlane = 0; @OriginalMember(owner = "client!mh", name = "hb", descriptor = "Lclient!bn;") public static Map map; @OriginalMember(owner = "client!tb", name = "X", descriptor = "Lclient!se;") @@ -696,14 +694,14 @@ public class LoginManager { @OriginalMember(owner = "client!k", name = "a", descriptor = "(IIIIZIZ)V") public static void method2463(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) boolean arg4, @OriginalArg(5) int arg5) { - if (SceneGraph.centralZoneX == arg2 && arg1 == SceneGraph.centralZoneZ && (centralPlane == arg0 || SceneGraph.allLevelsAreVisible())) { + if (SceneGraph.centralZoneX == arg2 && arg1 == SceneGraph.centralZoneZ && (SceneGraph.centralPlane == arg0 || SceneGraph.allLevelsAreVisible())) { return; } SceneGraph.centralZoneX = arg2; SceneGraph.centralZoneZ = arg1; - centralPlane = arg0; + SceneGraph.centralPlane = arg0; if (SceneGraph.allLevelsAreVisible()) { - centralPlane = 0; + SceneGraph.centralPlane = 0; } if (arg4) { client.setGameState(28); @@ -876,7 +874,7 @@ public class LoginManager { @Pc(45) int local45 = (regionBitPacked[local25] >> 8) * 64 - Camera.originX; @Pc(56) int local56 = (regionBitPacked[local25] & 0xFF) * 64 - Camera.originZ; client.audioLoop(); - SceneGraph.method2437(local45, arg0, local32, local56, PathFinder.collisionMaps); + SceneGraph.readLocs(local45, arg0, local32, local56, PathFinder.collisionMaps); } } } @@ -1001,7 +999,7 @@ public class LoginManager { for (i = 0; i < 4; i++) { for (chunkX = 0; chunkX < 104; chunkX++) { for (chunkZ = 0; chunkZ < 104; chunkZ++) { - SceneGraph.tileFlags[i][chunkX][chunkZ] = 0; + SceneGraph.renderFlags[i][chunkX][chunkZ] = 0; } } } @@ -1181,7 +1179,7 @@ public class LoginManager { } while (local72 >= 103); } while (local68 >= 103); local95 = LocTypeList.get(local17); - } while (local78 == 22 && !Preferences.showGroundDecorations && local95.anInt4429 == 0 && local95.anInt4435 != 1 && !local95.aBoolean206); + } while (local78 == 22 && !Preferences.showGroundDecorations && local95.interactive == 0 && local95.blockwalk != 1 && !local95.forcedecor); local39 = true; if (!local95.isReady()) { local15 = false; @@ -1258,14 +1256,14 @@ public class LoginManager { @Pc(154) CollisionMap local154 = null; if (!arg7) { @Pc(159) int local159 = arg1; - if ((SceneGraph.tileFlags[1][local120][local137] & 0x2) == 2) { + if ((SceneGraph.renderFlags[1][local120][local137] & 0x2) == 2) { local159 = arg1 - 1; } if (local159 >= 0) { local154 = arg0[local159]; } } - SceneGraph.method3397(arg1, !arg7, arg1, arg7, local154, local7, local68, local120, local137, local72 + arg4 & 0x3); + SceneGraph.addLoc(arg1, !arg7, arg1, arg7, local154, local7, local68, local120, local137, local72 + arg4 & 0x3); } } } @@ -1337,7 +1335,7 @@ public class LoginManager { @Pc(129) int local129 = local103 & 0x3F; @Pc(142) int local142 = local129 + (regionBitPacked[local16] & 0xFF) * 64 - Camera.originZ; @Pc(148) NpcType local148 = NpcTypeList.get(local74.g2()); - if (NpcList.npcs[local97] == null && (local148.aByte10 & 0x1) > 0 && local107 == centralPlane && local125 >= 0 && local148.size + local125 < 104 && local142 >= 0 && local142 + local148.size < 104) { + if (NpcList.npcs[local97] == null && (local148.aByte10 & 0x1) > 0 && local107 == SceneGraph.centralPlane && local125 >= 0 && local148.size + local125 < 104 && local142 >= 0 && local142 + local148.size < 104) { NpcList.npcs[local97] = new Npc(); @Pc(198) Npc local198 = NpcList.npcs[local97]; NpcList.ids[NpcList.size++] = local97; diff --git a/client/src/main/java/rt4/MiniMap.java b/client/src/main/java/rt4/MiniMap.java index 30d2888b..80a6e97e 100644 --- a/client/src/main/java/rt4/MiniMap.java +++ b/client/src/main/java/rt4/MiniMap.java @@ -124,10 +124,10 @@ public class MiniMap { for (local37 = 1; local37 < 103; local37++) { local76 = 4 * 512 * (103 - local37) + 24628; for (local80 = 1; local80 < 103; local80++) { - if ((SceneGraph.tileFlags[arg0][local80][local37] & 0x18) == 0) { + if ((SceneGraph.renderFlags[arg0][local80][local37] & 0x18) == 0) { renderTile(local32, local76, arg0, local80, local37); } - if (arg0 < 3 && (SceneGraph.tileFlags[arg0 + 1][local80][local37] & 0x8) != 0) { + if (arg0 < 3 && (SceneGraph.renderFlags[arg0 + 1][local80][local37] & 0x8) != 0) { renderTile(local32, local76, arg0 + 1, local80, local37); } local76 += 4; @@ -139,14 +139,14 @@ public class MiniMap { @Pc(169) long local169 = SceneGraph.getGroundDecorKey(Player.level, local37 + 0, local76); if (local169 != 0L) { @Pc(184) LocType local184 = LocTypeList.get((int) (local169 >>> 32) & Integer.MAX_VALUE); - @Pc(187) int local187 = local184.mapElement; + @Pc(187) int local187 = local184.mapfunction; @Pc(194) int local194; if (local184.multiLocs != null) { for (local194 = 0; local194 < local184.multiLocs.length; local194++) { if (local184.multiLocs[local194] != -1) { @Pc(216) LocType local216 = LocTypeList.get(local184.multiLocs[local194]); - if (local216.mapElement >= 0) { - local187 = local216.mapElement; + if (local216.mapfunction >= 0) { + local187 = local216.mapfunction; break; } } @@ -187,7 +187,7 @@ public class MiniMap { local35 = (int) (Math.random() * 20.0D) + 238 - 10 << 16; for (local37 = 1; local37 < 103; local37++) { for (local76 = 1; local76 < 103; local76++) { - if ((SceneGraph.tileFlags[arg0][local76][local37] & 0x18) == 0 && !method3109(local76, local455, local37, local35, arg0)) { + if ((SceneGraph.renderFlags[arg0][local76][local37] & 0x18) == 0 && !method3109(local76, local455, local37, local35, arg0)) { if (GlRenderer.enabled) { SoftwareRaster.pixels = null; } else { @@ -195,7 +195,7 @@ public class MiniMap { } return false; } - if (arg0 < 3 && (SceneGraph.tileFlags[arg0 + 1][local76][local37] & 0x8) != 0 && !method3109(local76, local455, local37, local35, arg0 + 1)) { + if (arg0 < 3 && (SceneGraph.renderFlags[arg0 + 1][local76][local37] & 0x8) != 0 && !method3109(local76, local455, local37, local35, arg0 + 1)) { if (GlRenderer.enabled) { SoftwareRaster.pixels = null; } else { @@ -297,11 +297,11 @@ public class MiniMap { @Pc(382) LocType local382 = LocTypeList.get(locId[local146]); if (local382.multiLocs != null) { local382 = local382.getMultiLoc(); - if (local382 == null || local382.mapElement == -1) { + if (local382 == null || local382.mapfunction == -1) { continue; } } - method1446(arg3, Sprites.mapfuncs[local382.mapElement], local150, local181, arg1, arg2); + method1446(arg3, Sprites.mapfuncs[local382.mapfunction], local150, local181, arg1, arg2); } for (local146 = 0; local146 < 104; local146++) { for (local181 = 0; local181 < 104; local181++) { diff --git a/client/src/main/java/rt4/PathFinder.java b/client/src/main/java/rt4/PathFinder.java index 48ee63e6..5c1f6815 100644 --- a/client/src/main/java/rt4/PathFinder.java +++ b/client/src/main/java/rt4/PathFinder.java @@ -637,7 +637,7 @@ public class PathFinder { local59 = local46.width; local62 = local46.length; } - @Pc(73) int local73 = local46.blockedSides; + @Pc(73) int local73 = local46.blockSides; if (angle != 0) { local73 = (local73 << angle & 0xF) + (local73 >> 4 - angle); } diff --git a/client/src/main/java/rt4/SceneGraph.java b/client/src/main/java/rt4/SceneGraph.java index 2087bcb0..ee6de3b2 100644 --- a/client/src/main/java/rt4/SceneGraph.java +++ b/client/src/main/java/rt4/SceneGraph.java @@ -6,18 +6,19 @@ import org.openrs2.deob.annotation.OriginalMember; import org.openrs2.deob.annotation.Pc; public class SceneGraph { + @OriginalMember(owner = "client!bb", name = "g", descriptor = "[[[B") - public static final byte[][][] tileFlags = new byte[4][104][104]; + public static final byte[][][] renderFlags = new byte[4][104][104]; @OriginalMember(owner = "client!mi", name = "Y", descriptor = "[[[Lclient!ih;") public static final LinkedList[][][] objStacks = new LinkedList[4][104][104]; @OriginalMember(owner = "client!te", name = "B", descriptor = "[I") - public static final int[] anIntArray469 = new int[]{0, -1, 0, 1}; + public static final int[] WALL_DECO_ROT_SIZE_Y_DIR = new int[]{0, -1, 0, 1}; @OriginalMember(owner = "client!fb", name = "q", descriptor = "[I") public static final int[] anIntArray154 = new int[]{-1, -1, 1, 1}; @OriginalMember(owner = "client!j", name = "O", descriptor = "[I") public static final int[] anIntArray565 = new int[]{1, -1, -1, 1}; @OriginalMember(owner = "client!vl", name = "e", descriptor = "[I") - public static final int[] anIntArray517 = new int[]{1, 2, 4, 8}; + public static final int[] WALL_ROTATION_TYPE1 = new int[]{1, 2, 4, 8}; @OriginalMember(owner = "client!pg", name = "T", descriptor = "[I") public static final int[] anIntArray386 = new int[]{76, 8, 137, 4, 0, 1, 38, 2, 19}; @OriginalMember(owner = "client!rj", name = "U", descriptor = "Lclient!ih;") @@ -27,7 +28,7 @@ public class SceneGraph { @OriginalMember(owner = "client!ec", name = "B", descriptor = "[[I") public static final int[][] anIntArrayArray8 = new int[][]{new int[0], {128, 0, 128, 128, 0, 128}, {0, 0, 128, 0, 128, 128, 64, 128}, {0, 128, 0, 0, 128, 0, 64, 128}, {0, 0, 64, 128, 0, 128}, {128, 128, 64, 128, 128, 0}, {64, 0, 128, 0, 128, 128, 64, 128}, {128, 0, 128, 128, 0, 128, 0, 64, 64, 0}, {0, 0, 64, 0, 0, 64}, {0, 0, 128, 0, 128, 128, 64, 96, 32, 64}, {0, 128, 0, 0, 32, 64, 64, 96, 128, 128}, {0, 128, 0, 0, 32, 32, 96, 32, 128, 0, 128, 128}}; @OriginalMember(owner = "client!ck", name = "d", descriptor = "[I") - public static final int[] anIntArray80 = new int[]{1, 0, -1, 0}; + public static final int[] WALL_DECO_ROT_SIZE_X_DIR = new int[]{1, 0, -1, 0}; @OriginalMember(owner = "client!ka", name = "t", descriptor = "[I") public static final int[] anIntArray294 = new int[]{0, 0, 2, 0, 0, 2, 1, 1, 0}; @OriginalMember(owner = "client!uj", name = "A", descriptor = "[I") @@ -78,7 +79,7 @@ public class SceneGraph { @OriginalMember(owner = "client!ui", name = "eb", descriptor = "[[[B") public static byte[][][] tileUnderlays; @OriginalMember(owner = "client!em", name = "t", descriptor = "[[[I") - public static int[][][] anIntArrayArrayArray6; + public static int[][][] occludeFlags; @OriginalMember(owner = "client!ka", name = "r", descriptor = "[I") public static int[] rowCount; @OriginalMember(owner = "client!lg", name = "k", descriptor = "I") @@ -90,7 +91,7 @@ public class SceneGraph { @OriginalMember(owner = "client!s", name = "i", descriptor = "[I") public static int[] rowWeightedHue; @OriginalMember(owner = "client!jd", name = "d", descriptor = "[[[B") - public static byte[][][] aByteArrayArrayArray9; + public static byte[][][] shadowmap; @OriginalMember(owner = "client!wk", name = "v", descriptor = "[I") public static int[] rowLightness; @OriginalMember(owner = "client!ub", name = "h", descriptor = "[Lclient!pe;") @@ -191,6 +192,8 @@ public class SceneGraph { public static int centralZoneX; @OriginalMember(owner = "client!eb", name = "u", descriptor = "I") public static int centralZoneZ; + @OriginalMember(owner = "client!dc", name = "ab", descriptor = "I") + public static int centralPlane = 0; @OriginalMember(owner = "client!km", name = "f", descriptor = "(I)Z") public static boolean allLevelsAreVisible() { @@ -210,7 +213,7 @@ public class SceneGraph { @Pc(36) int xFine2 = xFine & 0x7F; @Pc(40) int zFine2 = zFine & 0x7F; @Pc(42) int virtualLevel = level; - if (level < 3 && (tileFlags[1][x][z] & 0x2) == 2) { + if (level < 3 && (renderFlags[1][x][z] & 0x2) == 2) { virtualLevel = level + 1; } @Pc(91) int heightZ0 = xFine2 * tileHeights[virtualLevel][x + 1][z + 1] + tileHeights[virtualLevel][x][z + 1] * (128 - xFine2) >> 7; @@ -342,8 +345,8 @@ public class SceneGraph { } tileShapes = new byte[plane][104][104]; rowCount = new int[104]; - anIntArrayArrayArray6 = new int[plane][105][105]; - aByteArrayArrayArray9 = new byte[plane][105][105]; + occludeFlags = new int[plane][105][105]; + shadowmap = new byte[plane][105][105]; tileOverlays = new byte[plane][104][104]; rowLightness = new int[104]; tileAngles = new byte[plane][104][104]; @@ -353,11 +356,11 @@ public class SceneGraph { @OriginalMember(owner = "client!ib", name = "b", descriptor = "(I)V") public static void unload() { rowChroma = null; - anIntArrayArrayArray6 = null; + occludeFlags = null; rowCount = null; tileShapes = null; tileAngles = null; - aByteArrayArrayArray9 = null; + shadowmap = null; tileOverlays = null; tileUnderlays = null; rowSaturation = null; @@ -474,7 +477,7 @@ public class SceneGraph { return; } if (!arg2) { - tileFlags[level][x][z] = 0; + renderFlags[level][x][z] = 0; } while (true) { opcode = buffer.g1(); @@ -511,7 +514,7 @@ public class SceneGraph { } else if (opcode > 81) { tileUnderlays[level][x][z] = (byte) (opcode - 81); } else if (!arg2) { - tileFlags[level][x][z] = (byte) (opcode - 49); + renderFlags[level][x][z] = (byte) (opcode - 49); } } } @@ -780,9 +783,9 @@ public class SceneGraph { for (level = 0; level < 4; level++) { for (x = 0; x < 104; x++) { for (@Pc(22) int z = 0; z < 104; z++) { - if ((tileFlags[level][x][z] & 0x1) == 1) { + if ((renderFlags[level][x][z] & 0x1) == 1) { @Pc(43) int transformedLevel = level; - if ((tileFlags[1][x][z] & 0x2) == 2) { + if ((renderFlags[1][x][z] & 0x2) == 2) { transformedLevel = level - 1; } if (transformedLevel >= 0) { @@ -830,7 +833,7 @@ public class SceneGraph { @Pc(254) int local254; @Pc(267) int local267; for (local152 = 0; local152 < levels; local152++) { - @Pc(159) byte[][] local159 = aByteArrayArrayArray9[local152]; + @Pc(159) byte[][] local159 = shadowmap[local152]; @Pc(273) int local273; @Pc(326) int local326; @Pc(332) int local332; @@ -945,7 +948,7 @@ public class SceneGraph { for (local168 = 1; local168 < 103; local168++) { label771: for (local173 = 1; local173 < 103; local173++) { - if (underwater || allLevelsAreVisible() || (tileFlags[0][local168][local173] & 0x2) != 0 || (tileFlags[local152][local168][local173] & 0x10) == 0 && method22(local173, local168, local152) == LoginManager.centralPlane) { + if (underwater || allLevelsAreVisible() || (renderFlags[0][local168][local173] & 0x2) != 0 || (renderFlags[local152][local168][local173] & 0x10) == 0 && getRenderLevel(local173, local168, local152) == centralPlane) { if (firstVisibleLevel > local152) { firstVisibleLevel = local152; } @@ -962,7 +965,7 @@ public class SceneGraph { local1067 = false; } if (local1067 && local200 == local202 && local200 == local209 && local349 == local200) { - anIntArrayArrayArray6[local152][local168][local173] |= 0x4; + occludeFlags[local152][local168][local173] |= 0x4; } } if (local178 <= 0) { @@ -1085,12 +1088,12 @@ public class SceneGraph { if (local200 > 103) { @Pc(2025) GlTile[] local2025; if (underwater) { - local2025 = method3501(tileFlags, tileShapes[local152], tileUnderlays[local152], local146, local1896, anIntArrayArray11, tileOverlays[local152], tileAngles[local152], local1888, local152, local1900, local142, tileHeights[local152], surfaceTileHeights[0]); + local2025 = method3501(renderFlags, tileShapes[local152], tileUnderlays[local152], local146, local1896, anIntArrayArray11, tileOverlays[local152], tileAngles[local152], local1888, local152, local1900, local142, tileHeights[local152], surfaceTileHeights[0]); method2280(local152, local2025); break; } - local2025 = method3501(tileFlags, tileShapes[local152], tileUnderlays[local152], local146, local1896, null, tileOverlays[local152], tileAngles[local152], local1888, local152, local1900, local142, tileHeights[local152], null); - @Pc(2049) GlTile[] local2049 = method2(local1896, local1888, tileHeights[local152], local152, local1900, tileAngles[local152], local146, tileShapes[local152], tileUnderlays[local152], tileOverlays[local152], tileFlags); + local2025 = method3501(renderFlags, tileShapes[local152], tileUnderlays[local152], local146, local1896, null, tileOverlays[local152], tileAngles[local152], local1888, local152, local1900, local142, tileHeights[local152], null); + @Pc(2049) GlTile[] local2049 = method2(local1896, local1888, tileHeights[local152], local152, local1900, tileAngles[local152], local146, tileShapes[local152], tileUnderlays[local152], tileOverlays[local152], renderFlags); @Pc(2057) GlTile[] local2057 = new GlTile[local2025.length + local2049.length]; for (local349 = 0; local349 < local2025.length; local349++) { local2057[local349] = local2025[local349]; @@ -1117,7 +1120,7 @@ public class SceneGraph { tileOverlays[local152] = null; tileShapes[local152] = null; tileAngles[local152] = null; - aByteArrayArrayArray9[local152] = null; + shadowmap[local152] = null; } method3801(); if (underwater) { @@ -1126,7 +1129,7 @@ public class SceneGraph { @Pc(2204) int local2204; for (local152 = 0; local152 < 104; local152++) { for (local2204 = 0; local2204 < 104; local2204++) { - if ((tileFlags[1][local152][local2204] & 0x2) == 2) { + if ((renderFlags[1][local152][local2204] & 0x2) == 2) { method3884(local152, local2204); } } @@ -1134,17 +1137,17 @@ public class SceneGraph { for (local152 = 0; local152 < 4; local152++) { for (local2204 = 0; local2204 <= 104; local2204++) { for (local168 = 0; local168 <= 104; local168++) { - if ((anIntArrayArrayArray6[local152][local168][local2204] & 0x1) != 0) { + if ((occludeFlags[local152][local168][local2204] & 0x1) != 0) { local200 = local152; - for (local173 = local2204; local173 > 0 && (anIntArrayArrayArray6[local152][local168][local173 - 1] & 0x1) != 0; local173--) { + for (local173 = local2204; local173 > 0 && (occludeFlags[local152][local168][local173 - 1] & 0x1) != 0; local173--) { } overlay = local152; - for (local178 = local2204; local178 < 104 && (anIntArrayArrayArray6[local152][local168][local178 + 1] & 0x1) != 0; local178++) { + for (local178 = local2204; local178 < 104 && (occludeFlags[local152][local168][local178 + 1] & 0x1) != 0; local178++) { } label454: while (overlay > 0) { for (local202 = local173; local202 <= local178; local202++) { - if ((anIntArrayArrayArray6[overlay - 1][local168][local202] & 0x1) == 0) { + if ((occludeFlags[overlay - 1][local168][local202] & 0x1) == 0) { break label454; } } @@ -1153,7 +1156,7 @@ public class SceneGraph { label443: while (local200 < 3) { for (local202 = local173; local202 <= local178; local202++) { - if ((anIntArrayArrayArray6[local200 + 1][local168][local202] & 0x1) == 0) { + if ((occludeFlags[local200 + 1][local168][local202] & 0x1) == 0) { break label443; } } @@ -1166,22 +1169,22 @@ public class SceneGraph { SceneGraph_Class120.method4647(1, local168 * 128, local168 * 128, local173 * 128, local178 * 128 + 128, local349, local234); for (local254 = overlay; local254 <= local200; local254++) { for (local267 = local173; local267 <= local178; local267++) { - anIntArrayArrayArray6[local254][local168][local267] &= 0xFFFFFFFE; + occludeFlags[local254][local168][local267] &= 0xFFFFFFFE; } } } } - if ((anIntArrayArrayArray6[local152][local168][local2204] & 0x2) != 0) { - for (local173 = local168; local173 > 0 && (anIntArrayArrayArray6[local152][local173 - 1][local2204] & 0x2) != 0; local173--) { + if ((occludeFlags[local152][local168][local2204] & 0x2) != 0) { + for (local173 = local168; local173 > 0 && (occludeFlags[local152][local173 - 1][local2204] & 0x2) != 0; local173--) { } local200 = local152; overlay = local152; - for (local178 = local168; local178 < 104 && (anIntArrayArrayArray6[local152][local178 + 1][local2204] & 0x2) != 0; local178++) { + for (local178 = local168; local178 < 104 && (occludeFlags[local152][local178 + 1][local2204] & 0x2) != 0; local178++) { } label508: while (overlay > 0) { for (local202 = local173; local202 <= local178; local202++) { - if ((anIntArrayArrayArray6[overlay - 1][local202][local2204] & 0x2) == 0) { + if ((occludeFlags[overlay - 1][local202][local2204] & 0x2) == 0) { break label508; } } @@ -1190,7 +1193,7 @@ public class SceneGraph { label497: while (local200 < 3) { for (local202 = local173; local202 <= local178; local202++) { - if ((anIntArrayArrayArray6[local200 + 1][local202][local2204] & 0x2) == 0) { + if ((occludeFlags[local200 + 1][local202][local2204] & 0x2) == 0) { break label497; } } @@ -1203,22 +1206,22 @@ public class SceneGraph { SceneGraph_Class120.method4647(2, local173 * 128, local178 * 128 + 128, local2204 * 128, local2204 * 128, local349, local234); for (local254 = overlay; local254 <= local200; local254++) { for (local267 = local173; local267 <= local178; local267++) { - anIntArrayArrayArray6[local254][local267][local2204] &= 0xFFFFFFFD; + occludeFlags[local254][local267][local2204] &= 0xFFFFFFFD; } } } } - if ((anIntArrayArrayArray6[local152][local168][local2204] & 0x4) != 0) { + if ((occludeFlags[local152][local168][local2204] & 0x4) != 0) { local173 = local168; local178 = local168; - for (overlay = local2204; overlay > 0 && (anIntArrayArrayArray6[local152][local168][overlay - 1] & 0x4) != 0; overlay--) { + for (overlay = local2204; overlay > 0 && (occludeFlags[local152][local168][overlay - 1] & 0x4) != 0; overlay--) { } - for (local200 = local2204; local200 < 104 && (anIntArrayArrayArray6[local152][local168][local200 + 1] & 0x4) != 0; local200++) { + for (local200 = local2204; local200 < 104 && (occludeFlags[local152][local168][local200 + 1] & 0x4) != 0; local200++) { } label562: while (local173 > 0) { for (local202 = overlay; local202 <= local200; local202++) { - if ((anIntArrayArrayArray6[local152][local173 - 1][local202] & 0x4) == 0) { + if ((occludeFlags[local152][local173 - 1][local202] & 0x4) == 0) { break label562; } } @@ -1227,7 +1230,7 @@ public class SceneGraph { label551: while (local178 < 104) { for (local202 = overlay; local202 <= local200; local202++) { - if ((anIntArrayArrayArray6[local152][local178 + 1][local202] & 0x4) == 0) { + if ((occludeFlags[local152][local178 + 1][local202] & 0x4) == 0) { break label551; } } @@ -1238,7 +1241,7 @@ public class SceneGraph { SceneGraph_Class120.method4647(4, local173 * 128, local178 * 128 + 128, overlay * 128, local200 * 128 + 128, local202, local202); for (local209 = local173; local209 <= local178; local209++) { for (local349 = overlay; local349 <= local200; local349++) { - anIntArrayArrayArray6[local152][local209][local349] &= 0xFFFFFFFB; + occludeFlags[local152][local209][local349] &= 0xFFFFFFFB; } } } @@ -1453,8 +1456,8 @@ public class SceneGraph { local100 = wall.primary; local102 = wall.secondary; } - if (type.anInt4435 != 0) { - collision.unflagWall(angle, type.aBoolean207, z, shape, x); + if (type.blockwalk != 0) { + collision.unflagWall(angle, type.blockrange, z, shape, x); } } else if (arg3 == 1) { @Pc(233) WallDecor wallDecor = removeWallDecor(level, x, z); @@ -1467,15 +1470,15 @@ public class SceneGraph { if (scenery != null) { local100 = scenery.entity; } - if (type.anInt4435 != 0 && type.width + x < 104 && type.width + z < 104 && x + type.length < 104 && z + type.length < 104) { - collision.unflagScenery(x, type.width, type.aBoolean207, angle, type.length, z); + if (type.blockwalk != 0 && type.width + x < 104 && type.width + z < 104 && x + type.length < 104 && z + type.length < 104) { + collision.unflagScenery(x, type.width, type.blockrange, angle, type.length, z); } } else if (arg3 == 3) { @Pc(211) GroundDecor groundDecor = removeGroundDecor(level, x, z); if (groundDecor != null) { local100 = groundDecor.entity; } - if (type.anInt4435 == 1) { + if (type.blockwalk == 1) { collision.unflagGroundDecor(z, x); } } @@ -1497,7 +1500,7 @@ public class SceneGraph { if (local100 instanceof Loc) { ((Loc) local100).method1046(); } else { - Loc.method181(type, anIntArray469[angle] * 8, angle, anIntArray80[angle] * 8, 4, x, z, arg4); + Loc.method181(type, WALL_DECO_ROT_SIZE_Y_DIR[angle] * 8, angle, WALL_DECO_ROT_SIZE_X_DIR[angle] * 8, 4, x, z, arg4); } } else if (shape == 6) { if (local100 instanceof Loc) { @@ -2384,402 +2387,426 @@ public class SceneGraph { } @OriginalMember(owner = "client!p", name = "a", descriptor = "(IZIZLclient!mj;IIIBII)V") - public static void method3397(@OriginalArg(0) int arg0, @OriginalArg(1) boolean arg1, @OriginalArg(2) int arg2, @OriginalArg(3) boolean arg3, @OriginalArg(4) CollisionMap arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(9) int arg8, @OriginalArg(10) int arg9) { - if (arg1 && !allLevelsAreVisible() && (tileFlags[0][arg7][arg8] & 0x2) == 0) { - if ((tileFlags[arg2][arg7][arg8] & 0x10) != 0) { - return; - } - if (method22(arg8, arg7, arg2) != LoginManager.centralPlane) { + public static void addLoc(@OriginalArg(0) int currentPlane, @OriginalArg(1) boolean lowmem, @OriginalArg(2) int plane, @OriginalArg(3) boolean highmem, @OriginalArg(4) CollisionMap map, @OriginalArg(5) int locIndex, @OriginalArg(6) int locType, @OriginalArg(7) int x, @OriginalArg(9) int z, @OriginalArg(10) int orientation) { + if (lowmem && !allLevelsAreVisible() && (renderFlags[0][x][z] & 0x2) == 0) { + if ((renderFlags[plane][x][z] & 0x10) != 0 || getRenderLevel(z, x, plane) != centralPlane) { return; } } - if (arg2 < firstVisibleLevel) { - firstVisibleLevel = arg2; + + if (plane < firstVisibleLevel) { + firstVisibleLevel = plane; } - @Pc(62) LocType local62 = LocTypeList.get(arg5); - if (GlRenderer.enabled && local62.aBoolean216) { + + @Pc(62) LocType loc = LocTypeList.get(locIndex); + if (GlRenderer.enabled && loc.aBoolean216) { return; } - @Pc(84) int local84; - @Pc(81) int local81; - if (arg9 == 1 || arg9 == 3) { - local81 = local62.width; - local84 = local62.length; + + @Pc(84) int width; + @Pc(81) int length; + if (orientation == 1 || orientation == 3) { + length = loc.width; + width = loc.length; } else { - local84 = local62.width; - local81 = local62.length; + width = loc.width; + length = loc.length; } - @Pc(103) int local103; - @Pc(112) int local112; - if (arg7 + local84 <= 104) { - local103 = arg7 + (local84 >> 1); - local112 = arg7 + (local84 + 1 >> 1); + + @Pc(103) int west; + @Pc(112) int east; + if (x + width <= 104) { + west = x + (width >> 1); + east = x + (width + 1 >> 1); } else { - local112 = arg7 + 1; - local103 = arg7; + east = x + 1; + west = x; } - @Pc(129) int local129; - @Pc(133) int local133; - if (local81 + arg8 > 104) { - local129 = arg8; - local133 = arg8 + 1; + + @Pc(129) int south; + @Pc(133) int north; + if (length + z > 104) { + south = z; + north = z + 1; } else { - local129 = (local81 >> 1) + arg8; - local133 = arg8 + (local81 + 1 >> 1); + south = (length >> 1) + z; + north = z + (length + 1 >> 1); } - @Pc(153) int[][] local153 = tileHeights[arg0]; - @Pc(165) int local165 = (local84 << 6) + (arg7 << 7); - @Pc(173) int local173 = (local81 << 6) + (arg8 << 7); - @Pc(199) int local199 = local153[local103][local133] + local153[local112][local129] + local153[local103][local129] + local153[local112][local133] >> 2; - @Pc(201) int local201 = 0; - @Pc(213) int[][] local213; - if (GlRenderer.enabled && arg0 != 0) { - local213 = tileHeights[0]; - local201 = local199 - (local213[local112][local133] + local213[local112][local129] + local213[local103][local129] + local213[local103][local133] >> 2); + + @Pc(153) int[][] currentHeightmap = tileHeights[currentPlane]; + @Pc(165) int local165 = (width << 6) + (x << 7); + @Pc(173) int local173 = (length << 6) + (z << 7); + @Pc(199) int averageY = currentHeightmap[west][north] + currentHeightmap[east][south] + currentHeightmap[west][south] + currentHeightmap[east][north] >> 2; + + @Pc(201) int diffAverageY = 0; + @Pc(213) int[][] heightmap; + if (GlRenderer.enabled && currentPlane != 0) { + heightmap = tileHeights[0]; + diffAverageY = averageY - (heightmap[east][north] + heightmap[east][south] + heightmap[west][south] + heightmap[west][north] >> 2); } - local213 = null; - @Pc(261) long local261 = arg7 | 0x40000000 | (long) arg8 << 7 | (long) arg6 << 14 | (long) arg9 << 20; - if (arg3) { - local213 = surfaceTileHeights[0]; - } else if (arg0 < 3) { - local213 = tileHeights[arg0 + 1]; + heightmap = null; + + @Pc(261) long bitset = x | 0x40000000 | (long) z << 7 | (long) locType << 14 | (long) orientation << 20; + + if (highmem) { + heightmap = surfaceTileHeights[0]; + } else if (currentPlane < 3) { + heightmap = tileHeights[currentPlane + 1]; } - if (local62.anInt4429 == 0 || arg3) { - local261 |= Long.MIN_VALUE; + + if (loc.interactive == 0 || highmem) { + bitset |= Long.MIN_VALUE; } - if (local62.anInt4438 == 1) { - local261 |= 0x400000L; + + if (loc.anInt4438 == 1) { + bitset |= 0x400000L; } - if (local62.aBoolean213) { - local261 |= 0x80000000L; + + if (loc.aBoolean213) { + bitset |= Integer.MIN_VALUE; } - if (local62.hasAreaSound()) { - AreaSoundManager.add(arg8, local62, arg9, null, arg7, arg2, null); + + if (loc.hasAreaSound()) { + AreaSoundManager.add(z, loc, orientation, null, x, plane, null); } - @Pc(330) boolean local330 = local62.aBoolean212 & !arg3; - local261 |= (long) arg5 << 32; - @Pc(387) Entity local387; + + @Pc(330) boolean local330 = loc.aBoolean212 & !highmem; + bitset |= (long) locIndex << 32; + @Pc(387) Entity entity; @Pc(403) Loc_Class139 local403; - if (arg6 == 22) { - if (Preferences.showGroundDecorations || local62.anInt4429 != 0 || local62.anInt4435 == 1 || local62.aBoolean206) { - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local403 = local62.method3428(arg9, local165, local153, 22, local199, local213, arg1, null, local330, local173); + @Pc(1226) int local1226; + @Pc(1889) long local1889; + @Pc(1934) Entity local1934; + @Pc(1950) Loc_Class139 local1950; + + if (locType == LocType.GROUNDDECOR) { + if (Preferences.showGroundDecorations || loc.interactive != 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, local201, local173); + ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); } - local387 = local403.aClass8_10; + entity = local403.aClass8_10; } else { - local387 = new Loc(arg5, 22, arg9, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); + entity = new Loc(locIndex, LocType.GROUNDDECOR, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } - setGroundDecor(arg2, arg7, arg8, local199, local387, local261, local62.aBoolean211); - if (local62.anInt4435 == 1 && arg4 != null) { - arg4.flagGroundDecor(arg7, arg8); + + setGroundDecor(plane, x, z, averageY, entity, bitset, loc.aBoolean211); + + if (loc.blockwalk == 1 && map != null) { + map.flagGroundDecor(x, z); } } - } else if (arg6 == 10 || arg6 == 11) { - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local403 = local62.method3428(arg6 == 11 ? arg9 + 4 : arg9, local165, local153, 10, local199, local213, arg1, null, local330, local173); + } else if (locType == LocType.CENTREPIECE_STRAIGHT || locType == LocType.CENTREPIECE_DIAGONAL) { + 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, local201, local173); + ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); } - local387 = local403.aClass8_10; + entity = local403.aClass8_10; } else { - local387 = new Loc(arg5, 10, arg6 == 11 ? arg9 + 4 : arg9, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); + entity = new Loc(locIndex, LocType.CENTREPIECE_STRAIGHT, locType == LocType.CENTREPIECE_DIAGONAL ? orientation + 4 : orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } - if (local387 != null) { - @Pc(531) boolean local531 = method35(arg2, arg7, arg8, local199, local84, local81, local387, local261); - if (local62.aBoolean215 && local531 && arg1) { + + if (entity != null) { + @Pc(531) boolean local531 = method35(plane, x, z, averageY, width, length, entity, bitset); + if (loc.active && local531 && lowmem) { @Pc(541) int local541 = 15; - if (local387 instanceof Model) { - local541 = ((Model) local387).method4566() / 4; + if (entity instanceof Model) { + local541 = ((Model) entity).method4566() / 4; if (local541 > 30) { local541 = 30; } } - for (@Pc(560) int local560 = 0; local560 <= local84; local560++) { - for (@Pc(565) int local565 = 0; local565 <= local81; local565++) { - if (aByteArrayArrayArray9[arg2][arg7 + local560][local565 + arg8] < local541) { - aByteArrayArrayArray9[arg2][arg7 + local560][arg8 + local565] = (byte) local541; + for (@Pc(560) int local560 = 0; local560 <= width; local560++) { + for (@Pc(565) int local565 = 0; local565 <= length; local565++) { + if (shadowmap[plane][x + local560][local565 + z] < local541) { + shadowmap[plane][x + local560][z + local565] = (byte) local541; } } } } } - if (local62.anInt4435 != 0 && arg4 != null) { - arg4.flagScenery(arg7, local62.aBoolean207, arg8, local84, local81); + + if (loc.blockwalk != 0 && map != null) { + map.flagScenery(x, loc.blockrange, z, width, length); } - } else if (arg6 >= 12) { - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local403 = local62.method3428(arg9, local165, local153, arg6, local199, local213, arg1, null, local330, local173); + } else if (locType >= LocType.ROOF_STRAIGHT) { + 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, local201, local173); + ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); } - local387 = local403.aClass8_10; + entity = local403.aClass8_10; } else { - local387 = new Loc(arg5, arg6, arg9, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); + entity = new Loc(locIndex, locType, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } - method35(arg2, arg7, arg8, local199, 1, 1, local387, local261); - if (arg1 && arg6 >= 12 && arg6 <= 17 && arg6 != 13 && arg2 > 0) { - anIntArrayArrayArray6[arg2][arg7][arg8] |= 0x4; + + method35(plane, x, z, averageY, 1, 1, entity, bitset); + if (lowmem && locType <= LocType.ROOF_FLAT && locType != LocType.ROOF_DIAGONAL_WITH_ROOFEDGE && plane > 0) { + occludeFlags[plane][x][z] |= 0x4; } - if (local62.anInt4435 != 0 && arg4 != null) { - arg4.flagScenery(arg7, local62.aBoolean207, arg8, local84, local81); + + if (loc.blockwalk != 0 && map != null) { + map.flagScenery(x, loc.blockrange, z, width, length); } - } else if (arg6 == 0) { - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local403 = local62.method3428(arg9, local165, local153, 0, local199, local213, arg1, null, local330, local173); + } else if (locType == LocType.WALL_STRAIGHT) { + 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, local201, local173); + ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); } - local387 = local403.aClass8_10; + entity = local403.aClass8_10; } else { - local387 = new Loc(arg5, 0, arg9, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); + entity = new Loc(locIndex, LocType.WALL_STRAIGHT, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } - setWall(arg2, arg7, arg8, local199, local387, null, anIntArray517[arg9], 0, local261); - if (arg1) { - if (arg9 == 0) { - if (local62.aBoolean215) { - aByteArrayArrayArray9[arg2][arg7][arg8] = 50; - aByteArrayArrayArray9[arg2][arg7][arg8 + 1] = 50; + + setWall(plane, x, z, averageY, entity, null, WALL_ROTATION_TYPE1[orientation], 0, bitset); + + if (lowmem) { + if (orientation == 0) { + if (loc.active) { + shadowmap[plane][x][z] = 50; + shadowmap[plane][x][z + 1] = 50; } - if (local62.aBoolean220) { - anIntArrayArrayArray6[arg2][arg7][arg8] |= 0x1; + + if (loc.occlude) { + occludeFlags[plane][x][z] |= 0x1; } - } else if (arg9 == 1) { - if (local62.aBoolean215) { - aByteArrayArrayArray9[arg2][arg7][arg8 + 1] = 50; - aByteArrayArrayArray9[arg2][arg7 + 1][arg8 + 1] = 50; + } else if (orientation == 1) { + if (loc.active) { + shadowmap[plane][x][z + 1] = 50; + shadowmap[plane][x + 1][z + 1] = 50; } - if (local62.aBoolean220) { - anIntArrayArrayArray6[arg2][arg7][arg8 + 1] |= 0x2; + + if (loc.occlude) { + occludeFlags[plane][x][z + 1] |= 0x2; } - } else if (arg9 == 2) { - if (local62.aBoolean215) { - aByteArrayArrayArray9[arg2][arg7 + 1][arg8] = 50; - aByteArrayArrayArray9[arg2][arg7 + 1][arg8 + 1] = 50; + } else if (orientation == 2) { + if (loc.active) { + shadowmap[plane][x + 1][z] = 50; + shadowmap[plane][x + 1][z + 1] = 50; } - if (local62.aBoolean220) { - anIntArrayArrayArray6[arg2][arg7 + 1][arg8] |= 0x1; + + if (loc.occlude) { + occludeFlags[plane][x + 1][z] |= 0x1; } - } else if (arg9 == 3) { - if (local62.aBoolean215) { - aByteArrayArrayArray9[arg2][arg7][arg8] = 50; - aByteArrayArrayArray9[arg2][arg7 + 1][arg8] = 50; + } else if (orientation == 3) { + if (loc.active) { + shadowmap[plane][x][z] = 50; + shadowmap[plane][x + 1][z] = 50; } - if (local62.aBoolean220) { - anIntArrayArrayArray6[arg2][arg7][arg8] |= 0x2; + + if (loc.occlude) { + occludeFlags[plane][x][z] |= 0x2; } } } - if (local62.anInt4435 != 0 && arg4 != null) { - arg4.flagWall(arg9, arg6, local62.aBoolean207, arg8, arg7); + + if (loc.blockwalk != 0 && map != null) { + map.flagWall(orientation, locType, loc.blockrange, z, x); } - if (local62.wallDecorOffsetScale != 16) { - method559(arg2, arg7, arg8, local62.wallDecorOffsetScale); + + if (loc.walloff != 16) { + setWallDecoration(plane, x, z, loc.walloff); } - } else if (arg6 == 1) { - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local403 = local62.method3428(arg9, local165, local153, 1, local199, local213, arg1, null, local330, local173); + } else if (locType == LocType.WALL_DIAGONALCORNER) { + 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, local201, local173); + ShadowManager.method4211(local403.aClass36_Sub1_3, local165, diffAverageY, local173); } - local387 = local403.aClass8_10; + entity = local403.aClass8_10; } else { - local387 = new Loc(arg5, 1, arg9, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); + entity = new Loc(locIndex, LocType.WALL_DIAGONALCORNER, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); } - setWall(arg2, arg7, arg8, local199, local387, null, LoginManager.anIntArray204[arg9], 0, local261); - if (local62.aBoolean215 && arg1) { - if (arg9 == 0) { - aByteArrayArrayArray9[arg2][arg7][arg8 + 1] = 50; - } else if (arg9 == 1) { - aByteArrayArrayArray9[arg2][arg7 + 1][arg8 + 1] = 50; - } else if (arg9 == 2) { - aByteArrayArrayArray9[arg2][arg7 + 1][arg8] = 50; - } else if (arg9 == 3) { - aByteArrayArrayArray9[arg2][arg7][arg8] = 50; + + setWall(plane, x, z, averageY, entity, null, LoginManager.anIntArray204[orientation], 0, bitset); + if (loc.active && lowmem) { + if (orientation == 0) { + shadowmap[plane][x][z + 1] = 50; + } else if (orientation == 1) { + shadowmap[plane][x + 1][z + 1] = 50; + } else if (orientation == 2) { + shadowmap[plane][x + 1][z] = 50; + } else if (orientation == 3) { + shadowmap[plane][x][z] = 50; } } - if (local62.anInt4435 != 0 && arg4 != null) { - arg4.flagWall(arg9, arg6, local62.aBoolean207, arg8, arg7); + + if (loc.blockwalk != 0 && map != null) { + map.flagWall(orientation, locType, loc.blockrange, z, x); } - } else { - @Pc(1226) int local1226; - if (arg6 == 2) { - local1226 = arg9 + 1 & 0x3; - @Pc(1269) Entity local1269; - @Pc(1254) Entity local1254; - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - @Pc(1287) Loc_Class139 local1287 = local62.method3428(arg9 + 4, local165, local153, 2, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local1287.aClass36_Sub1_3, local165, local201, local173); - } - local1254 = local1287.aClass8_10; - local1287 = local62.method3428(local1226, local165, local153, 2, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local1287.aClass36_Sub1_3, local165, local201, local173); - } - local1269 = local1287.aClass8_10; - } else { - local1254 = new Loc(arg5, 2, arg9 + 4, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); - local1269 = new Loc(arg5, 2, local1226, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); + } else if (locType == LocType.WALL_L) { + local1226 = orientation + 1 & 0x3; + @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); + if (GlRenderer.enabled && local330) { + ShadowManager.method4211(local1287.aClass36_Sub1_3, local165, diffAverageY, local173); } - setWall(arg2, arg7, arg8, local199, local1254, local1269, anIntArray517[arg9], anIntArray517[local1226], local261); - if (local62.aBoolean220 && arg1) { - if (arg9 == 0) { - anIntArrayArrayArray6[arg2][arg7][arg8] |= 0x1; - anIntArrayArrayArray6[arg2][arg7][arg8 + 1] |= 0x2; - } else if (arg9 == 1) { - anIntArrayArrayArray6[arg2][arg7][arg8 + 1] |= 0x2; - anIntArrayArrayArray6[arg2][arg7 + 1][arg8] |= 0x1; - } else if (arg9 == 2) { - anIntArrayArrayArray6[arg2][arg7 + 1][arg8] |= 0x1; - anIntArrayArrayArray6[arg2][arg7][arg8] |= 0x2; - } else if (arg9 == 3) { - anIntArrayArrayArray6[arg2][arg7][arg8] |= 0x2; - anIntArrayArrayArray6[arg2][arg7][arg8] |= 0x1; - } + local1254 = local1287.aClass8_10; + 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); } - if (local62.anInt4435 != 0 && arg4 != null) { - arg4.flagWall(arg9, arg6, local62.aBoolean207, arg8, arg7); - } - if (local62.wallDecorOffsetScale != 16) { - method559(arg2, arg7, arg8, local62.wallDecorOffsetScale); - } - } else if (arg6 == 3) { - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local403 = local62.method3428(arg9, local165, local153, 3, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, local201, local173); - } - local387 = local403.aClass8_10; - } else { - local387 = new Loc(arg5, 3, arg9, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); - } - setWall(arg2, arg7, arg8, local199, local387, null, LoginManager.anIntArray204[arg9], 0, local261); - if (local62.aBoolean215 && arg1) { - if (arg9 == 0) { - aByteArrayArrayArray9[arg2][arg7][arg8 + 1] = 50; - } else if (arg9 == 1) { - aByteArrayArrayArray9[arg2][arg7 + 1][arg8 + 1] = 50; - } else if (arg9 == 2) { - aByteArrayArrayArray9[arg2][arg7 + 1][arg8] = 50; - } else if (arg9 == 3) { - aByteArrayArrayArray9[arg2][arg7][arg8] = 50; - } - } - if (local62.anInt4435 != 0 && arg4 != null) { - arg4.flagWall(arg9, arg6, local62.aBoolean207, arg8, arg7); - } - } else if (arg6 == 9) { - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local403 = local62.method3428(arg9, local165, local153, arg6, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, local201, local173); - } - local387 = local403.aClass8_10; - } else { - local387 = new Loc(arg5, arg6, arg9, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); - } - method35(arg2, arg7, arg8, local199, 1, 1, local387, local261); - if (local62.anInt4435 != 0 && arg4 != null) { - arg4.flagScenery(arg7, local62.aBoolean207, arg8, local84, local81); - } - if (local62.wallDecorOffsetScale != 16) { - method559(arg2, arg7, arg8, local62.wallDecorOffsetScale); - } - } else if (arg6 == 4) { - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local403 = local62.method3428(arg9, local165, local153, 4, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local403.aClass36_Sub1_3, local165, local201, local173); - } - local387 = local403.aClass8_10; - } else { - local387 = new Loc(arg5, 4, arg9, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); - } - setWallDecor(arg2, arg7, arg8, local199, local387, null, anIntArray517[arg9], 0, 0, 0, local261); + local1269 = local1287.aClass8_10; } else { - @Pc(1889) long local1889; - @Pc(1934) Entity local1934; - @Pc(1950) Loc_Class139 local1950; - if (arg6 == 5) { - local1226 = 16; - local1889 = getWallKey(arg2, arg7, arg8); - if (local1889 != 0L) { - local1226 = LocTypeList.get(Integer.MAX_VALUE & (int) (local1889 >>> 32)).wallDecorOffsetScale; - } - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local1950 = local62.method3428(arg9, local165, local153, 4, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local1950.aClass36_Sub1_3, local165 - anIntArray80[arg9] * 8, local201, local173 - anIntArray469[arg9] * 8); - } - local1934 = local1950.aClass8_10; - } else { - local1934 = new Loc(arg5, 4, arg9, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); - } - setWallDecor(arg2, arg7, arg8, local199, local1934, null, anIntArray517[arg9], 0, local1226 * anIntArray80[arg9], anIntArray469[arg9] * local1226, local261); - } else if (arg6 == 6) { - local1226 = 8; - local1889 = getWallKey(arg2, arg7, arg8); - if (local1889 != 0L) { - local1226 = LocTypeList.get(Integer.MAX_VALUE & (int) (local1889 >>> 32)).wallDecorOffsetScale / 2; - } - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - local1950 = local62.method3428(arg9 + 4, local165, local153, 4, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local1950.aClass36_Sub1_3, local165 - anIntArray565[arg9] * 8, local201, local173 - anIntArray154[arg9] * 8); - } - local1934 = local1950.aClass8_10; - } else { - local1934 = new Loc(arg5, 4, arg9 + 4, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); - } - setWallDecor(arg2, arg7, arg8, local199, local1934, null, 256, arg9, local1226 * anIntArray565[arg9], local1226 * anIntArray154[arg9], local261); - } else if (arg6 == 7) { - @Pc(2137) int local2137 = arg9 + 2 & 0x3; - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - @Pc(2183) Loc_Class139 local2183 = local62.method3428(local2137 + 4, local165, local153, 4, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local2183.aClass36_Sub1_3, local165, local201, local173); - } - local387 = local2183.aClass8_10; - } else { - local387 = new Loc(arg5, 4, local2137 + 4, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); - } - setWallDecor(arg2, arg7, arg8, local199, local387, null, 256, local2137, 0, 0, local261); - } else if (arg6 == 8) { - local1226 = 8; - local1889 = getWallKey(arg2, arg7, arg8); - if (local1889 != 0L) { - local1226 = LocTypeList.get(Integer.MAX_VALUE & (int) (local1889 >>> 32)).wallDecorOffsetScale / 2; - } - @Pc(2244) int local2244 = arg9 + 2 & 0x3; - @Pc(2289) Entity local2289; - if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { - @Pc(2297) int local2297 = anIntArray154[arg9] * 8; - @Pc(2303) int local2303 = anIntArray565[arg9] * 8; - @Pc(2319) Loc_Class139 local2319 = local62.method3428(arg9 + 4, local165, local153, 4, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local2319.aClass36_Sub1_3, local165 - local2303, local201, local173 - local2297); - } - local1934 = local2319.aClass8_10; - local2319 = local62.method3428(local2244 + 4, local165, local153, 4, local199, local213, arg1, null, local330, local173); - if (GlRenderer.enabled && local330) { - ShadowManager.method4211(local2319.aClass36_Sub1_3, local165 - local2303, local201, local173 - local2297); - } - local2289 = local2319.aClass8_10; - } else { - local1934 = new Loc(arg5, 4, arg9 + 4, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); - local2289 = new Loc(arg5, 4, local2244 + 4, arg0, arg7, arg8, local62.anInt4430, local62.aBoolean209, null); - } - setWallDecor(arg2, arg7, arg8, local199, local1934, local2289, 256, arg9, local1226 * anIntArray565[arg9], anIntArray154[arg9] * local1226, local261); + 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); + } + setWall(plane, x, z, averageY, local1254, local1269, WALL_ROTATION_TYPE1[orientation], WALL_ROTATION_TYPE1[local1226], bitset); + if (loc.occlude && lowmem) { + if (orientation == 0) { + occludeFlags[plane][x][z] |= 0x1; + occludeFlags[plane][x][z + 1] |= 0x2; + } else if (orientation == 1) { + occludeFlags[plane][x][z + 1] |= 0x2; + occludeFlags[plane][x + 1][z] |= 0x1; + } else if (orientation == 2) { + occludeFlags[plane][x + 1][z] |= 0x1; + occludeFlags[plane][x][z] |= 0x2; + } else if (orientation == 3) { + occludeFlags[plane][x][z] |= 0x2; + occludeFlags[plane][x][z] |= 0x1; } } + if (loc.blockwalk != 0 && map != null) { + map.flagWall(orientation, locType, loc.blockrange, z, x); + } + if (loc.walloff != 16) { + setWallDecoration(plane, x, z, loc.walloff); + } + } else if (locType == LocType.WALL_SQUARECORNER) { + 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); + } + entity = local403.aClass8_10; + } else { + entity = new Loc(locIndex, LocType.WALL_SQUARECORNER, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); + } + setWall(plane, x, z, averageY, entity, null, LoginManager.anIntArray204[orientation], 0, bitset); + if (loc.active && lowmem) { + if (orientation == 0) { + shadowmap[plane][x][z + 1] = 50; + } else if (orientation == 1) { + shadowmap[plane][x + 1][z + 1] = 50; + } else if (orientation == 2) { + shadowmap[plane][x + 1][z] = 50; + } else if (orientation == 3) { + shadowmap[plane][x][z] = 50; + } + } + if (loc.blockwalk != 0 && map != null) { + map.flagWall(orientation, locType, loc.blockrange, z, x); + } + } else if (locType == LocType.WALL_DIAGONAL) { + 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); + } + entity = local403.aClass8_10; + } else { + entity = new Loc(locIndex, locType, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); + } + method35(plane, x, z, averageY, 1, 1, entity, bitset); + if (loc.blockwalk != 0 && map != null) { + map.flagScenery(x, loc.blockrange, z, width, length); + } + if (loc.walloff != 16) { + setWallDecoration(plane, x, z, loc.walloff); + } + } else if (locType == LocType.WALLDECOR_STRAIGHT_XOFFSET) { + 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); + } + entity = local403.aClass8_10; + } else { + entity = new Loc(locIndex, 4, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); + } + setWallDecor(plane, x, z, averageY, entity, null, WALL_ROTATION_TYPE1[orientation], 0, 0, 0, bitset); + } else if (locType == LocType.WALLDECOR_STRAIGHT_ZOFFSET) { + local1226 = 16; + local1889 = getWallKey(plane, x, z); + if (local1889 != 0L) { + local1226 = LocTypeList.get(Integer.MAX_VALUE & (int) (local1889 >>> 32)).walloff; + } + 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); + } + local1934 = local1950.aClass8_10; + } else { + local1934 = new Loc(locIndex, 4, orientation, currentPlane, x, z, loc.anim, loc.aBoolean209, null); + } + setWallDecor(plane, x, z, averageY, local1934, null, WALL_ROTATION_TYPE1[orientation], 0, local1226 * WALL_DECO_ROT_SIZE_X_DIR[orientation], WALL_DECO_ROT_SIZE_Y_DIR[orientation] * local1226, bitset); + } else if (locType == LocType.WALLDECOR_DIAGONAL_XOFFSET) { + local1226 = 8; + local1889 = getWallKey(plane, x, z); + if (local1889 != 0L) { + local1226 = LocTypeList.get(Integer.MAX_VALUE & (int) (local1889 >>> 32)).walloff / 2; + } + 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); + } + local1934 = local1950.aClass8_10; + } else { + local1934 = new Loc(locIndex, 4, orientation + 4, currentPlane, x, z, loc.anim, loc.aBoolean209, null); + } + setWallDecor(plane, x, z, averageY, local1934, null, 256, orientation, local1226 * anIntArray565[orientation], local1226 * anIntArray154[orientation], bitset); + } 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); + if (GlRenderer.enabled && local330) { + ShadowManager.method4211(local2183.aClass36_Sub1_3, local165, diffAverageY, local173); + } + entity = local2183.aClass8_10; + } else { + entity = new Loc(locIndex, 4, local2137 + 4, currentPlane, x, z, loc.anim, loc.aBoolean209, null); + } + setWallDecor(plane, x, z, averageY, entity, null, 256, local2137, 0, 0, bitset); + } else if (locType == LocType.WALLDECOR_DIAGONAL_BOTH) { + local1226 = 8; + local1889 = getWallKey(plane, x, z); + if (local1889 != 0L) { + local1226 = LocTypeList.get(Integer.MAX_VALUE & (int) (local1889 >>> 32)).walloff / 2; + } + @Pc(2244) int local2244 = orientation + 2 & 0x3; + @Pc(2289) Entity local2289; + 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); + if (GlRenderer.enabled && local330) { + ShadowManager.method4211(local2319.aClass36_Sub1_3, local165 - local2303, diffAverageY, local173 - local2297); + } + local1934 = local2319.aClass8_10; + 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); + } + local2289 = local2319.aClass8_10; + } 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); + } + setWallDecor(plane, x, z, averageY, local1934, local2289, 256, orientation, local1226 * anIntArray565[orientation], anIntArray154[orientation] * local1226, bitset); } } @OriginalMember(owner = "client!ch", name = "c", descriptor = "(I)V") public static void method846() { - if (!allLevelsAreVisible() && LoginManager.centralPlane != Player.level) { + 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; @@ -2788,42 +2815,49 @@ public class SceneGraph { } @OriginalMember(owner = "client!jk", name = "a", descriptor = "(IZ[BII[Lclient!mj;)V") - public static void method2437(@OriginalArg(0) int arg0, @OriginalArg(1) boolean arg1, @OriginalArg(2) byte[] arg2, @OriginalArg(3) int arg3, @OriginalArg(5) CollisionMap[] arg4) { - @Pc(10) Buffer local10 = new Buffer(arg2); - @Pc(12) int local12 = -1; + public static void readLocs(@OriginalArg(0) int baseX, @OriginalArg(1) boolean highmem, @OriginalArg(2) byte[] src, @OriginalArg(3) int baseZ, @OriginalArg(5) CollisionMap[] maps) { + @Pc(10) Buffer b = new Buffer(src); + + @Pc(12) int locIndex = -1; while (true) { - @Pc(16) int local16 = local10.gVarSmart(); - if (local16 == 0) { + @Pc(16) int locOffset = b.gVarSmart(); + if (locOffset == 0) { return; } - local12 += local16; - @Pc(27) int local27 = 0; + locIndex += locOffset; + + @Pc(27) int position = 0; while (true) { - @Pc(31) int local31 = local10.gsmarts(); - if (local31 == 0) { + @Pc(31) int posOffset = b.gsmarts(); + if (posOffset == 0) { break; } - local27 += local31 - 1; - @Pc(46) int local46 = local27 & 0x3F; - @Pc(50) int local50 = local27 >> 12; - @Pc(56) int local56 = local27 >> 6 & 0x3F; - @Pc(60) int local60 = local10.g1(); - @Pc(64) int local64 = local60 >> 2; - @Pc(68) int local68 = local60 & 0x3; - @Pc(72) int local72 = arg0 + local56; - @Pc(76) int local76 = local46 + arg3; - if (local72 > 0 && local76 > 0 && local72 < 103 && local76 < 103) { - @Pc(90) CollisionMap local90 = null; - if (!arg1) { - @Pc(95) int local95 = local50; - if ((tileFlags[1][local72][local76] & 0x2) == 2) { - local95 = local50 - 1; + position += posOffset - 1; + + @Pc(46) int z = position & 0x3F; + @Pc(56) int x = position >> 6 & 0x3F; + @Pc(50) int plane = position >> 12; + + @Pc(60) int flags = b.g1(); + @Pc(64) int type = flags >> 2; + @Pc(68) int orientation = flags & 0x3; + + @Pc(72) int tileX = x + baseX; + @Pc(76) int tileZ = z + baseZ; + if (tileX > 0 && tileZ > 0 && tileX < 103 && tileZ < 103) { + @Pc(90) CollisionMap map = null; + if (!highmem) { + @Pc(95) int markingPlane = plane; + // might be used with bridges? + if ((renderFlags[1][tileX][tileZ] & 0x2) == 2) { + markingPlane--; } - if (local95 >= 0) { - local90 = arg4[local95]; + if (markingPlane >= 0) { + map = maps[markingPlane]; } } - method3397(local50, !arg1, local50, arg1, local90, local12, local64, local72, local76, local68); + + addLoc(plane, !highmem, plane, highmem, map, locIndex, type, tileX, tileZ, orientation); } } } @@ -3243,7 +3277,7 @@ public class SceneGraph { } @OriginalMember(owner = "client!bh", name = "a", descriptor = "(IIII)V") - public static void method559(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3) { + public static void setWallDecoration(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3) { @Pc(7) Tile local7 = tiles[arg0][arg1][arg2]; if (local7 == null) { return; @@ -3775,24 +3809,24 @@ public class SceneGraph { return; } @Pc(39) int local39; - if (!allLevelsAreVisible() && (tileFlags[0][arg1][arg4] & 0x2) == 0) { + if (!allLevelsAreVisible() && (renderFlags[0][arg1][arg4] & 0x2) == 0) { local39 = arg2; - if ((tileFlags[arg2][arg1][arg4] & 0x8) != 0) { + if ((renderFlags[arg2][arg1][arg4] & 0x8) != 0) { local39 = 0; } - if (local39 != LoginManager.centralPlane) { + if (local39 != centralPlane) { return; } } local39 = arg2; - if (arg2 < 3 && (tileFlags[1][arg1][arg4] & 0x2) == 2) { + if (arg2 < 3 && (renderFlags[1][arg1][arg4] & 0x2) == 2) { local39 = arg2 + 1; } method1144(arg4, arg1, arg2, arg6, local39, PathFinder.collisionMaps[arg2]); if (arg0 >= 0) { @Pc(92) boolean local92 = Preferences.showGroundDecorations; Preferences.showGroundDecorations = true; - method3397(local39, false, arg2, false, PathFinder.collisionMaps[arg2], arg0, arg5, arg1, arg4, arg3); + addLoc(local39, false, arg2, false, PathFinder.collisionMaps[arg2], arg0, arg5, arg1, arg4, arg3); Preferences.showGroundDecorations = local92; } } @@ -3809,9 +3843,9 @@ public class SceneGraph { } @OriginalMember(owner = "client!ac", name = "a", descriptor = "(IIII)I") - public static int method22(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) int arg2) { - if ((tileFlags[arg2][arg1][arg0] & 0x8) == 0) { - return arg2 <= 0 || (tileFlags[1][arg1][arg0] & 0x2) == 0 ? arg2 : arg2 - 1; + public static int getRenderLevel(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) int arg2) { + if ((renderFlags[arg2][arg1][arg0] & 0x8) == 0) { + return arg2 <= 0 || (renderFlags[1][arg1][arg0] & 0x2) == 0 ? arg2 : arg2 - 1; } else { return 0; } @@ -5021,7 +5055,7 @@ public class SceneGraph { for (local3 = arg1; local3 <= arg3 + arg1; local3++) { for (local10 = arg2; local10 <= arg4 + arg2; local10++) { if (local10 >= 0 && local10 < 104 && local3 >= 0 && local3 < 104) { - aByteArrayArrayArray9[arg0][local10][local3] = 127; + shadowmap[arg0][local10][local3] = 127; } } } @@ -5233,7 +5267,7 @@ public class SceneGraph { local194 = local529.z >> 7; local190 = local529.x >> 7; if (local190 >= 0 && local194 >= 0 && local190 < 104 && local194 < 104) { - local529.aBoolean125 = (tileFlags[1][local190][local194] & 0x2) != 0; + local529.aBoolean125 = (renderFlags[1][local190][local194] & 0x2) != 0; local529.y = tileHeights[local529.level][local190][local194] - local529.y; LightingManager.method2389(local529); } @@ -5399,7 +5433,7 @@ public class SceneGraph { local417 = local517.x >> 7; local255 = local517.z >> 7; if (local417 >= 0 && local255 >= 0 && local417 < 104 && local255 < 104) { - local517.aBoolean125 = (tileFlags[1][local417][local255] & 0x2) != 0; + local517.aBoolean125 = (renderFlags[1][local417][local255] & 0x2) != 0; local517.y = tileHeights[local517.level][local417][local255] - local517.y; LightingManager.method2389(local517); } diff --git a/client/src/main/java/rt4/ScriptRunner.java b/client/src/main/java/rt4/ScriptRunner.java index eb96a58a..8ad4fd06 100644 --- a/client/src/main/java/rt4/ScriptRunner.java +++ b/client/src/main/java/rt4/ScriptRunner.java @@ -1039,7 +1039,7 @@ public final class ScriptRunner { @Pc(14) byte local14 = arg0 ? 1 : (byte) (anInt3325 & 0xFF); if (local14 == aByteArrayArrayArray15[Player.level][arg1][arg2]) { return false; - } else if ((SceneGraph.tileFlags[Player.level][arg1][arg2] & 0x4) == 0) { + } else if ((SceneGraph.renderFlags[Player.level][arg1][arg2] & 0x4) == 0) { return false; } else { @Pc(47) int local47 = 0; @@ -1057,14 +1057,14 @@ public final class ScriptRunner { local47 = local47 + 1 & 0xFFF; @Pc(130) boolean local130 = false; @Pc(132) boolean local132 = false; - if ((SceneGraph.tileFlags[Player.level][local108][local122] & 0x4) == 0) { + if ((SceneGraph.renderFlags[Player.level][local108][local122] & 0x4) == 0) { local130 = true; } @Pc(150) int local150; @Pc(191) int local191; label238: for (local150 = Player.level + 1; local150 <= 3; local150++) { - if ((SceneGraph.tileFlags[local150][local108][local122] & 0x8) == 0) { + if ((SceneGraph.renderFlags[local150][local108][local122] & 0x8) == 0) { @Pc(227) int local227; @Pc(358) int local358; if (local130 && arg3[local150][local108][local122] != null) { @@ -1143,7 +1143,7 @@ public final class ScriptRunner { } local122++; if (local122 < 104) { - if (local108 - 1 >= 0 && local14 != aByteArrayArrayArray15[Player.level][local108 - 1][local122] && (SceneGraph.tileFlags[Player.level][local108][local122] & 0x4) == 0 && (SceneGraph.tileFlags[Player.level][local108 - 1][local122 - 1] & 0x4) == 0) { + 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) { PathFinder.queueX[local69] = 0x52000000 | 0x120000 | local108 - 1; PathFinder.queueZ[local69] = local122 | 0x130000; aByteArrayArrayArray15[Player.level][local108 - 1][local122] = local14; @@ -1155,7 +1155,7 @@ public final class ScriptRunner { local69 = local69 + 1 & 0xFFF; aByteArrayArrayArray15[Player.level][local108][local122] = local14; } - if (local108 + 1 < 104 && aByteArrayArrayArray15[Player.level][local108 + 1][local122] != local14 && (SceneGraph.tileFlags[Player.level][local108][local122] & 0x4) == 0 && (SceneGraph.tileFlags[Player.level][local108 + 1][local122 - 1] & 0x4) == 0) { + 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) { PathFinder.queueX[local69] = 0x92000000 | 0x520000 | local108 + 1; PathFinder.queueZ[local69] = local122 | 0x530000; aByteArrayArrayArray15[Player.level][local108 + 1][local122] = local14; @@ -1171,7 +1171,7 @@ public final class ScriptRunner { } local122--; if (local122 >= 0) { - if (local108 - 1 >= 0 && aByteArrayArrayArray15[Player.level][local108 - 1][local122] != local14 && (SceneGraph.tileFlags[Player.level][local108][local122] & 0x4) == 0 && (SceneGraph.tileFlags[Player.level][local108 - 1][local122 + 1] & 0x4) == 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) { PathFinder.queueX[local69] = local108 - 1 | 0xD20000 | 0x12000000; PathFinder.queueZ[local69] = local122 | 0xD30000; aByteArrayArrayArray15[Player.level][local108 - 1][local122] = local14; @@ -1183,7 +1183,7 @@ public final class ScriptRunner { local69 = local69 + 1 & 0xFFF; aByteArrayArrayArray15[Player.level][local108][local122] = local14; } - if (local108 + 1 < 104 && aByteArrayArrayArray15[Player.level][local108 + 1][local122] != local14 && (SceneGraph.tileFlags[Player.level][local108][local122] & 0x4) == 0 && (SceneGraph.tileFlags[Player.level][local108 + 1][local122 + 1] & 0x4) == 0) { + 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) { PathFinder.queueX[local69] = local108 + 1 | 0xD2000000 | 0x920000; PathFinder.queueZ[local69] = local122 | 0x930000; aByteArrayArrayArray15[Player.level][local108 + 1][local122] = local14; @@ -1334,12 +1334,12 @@ public final class ScriptRunner { } if (Camera.cameraType != 1) { local33 = SceneGraph.getTileHeight(Player.level, Camera.renderX, Camera.renderZ); - if (local33 - Camera.anInt40 < 800 && (SceneGraph.tileFlags[Player.level][Camera.renderX >> 7][Camera.renderZ >> 7] & 0x4) != 0) { + if (local33 - Camera.anInt40 < 800 && (SceneGraph.renderFlags[Player.level][Camera.renderX >> 7][Camera.renderZ >> 7] & 0x4) != 0) { method4348(false, Camera.renderX >> 7, Camera.renderZ >> 7, SceneGraph.tiles, 1); } return; } - if ((SceneGraph.tileFlags[Player.level][PlayerList.self.xFine >> 7][PlayerList.self.zFine >> 7] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.level][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.tileFlags[Player.level][local33][local40] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.level][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.tileFlags[Player.level][local33][local40] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.level][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.tileFlags[Player.level][local33][local40] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.level][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.tileFlags[Player.level][local33][local40] & 0x4) != 0) { + if ((SceneGraph.renderFlags[Player.level][local33][local40] & 0x4) != 0) { method4348(false, local33, local40, SceneGraph.tiles, 1); break; } diff --git a/client/src/main/java/rt4/WorldMap.java b/client/src/main/java/rt4/WorldMap.java index 2bed77e5..44f55633 100644 --- a/client/src/main/java/rt4/WorldMap.java +++ b/client/src/main/java/rt4/WorldMap.java @@ -576,13 +576,13 @@ public class WorldMap { @Pc(312) LocType local312 = LocTypeList.get(id); if (local312.multiLocs != null) { local312 = local312.getMultiLoc(); - if (local312 == null || local312.mapElement == -1) { + if (local312 == null || local312.mapfunction == -1) { continue; } } underlayColors[local84][local95][(63 - local155 << 6) + local150] = local312.id + 1; @Pc(353) MapElement element = new MapElement(); - element.id = local312.mapElement; + element.id = local312.mapfunction; element.anInt4307 = local53; element.anInt4314 = local65; mapElements.addTail(element); @@ -1727,15 +1727,15 @@ public class WorldMap { @Pc(209) int local209 = local116[local163][local203]; if (local209 != 0) { @Pc(222) LocType local222 = LocTypeList.get(local209 - 1); - if (!MapList.aBooleanArray130[local222.mapElement]) { - if (local11 != -1 && local222.mapElement == anInt172) { + if (!MapList.aBooleanArray130[local222.mapfunction]) { + if (local11 != -1 && local222.mapfunction == anInt172) { @Pc(243) MapElement local243 = new MapElement(); local243.anInt4307 = local65; local243.anInt4314 = local144; - local243.id = local222.mapElement; + local243.id = local222.mapfunction; aClass69_97.addTail(local243); } else { - MapList.sprites[local222.mapElement].render(local65 - 7, local144 + -7); + MapList.sprites[local222.mapfunction].render(local65 - 7, local144 + -7); } } }