Originally Posted by
Galkon
I've updated the source code, brought it up to date to Java 8 standards. Rewrote a lot of the old shit code that was in there... Man it was bad. Anyways, it should only count image files now, and it should be able to load even if the sprite cache doesn't load, or if there aren't any images in the sprites folder. I didn't do a lot of extensive testing, but it worked for what I did test.
Anyways, here's the full source and the fixed tool:
https://www.sendspace.com/file/ey5ve0
This tool is mainly for my RuneLimited client users, however it will work for anybody that uses it correctly.
Awhile ago Songoty released a model cache packer, this is based on that code. However, it's been modified to be a sprite cache packer, but you may also view the sprites you're packing, assign drawOffsetX and drawOffsetY variables, as well as names.
__________________________
A couple things to remember:
All pictures in the sprite folder must be a .png.
If you want to add more images, place them in the sprites folder, and make sure their name is "#.png", # being the next number. You'll see what I mean in the folder. All files must be in ascending numerical order.
The main use for this tool was to create a sprite cache that's easy to use, and preserves the quality of the images at the same time.
The sprite cache and sprites included in the download are from my RuneLimited client. Feel free to use your own.
__________________________
The compression used is just GZip compression. It will pack your sprites to sprites.dat and sprites.idx which you can use the loader given on this thread to unpack them. The applet resizes if the sprite is big so you can view it in the program. It also holds the transparency of the image if it has any.
__________________________
Download
https://www.sendspace.com/file/yxqsxm
__________________________
Implementation
Add this class:
If you're using my RuneLimited client, in client.java remove the current loadSprites() method, and in startup add this where loadSprites() was:
Code:
SpriteLoader.loadSprites(mediaArchive);
cacheSprite = SpriteLoader.sprites;
If you aren't using my RuneLimited client, simply add these where appropriate:
Code:
public Sprite[] cacheSprite;
and the nullpointer:
Code:
cacheSprite = null;
The usage is cacheSprite[#].drawSprite(0, 0); while # is the # in the viewer/sprites folder.
__________________________
Pictures