1package com.runehive.fs.cache.decoder;
3import com.runehive.fs.cache.FileSystem;
4import com.runehive.fs.cache.archive.Archive;
5import io.netty.buffer.ByteBuf;
6import io.netty.buffer.Unpooled;
7import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
8import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
9import org.apache.logging.log4j.LogManager;
10import org.apache.logging.log4j.Logger;
20 public static final Int2ObjectMap<AnimationDefinition>
definitions =
new Int2ObjectOpenHashMap<>();
31 LOGGER.info(
"Loading animation definitions.");
34 final ByteBuf buffer = Unpooled.wrappedBuffer(
archive.getData(
"seq.dat"));
36 final int highestFileId = buffer.readUnsignedShort();
37 for (
int i = 0; i <= highestFileId; i++) {
38 final int id = buffer.readUnsignedShort();
39 if (
id == 65535)
break;
41 final int length = buffer.readUnsignedShort();
42 final ByteBuf animBuffer = buffer.readBytes(length);
45 definition.
decode(animBuffer);
52 if (
id >= highestFileId)
break;
Represents a file system of Caches and Archives.
static final int CONFIG_ARCHIVE
Represents the id of the configurations archive.
Represents an archive within the Cache.
static final Int2ObjectMap< AnimationDefinition > definitions
final FileSystem fs
The IndexedFileSystem.
AnimationDefinitionDecoder(final FileSystem fs)
static final Logger LOGGER
The logger to log process output.
void decode(ByteBuf buffer)