Skip to content

Commit 3238301

Browse files
authored
Merge pull request #59 from hallowatcher/deob-2
More deob
2 parents d7de401 + 93bbe9d commit 3238301

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+769
-794
lines changed

src/main/java/com/jagex/runescape/Class13.java

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package com.jagex.runescape;
22

33
import com.jagex.runescape.node.Class40_Sub6;
4-
import com.jagex.runescape.node.NodeCache;
54
import com.jagex.runescape.cache.def.IdentityKit;
6-
import com.jagex.runescape.cache.def.VarbitDefinition;
75
import com.jagex.runescape.cache.media.IndexedImage;
86
import com.jagex.runescape.cache.media.gameInterface.GameInterface;
97
import com.jagex.runescape.media.renderable.GameObject;
@@ -14,42 +12,39 @@
1412
import com.jagex.runescape.scene.tile.Wall;
1513

1614
public class Class13 {
17-
public static NodeCache aClass9_406 = new NodeCache(64);
1815
public static boolean[] playerArray = new boolean[5];
1916
public static IndexedImage aClass40_Sub5_Sub14_Sub2_418;
2017
public static int anInt419 = 2;
2118
public static int mouseX = 0;
2219
public static int[] anIntArray421;
2320

24-
public static void method241(Actor arg0, byte arg2) {
25-
if(arg0.worldX < 128 || arg0.worldY < 128 || arg0.worldX >= 13184 || arg0.worldY >= 13184) {
26-
arg0.playingAnimation = -1;
27-
arg0.anInt3112 = 0;
28-
arg0.anInt3107 = 0;
29-
arg0.graphicId = -1;
30-
arg0.worldX = arg0.anInt3096 * 64 + 128 * arg0.pathY[0];
31-
arg0.worldY = arg0.pathX[0] * 128 + 64 * arg0.anInt3096;
32-
arg0.method790(0);
21+
public static void handleActorAnimation(Actor actor) {
22+
if(actor.worldX < 128 || actor.worldY < 128 || actor.worldX >= 13184 || actor.worldY >= 13184) {
23+
actor.playingAnimation = -1;
24+
actor.anInt3112 = 0;
25+
actor.anInt3107 = 0;
26+
actor.graphicId = -1;
27+
actor.worldX = actor.anInt3096 * 64 + 128 * actor.pathY[0];
28+
actor.worldY = actor.pathX[0] * 128 + 64 * actor.anInt3096;
29+
actor.method790(0);
3330
}
34-
if(arg0 == Player.localPlayer && (arg0.worldX < 1536 || arg0.worldY < 1536 || arg0.worldX >= 11776 || arg0.worldY >= 11776)) {
35-
arg0.graphicId = -1;
36-
arg0.anInt3107 = 0;
37-
arg0.anInt3112 = 0;
38-
arg0.playingAnimation = -1;
39-
arg0.worldX = arg0.pathY[0] * 128 + arg0.anInt3096 * 64;
40-
arg0.worldY = 64 * arg0.anInt3096 + arg0.pathX[0] * 128;
41-
arg0.method790(0);
31+
if(actor == Player.localPlayer && (actor.worldX < 1536 || actor.worldY < 1536 || actor.worldX >= 11776 || actor.worldY >= 11776)) {
32+
actor.graphicId = -1;
33+
actor.anInt3107 = 0;
34+
actor.anInt3112 = 0;
35+
actor.playingAnimation = -1;
36+
actor.worldX = actor.pathY[0] * 128 + actor.anInt3096 * 64;
37+
actor.worldY = 64 * actor.anInt3096 + actor.pathX[0] * 128;
38+
actor.method790(0);
4239
}
43-
if(arg0.anInt3112 > MovedStatics.pulseCycle)
44-
Class40_Sub5_Sub11.method631(arg0);
45-
else if(arg0.anInt3107 < MovedStatics.pulseCycle)
46-
Class44.method898(255, arg0);
40+
if(actor.anInt3112 > MovedStatics.pulseCycle)
41+
method631(actor);
42+
else if(actor.anInt3107 < MovedStatics.pulseCycle)
43+
Class44.method898(255, actor);
4744
else
48-
PlayerAppearance.method381(arg0);
49-
Class40_Sub5_Sub17_Sub1.method762(arg0);
50-
Class40_Sub5_Sub15.method736(true, arg0);
51-
if(arg2 != 107)
52-
method249(false);
45+
PlayerAppearance.method381(actor);
46+
Class40_Sub5_Sub17_Sub1.method762(actor);
47+
Class40_Sub5_Sub15.method736(true, actor);
5348
}
5449

5550
public static void method242(byte arg0) {
@@ -95,9 +90,9 @@ public static synchronized byte[] method246(int arg1) {
9590
Class44.aByteArrayArray1039[Main.anInt1764] = null;
9691
return is;
9792
}
98-
if(arg1 == 30000 && VarbitDefinition.anInt2359 > 0) {
99-
byte[] is = RSCanvas.aByteArrayArray47[--VarbitDefinition.anInt2359];
100-
RSCanvas.aByteArrayArray47[VarbitDefinition.anInt2359] = null;
93+
if(arg1 == 30000 && MovedStatics.anInt2359 > 0) {
94+
byte[] is = RSCanvas.aByteArrayArray47[--MovedStatics.anInt2359];
95+
RSCanvas.aByteArrayArray47[MovedStatics.anInt2359] = null;
10196
return is;
10297
}
10398
return new byte[arg1];
@@ -141,4 +136,21 @@ public static void method249(boolean arg0) {
141136
}
142137
}
143138
}
139+
140+
public static void method631(Actor actor) {
141+
int i = actor.anInt3125 * 128 + 64 * actor.anInt3096;
142+
int i_0_ = actor.anInt3112 + -MovedStatics.pulseCycle;
143+
if(actor.anInt3073 == 0)
144+
actor.initialFaceDirection = 1024;
145+
if(actor.anInt3073 == 1)
146+
actor.initialFaceDirection = 1536;
147+
if(actor.anInt3073 == 2)
148+
actor.initialFaceDirection = 0;
149+
int i_1_ = actor.anInt3096 * 64 + 128 * actor.anInt3081;
150+
actor.worldX += (i - actor.worldX) / i_0_;
151+
if(actor.anInt3073 == 3)
152+
actor.initialFaceDirection = 512;
153+
actor.anInt3074 = 0;
154+
actor.worldY += (-actor.worldY + i_1_) / i_0_;
155+
}
144156
}

src/main/java/com/jagex/runescape/Class17.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ public static void method275(long arg1) {
115115
}
116116
}
117117

118-
public static void method276(int arg0) {
119-
for(int i = arg0; Player.localPlayerCount > i; i++) {
120-
int i_0_;
121-
if(i == -1)
122-
i_0_ = 2047;
118+
public static void animatePlayers(int playerIndex) {
119+
for(int currentPlayerIndex = playerIndex; Player.localPlayerCount > currentPlayerIndex; currentPlayerIndex++) {
120+
int actualIndex;
121+
if(currentPlayerIndex == -1)
122+
actualIndex = 2047;
123123
else
124-
i_0_ = Player.trackedPlayerIndices[i];
125-
Player class40_sub5_sub17_sub4_sub1 = Player.trackedPlayers[i_0_];
126-
if(class40_sub5_sub17_sub4_sub1 != null)
127-
Class13.method241(class40_sub5_sub17_sub4_sub1, (byte) 107);
124+
actualIndex = Player.trackedPlayerIndices[currentPlayerIndex];
125+
Player player = Player.trackedPlayers[actualIndex];
126+
if(player != null)
127+
Class13.handleActorAnimation(player);
128128
}
129129
}
130130

src/main/java/com/jagex/runescape/Class22.java

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.jagex.runescape.cache.def.GameObjectDefinition;
55
import com.jagex.runescape.cache.def.IdentityKit;
66
import com.jagex.runescape.cache.def.OverlayDefinition;
7+
import com.jagex.runescape.cache.def.VarPlayerDefinition;
78
import com.jagex.runescape.cache.media.AnimationSequence;
89
import com.jagex.runescape.cache.media.IndexedImage;
910
import com.jagex.runescape.frame.ChatBox;
@@ -15,7 +16,6 @@
1516
import com.jagex.runescape.media.renderable.actor.Actor;
1617
import com.jagex.runescape.media.renderable.actor.Npc;
1718
import com.jagex.runescape.media.renderable.actor.Player;
18-
import com.jagex.runescape.scene.GroundItemTile;
1919
import com.jagex.runescape.scene.util.CollisionMap;
2020

2121
public abstract class Class22 {
@@ -117,44 +117,44 @@ public static void method308() {
117117
RSString.method56(false, null, 0);
118118
}
119119

120-
public static void method309(int arg0, int arg1) {
120+
public static void method309(int varPlayerIndex) {
121121
do {
122122
AnimationSequence.anInt2480 = MovedStatics.pulseCycle;
123123
HuffmanEncoding.method1030((byte) 127);
124-
int i = Npc.method795((byte) -70, arg1).anInt2633;
125-
if(i != 0) {
126-
int i_21_ = GroundItemTile.varbitMasks[arg1];
127-
if(i == 1) {
128-
if(i_21_ == 1) {
124+
int varPlayerType = VarPlayerDefinition.getDefinition(varPlayerIndex).type;
125+
if(varPlayerType != 0) {
126+
int varPlayerValue = VarPlayerDefinition.varPlayers[varPlayerIndex];
127+
if(varPlayerType == 1) {
128+
if(varPlayerValue == 1) {
129129
Rasterizer3D.method711(0.9);
130130
((Class35) Rasterizer3D.anInterface3_2939).method424(0.9);
131131
}
132-
if(i_21_ == 2) {
132+
if(varPlayerValue == 2) {
133133
Rasterizer3D.method711(0.8);
134134
((Class35) Rasterizer3D.anInterface3_2939).method424(0.8);
135135
}
136-
if(i_21_ == 3) {
136+
if(varPlayerValue == 3) {
137137
Rasterizer3D.method711(0.7);
138138
((Class35) Rasterizer3D.anInterface3_2939).method424(0.7);
139139
}
140-
if(i_21_ == 4) {
140+
if(varPlayerValue == 4) {
141141
Rasterizer3D.method711(0.6);
142142
((Class35) Rasterizer3D.anInterface3_2939).method424(0.6);
143143
}
144-
GameObject.method774((byte) -96);
145-
Class40_Sub5_Sub11.clearScreen = true;
144+
GameObject.clearImageCache();
145+
MovedStatics.clearScreen = true;
146146
}
147-
if(i == 3) {
147+
if(varPlayerType == 3) {
148148
int i_22_ = 0;
149-
if(i_21_ == 0)
149+
if(varPlayerValue == 0)
150150
i_22_ = 255;
151-
if(i_21_ == 1)
151+
if(varPlayerValue == 1)
152152
i_22_ = 192;
153-
if(i_21_ == 2)
153+
if(varPlayerValue == 2)
154154
i_22_ = 128;
155-
if(i_21_ == 3)
155+
if(varPlayerValue == 3)
156156
i_22_ = 64;
157-
if(i_21_ == 4)
157+
if(varPlayerValue == 4)
158158
i_22_ = 0;
159159
if(i_22_ != RSCanvas.anInt60) {
160160
if(RSCanvas.anInt60 != 0 || MouseHandler.anInt1457 == -1) {
@@ -170,43 +170,41 @@ public static void method309(int arg0, int arg1) {
170170
RSCanvas.anInt60 = i_22_;
171171
}
172172
}
173-
if(i == 9)
174-
Class43.bankInsertMode = i_21_;
175-
if(i == 10) {
176-
if(i_21_ == 0)
173+
if(varPlayerType == 9)
174+
Class43.bankInsertMode = varPlayerValue;
175+
if(varPlayerType == 10) {
176+
if(varPlayerValue == 0)
177177
RSCanvas.anInt65 = 127;
178-
if(i_21_ == 1)
178+
if(varPlayerValue == 1)
179179
RSCanvas.anInt65 = 96;
180-
if(i_21_ == 2)
180+
if(varPlayerValue == 2)
181181
RSCanvas.anInt65 = 64;
182-
if(i_21_ == 3)
182+
if(varPlayerValue == 3)
183183
RSCanvas.anInt65 = 32;
184-
if(i_21_ == 4)
184+
if(varPlayerValue == 4)
185185
RSCanvas.anInt65 = 0;
186186
}
187-
if(i == 8) {
187+
if(varPlayerType == 8) {
188188
ChatBox.redrawChatbox = true;
189-
CollisionMap.anInt165 = i_21_;
189+
CollisionMap.anInt165 = varPlayerValue;
190190
}
191-
if(i == 4) {
192-
if(i_21_ == 0)
191+
if(varPlayerType == 4) {
192+
if(varPlayerValue == 0)
193193
MovedStatics.anInt200 = 127;
194-
if(i_21_ == 1)
194+
if(varPlayerValue == 1)
195195
MovedStatics.anInt200 = 96;
196-
if(i_21_ == 2)
196+
if(varPlayerValue == 2)
197197
MovedStatics.anInt200 = 64;
198-
if(i_21_ == 3)
198+
if(varPlayerValue == 3)
199199
MovedStatics.anInt200 = 32;
200-
if(i_21_ == 4)
200+
if(varPlayerValue == 4)
201201
MovedStatics.anInt200 = 0;
202202
}
203-
if(i == 6)
204-
MovedStatics.anInt2280 = i_21_;
205-
if(arg0 != -1)
206-
method309(74, -85);
207-
if(i != 5)
203+
if(varPlayerType == 6)
204+
MovedStatics.anInt2280 = varPlayerValue;
205+
if(varPlayerType != 5)
208206
break;
209-
ProducingGraphicsBuffer.oneMouseButton = i_21_;
207+
ProducingGraphicsBuffer.oneMouseButton = varPlayerValue;
210208
}
211209

212210
break;

src/main/java/com/jagex/runescape/Class22_Sub2.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.jagex.runescape.media.renderable.actor.Actor;
1212
import com.jagex.runescape.media.renderable.actor.Npc;
1313
import com.jagex.runescape.scene.GroundItemTile;
14+
import com.jagex.runescape.util.BitUtils;
1415

1516
public abstract class Class22_Sub2 extends Class22 {
1617
public static GameInterface aGameInterface_1887;
@@ -35,16 +36,9 @@ public static IndexedImage[] method315() {
3536
return class40_sub5_sub14_sub2s;
3637
}
3738

38-
public static void method316(int arg0) {
39-
do {
40-
Class43.aClass9_1014.clear();
41-
MovedStatics.aClass9_851.clear();
42-
if(arg0 == -11965)
43-
break;
44-
method323(-25);
45-
46-
break;
47-
} while(false);
39+
public static void method316() {
40+
Class43.aClass9_1014.clear();
41+
MovedStatics.aClass9_851.clear();
4842
}
4943

5044
public static ImageRGB[] method319(byte arg0) {
@@ -63,7 +57,7 @@ public static ImageRGB[] method319(byte arg0) {
6357
int i_4_ = class40_sub5_sub14_sub4.imageHeight * class40_sub5_sub14_sub4.imageWidth;
6458
class40_sub5_sub14_sub4.pixels = new int[i_4_];
6559
for(int i_5_ = 0; i_5_ < i_4_; i_5_++)
66-
class40_sub5_sub14_sub4.pixels[i_5_] = Buffer.anIntArray1972[HuffmanEncoding.method1021(255, is[i_5_])];
60+
class40_sub5_sub14_sub4.pixels[i_5_] = Buffer.anIntArray1972[BitUtils.bitWiseAND(255, is[i_5_])];
6761
}
6862
ActorDefinition.method569();
6963
return class40_sub5_sub14_sub4s;

src/main/java/com/jagex/runescape/Class22_Sub2_Sub2.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.jagex.runescape;
22

33
import com.jagex.runescape.audio.MidiFileReader;
4-
import com.jagex.runescape.cache.def.UnderlayDefinition;
4+
import com.jagex.runescape.util.BitUtils;
55
import com.jagex.runescape.util.Signlink;
66

77
public class Class22_Sub2_Sub2 extends Class22_Sub2 implements Runnable {
@@ -41,7 +41,7 @@ public static void method326(int arg0, byte arg1, int arg2, int arg3, int arg4)
4141
}
4242
anIntArray2227[anInt2229++] = -anInt2226 + arg3;
4343
anInt2226 = arg3;
44-
anIntArray2227[anInt2229++] = UnderlayDefinition.bitWiseOR(UnderlayDefinition.bitWiseOR(arg4, arg0 << 8), arg2 << 16);
44+
anIntArray2227[anInt2229++] = BitUtils.bitWiseOR(BitUtils.bitWiseOR(arg4, arg0 << 8), arg2 << 16);
4545

4646
}
4747

src/main/java/com/jagex/runescape/Class24.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.jagex.runescape.cache.CacheArchive;
44
import com.jagex.runescape.cache.def.GameObjectDefinition;
55
import com.jagex.runescape.cache.def.OverlayDefinition;
6-
import com.jagex.runescape.cache.def.VarbitDefinition;
76
import com.jagex.runescape.cache.media.ImageRGB;
87
import com.jagex.runescape.cache.media.IndexedImage;
98
import com.jagex.runescape.io.Buffer;
@@ -64,7 +63,7 @@ public static void method341(int arg0, Scene arg1, int arg2, int arg3, int arg4,
6463
if(i_3_ == arg5 && arg0 <= i_4_ && i_4_ < 8 + arg0 && arg9 <= i_7_ && arg9 + 8 > i_7_) {
6564
GameObjectDefinition gameObjectDefinition = GameObjectDefinition.getDefinition(i);
6665
int i_9_ = Main.method42(arg2 ^ 0x1, i_8_, gameObjectDefinition.sizeX, i_4_ & 0x7, gameObjectDefinition.sizeY, arg4, 0x7 & i_7_) + arg10;
67-
int i_10_ = VarbitDefinition.method564(i_7_ & 0x7, gameObjectDefinition.sizeY, i_4_ & 0x7, gameObjectDefinition.sizeX, arg4, i_8_) + arg7;
66+
int i_10_ = method564(i_7_ & 0x7, gameObjectDefinition.sizeY, i_4_ & 0x7, gameObjectDefinition.sizeX, arg4, i_8_) + arg7;
6867
if(i_9_ > 0 && i_10_ > 0 && i_9_ < 103 && i_10_ < 103) {
6968
CollisionMap collisionMap = null;
7069
int i_11_ = arg3;
@@ -84,4 +83,20 @@ public static void method341(int arg0, Scene arg1, int arg2, int arg3, int arg4,
8483
break;
8584
} while(false);
8685
}
86+
87+
public static int method564(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5) {
88+
arg4 &= 0x3;
89+
if((arg5 & 0x1) == 1) {
90+
int i = arg3;
91+
arg3 = arg1;
92+
arg1 = i;
93+
}
94+
if(arg4 == 0)
95+
return arg0;
96+
if(arg4 == 1)
97+
return 1 + -arg3 + 7 - arg2;
98+
if(arg4 == 2)
99+
return -arg1 + 1 + -arg0 + 7;
100+
return arg2;
101+
}
87102
}

0 commit comments

Comments
 (0)