Skip to content

Commit a8d3466

Browse files
authored
Merge branch 'master' into refactor/gpu-preperations
2 parents 679e6ef + 4e4c6f1 commit a8d3466

34 files changed

+1713
-1576
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public static void spawnObject(int objectId, int x, int y, int z, int rotation,
132132
class20 = groundData[plane];
133133
}
134134
if(localY > 0 && localX > 0 && localY < 103 && localX < 103) {
135-
Landscape.addObject(objectId, localX, localY, z, rotation, type, Game.currentScene, class20);
135+
Game.currentScene.landscape.addObject(objectId, localX, localY, z, rotation, type, class20);
136136
}
137137
}
138138

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public static void spawnObject(int objectId, int x, int y, int z, int rotation,
135135
class20 = groundData[plane];
136136
}
137137
if(localY > 0 && localX > 0 && localY < 103 && localX < 103) {
138-
Landscape.addObject(objectId, localX, localY, z, rotation, type, Game.currentScene, class20);
138+
Game.currentScene.landscape.addObject(objectId, localX, localY, z, rotation, type, class20);
139139
}
140140
}
141141

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

Lines changed: 41 additions & 38 deletions
Large diffs are not rendered by default.

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import org.runejs.client.frame.ScreenController;
44
import org.runejs.client.frame.ScreenMode;
5-
import org.runejs.client.scene.SceneCluster;
5+
import org.runejs.client.language.Native;
6+
import org.runejs.client.media.renderable.actor.Player;
67
import org.runejs.client.util.Signlink;
78
import org.runejs.client.util.Timer;
89

@@ -66,7 +67,7 @@ public void run() {
6667
}
6768
}
6869
if (Game.signlink.gameShell != null) {
69-
Method method = Signlink.aMethod724;
70+
Method method = Signlink.setFocusCycleRoot;
7071
if (method != null) {
7172
try {
7273
method.invoke(Game.signlink.gameShell, Boolean.TRUE);
@@ -77,12 +78,12 @@ public void run() {
7778
setCanvas();
7879
MovedStatics.aProducingGraphicsBuffer_2213 = MovedStatics.createGraphicsBuffer(MovedStatics.width, MovedStatics.height, Game.gameCanvas);
7980
this.game.startup();
80-
SceneCluster.gameTimer = Timer.create();
81-
SceneCluster.gameTimer.start();
81+
Game.gameTimer = Timer.create();
82+
Game.gameTimer.start();
8283

8384
// Initialize client loop
8485
while (exitTimeInMillis == 0L || System.currentTimeMillis() < exitTimeInMillis) {
85-
MovedStatics.ticksPerLoop = SceneCluster.gameTimer.getTicks(millisPerTick, anInt2024);
86+
MovedStatics.ticksPerLoop = Game.gameTimer.getTicks(millisPerTick, anInt2024);
8687
for (int currentTick = 0; currentTick < MovedStatics.ticksPerLoop; currentTick++) {
8788
long currentTimeMillis = System.currentTimeMillis();
8889

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

Lines changed: 84 additions & 197 deletions
Large diffs are not rendered by default.

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

Lines changed: 155 additions & 55 deletions
Large diffs are not rendered by default.

src/main/java/org/runejs/client/cache/media/gameInterface/GameInterface.java

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.runejs.client.net.OutgoingPackets;
3434
import org.runejs.client.node.CachedNode;
3535
import org.runejs.client.node.NodeCache;
36-
import org.runejs.client.scene.SceneCluster;
3736
import org.runejs.client.util.TextUtils;
3837
import org.runejs.client.*;
3938
import org.runejs.Configuration;
@@ -1723,7 +1722,7 @@ public static boolean method166(byte arg0, GameInterface arg1) {
17231722
}
17241723
}
17251724
if(i == 205) {
1726-
SceneCluster.idleLogout = 250;
1725+
Game.idleLogout = 250;
17271726
return true;
17281727
}
17291728
if(i == 501) {
@@ -2293,6 +2292,50 @@ public static void clearInterfaceCaches() {
22932292
interfaceTypefaceCache.clear();
22942293
}
22952294

2295+
public static boolean handleSequences(int arg1) {
2296+
if(!decodeGameInterface(arg1))
2297+
return false;
2298+
GameInterface[] gameInterfaces = cachedInterfaces[arg1];
2299+
boolean bool = false;
2300+
for(int i = 0; gameInterfaces.length > i; i++) {
2301+
GameInterface gameInterface = gameInterfaces[i];
2302+
if(gameInterface != null && gameInterface.type == GameInterfaceType.MODEL) {
2303+
if(gameInterface.animation != -1 || gameInterface.alternateAnimation != -1) {
2304+
boolean bool_0_ = checkForAlternateAction(gameInterface);
2305+
int i_1_;
2306+
if(bool_0_)
2307+
i_1_ = gameInterface.alternateAnimation;
2308+
else
2309+
i_1_ = gameInterface.animation;
2310+
if(i_1_ != -1) {
2311+
AnimationSequence animationSequence = AnimationSequence.getAnimationSequence(i_1_);
2312+
gameInterface.remainingAnimationTime += MovedStatics.anInt199;
2313+
while(animationSequence.frameLengths[gameInterface.animationFrame] < gameInterface.remainingAnimationTime) {
2314+
bool = true;
2315+
gameInterface.remainingAnimationTime -= animationSequence.frameLengths[gameInterface.animationFrame];
2316+
gameInterface.animationFrame++;
2317+
if(gameInterface.animationFrame >= animationSequence.frameIds.length) {
2318+
gameInterface.animationFrame -= animationSequence.frameStep;
2319+
if(gameInterface.animationFrame < 0 || animationSequence.frameIds.length <= gameInterface.animationFrame)
2320+
gameInterface.animationFrame = 0;
2321+
}
2322+
}
2323+
}
2324+
}
2325+
if(gameInterface.rotationSpeed != 0) {
2326+
bool = true;
2327+
int i_2_ = gameInterface.rotationSpeed >> 16;
2328+
int i_3_ = gameInterface.rotationSpeed << 16 >> 16;
2329+
i_2_ *= MovedStatics.anInt199;
2330+
gameInterface.rotationX = 0x7ff & i_2_ + gameInterface.rotationX;
2331+
i_3_ *= MovedStatics.anInt199;
2332+
gameInterface.rotationZ = 0x7ff & gameInterface.rotationZ + i_3_;
2333+
}
2334+
}
2335+
}
2336+
return bool;
2337+
}
2338+
22962339
public void swapItems(int arg0, boolean arg1, int arg2) {
22972340
int i = items[arg2];
22982341
items[arg2] = items[arg0];

src/main/java/org/runejs/client/frame/Minimap.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ public class Minimap extends FramePieceRenderer {
3030
* Images for function icons on the minimap (e.g. quests, instructors)
3131
*/
3232
public static ImageRGB[] mapFunctionIcons;
33+
/**
34+
* Minimap tile rotations (move to Minimap class)
35+
*/
36+
public static int[][] anIntArrayArray121 = new int[][]{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, {12, 8, 4, 0, 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3}, {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, {3, 7, 11, 15, 2, 6, 10, 14, 1, 5, 9, 13, 0, 4, 8, 12}};
37+
/**
38+
* Minimap tile masks (move to Minimap class)
39+
*/
40+
public static int[][] anIntArrayArray129 = new int[][]{new int[16], {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1}, {1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1}};
3341
private static int[] resizableMinimapOffsets1;
3442
private static int[] resizableMinimapOffsets2;
3543
private static ProducingGraphicsBuffer resizableMiniMapimage;

src/main/java/org/runejs/client/frame/ScreenController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static void setBounds() {
108108
}
109109

110110

111-
Scene.computeTileVisibilityMaps(500, 800, frameMode == ScreenMode.FIXED ? 512 : drawWidth, frameMode == ScreenMode.FIXED ? 334 : drawHeight, is);
111+
Game.sceneRenderer.precalculateTileVisibility(frameMode == ScreenMode.FIXED ? 512 : drawWidth, frameMode == ScreenMode.FIXED ? 334 : drawHeight, 500, 800, is);
112112
Game.gameCanvas.setSize(ScreenController.frameMode == ScreenMode.FIXED ? 512 : ScreenController.drawWidth, ScreenController.frameMode == ScreenMode.FIXED ? 334 : ScreenController.drawHeight);
113113

114114
if (Game.gameStatusCode <= 35 && Game.gameStatusCode >= 30) {

src/main/java/org/runejs/client/input/KeyFocusListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class KeyFocusListener implements KeyListener, FocusListener {
3131
}
3232

3333
public static void addListeners(Component arg0) {
34-
Method method = Signlink.aMethod729;
34+
Method method = Signlink.setFocusTraversalKeysEnabled;
3535
if(method != null) {
3636
try {
3737
method.invoke(arg0, Boolean.FALSE);
@@ -71,7 +71,7 @@ public static void method997() {
7171
anIntArray1564[91] = 42;
7272
anIntArray1564[92] = 74;
7373
anIntArray1564[93] = 43;
74-
if (Signlink.aMethod729 == null) {
74+
if (Signlink.setFocusTraversalKeysEnabled == null) {
7575
anIntArray1564[192] = 58;
7676
anIntArray1564[222] = 59;
7777
} else {

0 commit comments

Comments
 (0)