cache: add texture manager
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user