Skip to content

Commit d8f5312

Browse files
committed
refactor: clean up remaining statics in definitions
1 parent 672272d commit d8f5312

Some content is hidden

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

45 files changed

+305
-344
lines changed

src/main/java/org/runejs/OldEngine/MapDecompressor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.runejs.client.Projectile;
99
import org.runejs.client.Landscape;
1010
import org.runejs.client.MovedStatics;
11-
import org.runejs.client.cache.def.OverlayDefinition;
1211
import org.runejs.client.media.renderable.actor.Npc;
1312
import org.runejs.client.scene.util.CollisionMap;
1413

@@ -125,7 +124,7 @@ public static void spawnObject(int objectId, int x, int y, int z, int rotation,
125124
int localY = y - Class26.baseY; // ??? is this correct?
126125
int plane = z;
127126
if(localX > -1 && localY > -1) {
128-
if((OverlayDefinition.tile_flags[1][localY][localX] & 2) == 2) {
127+
if((MovedStatics.tile_flags[1][localY][localX] & 2) == 2) {
129128
plane--;
130129
}
131130
}

src/main/java/org/runejs/OldEngine/ObjectDecompressor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.runejs.client.Projectile;
99
import org.runejs.client.Landscape;
1010
import org.runejs.client.MovedStatics;
11-
import org.runejs.client.cache.def.OverlayDefinition;
1211
import org.runejs.client.io.Buffer;
1312
import org.runejs.client.media.renderable.actor.Npc;
1413
import org.runejs.client.scene.util.CollisionMap;
@@ -128,7 +127,7 @@ public static void spawnObject(int objectId, int x, int y, int z, int rotation,
128127
int localY = y - Class26.baseY; // ??? is this correct?
129128
int plane = z;
130129
if(localX > -1 && localY > -1) {
131-
if((OverlayDefinition.tile_flags[1][localY][localX] & 2) == 2) {
130+
if((MovedStatics.tile_flags[1][localY][localX] & 2) == 2) {
132131
plane--;
133132
}
134133
}

src/main/java/org/runejs/client/Class13.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.runejs.client;
22

33
import org.runejs.client.node.Class40_Sub6;
4-
import org.runejs.client.cache.def.IdentityKit;
54
import org.runejs.client.cache.media.IndexedImage;
65
import org.runejs.client.cache.media.gameInterface.GameInterface;
76
import org.runejs.client.cache.media.gameInterface.GameInterfaceArea;
@@ -55,7 +54,7 @@ public static void handleRequests() {
5554
for(; ; ) {
5655
Class40_Sub6 class40_sub6;
5756
synchronized(RSCanvas.aLinkedList_53) {
58-
class40_sub6 = (Class40_Sub6) IdentityKit.aLinkedList_2604.removeFirst();
57+
class40_sub6 = (Class40_Sub6) MovedStatics.aLinkedList_2604.removeFirst();
5958
}
6059
if(class40_sub6 == null)
6160
break;

src/main/java/org/runejs/client/Class40_Sub3.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ private static ImageRGB[] method319() {
326326
ImageRGB[] class40_sub5_sub14_sub4s = new ImageRGB[MovedStatics.anInt2581];
327327
for(int i = 0; i < MovedStatics.anInt2581; i++) {
328328
ImageRGB class40_sub5_sub14_sub4 = class40_sub5_sub14_sub4s[i] = new ImageRGB();
329-
class40_sub5_sub14_sub4.maxWidth = ItemDefinition.imageMaxWidth;
329+
class40_sub5_sub14_sub4.maxWidth = MovedStatics.imageMaxWidth;
330330
class40_sub5_sub14_sub4.maxHeight = MovedStatics.imageMaxHeight;
331331
class40_sub5_sub14_sub4.offsetX = Class57.anIntArray1347[i];
332332
class40_sub5_sub14_sub4.offsetY = Actor.anIntArray3111[i];

src/main/java/org/runejs/client/Class43.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.runejs.client;
22

3-
import org.runejs.client.cache.def.ItemDefinition;
4-
import org.runejs.client.cache.def.OverlayDefinition;
53
import org.runejs.client.cache.media.TypeFace;
64
import org.runejs.client.cache.media.gameInterface.GameInterface;
75
import org.runejs.client.cache.media.gameInterface.GameInterfaceArea;
@@ -69,7 +67,7 @@ public static void processRightClick() {
6967
if(GameInterface.fullscreenInterfaceId == -1) {
7068
MovedStatics.method445();
7169
Item.anInt3065 = -1;
72-
OverlayDefinition.hoveredWidgetChildId = -1;
70+
MovedStatics.hoveredWidgetChildId = -1;
7371
boolean bool = false;
7472
// Right game screen
7573
if(ScreenController.isCoordinatesIn3dScreen(MouseHandler.mouseX , MouseHandler.mouseY )) {
@@ -87,18 +85,18 @@ public static void processRightClick() {
8785
}
8886

8987
MovedStatics.anInt573 = Item.anInt3065;
90-
ItemDefinition.anInt2850 = OverlayDefinition.hoveredWidgetChildId;
88+
MovedStatics.anInt2850 = MovedStatics.hoveredWidgetChildId;
9189
Item.anInt3065 = -1;
92-
OverlayDefinition.hoveredWidgetChildId = -1;
90+
MovedStatics.hoveredWidgetChildId = -1;
9391
// Right click tab
9492
if(ScreenController.isCoordinatesInTabArea(MouseHandler.mouseX, MouseHandler.mouseY)) {
9593
ScreenController.handleTabClick(MouseHandler.mouseX, MouseHandler.mouseY);
9694
}
97-
if(OverlayDefinition.hoveredWidgetChildId != CollisionMap.currentHoveredWidgetChildId) {
95+
if(MovedStatics.hoveredWidgetChildId != CollisionMap.currentHoveredWidgetChildId) {
9896
GameInterface.redrawTabArea = true;
99-
CollisionMap.currentHoveredWidgetChildId = OverlayDefinition.hoveredWidgetChildId;
97+
CollisionMap.currentHoveredWidgetChildId = MovedStatics.hoveredWidgetChildId;
10098
}
101-
OverlayDefinition.hoveredWidgetChildId = -1;
99+
MovedStatics.hoveredWidgetChildId = -1;
102100
if(Item.anInt3065 != FloorDecoration.anInt614) {
103101
FloorDecoration.anInt614 = Item.anInt3065;
104102
GameInterface.redrawTabArea = true;
@@ -110,9 +108,9 @@ public static void processRightClick() {
110108
}
111109

112110
// Set hovering for chat widgets
113-
if((GameInterface.chatboxInterfaceId != -1 || ChatBox.dialogueId != -1) && Class55.currentHoveredChatboxWidgetChildId != OverlayDefinition.hoveredWidgetChildId) {
111+
if((GameInterface.chatboxInterfaceId != -1 || ChatBox.dialogueId != -1) && Class55.currentHoveredChatboxWidgetChildId != MovedStatics.hoveredWidgetChildId) {
114112
ChatBox.redrawChatbox = true;
115-
Class55.currentHoveredChatboxWidgetChildId = OverlayDefinition.hoveredWidgetChildId;
113+
Class55.currentHoveredChatboxWidgetChildId = MovedStatics.hoveredWidgetChildId;
116114
}
117115

118116
if((GameInterface.chatboxInterfaceId != -1 || ChatBox.dialogueId != -1) && Item.anInt3065 != MovedStatics.anInt1586) {
@@ -144,9 +142,9 @@ public static void processRightClick() {
144142
}
145143
} else {
146144
Item.anInt3065 = -1;
147-
OverlayDefinition.hoveredWidgetChildId = -1;
145+
MovedStatics.hoveredWidgetChildId = -1;
148146
Class13.handleInterfaceActions(GameInterfaceArea.GAME_AREA, MouseHandler.mouseX, MouseHandler.mouseY, 0, 0, 765, 503, GameInterface.fullscreenInterfaceId);
149-
ItemDefinition.anInt2850 = OverlayDefinition.hoveredWidgetChildId;
147+
MovedStatics.anInt2850 = MovedStatics.hoveredWidgetChildId;
150148
MovedStatics.anInt573 = Item.anInt3065;
151149
}
152150
}

src/main/java/org/runejs/client/Class44.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.runejs.client;
22

3-
import org.runejs.client.cache.def.IdentityKit;
43
import org.runejs.client.cache.media.AnimationSequence;
54
import org.runejs.client.cache.media.IndexedImage;
65
import org.runejs.client.io.Buffer;
@@ -141,7 +140,7 @@ public void run() {
141140
} else if(class40_sub6.anInt2112 == 1) {
142141
class40_sub6.aByteArray2102 = class40_sub6.cacheIndex.get((int) class40_sub6.key);
143142
synchronized(RSCanvas.aLinkedList_53) {
144-
IdentityKit.aLinkedList_2604.addLast(class40_sub6);
143+
MovedStatics.aLinkedList_2604.addLast(class40_sub6);
145144
}
146145
}
147146
synchronized(CollisionMap.anObject162) {

src/main/java/org/runejs/client/Class51.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.runejs.client;
22

3-
import org.runejs.client.cache.def.ItemDefinition;
43
import org.runejs.client.cache.def.ActorDefinition;
54
import org.runejs.client.cache.media.gameInterface.GameInterface;
65
import org.runejs.client.frame.ChatBox;
@@ -31,7 +30,7 @@ public static int getKeyChar(KeyEvent arg1) {
3130
public static void method940(String arg1, boolean arg2, String arg3) {
3231
if(MovedStatics.clearScreen) {
3332
MovedStatics.clearScreen = false;
34-
ItemDefinition.drawWelcomeScreenGraphics();
33+
MovedStatics.drawWelcomeScreenGraphics();
3534
LinkedList.drawChatBoxGraphics();
3635
Class55.drawTabGraphics();
3736
ActorDefinition.drawMapBack();

src/main/java/org/runejs/client/Class59.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.runejs.client;
22

3-
import org.runejs.client.cache.def.OverlayDefinition;
43
import org.runejs.client.cache.media.IndexedImage;
54
import org.runejs.client.input.KeyFocusListener;
65
import org.runejs.client.media.VertexNormal;
@@ -42,9 +41,9 @@ public static void setLowMemory() {
4241
public static int getVisibilityPlaneFor(int arg0, int arg1, int arg2, int arg3) {
4342
if(arg2 != 0)
4443
getVisibilityPlaneFor(-73, 123, 115, 98);
45-
if((OverlayDefinition.tile_flags[arg0][arg3][arg1] & 0x8) != 0)
44+
if((MovedStatics.tile_flags[arg0][arg3][arg1] & 0x8) != 0)
4645
return 0;
47-
if(arg0 > 0 && (OverlayDefinition.tile_flags[1][arg3][arg1] & 0x2) != 0)
46+
if(arg0 > 0 && (MovedStatics.tile_flags[1][arg3][arg1] & 0x2) != 0)
4847
return -1 + arg0;
4948
return arg0;
5049
}

src/main/java/org/runejs/client/Class60.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.runejs.client;
22

33
import org.runejs.client.cache.CacheArchive;
4-
import org.runejs.client.cache.def.*;
54
import org.runejs.client.cache.media.ImageRGB;
65
import org.runejs.client.cache.media.IndexedImage;
76
import org.runejs.client.cache.media.TypeFace;
@@ -278,18 +277,18 @@ public static void updateLogin() {
278277
}
279278
}
280279
if(loginScreenFocus == 0) {
281-
if(ItemDefinition.anInt2854 == 85 && Native.username.length() > 0)
280+
if(MovedStatics.anInt2854 == 85 && Native.username.length() > 0)
282281
Native.username = Native.username.substring(0, -1 + Native.username.length());
283-
if(ItemDefinition.anInt2854 == 84 || ItemDefinition.anInt2854 == 80)
282+
if(MovedStatics.anInt2854 == 84 || MovedStatics.anInt2854 == 80)
284283
loginScreenFocus = 1;
285284
if(bool && Native.username.length() < 18)
286285
Native.username = Native.username.addChar(Class59.anInt1388);
287286
} else if(loginScreenFocus == 1) {
288-
if(ItemDefinition.anInt2854 == 85 && Native.password.length() > 0)
287+
if(MovedStatics.anInt2854 == 85 && Native.password.length() > 0)
289288
Native.password = Native.password.substring(0, Native.password.length() + -1);
290-
if(ItemDefinition.anInt2854 == 80)
289+
if(MovedStatics.anInt2854 == 80)
291290
loginScreenFocus = 0;
292-
if(ItemDefinition.anInt2854 == 84) {
291+
if(MovedStatics.anInt2854 == 84) {
293292
Native.username = Native.username.method62().method85();
294293
setLoginScreenMessage("", English.connectingToServer, "");
295294
MovedStatics.processGameStatus(20);
@@ -511,14 +510,14 @@ private static void method836(int arg0) {
511510
Class17.anIntArray466[i - arg0] = (int) (16.0 * Math.sin((double) MovedStatics.pulseCycle / 14.0) + 14.0 * Math.sin((double) MovedStatics.pulseCycle / 15.0) + 12.0 * Math.sin((double) MovedStatics.pulseCycle / 16.0));
512511
if (MovedStatics.anInt2452 > 0)
513512
MovedStatics.anInt2452 -= 4;
514-
if (IdentityKit.anInt2613 > 0)
515-
IdentityKit.anInt2613 -= 4;
516-
if (MovedStatics.anInt2452 == 0 && IdentityKit.anInt2613 == 0) {
513+
if (MovedStatics.anInt2613 > 0)
514+
MovedStatics.anInt2613 -= 4;
515+
if (MovedStatics.anInt2452 == 0 && MovedStatics.anInt2613 == 0) {
517516
int i_15_ = (int) (2000.0 * Math.random());
518517
if (i_15_ == 0)
519518
MovedStatics.anInt2452 = 1024;
520519
if (i_15_ == 1)
521-
IdentityKit.anInt2613 = 1024;
520+
MovedStatics.anInt2613 = 1024;
522521
}
523522
}
524523

src/main/java/org/runejs/client/GameShell.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.runejs.client;
22

3-
import org.runejs.client.cache.def.IdentityKit;
43
import org.runejs.client.frame.ScreenController;
54
import org.runejs.client.frame.ScreenMode;
65
import org.runejs.client.input.MouseHandler;
@@ -59,7 +58,7 @@ public void run() {
5958
}
6059
}
6160
setCanvas();
62-
ProducingGraphicsBuffer_Sub1.aProducingGraphicsBuffer_2213 = MovedStatics.createGraphicsBuffer(Class12.width, IdentityKit.height, MouseHandler.gameCanvas);
61+
ProducingGraphicsBuffer_Sub1.aProducingGraphicsBuffer_2213 = MovedStatics.createGraphicsBuffer(Class12.width, MovedStatics.height, MouseHandler.gameCanvas);
6362
startup();
6463
SceneCluster.gameTimer = Timer.create();
6564
SceneCluster.gameTimer.start();
@@ -175,7 +174,7 @@ public synchronized void paint(Graphics arg0) {
175174
if (Signlink.javaVersion == null || !Signlink.javaVersion.startsWith("1.5") || -MovedStatics.aLong174 + System.currentTimeMillis() <= 1000L)
176175
return;
177176
Rectangle rectangle = arg0.getClipBounds();
178-
if (rectangle == null || rectangle.width >= Class12.width && rectangle.height >= IdentityKit.height)
177+
if (rectangle == null || rectangle.width >= Class12.width && rectangle.height >= MovedStatics.height)
179178
MovedStatics.aBoolean1575 = true;
180179
}
181180
}
@@ -210,7 +209,7 @@ public void displayClientFrame(int clientVersion, int width, int height, int fil
210209
}
211210
Class12.width = height;
212211
Class39.anInt901 = clientVersion;
213-
IdentityKit.height = width;
212+
MovedStatics.height = width;
214213
currentGameShell = this;
215214
if (Main.signlink == null) {
216215
try {
@@ -246,7 +245,7 @@ public void runAfterGameLoop() {
246245
if (MovedStatics.anInt938++ > 50) {
247246
MovedStatics.anInt938 -= 50;
248247
MovedStatics.clearScreen = true;
249-
MouseHandler.gameCanvas.setSize(Class12.width, IdentityKit.height);
248+
MouseHandler.gameCanvas.setSize(Class12.width, MovedStatics.height);
250249
MouseHandler.gameCanvas.setVisible(true);
251250
MouseHandler.gameCanvas.setBackground(Color.BLACK);
252251
if (clientFrame == null)
@@ -273,7 +272,7 @@ public void openClientApplet(String cacheFolder, int cacheIndexes, int fileStore
273272
int width = 765;
274273
Class39.anInt901 = clientVersion;
275274
Class12.width = width;
276-
IdentityKit.height = height;
275+
MovedStatics.height = height;
277276
currentGameShell = this;
278277
clientFrame = new Frame();
279278
clientFrame.setTitle(Configuration.SERVER_DISPLAY_NAME);
@@ -329,7 +328,7 @@ public synchronized void setCanvas() {
329328
}
330329
MouseHandler.gameCanvas = new RSCanvas(this);
331330
container.add(MouseHandler.gameCanvas);
332-
MouseHandler.gameCanvas.setSize(Class12.width, IdentityKit.height);
331+
MouseHandler.gameCanvas.setSize(Class12.width, MovedStatics.height);
333332
MouseHandler.gameCanvas.setVisible(true);
334333
if (clientFrame != null) {
335334
Insets insets = clientFrame.getInsets();

0 commit comments

Comments
 (0)