Jump to content

0x6D6F

Members
  • Posts

    3
  • Joined

  • Last visited

Community Answers

  1. 0x6D6F's post in Unswizzling/Untiling Xbox 360 textures (Call of Duty 4 Modern Warfare) was marked as the answer   
    Okay so I worked it out, I was doing the byte swap on every 4-byte chunks instead of every 2-byte chunks. 

     
    def flip_byte_order_16bit(data: bytes): if len(data) % 2 != 0: raise ValueError( "Data length must be a multiple of 2 bytes for 16-bit flipping." ) flipped = bytearray() for i in range(0, len(data), 2): group = data[i : i + 2] flipped.extend(group[::-1]) # Reverse the 2-byte group return flipped

    Reversing every 2 bytes works great


    Hopefully might be of use to someone every coming across this!
     
×
×
  • Create New...