Search in sources :

Example 41 with Index

use of net.runelite.cache.fs.Index in project runelite by runelite.

the class SpriteManager method load.

public void load() throws IOException {
    Storage storage = store.getStorage();
    Index index = store.getIndex(IndexType.SPRITES);
    for (Archive a : index.getArchives()) {
        byte[] contents = a.decompress(storage.loadArchive(a));
        SpriteLoader loader = new SpriteLoader();
        SpriteDefinition[] defs = loader.load(a.getArchiveId(), contents);
        for (SpriteDefinition sprite : defs) {
            sprites.put(sprite.getId(), sprite);
        }
    }
}
Also used : Storage(net.runelite.cache.fs.Storage) Archive(net.runelite.cache.fs.Archive) SpriteDefinition(net.runelite.cache.definitions.SpriteDefinition) Index(net.runelite.cache.fs.Index) SpriteLoader(net.runelite.cache.definitions.loaders.SpriteLoader)

Aggregations

Index (net.runelite.cache.fs.Index)41 Archive (net.runelite.cache.fs.Archive)38 Storage (net.runelite.cache.fs.Storage)33 Store (net.runelite.cache.fs.Store)20 File (java.io.File)19 Test (org.junit.Test)19 ArchiveFiles (net.runelite.cache.fs.ArchiveFiles)18 FSFile (net.runelite.cache.fs.FSFile)18 IOException (java.io.IOException)5 FileData (net.runelite.cache.index.FileData)4 ByteBuf (io.netty.buffer.ByteBuf)2 BufferedImage (java.awt.image.BufferedImage)2 FramemapDefinition (net.runelite.cache.definitions.FramemapDefinition)2 InterfaceDefinition (net.runelite.cache.definitions.InterfaceDefinition)2 InventoryDefinition (net.runelite.cache.definitions.InventoryDefinition)2 ItemDefinition (net.runelite.cache.definitions.ItemDefinition)2 OverlayDefinition (net.runelite.cache.definitions.OverlayDefinition)2 SpriteDefinition (net.runelite.cache.definitions.SpriteDefinition)2 UnderlayDefinition (net.runelite.cache.definitions.UnderlayDefinition)2 FramemapLoader (net.runelite.cache.definitions.loaders.FramemapLoader)2