ThatTrueStruggle

persona3/4_spr0.bms

Dec 30th, 2015
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. get filenamebase FULLBASENAME
  2. get chunkID long
  3. get null long
  4. idstring "SPR0"
  5. endian little
  6. get dataStartOffset long
  7. get dataEndOffset long
  8. get textureCount short
  9. get keyFrameCount short
  10. get textureOffsetArrayStart long
  11. get keyFrameOffsetArrayStart long
  12.  
  13. // lets get the textures first
  14. goto textureOffsetArrayStart
  15. for j = 0 < textureCount
  16. get null long
  17. get OFFSETS_TEXTURE[j] long
  18. next j
  19.  
  20. // now for the keyframes
  21. goto keyFrameOffsetArrayStart
  22. for i = 0 < keyFrameCount
  23. get null long
  24. get OFFSET_KEY[i] long
  25. next i
  26.  
  27. // now to extract it
  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 += ".tmx"
  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 += ".tmx"
  71. log filename OFFSET SIZE
  72. next j
Advertisement
Add Comment
Please, Sign In to add comment