Thread: Better Sprite Packer

Page 1 of 10 123 ... LastLast
Results 1 to 10 of 99
  1. #1 Better Sprite Packer 
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    For Galkons format use...
    v1.44

    Better Sprite Packer 3 (View on GitHub)

    Is a tool designed to pack sprites in a way they can be random-accessed.

    Features
    • No needed libraries! (you just need the SpriteCache class)
    • You can randomly access any sprite (extremely fast and less memory consumption especially for sprites that aren't used right away such as sprites on interfaces)
    • Images are fully preserved even the meta data, compression is done by the image format
    • Transparency is never set, if you have transparent images they will remain transparent
    • Displays image meta data
    • Indexes are preserved (any image removed and if its not the last element will create a placeholder 0 byte)
    • Import sprites from a directory
    • Import from binary
    • Select the sprites you want to add (with multi-selection)
    • Export to raw formats
    • Export to binary
    • Search an image by it's imdex
    • Modern, clean looking
    • Made in Kotlin programming language
    • Works on Windows, Mac, and Linux
    • Supports PNG, JPEG, and GIF


    Info

    The programs exports your files in a binary format in 2 files

    1. main_file_sprites.dat (this is where all of the image data is kept)
    2. main_file_sprites.idx (this is the meta data that contains meta information)


    main_file_sprites.dat
    Code:
    HEADER
    signature: "bsp" (3 byte)
    
    PAYLOAD
    foreach image
    	data[]: (variable byte)
    main_file_sprites.idx

    Code:
    HEADER
    NONE
    
    PAYLOAD
    foreach sprite
    	dataOffset: 24uint
    	offsetX: ushort
    	offsetY: ushort
    	length: 24uint
    Attached image

    Attached image

    Attached image

    memory consumption

    Attached image
    Last edited by CrazyPanda; 03-08-2019 at 05:21 AM.
    Attached image
    Reply With Quote  
     


  2. #2  
    Owner of Dawntained

    Mgt Madness's Avatar
    Join Date
    Oct 2011
    Age
    28
    Posts
    3,380
    Thanks given
    1,429
    Thanks received
    958
    Rep Power
    2168
    Thanks, really useful
    Attached image
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    rippp
    Attached image
    Reply With Quote  
     

  5. Thankful users:


  6. #4  
    Owner of Dawntained

    Mgt Madness's Avatar
    Join Date
    Oct 2011
    Age
    28
    Posts
    3,380
    Thanks given
    1,429
    Thanks received
    958
    Rep Power
    2168
    Sick update
    Attached image
    Reply With Quote  
     

  7. Thankful user:


  8. #5  
    Registered Member

    Join Date
    Feb 2013
    Posts
    1,682
    Thanks given
    401
    Thanks received
    402
    Rep Power
    446
    It's nice to see your always releasing useful things and pay attention to small details.
    Appreciate Seven.
    Reply With Quote  
     

  9. Thankful user:


  10. #6  
    Registered Member Devo's Avatar
    Join Date
    Aug 2013
    Age
    25
    Posts
    514
    Thanks given
    38
    Thanks received
    47
    Rep Power
    70
    Thank you so much for this, will definitely come in handy.

    Reply With Quote  
     

  11. #7  
    Donator

    Join Date
    Mar 2012
    Posts
    237
    Thanks given
    32
    Thanks received
    9
    Rep Power
    53
    Awesome Seven nice work thanks for the release this will come in very useful to the community


    Looking for committed and active coders/developers to join my project
    add me
    Skype:bigbudz4
    Reply With Quote  
     

  12. #8  
    Community Veteran

    mige5's Avatar
    Join Date
    Aug 2008
    Posts
    5,528
    Thanks given
    573
    Thanks received
    1,410
    Rep Power
    2114
    Could u try changing the sprite loading/saving similar to what it is for cache packed sprites..? (so that this feature would work: http://www.rune-server.org/runescape...spellbook.html)
    Number of page #1 releases with most views & posts: (Updated: 2023)
    RS2 server section: 1
    RS2 client section: 2
    Reply With Quote  
     

  13. #9  
    Kairos
    Kairos..'s Avatar
    Join Date
    Dec 2015
    Posts
    154
    Thanks given
    21
    Thanks received
    20
    Rep Power
    34
    thanks for sharing it. nice work
    Reply With Quote  
     

  14. #10  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Delinquent View Post
    It's nice to see your always releasing useful things and pay attention to small details.
    Appreciate Seven.
    Thanks man appreciate it.

    Quote Originally Posted by Devo View Post
    Thank you so much for this, will definitely come in handy.
    You're welcome

    Quote Originally Posted by leen12 View Post
    Awesome Seven nice work thanks for the release this will come in very useful to the community
    Thanks, you're welcome.

    Quote Originally Posted by mige5 View Post
    Could u try changing the sprite loading/saving similar to what it is for cache packed sprites..? (so that this feature would work: http://www.rune-server.org/runescape...spellbook.html)
    Cache sprite doesn't have anything to do with drawing the outline of sprites, iirc.

    This method in Sprite class does that.

    Code:
          private void method349(int ai[], int ai1[], int j, int k, int l, int i1, int j1, int k1) {
                int i;// was parameter
                int l1 = -(l >> 2);
                l = -(l & 3);
                for (int i2 = -i1; i2 < 0; i2++) {
                      for (int j2 = l1; j2 < 0; j2++) {
                            i = ai1[j++];
                            if (i != 0 && i != -1) {
                                  ai[k++] = i;
                            } else {
                                  k++;
                            }
                            i = ai1[j++];
                            if (i != 0 && i != -1) {
                                  ai[k++] = i;
                            } else {
                                  k++;
                            }
                            i = ai1[j++];
                            if (i != 0 && i != -1) {
                                  ai[k++] = i;
                            } else {
                                  k++;
                            }
                            i = ai1[j++];
                            if (i != 0 && i != -1) {
                                  ai[k++] = i;
                            } else {
                                  k++;
                            }
                      }
    
                      for (int k2 = l; k2 < 0; k2++) {
                            i = ai1[j++];
                            if (i != 0 && i != -1) {
                                  ai[k++] = i;
                            } else {
                                  k++;
                            }
                      }
                      k += j1;
                      j += k1;
                }
          }
    Refactored version

    Code:
    	private void draw(int raster[], int[] image, int colour, int sourceIndex, int destIndex, int width, int height, int destStep,
    			int sourceStep) {
    		int minX = -(width >> 2);
    		width = -(width & 3);
    
    		for (int y = -height; y < 0; y++) {
    			for (int x = minX; x < 0; x++) {
    				colour = image[sourceIndex++];
    				if (colour != 0) {
    					raster[destIndex++] = colour;
    				} else {
    					destIndex++;
    				}
    				colour = image[sourceIndex++];
    
    				if (colour != 0) {
    					raster[destIndex++] = colour;
    				} else {
    					destIndex++;
    				}
    				colour = image[sourceIndex++];
    
    				if (colour != 0) {
    					raster[destIndex++] = colour;
    				} else {
    					destIndex++;
    				}
    				colour = image[sourceIndex++];
    
    				if (colour != 0) {
    					raster[destIndex++] = colour;
    				} else {
    					destIndex++;
    				}
    			}
    
    			for (int k2 = width; k2 < 0; k2++) {
    				colour = image[sourceIndex++];
    				if (colour != 0) {
    					raster[destIndex++] = colour;
    				} else {
    					destIndex++;
    				}
    			}
    
    			destIndex += destStep;
    			sourceIndex += sourceStep;
    		}
    	}
    Just make sure when you're loading your cache sprites that method above is being called correctly.
    Attached image
    Reply With Quote  
     

Page 1 of 10 123 ... LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Galkon sprite packer ids scrambling?
    By Bloody in forum Help
    Replies: 4
    Last Post: 06-27-2016, 02:22 AM
  2. Better Sprite Hovering
    By Christian_ in forum Snippets
    Replies: 12
    Last Post: 05-28-2014, 04:45 PM
  3. Better sprite hovering method.
    By thim slug in forum Snippets
    Replies: 8
    Last Post: 09-21-2012, 12:22 PM
  4. [REQ] Sprite Packer [PayPal]
    By Insane in forum Requests
    Replies: 0
    Last Post: 09-01-2011, 07:25 AM
  5. [REQ] Sprite Packer [PayPal]
    By TORONTO in forum Requests
    Replies: 4
    Last Post: 12-22-2010, 01:36 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •