Rename Resource::crc to checksum

This is consistent with us using checksum/digest in the Js5Index naming.

Signed-off-by: Graham <gpe@openrs2.dev>
bzip2
Graham 4 years ago
parent f9c14aad14
commit 7887a4dff1
  1. 6
      bundler/src/main/java/dev/openrs2/bundler/Resource.kt
  2. 4
      bundler/src/main/java/dev/openrs2/bundler/transform/ResourceTransformer.kt

@ -14,13 +14,13 @@ import java.util.zip.Deflater
public class Resource( public class Resource(
public val source: String, public val source: String,
public val destination: String, public val destination: String,
public val crc: Int, public val checksum: Int,
public val digest: ByteArray, public val digest: ByteArray,
public val uncompressedSize: Int, public val uncompressedSize: Int,
public val content: ByteArray public val content: ByteArray
) { ) {
public val sourceWithCrc: String public val sourceWithChecksum: String
get() = source.replace(".", "_$crc.") get() = source.replace(".", "_$checksum.")
public val compressedSize: Int public val compressedSize: Int
get() = content.size get() = content.size

@ -41,7 +41,7 @@ public class ResourceTransformer(
// update the source (the CRC may have changed) // update the source (the CRC may have changed)
val source = match[3] as LdcInsnNode val source = match[3] as LdcInsnNode
source.cst = resource.sourceWithCrc source.cst = resource.sourceWithChecksum
// update file sizes // update file sizes
method.instructions.set(match[22], resource.uncompressedSize.toAbstractInsnNode()) method.instructions.set(match[22], resource.uncompressedSize.toAbstractInsnNode())
@ -135,7 +135,7 @@ public class ResourceTransformer(
list.add(TypeInsnNode(Opcodes.NEW, type)) list.add(TypeInsnNode(Opcodes.NEW, type))
list.add(InsnNode(Opcodes.DUP)) list.add(InsnNode(Opcodes.DUP))
list.add(LdcInsnNode(resource.destination)) list.add(LdcInsnNode(resource.destination))
list.add(LdcInsnNode(resource.sourceWithCrc)) list.add(LdcInsnNode(resource.sourceWithChecksum))
list.add(messages.size.toAbstractInsnNode()) list.add(messages.size.toAbstractInsnNode())
list.add(TypeInsnNode(Opcodes.ANEWARRAY, "java/lang/String")) list.add(TypeInsnNode(Opcodes.ANEWARRAY, "java/lang/String"))

Loading…
Cancel
Save