Skip to content

Commit 31f3452

Browse files
committed
chore: Renamed some component redraw fields
1 parent 2efabd9 commit 31f3452

File tree

2 files changed

+55
-52
lines changed

2 files changed

+55
-52
lines changed

src/main/java/jagex3/client/Client.java

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ public class Client extends GameShell {
829829
public static int bankArrangeMode = 0;
830830

831831
@ObfuscatedName("client.ka")
832-
public static IfType resumePausedButton = null;
832+
public static IfType resumePauseCom = null;
833833

834834
@ObfuscatedName("client.kr")
835835
public static int runenergy = 0;
@@ -966,13 +966,13 @@ public class Client extends GameShell {
966966
public static int componentDrawTime = -2;
967967

968968
@ObfuscatedName("client.mq")
969-
public static boolean[] componentRedrawRequested1 = new boolean[100];
969+
public static boolean[] componentDirtyArea = new boolean[100];
970970

971971
@ObfuscatedName("client.me")
972-
public static boolean[] componentRedrawRequested2 = new boolean[100];
972+
public static boolean[] componentBlitArea = new boolean[100];
973973

974974
@ObfuscatedName("client.mn")
975-
public static boolean[] componentDrawSomething2 = new boolean[100];
975+
public static boolean[] componentRedraw = new boolean[100];
976976

977977
@ObfuscatedName("client.mi")
978978
public static int[] componentDrawX = new int[100];
@@ -1460,9 +1460,9 @@ public final void mainredraw() {
14601460
try {
14611461
Graphics g = GameShell.canvas.getGraphics();
14621462
for (int i = 0; i < componentDrawCount; i++) {
1463-
if (componentRedrawRequested2[i]) {
1463+
if (componentBlitArea[i]) {
14641464
GameShell.drawArea.draw(g, componentDrawX[i], componentDrawY[i], componentDrawWidth[i], componentDrawHeight[i]);
1465-
componentRedrawRequested2[i] = false;
1465+
componentBlitArea[i] = false;
14661466
}
14671467
}
14681468
} catch (Exception ex) {
@@ -1474,7 +1474,7 @@ public final void mainredraw() {
14741474
GameShell.drawArea.draw(g, 0, 0);
14751475
fullredraw = false;
14761476
for (int i = 0; i < componentDrawCount; i++) {
1477-
componentRedrawRequested2[i] = false;
1477+
componentBlitArea[i] = false;
14781478
}
14791479
} catch (Exception ex) {
14801480
GameShell.canvas.repaint();
@@ -2755,12 +2755,12 @@ public static void gameDraw() {
27552755
}
27562756

27572757
for (int i = 0; i < componentDrawCount; i++) {
2758-
if (componentRedrawRequested1[i]) {
2759-
componentRedrawRequested2[i] = true;
2758+
if (componentDirtyArea[i]) {
2759+
componentBlitArea[i] = true;
27602760
}
27612761

2762-
componentDrawSomething2[i] = componentRedrawRequested1[i];
2763-
componentRedrawRequested1[i] = false;
2762+
componentRedraw[i] = componentDirtyArea[i];
2763+
componentDirtyArea[i] = false;
27642764
}
27652765

27662766
componentDrawTime = loopCycle;
@@ -2785,9 +2785,9 @@ public static void gameDraw() {
27852785

27862786
if (componentRectDebug == 3) {
27872787
for (int i = 0; i < componentDrawCount; i++) {
2788-
if (componentDrawSomething2[i]) {
2788+
if (componentRedraw[i]) {
27892789
Pix2D.fillRectTrans(componentDrawX[i], componentDrawY[i], componentDrawWidth[i], componentDrawHeight[i], 0xff00ff, 0x80);
2790-
} else if (componentRedrawRequested2[i]) {
2790+
} else if (componentBlitArea[i]) {
27912791
Pix2D.fillRectTrans(componentDrawX[i], componentDrawY[i], componentDrawWidth[i], componentDrawHeight[i], 0xff0000, 0x80);
27922792
}
27932793
}
@@ -2919,7 +2919,7 @@ public static void loginDone() {
29192919

29202920
toplevelinterface = -1;
29212921
subinterfaces = new HashTable(8);
2922-
resumePausedButton = null;
2922+
resumePauseCom = null;
29232923

29242924
isMenuOpen = false;
29252925
menuNumEntries = 0;
@@ -2937,7 +2937,7 @@ public static void loginDone() {
29372937
js5Loading = true;
29382938

29392939
for (int var14 = 0; var14 < 100; var14++) {
2940-
componentRedrawRequested1[var14] = true;
2940+
componentDirtyArea[var14] = true;
29412941
}
29422942

29432943
chatDisplayName = null;
@@ -3052,7 +3052,7 @@ public static void reconnectDone() {
30523052
setMainState(30);
30533053

30543054
for (int i = 0; i < 100; i++) {
3055-
componentRedrawRequested1[i] = true;
3055+
componentDirtyArea[i] = true;
30563056
}
30573057
}
30583058

@@ -4079,7 +4079,7 @@ public static void messageBox(String arg0, boolean arg1) {
40794079
int var12 = var6;
40804080
for (int var13 = 0; var13 < componentDrawCount; var13++) {
40814081
if (componentDrawWidth[var13] + componentDrawX[var13] > var9 && componentDrawX[var13] < var9 + var11 && componentDrawHeight[var13] + componentDrawY[var13] > var10 && componentDrawY[var13] < var10 + var12) {
4082-
componentRedrawRequested2[var13] = true;
4082+
componentBlitArea[var13] = true;
40834083
}
40844084
}
40854085
}
@@ -5812,9 +5812,9 @@ public static boolean tcpIn() {
58125812
if (var93 != null) {
58135813
closeSubInterface(var93, true);
58145814
}
5815-
if (resumePausedButton != null) {
5816-
componentUpdated(resumePausedButton);
5817-
resumePausedButton = null;
5815+
if (resumePauseCom != null) {
5816+
componentUpdated(resumePauseCom);
5817+
resumePauseCom = null;
58185818
}
58195819

58205820
ptype = -1;
@@ -5946,16 +5946,16 @@ public static boolean tcpIn() {
59465946

59475947
if (
59485948
ptype == 205 ||
5949-
ptype == 106 ||
5950-
ptype == 245 ||
5951-
ptype == 215 ||
5952-
ptype == 20 ||
5953-
ptype == 32 ||
5954-
ptype == 207 ||
5955-
ptype == 173 ||
5956-
ptype == 6 ||
5957-
ptype == 7 ||
5958-
ptype == 154
5949+
ptype == 106 ||
5950+
ptype == 245 ||
5951+
ptype == 215 ||
5952+
ptype == 20 ||
5953+
ptype == 32 ||
5954+
ptype == 207 ||
5955+
ptype == 173 ||
5956+
ptype == 6 ||
5957+
ptype == 7 ||
5958+
ptype == 154
59595959
) {
59605960
zonePacket();
59615961
ptype = -1;
@@ -6056,7 +6056,7 @@ public static boolean tcpIn() {
60566056
ifAnimReset(var137);
60576057
ScriptRunner.executeOnLoad(toplevelinterface);
60586058
for (int var138 = 0; var138 < 100; var138++) {
6059-
componentRedrawRequested1[var138] = true;
6059+
componentDirtyArea[var138] = true;
60606060
}
60616061

60626062
ptype = -1;
@@ -6262,7 +6262,7 @@ public static boolean tcpIn() {
62626262
ifAnimReset(toplevelinterface);
62636263
ScriptRunner.executeOnLoad(toplevelinterface);
62646264
for (int var181 = 0; var181 < 100; var181++) {
6265-
componentRedrawRequested1[var181] = true;
6265+
componentDirtyArea[var181] = true;
62666266
}
62676267
}
62686268
while (var180-- > 0) {
@@ -8198,7 +8198,7 @@ public static void getNpcPosExtended() {
81988198
public static void dirtyArea(int arg0, int arg1, int arg2, int arg3) {
81998199
for (int i = 0; i < componentDrawCount; i++) {
82008200
if (componentDrawWidth[i] + componentDrawX[i] > arg0 && componentDrawX[i] < arg0 + arg2 && componentDrawHeight[i] + componentDrawY[i] > arg1 && componentDrawY[i] < arg1 + arg3) {
8201-
componentRedrawRequested1[i] = true;
8201+
componentDirtyArea[i] = true;
82028202
}
82038203
}
82048204
}
@@ -8328,7 +8328,7 @@ public static void sortMinimenu() {
83288328
public static void imethod26(int var37, int var38, int var39, int var40) {
83298329
for (int var41 = 0; var41 < componentDrawCount; var41++) {
83308330
if (componentDrawWidth[var41] + componentDrawX[var41] > var37 && componentDrawX[var41] < var37 + var39 && componentDrawHeight[var41] + componentDrawY[var41] > var38 && componentDrawY[var41] < var38 + var40) {
8331-
componentRedrawRequested2[var41] = true;
8331+
componentBlitArea[var41] = true;
83328332
}
83338333
}
83348334
}
@@ -9147,14 +9147,14 @@ public static void doAction(int arg0) {
91479147
}
91489148

91499149
if (action == 30) {
9150-
if (resumePausedButton == null) {
9150+
if (resumePauseCom == null) {
91519151
// RESUME_PAUSEBUTTON
91529152
out.p1Enc(242);
91539153
out.p2_alt2(b);
91549154
out.p4(c);
91559155

9156-
resumePausedButton = IfType.get(c, b);
9157-
componentUpdated(resumePausedButton);
9156+
resumePauseCom = IfType.get(c, b);
9157+
componentUpdated(resumePauseCom);
91589158
}
91599159
}
91609160

@@ -9856,7 +9856,7 @@ public static void addComponentOptions(IfType com, int mouseX, int mouseY) {
98569856
addMenuOption(com.buttonText, "", 29, 0, 0, com.parentId);
98579857
}
98589858

9859-
if (com.buttonType == 6 && resumePausedButton == null) {
9859+
if (com.buttonType == 6 && resumePauseCom == null) {
98609860
addMenuOption(com.buttonText, "", 30, 0, -1, com.parentId);
98619861
}
98629862

@@ -10023,10 +10023,10 @@ public static void drawInterface(int id, int arg1, int arg2, int arg3, int arg4,
1002310023
dragChildren = null;
1002410024
}
1002510025
} else if (arg7 != -1) {
10026-
componentRedrawRequested1[arg7] = true;
10026+
componentDirtyArea[arg7] = true;
1002710027
} else {
1002810028
for (int i = 0; i < 100; i++) {
10029-
componentRedrawRequested1[i] = true;
10029+
componentDirtyArea[i] = true;
1003010030
}
1003110031
}
1003210032
}
@@ -10212,7 +10212,7 @@ public static void drawLayer(IfType[] children, int layerid, int x, int y, int w
1021210212
Pix3D.setRenderClipping();
1021310213
}
1021410214

10215-
if (!componentDrawSomething2[drawCount] && componentRectDebug <= 1) {
10215+
if (!componentRedraw[drawCount] && componentRectDebug <= 1) {
1021610216
continue;
1021710217
}
1021810218

@@ -10379,7 +10379,7 @@ public static void drawLayer(IfType[] children, int layerid, int x, int y, int w
1037910379
}
1038010380
}
1038110381

10382-
if (resumePausedButton == com) {
10382+
if (resumePauseCom == com) {
1038310383
text = Text.PLEASEWAIT;
1038410384
colour = com.colour;
1038510385
}
@@ -11472,14 +11472,14 @@ public static void loopIf3Drag() {
1147211472
@ObfuscatedName("cq.fy(Leg;I)V")
1147311473
public static void componentUpdated(IfType com) {
1147411474
if (componentDrawTime == com.drawTime) {
11475-
componentRedrawRequested1[com.drawCount] = true;
11475+
componentDirtyArea[com.drawCount] = true;
1147611476
}
1147711477
}
1147811478

1147911479
// todo: guessing that this may be inlined from repeat use
1148011480
public static void redrawAllComponents() {
1148111481
for (int i = 0; i < 100; i++) {
11482-
componentRedrawRequested1[i] = true;
11482+
componentDirtyArea[i] = true;
1148311483
}
1148411484
}
1148511485

@@ -11796,9 +11796,9 @@ public static void closeModal() {
1179611796
}
1179711797
}
1179811798

11799-
if (resumePausedButton != null) {
11800-
componentUpdated(resumePausedButton);
11801-
resumePausedButton = null;
11799+
if (resumePauseCom != null) {
11800+
componentUpdated(resumePauseCom);
11801+
resumePauseCom = null;
1180211802
}
1180311803
}
1180411804

@@ -11818,9 +11818,9 @@ public static SubInterface openSubInterface(int arg0, int arg1, int arg2) {
1181811818
componentUpdated(var4);
1181911819
}
1182011820

11821-
if (resumePausedButton != null) {
11822-
componentUpdated(resumePausedButton);
11823-
resumePausedButton = null;
11821+
if (resumePauseCom != null) {
11822+
componentUpdated(resumePauseCom);
11823+
resumePauseCom = null;
1182411824
}
1182511825

1182611826
isMenuOpen = false;
@@ -12022,11 +12022,11 @@ public static void minimapDraw(int arg0, int arg1, int arg2) {
1202212022
Pix2D.fillScanLine(arg0, arg1, 0, compassMaskLineOffsets, compassMaskLineLengths);
1202312023
}
1202412024

12025-
if (componentDrawSomething2[arg2]) {
12025+
if (componentRedraw[arg2]) {
1202612026
mapback.plotSprite(arg0, arg1);
1202712027
}
1202812028

12029-
componentRedrawRequested2[arg2] = true;
12029+
componentBlitArea[arg2] = true;
1203012030
}
1203112031

1203212032
// jag::oldscape::minimap::Minimap::DrawArrow

src/main/java/jagex3/client/ClientBuild.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,8 @@ public static void addLoc(int arg0, int arg1, int arg2, int arg3, int arg4, int
415415
if ((mapl[arg0][arg1][arg2] & 0x10) != 0) {
416416
return;
417417
}
418+
419+
// todo: inlined method
418420
int var8;
419421
if ((mapl[arg0][arg1][arg2] & 0x8) != 0) {
420422
var8 = 0;
@@ -948,6 +950,7 @@ public static void finishBuild(World arg0, CollisionMap[] arg1) {
948950
}
949951
for (int var69 = 1; var69 < 103; var69++) {
950952
for (int var70 = 1; var70 < 103; var70++) {
953+
// todo: inlined method
951954
int var75;
952955
if ((mapl[var6][var70][var69] & 0x8) != 0) {
953956
var75 = 0;

0 commit comments

Comments
 (0)