forked from 2009Scape/Server
Slayer improvements
This commit is contained in:
parent
a60c0e3a7b
commit
6f7577ce51
16 changed files with 509 additions and 362 deletions
|
|
@ -1,6 +1,9 @@
|
|||
package org.runite.client;
|
||||
|
||||
import org.rs09.client.Node;
|
||||
import org.rs09.client.rendering.Toolkit;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class AbstractSprite extends Node {
|
||||
|
||||
|
|
@ -14,6 +17,98 @@ public abstract class AbstractSprite extends Node {
|
|||
public int width;
|
||||
static RSInterface aClass11_3708 = null;
|
||||
|
||||
public static AbstractSprite constructItemSprite(int var0, boolean useHDSprite, int itemID, boolean var4, int outlineType, int itemCount, boolean shrinkInSprite) {
|
||||
try {
|
||||
ItemDefinition item = ItemDefinition.getItemDefinition(itemID);
|
||||
if (itemCount > 1 && item.anIntArray804 != null) {
|
||||
int var9 = -1;
|
||||
|
||||
for (int var10 = 0; var10 < 10; ++var10) {
|
||||
if (item.anIntArray766[var10] <= itemCount && item.anIntArray766[var10] != 0) {
|
||||
var9 = item.anIntArray804[var10];
|
||||
}
|
||||
}
|
||||
|
||||
if (var9 != -1) {
|
||||
item = ItemDefinition.getItemDefinition(var9);
|
||||
}
|
||||
}
|
||||
|
||||
Class140_Sub1_Sub2 var21 = item.method1120();
|
||||
if (null == var21) {
|
||||
return null;
|
||||
} else {
|
||||
SoftwareSprite var22 = null;
|
||||
if (item.anInt791 == -1) {
|
||||
if (item.anInt762 != -1) {
|
||||
var22 = (SoftwareSprite) constructItemSprite(var0, true, item.anInt795, false, outlineType, itemCount, false);
|
||||
if (null == var22) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var22 = (SoftwareSprite) constructItemSprite(0, true, item.noteID, false, 1, 10, true);
|
||||
if (null == var22) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
int[] var11 = Toolkit.JAVA_TOOLKIT.getBuffer();
|
||||
int var12 = Toolkit.JAVA_TOOLKIT.width;
|
||||
int var13 = Toolkit.JAVA_TOOLKIT.height;
|
||||
int[] var14 = new int[4];
|
||||
Class74.method1325(var14);
|
||||
SoftwareSprite var15 = new SoftwareSprite(36, 32);
|
||||
Class74.setBuffer(var15.anIntArray4081, 36, 32);
|
||||
Class51.method1134();
|
||||
Class51.method1145(16, 16);
|
||||
int var16 = item.anInt810;
|
||||
Class51.aBoolean843 = false;
|
||||
if (shrinkInSprite) {
|
||||
var16 = (int) ((double) var16 * 1.5D);
|
||||
} else if (outlineType == 2) {
|
||||
var16 = (int) (1.04D * (double) var16);
|
||||
}
|
||||
|
||||
int var18 = Class51.anIntArray851[item.anInt786] * var16 >> 16;
|
||||
int var17 = Class51.anIntArray840[item.anInt786] * var16 >> 16;
|
||||
var21.method1893(item.anInt799, item.anInt768, item.anInt786, item.anInt792, var17 - (var21.method1871() / 2 + -item.anInt754), item.anInt754 + var18);
|
||||
if (outlineType >= 1) {
|
||||
var15.method657(1);
|
||||
if (outlineType >= 2) {
|
||||
var15.method657(16777215);
|
||||
}
|
||||
|
||||
Class74.setBuffer(var15.anIntArray4081, 36, 32);
|
||||
}
|
||||
|
||||
if (var0 != 0) {
|
||||
var15.method668(var0);
|
||||
}
|
||||
|
||||
if (item.anInt791 != -1) {
|
||||
Objects.requireNonNull(var22).drawAt(0, 0);
|
||||
} else if (-1 != item.anInt762) {
|
||||
Class74.setBuffer(Objects.requireNonNull(var22).anIntArray4081, 36, 32);
|
||||
var15.drawAt(0, 0);
|
||||
var15 = var22;
|
||||
}
|
||||
|
||||
if (var4 && (item.stackingType == 1 || itemCount != 1) && itemCount != -1) {
|
||||
TextureOperation10.aClass3_Sub28_Sub17_Sub1_3440.method681(Class3_Sub7.itemStackColor(1000, itemCount), 0, 9, 16776960, 1);
|
||||
}
|
||||
|
||||
Class74.setBuffer(var11, var12, var13);
|
||||
Class74.setClipping(var14);
|
||||
Class51.method1134();
|
||||
Class51.aBoolean843 = true;
|
||||
return HDToolKit.highDetail && !useHDSprite ? new HDSprite(var15) : var15;
|
||||
}
|
||||
} catch (RuntimeException var20) {
|
||||
throw ClientErrorException.clientError(var20, "na.WA(" + var0 + ',' + useHDSprite + ',' + itemID + ',' + var4 + ',' + outlineType + ',' + itemCount + ',' + shrinkInSprite + ')');
|
||||
}
|
||||
}
|
||||
|
||||
abstract void method635(int var1, int var2);
|
||||
|
||||
abstract void method636(int var1, int var2, int var3, int var4, int var5, int var6);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ final class Class114 {
|
|||
AbstractSprite var10 = (AbstractSprite) Class67.aReferenceCache_1013.get(var8);
|
||||
if (var10 == null) {
|
||||
Class51.aBoolean837 = false;
|
||||
var10 = Unsorted.constructItemSprite(var4, false, var1, var2, var0, var3, false);
|
||||
var10 = AbstractSprite.constructItemSprite(var4, false, var1, var2, var0, var3, false);
|
||||
if (var10 != null && !Class51.aBoolean837) {
|
||||
Class67.aReferenceCache_1013.put(var10, var8);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.runite.client;
|
||||
|
||||
import org.rs09.SlayerTracker;
|
||||
import org.rs09.client.config.GameConfig;
|
||||
|
||||
import javax.media.opengl.*;
|
||||
|
|
@ -431,6 +432,7 @@ public final class HDToolKit {
|
|||
|
||||
Class68.method1273();
|
||||
highDetail = false;
|
||||
SlayerTracker.setSprite();
|
||||
}
|
||||
|
||||
static void method1843(float var0, float var1) {
|
||||
|
|
@ -627,6 +629,7 @@ public final class HDToolKit {
|
|||
gl = glContext.getGL();
|
||||
new GLU();
|
||||
highDetail = true;
|
||||
SlayerTracker.setSprite();
|
||||
System.out.println("Setting high detail to " + highDetail);
|
||||
viewWidth = canvas.getSize().width;
|
||||
viewHeight = canvas.getSize().height;
|
||||
|
|
|
|||
|
|
@ -1404,7 +1404,7 @@ public final class PacketParser {
|
|||
Unsorted.incomingOpcode = -1;
|
||||
return true;
|
||||
} else {
|
||||
RSInterface var25;
|
||||
RSInterface iface;
|
||||
if (Unsorted.incomingOpcode == 22) {
|
||||
nodeModelId = BufferedDataStream.incomingBuffer.readInt();
|
||||
var19 = BufferedDataStream.incomingBuffer.readUnsignedShort();
|
||||
|
|
@ -1413,9 +1413,9 @@ public final class PacketParser {
|
|||
}
|
||||
|
||||
if (nodeModelId < 0) {
|
||||
var25 = null;
|
||||
iface = null;
|
||||
} else {
|
||||
var25 = Unsorted.getRSInterface(nodeModelId);
|
||||
iface = Unsorted.getRSInterface(nodeModelId);
|
||||
}
|
||||
|
||||
for (; Unsorted.incomingPacketLength > BufferedDataStream.incomingBuffer.index; method2277(var6 + -1, counter, var30, var19, (byte) 46)) {
|
||||
|
|
@ -1429,14 +1429,14 @@ public final class PacketParser {
|
|||
}
|
||||
}
|
||||
|
||||
if (var25 != null && counter >= 0 && counter < var25.itemAmounts.length) {
|
||||
var25.itemAmounts[counter] = var6;
|
||||
var25.itemIds[counter] = var30;
|
||||
if (iface != null && counter >= 0 && counter < iface.itemAmounts.length) {
|
||||
iface.itemAmounts[counter] = var6;
|
||||
iface.itemIds[counter] = var30;
|
||||
}
|
||||
}
|
||||
|
||||
if (var25 != null) {
|
||||
Class20.method909(var25);
|
||||
if (iface != null) {
|
||||
Class20.method909(iface);
|
||||
}
|
||||
|
||||
BufferedDataStream.method819();
|
||||
|
|
@ -1647,15 +1647,15 @@ public final class PacketParser {
|
|||
}
|
||||
|
||||
if (0 <= nodeModelId) {
|
||||
var25 = Unsorted.getRSInterface(nodeModelId);
|
||||
iface = Unsorted.getRSInterface(nodeModelId);
|
||||
} else {
|
||||
var25 = null;
|
||||
iface = null;
|
||||
}
|
||||
|
||||
if (var25 != null) {
|
||||
for (counter = 0; var25.itemAmounts.length > counter; ++counter) {
|
||||
var25.itemAmounts[counter] = 0;
|
||||
var25.itemIds[counter] = 0;
|
||||
if (iface != null) {
|
||||
for (counter = 0; iface.itemAmounts.length > counter; ++counter) {
|
||||
iface.itemAmounts[counter] = 0;
|
||||
iface.itemIds[counter] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1669,16 +1669,16 @@ public final class PacketParser {
|
|||
}
|
||||
|
||||
chatIcon = BufferedDataStream.incomingBuffer.readUnsignedShort();
|
||||
if (null != var25 && var25.itemAmounts.length > var6) {
|
||||
var25.itemAmounts[var6] = chatIcon;
|
||||
var25.itemIds[var6] = var30;
|
||||
if (null != iface && iface.itemAmounts.length > var6) {
|
||||
iface.itemAmounts[var6] = chatIcon;
|
||||
iface.itemIds[var6] = var30;
|
||||
}
|
||||
|
||||
method2277(-1 + chatIcon, var6, var30, var19, (byte) 41);
|
||||
}
|
||||
|
||||
if (var25 != null) {
|
||||
Class20.method909(var25);
|
||||
if (iface != null) {
|
||||
Class20.method909(iface);
|
||||
}
|
||||
|
||||
BufferedDataStream.method819();
|
||||
|
|
|
|||
|
|
@ -407,98 +407,6 @@ public class Unsorted {
|
|||
}
|
||||
}
|
||||
|
||||
static AbstractSprite constructItemSprite(int var0, boolean useHDSprite, int itemID, boolean var4, int outlineType, int itemCount, boolean shrinkInSprite) {
|
||||
try {
|
||||
ItemDefinition item = ItemDefinition.getItemDefinition(itemID);
|
||||
if (itemCount > 1 && item.anIntArray804 != null) {
|
||||
int var9 = -1;
|
||||
|
||||
for (int var10 = 0; var10 < 10; ++var10) {
|
||||
if (item.anIntArray766[var10] <= itemCount && item.anIntArray766[var10] != 0) {
|
||||
var9 = item.anIntArray804[var10];
|
||||
}
|
||||
}
|
||||
|
||||
if (var9 != -1) {
|
||||
item = ItemDefinition.getItemDefinition(var9);
|
||||
}
|
||||
}
|
||||
|
||||
Class140_Sub1_Sub2 var21 = item.method1120();
|
||||
if (null == var21) {
|
||||
return null;
|
||||
} else {
|
||||
SoftwareSprite var22 = null;
|
||||
if (item.anInt791 == -1) {
|
||||
if (item.anInt762 != -1) {
|
||||
var22 = (SoftwareSprite) constructItemSprite(var0, true, item.anInt795, false, outlineType, itemCount, false);
|
||||
if (null == var22) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var22 = (SoftwareSprite) constructItemSprite(0, true, item.noteID, false, 1, 10, true);
|
||||
if (null == var22) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
int[] var11 = Toolkit.JAVA_TOOLKIT.getBuffer();
|
||||
int var12 = Toolkit.JAVA_TOOLKIT.width;
|
||||
int var13 = Toolkit.JAVA_TOOLKIT.height;
|
||||
int[] var14 = new int[4];
|
||||
Class74.method1325(var14);
|
||||
SoftwareSprite var15 = new SoftwareSprite(36, 32);
|
||||
Class74.setBuffer(var15.anIntArray4081, 36, 32);
|
||||
Class51.method1134();
|
||||
Class51.method1145(16, 16);
|
||||
int var16 = item.anInt810;
|
||||
Class51.aBoolean843 = false;
|
||||
if (shrinkInSprite) {
|
||||
var16 = (int) ((double) var16 * 1.5D);
|
||||
} else if (outlineType == 2) {
|
||||
var16 = (int) (1.04D * (double) var16);
|
||||
}
|
||||
|
||||
int var18 = Class51.anIntArray851[item.anInt786] * var16 >> 16;
|
||||
int var17 = Class51.anIntArray840[item.anInt786] * var16 >> 16;
|
||||
var21.method1893(item.anInt799, item.anInt768, item.anInt786, item.anInt792, var17 - (var21.method1871() / 2 + -item.anInt754), item.anInt754 + var18);
|
||||
if (outlineType >= 1) {
|
||||
var15.method657(1);
|
||||
if (outlineType >= 2) {
|
||||
var15.method657(16777215);
|
||||
}
|
||||
|
||||
Class74.setBuffer(var15.anIntArray4081, 36, 32);
|
||||
}
|
||||
|
||||
if (var0 != 0) {
|
||||
var15.method668(var0);
|
||||
}
|
||||
|
||||
if (item.anInt791 != -1) {
|
||||
Objects.requireNonNull(var22).drawAt(0, 0);
|
||||
} else if (-1 != item.anInt762) {
|
||||
Class74.setBuffer(Objects.requireNonNull(var22).anIntArray4081, 36, 32);
|
||||
var15.drawAt(0, 0);
|
||||
var15 = var22;
|
||||
}
|
||||
|
||||
if (var4 && (item.stackingType == 1 || itemCount != 1) && itemCount != -1) {
|
||||
TextureOperation10.aClass3_Sub28_Sub17_Sub1_3440.method681(Class3_Sub7.itemStackColor(1000, itemCount), 0, 9, 16776960, 1);
|
||||
}
|
||||
|
||||
Class74.setBuffer(var11, var12, var13);
|
||||
Class74.setClipping(var14);
|
||||
Class51.method1134();
|
||||
Class51.aBoolean843 = true;
|
||||
return HDToolKit.highDetail && !useHDSprite ? new HDSprite(var15) : var15;
|
||||
}
|
||||
} catch (RuntimeException var20) {
|
||||
throw ClientErrorException.clientError(var20, "na.WA(" + var0 + ',' + useHDSprite + ',' + itemID + ',' + var4 + ',' + outlineType + ',' + itemCount + ',' + shrinkInSprite + ')');
|
||||
}
|
||||
}
|
||||
|
||||
public static RSString method802(int var0) {
|
||||
try {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue