Skip to content

Commit

Permalink
fix cache loading
Browse files Browse the repository at this point in the history
  • Loading branch information
tamateea committed Feb 21, 2024
1 parent 23b12f5 commit 5ce235d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qodat-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version = "0.0.1"

dependencies {
api(group = "net.runelite", name = "cache", version = "1.9.6-SNAPSHOT") {
api(group = "net.runelite", name = "cache", version = "1.10.23-SNAPSHOT") {
exclude(group = "com.google.common")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import net.runelite.cache.*
import net.runelite.cache.definitions.FramemapDefinition
import net.runelite.cache.definitions.loaders.FrameLoader
import net.runelite.cache.definitions.loaders.FramemapLoader
import net.runelite.cache.definitions.loaders.SequenceLoader
import net.runelite.cache.definitions.loaders.SpotAnimLoader
import net.runelite.cache.fs.Index
import net.runelite.cache.fs.Store
Expand Down Expand Up @@ -208,7 +209,7 @@ object OldschoolCacheRuneLite : Cache("LIVE") {
val seqArchiveFiles = seqArchive.getFiles(seqArchiveData)

animations = seqArchiveFiles.files.map {
val sequence = SequenceLoader206().load(it.fileId, it.contents)
val sequence = SequenceLoader().load(it.fileId, it.contents)
return@map object : AnimationDefinition {
override val id: String = it.fileId.toString()
override val frameHashes: IntArray = sequence.frameIDs?: IntArray(0)
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/stan/qodat/util/osrs_anim_parser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import net.runelite.cache.ConfigType
import net.runelite.cache.IndexType
import net.runelite.cache.NpcManager
import net.runelite.cache.ObjectManager
import net.runelite.cache.definitions.loaders.SequenceLoader
import net.runelite.cache.fs.ArchiveFiles
import net.runelite.cache.fs.Store
import stan.qodat.Properties
Expand Down Expand Up @@ -42,7 +43,7 @@ fun createNpcAnimsJsonDir(
val frameIndex = store.getIndex(IndexType.ANIMATIONS)
val animationFiles = files.files
val animations: Map<Int, Set<Int>> = animationFiles.parallelStream().map { file ->
val loader = SequenceLoader206()
val loader = SequenceLoader()
val anim = loader.load(file.fileId, file.contents)
Platform.runLater {
val progress = (100.0 * anim.id.toFloat().div(animationFiles.size))
Expand Down Expand Up @@ -140,7 +141,7 @@ fun createObjectAnimsJsonDir(
val frameIndex = store.getIndex(IndexType.ANIMATIONS)
val animationFiles = files.files
val animations = animationFiles.parallelStream().map { file ->
val loader = SequenceLoader206()
val loader = SequenceLoader()
val anim = loader.load(file.fileId, file.contents)
Platform.runLater {
val progress = (100.0 * anim.id.toFloat().div(animationFiles.size))
Expand Down

0 comments on commit 5ce235d

Please sign in to comment.