Make the second argument of SpriteManager::getSprite work
I just blindly assumed that the arguments to net.runelite.cache.SpriteManager worked the same as Jagex's code, which is not true. In reality the second argument to getSprite(s?)asSpritePixels is always zero, and instead you have to decode the entire archive then select a sub image, rather than a subfile.
This commit is contained in:
@@ -71,8 +71,8 @@ public class SpriteManager
|
||||
return cached;
|
||||
}
|
||||
|
||||
SpritePixels sp = client.getSprite(client.getIndexSprites(), archive, file);
|
||||
BufferedImage img = sp.toBufferedImage();
|
||||
SpritePixels[] sp = client.getSprites(client.getIndexSprites(), archive, 0);
|
||||
BufferedImage img = sp[file].toBufferedImage();
|
||||
|
||||
cache.put(key, img);
|
||||
return img;
|
||||
|
||||
Reference in New Issue
Block a user