Skip to content

Commit bf7806b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into doc/cs2-instructions
2 parents 2457526 + ab8ceb5 commit bf7806b

File tree

92 files changed

+4194
-3343
lines changed

Some content is hidden

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

92 files changed

+4194
-3343
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public Class35(CacheArchive gameTextureCacheArchive, CacheArchive gameImageCache
2020
brightness = arg3;
2121
textureSize = arg4;
2222
anInt1753 = anInt1752;
23-
int[] cacheTextures = gameTextureCacheArchive.method192(0, true);
23+
int[] cacheTextures = gameTextureCacheArchive.getFileIds(0);
2424
int textureCount = cacheTextures.length;
2525
textures = new Texture[gameTextureCacheArchive.fileLength(0)];
2626
for(int texturePointer = 0; textureCount > texturePointer; texturePointer++) {
@@ -65,7 +65,7 @@ public int[] getTexturePixels(int textureId) {
6565

6666
public int getAverageTextureColour(int arg1) {
6767
if(textures[arg1] != null)
68-
return textures[arg1].anInt2137;
68+
return textures[arg1].averageColour;
6969
return 0;
7070
}
7171

@@ -78,12 +78,12 @@ public void setBrightness(double brightness) {
7878
clearTextures();
7979
}
8080

81-
public void animateTextures(int arg1) {
81+
public void animateTextures(int deltaT) {
8282
int i = 0;
8383
for (/**/; i < textures.length; i++) {
8484
Texture texture = textures[i];
8585
if (texture != null && texture.animateDirection != 0 && texture.aBoolean2146) {
86-
texture.animate(arg1);
86+
texture.animate(deltaT);
8787
texture.aBoolean2146 = false;
8888
}
8989
}

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

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import org.runejs.client.cache.CacheArchive;
44
import org.runejs.client.cache.def.FrameDefinition;
55
import org.runejs.client.cache.def.FramemapDefinition;
6+
import org.runejs.client.cache.def.loading.DefinitionLoader;
7+
import org.runejs.client.cache.def.loading.rs435.FrameDefinitionLoader;
8+
import org.runejs.client.cache.def.loading.rs435.FramemapDefinitionLoader;
69
import org.runejs.client.cache.media.AnimationSequence;
710
import org.runejs.client.cache.def.SpotAnimDefinition;
811
import org.runejs.client.media.renderable.actor.Actor;
@@ -12,33 +15,39 @@
1215
* anim skeleton?
1316
*/
1417
public class Class40_Sub5_Sub15 extends CachedNode {
18+
public static DefinitionLoader<FramemapDefinition> framemapDefinitionLoader = new FramemapDefinitionLoader();
19+
public static DefinitionLoader<FrameDefinition> frameDefinitionLoader = new FrameDefinitionLoader();
20+
1521
public FrameDefinition[] aFrameDefinitionArray2794;
1622

17-
public Class40_Sub5_Sub15(CacheArchive arg0, CacheArchive arg1, int arg2, boolean arg3) {
23+
public Class40_Sub5_Sub15(CacheArchive skeletonArchive, CacheArchive skinArchive, int groupId, boolean arg3) {
1824
LinkedList linkedList = new LinkedList();
19-
int i = arg0.fileLength(arg2);
25+
int i = skeletonArchive.fileLength(groupId);
2026
aFrameDefinitionArray2794 = new FrameDefinition[i];
21-
int[] is = arg0.method192(arg2, true);
22-
for(int i_0_ = 0; is.length > i_0_; i_0_++) {
23-
byte[] is_1_ = arg0.getFile(arg2, is[i_0_]);
27+
int[] skeletonFileIds = skeletonArchive.getFileIds(groupId);
28+
for(int i_0_ = 0; skeletonFileIds.length > i_0_; i_0_++) {
29+
byte[] skeleton = skeletonArchive.getFile(groupId, skeletonFileIds[i_0_]);
2430
FramemapDefinition framemapDefinition = null;
25-
int i_2_ = is_1_[1] & 0xff | is_1_[0] << 8 & 0xff00;
31+
int i_2_ = skeleton[1] & 0xff | skeleton[0] << 8 & 0xff00;
2632
for(FramemapDefinition framemapDefinition_3_ = (FramemapDefinition) linkedList.peekFirst(); framemapDefinition_3_ != null; framemapDefinition_3_ = (FramemapDefinition) linkedList.pollFirst()) {
2733
if(i_2_ == framemapDefinition_3_.id) {
2834
framemapDefinition = framemapDefinition_3_;
2935
break;
3036
}
3137
}
3238
if(framemapDefinition == null) {
33-
byte[] is_4_;
39+
byte[] framemapData;
3440
if(!arg3)
35-
is_4_ = arg1.method182(0, i_2_);
41+
framemapData = skinArchive.getFileContents(i_2_, 0);
3642
else
37-
is_4_ = arg1.method182(i_2_, 0);
38-
framemapDefinition = new FramemapDefinition(i_2_, is_4_);
43+
framemapData = skinArchive.getFileContents(0, i_2_);
44+
framemapDefinition = new FramemapDefinition(i_2_, framemapDefinitionLoader, framemapData);
3945
linkedList.addLast(framemapDefinition);
4046
}
41-
aFrameDefinitionArray2794[is[i_0_]] = new FrameDefinition(is_1_, framemapDefinition);
47+
48+
int frameDefinitionId = skeletonFileIds[i_0_];
49+
50+
aFrameDefinitionArray2794[skeletonFileIds[i_0_]] = new FrameDefinition(frameDefinitionId, frameDefinitionLoader, skeleton, framemapDefinition);
4251
}
4352
}
4453

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

Lines changed: 0 additions & 49 deletions
This file was deleted.

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ public static void runClientScripts(Object[] listeners, int arg1, int arg2, Game
611611
// setscrollpos
612612
intValueIndex -= 2;
613613
gameInterface.scrollWidth = scriptIntValues[intValueIndex];
614-
gameInterface.scrollPosition = scriptIntValues[1 + intValueIndex];
614+
gameInterface.scrollDepth = scriptIntValues[1 + intValueIndex];
615615
} else if(scriptOpcode == 1101) {
616616
// setcolour
617617
int i_24_ = scriptIntValues[--intValueIndex];
@@ -720,7 +720,7 @@ public static void runClientScripts(Object[] listeners, int arg1, int arg2, Game
720720
GameInterface gameInterface = GameInterface.getInterface(scriptIntValues[intValueIndex]);
721721
int i_33_ = scriptIntValues[2 + intValueIndex];
722722
int i_34_ = scriptIntValues[intValueIndex + 1];
723-
GameInterface gameInterface_35_ = GameInterface.method361(gameInterface.children, i_33_, true, gameInterface.scrollPosition, gameInterface.id, gameInterface.scrollWidth, i_34_, 398);
723+
GameInterface gameInterface_35_ = GameInterface.method361(gameInterface.children, i_33_, true, gameInterface.scrollDepth, gameInterface.id, gameInterface.scrollWidth, i_34_, 398);
724724
if(gameInterface_35_ == null) {
725725
scriptIntValues[intValueIndex++] = 0;
726726
} else {
@@ -779,7 +779,7 @@ public static void runClientScripts(Object[] listeners, int arg1, int arg2, Game
779779
GameInterface gameInterface = GameInterface.getInterface(scriptIntValues[intValueIndex]);
780780
int i_39_ = scriptIntValues[1 + intValueIndex];
781781
int i_40_ = scriptIntValues[intValueIndex + 2];
782-
GameInterface gameInterface_41_ = GameInterface.method361(GameInterface.cachedInterfaces[gameInterface.id >> 16], i_40_, false, gameInterface.scrollPosition, 0xffff & gameInterface.id, gameInterface.scrollWidth, i_39_, 398);
782+
GameInterface gameInterface_41_ = GameInterface.method361(GameInterface.cachedInterfaces[gameInterface.id >> 16], i_40_, false, gameInterface.scrollDepth, 0xffff & gameInterface.id, gameInterface.scrollWidth, i_39_, 398);
783783
if(gameInterface_41_ == null) {
784784
scriptIntValues[intValueIndex++] = -1;
785785
} else {
@@ -797,7 +797,7 @@ public static void runClientScripts(Object[] listeners, int arg1, int arg2, Game
797797
break;
798798
}
799799
// if_getscrolly
800-
scriptIntValues[intValueIndex++] = gameInterface.scrollPosition;
800+
scriptIntValues[intValueIndex++] = gameInterface.scrollDepth;
801801
}
802802
} else {
803803
if(scriptOpcode < 2800) {
@@ -808,7 +808,7 @@ public static void runClientScripts(Object[] listeners, int arg1, int arg2, Game
808808
// todo
809809
int i_42_ = scriptIntValues[--intValueIndex];
810810
if(MovedStatics.lastContinueTextWidgetId == -1) {
811-
GameInterface.method517(0, i_42_);
811+
GameInterface.sendPleaseWaitOptionClick(0, i_42_);
812812
MovedStatics.lastContinueTextWidgetId = i_42_;
813813
}
814814
} else if(scriptOpcode == 3001 || scriptOpcode == 3003) {
@@ -821,7 +821,7 @@ public static void runClientScripts(Object[] listeners, int arg1, int arg2, Game
821821
// todo
822822
GameInterface gameInterface = !bool ? aGameInterface_1887 : MovedStatics.aGameInterface_2116;
823823
if(MovedStatics.lastContinueTextWidgetId == -1) {
824-
GameInterface.method517(gameInterface.id & 0x7fff, gameInterface.parentId);
824+
GameInterface.sendPleaseWaitOptionClick(gameInterface.id & 0x7fff, gameInterface.parentId);
825825
MovedStatics.lastContinueTextWidgetId = gameInterface.id;
826826
}
827827
} else {
@@ -992,7 +992,7 @@ public static void runClientScripts(Object[] listeners, int arg1, int arg2, Game
992992
stringValueIndex -= 2;
993993
String class1 = scriptStringValues[stringValueIndex];
994994
String class1_82_ = scriptStringValues[stringValueIndex + 1];
995-
if(Player.localPlayer.playerAppearance == null || !Player.localPlayer.playerAppearance.gender) {
995+
if(Player.localPlayer.playerAppearance == null || !Player.localPlayer.playerAppearance.isFemale) {
996996
scriptStringValues[stringValueIndex++] = class1;
997997
} else {
998998
scriptStringValues[stringValueIndex++] = class1_82_;
@@ -1058,7 +1058,7 @@ public static void runClientScripts(Object[] listeners, int arg1, int arg2, Game
10581058
break;
10591059
}
10601060
// cc_getscrolly
1061-
scriptIntValues[intValueIndex++] = gameInterface.scrollPosition;
1061+
scriptIntValues[intValueIndex++] = gameInterface.scrollDepth;
10621062
}
10631063
}
10641064
} else {
@@ -1235,7 +1235,7 @@ private static Class stringToType(String typeCode) throws ClassNotFoundException
12351235
}
12361236

12371237
private static RSString method1024(boolean arg0, int arg2) {
1238-
return MovedStatics.method521(arg0, 10, arg2);
1238+
return RSString.method521(arg0, 10, arg2);
12391239
}
12401240

12411241
public static void method406(int arg0, int arg1, int arg2) {

0 commit comments

Comments
 (0)