Skip to content

Commit

Permalink
cache: update worldmap dumper test for new index
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed May 18, 2024
1 parent 7bc209a commit 14069bd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
1 change: 0 additions & 1 deletion cache/src/main/java/net/runelite/cache/IndexType.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public enum IndexType
FONTS(13),
MUSIC_SAMPLES(14),
MUSIC_PATCHES(15),
WORLDMAP_OLD(16), // looks unused
WORLDMAP_GEOGRAPHY(18),
WORLDMAP(19),
WORLDMAP_GROUND(20),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class WorldMapDefinition
public int field454;
public int field456;
public boolean isSurface;
public List regionList;
public List<WorldMapTypeBase> regionList;
public String safeName;
public Position position;
public int field463;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,14 @@ public WorldMapDefinition load(byte[] b, int fileId)
def.name = in.readString();

int packedPos = in.readInt();
if (packedPos == -1)
{
def.position = new Position(-1, -1, -1);
}
else
{
int y = packedPos >> 28 & 3;
int x = packedPos >> 14 & 16383;
int z = packedPos & 16383;
def.position = new Position(x, y, z);
}
def.position = Position.fromPacked(packedPos);

def.field450 = in.readInt();
in.readUnsignedByte();
def.isSurface = in.readUnsignedByte() == 1;
def.defaultZoom = in.readUnsignedByte();
int var3 = in.readUnsignedByte();
def.regionList = new LinkedList();
def.regionList = new LinkedList<>();

for (int var4 = 0; var4 < var3; ++var4)
{
Expand All @@ -76,10 +66,6 @@ public WorldMapDefinition load(byte[] b, int fileId)
private WorldMapTypeBase loadType(InputStream var1)
{
int var2 = var1.readUnsignedByte();
// field397 = new class27(1, (byte)0);
// field390 = new class27(2, (byte)1);
// field399 = new class27(3, (byte)2);
// field393 = new class27(0, (byte)3);
WorldMapTypeBase base;
switch (var2)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public void extract() throws IOException
store.load();

Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.WORLDMAP_OLD);
Archive archive = index.getArchive(0); // there is also archive 1/2, but their data format is not this
Index index = store.getIndex(IndexType.WORLDMAP);
Archive archive = index.findArchiveByName("details");

byte[] archiveData = storage.loadArchive(archive);
ArchiveFiles files = archive.getFiles(archiveData);
Expand Down

0 comments on commit 14069bd

Please sign in to comment.