cache: add texture manager

This commit is contained in:
Adam
2017-03-26 19:48:28 -04:00
parent a3828fcedf
commit 731fa488dd
2 changed files with 79 additions and 10 deletions

View File

@@ -30,10 +30,6 @@ import com.google.gson.GsonBuilder;
import java.io.IOException;
import java.nio.charset.Charset;
import net.runelite.cache.definitions.TextureDefinition;
import net.runelite.cache.definitions.loaders.TextureLoader;
import net.runelite.cache.fs.Archive;
import net.runelite.cache.fs.File;
import net.runelite.cache.fs.Index;
import net.runelite.cache.fs.Store;
import org.junit.Rule;
import org.junit.Test;
@@ -62,14 +58,11 @@ public class TextureDumper
{
store.load();
Index index = store.getIndex(IndexType.TEXTURES);
Archive archive = index.getArchive(0);
TextureManager tm = new TextureManager(store);
tm.load();
for (File file : archive.getFiles())
for (TextureDefinition texture : tm.getTextures())
{
TextureLoader loader = new TextureLoader();
TextureDefinition texture = loader.load(file.getFileId(), file.getContents());
Files.write(gson.toJson(texture), new java.io.File(outDir, texture.getId() + ".json"), Charset.defaultCharset());
++count;
}