Thread: RS2 Sprite Format

Results 1 to 8 of 8
  1. #1 RS2 Sprite Format 
    Renown Programmer
    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,747
    Thanks given
    354
    Thanks received
    1,368
    Rep Power
    3032
    Code:
            Stream dataStream = new Stream(compressedContainer.getFileData(s + ".dat"));
            Stream indexStream = new Stream(compressedContainer.getFileData("index.dat"));
            indexStream.currentOffset = dataStream.getUnsignedShort();
            anInt1444 = indexStream.getUnsignedShort();
            anInt1445 = indexStream.getUnsignedShort();
            int paletteSize = indexStream.getUnsignedByte();
            int buffer[] = new int[paletteSize];
            for (int palettePtr = 0; palettePtr < paletteSize - 1; palettePtr++) {
                buffer[palettePtr + 1] = indexStream.get24BitInt();
                if (buffer[palettePtr + 1] == 0)
                    buffer[palettePtr + 1] = 1;
            }
    
            for (int l = 0; l < i; l++) {
                indexStream.currentOffset += 2;
                dataStream.currentOffset += indexStream.getUnsignedShort() * indexStream.getUnsignedShort();
                indexStream.currentOffset++;
            }
    
            anInt1442 = indexStream.getUnsignedByte();
            anInt1443 = indexStream.getUnsignedByte();
            myWidth = indexStream.getUnsignedShort();
            myHeight = indexStream.getUnsignedShort();
            int imgType = indexStream.getUnsignedByte();
            int pixelSize = myWidth * myHeight;
            myPixels = new int[pixelSize];
            if (imgType == 0) { //use individual pixel values
                for (int pixelsPtr = 0; pixelsPtr < pixelSize; pixelsPtr++)
                    myPixels[pixelsPtr] = buffer[dataStream.getUnsignedByte()];
    
                return;
            }
            if (imgType == 1) { //use palette indexes
                for (int pixelX = 0; pixelX < myWidth; pixelX++) {
                    for (int pixelY = 0; pixelY < myHeight; pixelY++)
                        myPixels[pixelX + pixelY * myWidth] = buffer[dataStream.getUnsignedByte()];
    
                }
    
            }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Enjoi's Avatar
    Join Date
    Sep 2008
    Posts
    2,454
    Thanks given
    565
    Thanks received
    281
    Rep Power
    1325
    ok....so what are you trying to tell us?


    just posting something like that makes no sense to me? and probably a lot of people


    and where am i supposed to put this?
    Reply With Quote  
     

  3. #3  
    Tom
    Tom is offline
    Registered Member
    Tom's Avatar
    Join Date
    Jul 2006
    Age
    27
    Posts
    1,148
    Thanks given
    8
    Thanks received
    86
    Rep Power
    902
    rofolroflrofl @ above post

    you're a ******, learn how the world works

    gj super, already had this though
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Aug 2006
    Posts
    50
    Thanks given
    0
    Thanks received
    0
    Rep Power
    4
    post you getUnsignedShort();
    method ?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Renown Programmer
    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,747
    Thanks given
    354
    Thanks received
    1,368
    Rep Power
    3032
    Quote Originally Posted by shangtsung1 View Post
    post you getUnsignedShort();
    method ?
    are you dumb? i'd imagine it was something like:

    Code:
    currentOffset += 2;
    return ((buffer[currentOffset - 2] & 0xFF) << 8) | (buffer[currentOffset - 1] & 0xFF);
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Sep 2008
    Posts
    228
    Thanks given
    6
    Thanks received
    15
    Rep Power
    91
    you legend
    Quote Originally Posted by d0uwontawank View Post
    What about the botnets crossing the atlantic
    Reply With Quote  
     

  7. #7  
    CORBA
    Guest
    Sexy Super
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Feb 2008
    Age
    35
    Posts
    262
    Thanks given
    1
    Thanks received
    4
    Rep Power
    0
    Cheers super, Needed this.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •