ThatTrueStruggle

pq:sol_spr3.bms

Jan 4th, 2016
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. get chunkID long
  2. get null long
  3. idstring "SPR3"
  4. endian little
  5. get dataStartOffset long
  6. get dataEndOffset long
  7. get textureCount short
  8. get keyFrameCount short
  9. get textureOffsetArrayStart long
  10. get keyFrameOffsetArrayStart long
  11.  
  12. // lets get the textures first
  13. goto textureOffsetArrayStart
  14. for j = 0 < textureCount
  15. get null long
  16. get OFFSETS_TEXTURE[j] long
  17. next j
  18.  
  19. // now for the keyframes
  20. goto keyFrameOffsetArrayStart
  21. for i = 0 < keyFrameCount
  22. get null long
  23. get OFFSET_KEY[i] long
  24. next i
  25.  
  26. // now to extract it
  27. get filenamebase basename
  28. xmath trueFRAMECOUNT "keyFrameCount - 1"
  29. for i = 0 < keyFrameCount
  30. string filename = filenamebase
  31. if i == trueFRAMECOUNT
  32. math j = 0
  33. math OFFSET = OFFSETS_TEXTURE[j]
  34. math SIZE = OFFSET_KEY[i]
  35. xmath TRUESIZE "OFFSET - SIZE"
  36. string filename += i
  37. string filename += ".keyframe"
  38. log filename SIZE TRUESIZE
  39. break
  40. endif
  41. math OFFSET = OFFSET_KEY[i]
  42. math i + 1
  43. math SIZE = OFFSET_KEY[i]
  44. math SIZE - OFFSET
  45. math i - 1
  46. string filename += i
  47. string filename += ".keyframe"
  48. log filename OFFSET SIZE
  49. next i
  50.  
  51. // that was alot but now to get to the textures; basically the same thing as above
  52. xmath trueTextureCount "textureCount - 1"
  53. for j = 0 < textureCount
  54. string filename = filenamebase
  55. if j == trueTextureCount
  56. math OFFSET = OFFSETS_TEXTURE[j]
  57. get SIZE asize
  58. xmath TRUESIZE "SIZE - OFFSET"
  59. string filename += j
  60. string filename += ".ctpk"
  61. log filename OFFSET TRUESIZE
  62. break
  63. endif
  64. math OFFSET = OFFSETS_TEXTURE[j]
  65. math j + 1
  66. math SIZE = OFFSETS_TEXTURE[j]
  67. math SIZE - OFFSET
  68. math j - 1
  69. string filename += j
  70. string filename += ".ctpk"
  71. log filename OFFSET SIZE
  72. next j
Advertisement
Add Comment
Please, Sign In to add comment