Thread: Galkon's Sprite Cache Updated

Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11  
    Registered Member

    Join Date
    May 2012
    Posts
    153
    Thanks given
    161
    Thanks received
    69
    Rep Power
    117
    Thanks for the contribution
    Reply With Quote  
     

  2. #12  
    Google it ffs

    Reich's Avatar
    Join Date
    Mar 2011
    Age
    30
    Posts
    825
    Thanks given
    120
    Thanks received
    174
    Rep Power
    105
    Quote Originally Posted by Stuart View Post
    instead of using this tool you can just zip the images and not need a 3rd party programme at all, or have to rename all your sprite paths to the id assigned by his tool.

    Code:
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.util.HashMap;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipInputStream;
    
    public class Zip {
    
        public HashMap<String, byte[]> files = new HashMap<String, byte[]>();
    
        public void load(byte[] buffer) {
            try {
                ZipInputStream zipStream = new ZipInputStream(new ByteArrayInputStream(buffer));
                ZipEntry entry = null;
                while ((entry = zipStream.getNextEntry()) != null) {
    
                    ByteArrayOutputStream out = new ByteArrayOutputStream();
                    byte[] buff = new byte[1024];
    
                    int count = -1;
                    while ((count = zipStream.read(buff)) != -1) {
                        out.write(buff, 0, count);
                    }
    
                    files.put(entry.getName().toLowerCase(), out.toByteArray());
                }
    
                zipStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    
        public byte[] getFile(String str) {
            str = str.toLowerCase();
    
            return files.get(str);
        }
    
    }
    Yeah I'm turning it into An editor too. I like working on new things instead of making them simple.

    Quote Originally Posted by TheIronDoorProject View Post
    u should chanage the look and feel to like substence also it did not work just got errors could u send a file which has no sprites packed into it so it is just blank ?
    Okay man its really easy. Building an empty file to upload to you is not needed. If you got errors post the stack trace I'll try to help. I already explained how to repack your own archives. You may or may not have r/w privileges just create an empty text document and rename it to idx.dat
    Reply With Quote  
     

  3. #13  
    Banned

    Join Date
    Apr 2013
    Posts
    1,456
    Thanks given
    341
    Thanks received
    148
    Rep Power
    0
    Quote Originally Posted by Reich View Post
    Yeah I'm turning it into An editor too. I like working on new things instead of making them simple.


    Okay man its really easy. Building an empty file to upload to you is not needed. If you got errors post the stack trace I'll try to help. I already explained how to repack your own archives. You may or may not have r/w privileges just create an empty text document and rename it to idx.dat

    I have done it now ty
    Reply With Quote  
     

  4. #14  
    Banned

    Join Date
    Apr 2013
    Posts
    1,456
    Thanks given
    341
    Thanks received
    148
    Rep Power
    0
    Quote Originally Posted by Reich View Post
    Yeah I'm turning it into An editor too. I like working on new things instead of making them simple.


    Okay man its really easy. Building an empty file to upload to you is not needed. If you got errors post the stack trace I'll try to help. I already explained how to repack your own archives. You may or may not have r/w privileges just create an empty text document and rename it to idx.dat

    Ok now i get these


    Code:
    java.io.EOFException	at java.util.zip.GZIPInputStream.readUByte(Unknown Source)
    	at java.util.zip.GZIPInputStream.readUShort(Unknown Source)
    	at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
    	at java.util.zip.GZIPInputStream.<init>(Unknown Source)
    	at java.util.zip.GZIPInputStream.<init>(Unknown Source)
    	at com.tools.sprite.SpriteLoader.loadArchivedSprites(SpriteLoader.java:166)
    	at com.tools.SpriteUtility.main(SpriteUtility.java:24)


    When i run it when i made the bank files
    Reply With Quote  
     

  5. #15  
    Registered Member
    Join Date
    Jan 2013
    Posts
    57
    Thanks given
    37
    Thanks received
    8
    Rep Power
    11
    Quote Originally Posted by Stuart View Post
    instead of using this tool you can just zip the images and not need a 3rd party programme at all, or have to rename all your sprite paths to the id assigned by his tool.

    Code:
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.util.HashMap;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipInputStream;
    
    public class Zip {
    
        public HashMap<String, byte[]> files = new HashMap<String, byte[]>();
    
        public void load(byte[] buffer) {
            try {
                ZipInputStream zipStream = new ZipInputStream(new ByteArrayInputStream(buffer));
                ZipEntry entry = null;
                while ((entry = zipStream.getNextEntry()) != null) {
    
                    ByteArrayOutputStream out = new ByteArrayOutputStream();
                    byte[] buff = new byte[1024];
    
                    int count = -1;
                    while ((count = zipStream.read(buff)) != -1) {
                        out.write(buff, 0, count);
                    }
    
                    files.put(entry.getName().toLowerCase(), out.toByteArray());
                }
    
                zipStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    
        public byte[] getFile(String str) {
            str = str.toLowerCase();
    
            return files.get(str);
        }
    
    }
    Or even better you could just pack them in the same fashion models, animations etc are packed into the cache. That way you don't need to re-download an entire archive when you add or remove sprites.
    Reply With Quote  
     

  6. #16  
    Google it ffs

    Reich's Avatar
    Join Date
    Mar 2011
    Age
    30
    Posts
    825
    Thanks given
    120
    Thanks received
    174
    Rep Power
    105
    Quote Originally Posted by TheIronDoorProject View Post
    Ok now i get these


    Code:
    java.io.EOFException	at java.util.zip.GZIPInputStream.readUByte(Unknown Source)
    	at java.util.zip.GZIPInputStream.readUShort(Unknown Source)
    	at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
    	at java.util.zip.GZIPInputStream.<init>(Unknown Source)
    	at java.util.zip.GZIPInputStream.<init>(Unknown Source)
    	at com.tools.sprite.SpriteLoader.loadArchivedSprites(SpriteLoader.java:166)
    	at com.tools.SpriteUtility.main(SpriteUtility.java:24)


    When i run it when i made the bank files
    Okay to repack an archive. Go to SpriteUtility.java in the main method and uncomment the packArchivedSprites leaving packUnarchivedSprites. Throw the sprites you want in the sprite folder and run the tool. press build and there you go. I've already done a lot of work to the tool since this release and making new archives is a snap
    Programmers are machines that convert caffeine into code
    Reply With Quote  
     

  7. #17  
    Banned

    Join Date
    Apr 2013
    Posts
    1,456
    Thanks given
    341
    Thanks received
    148
    Rep Power
    0
    Dont Matter
    Reply With Quote  
     

  8. Thankful user:


  9. #18  
    Registered Member Cr0nix's Avatar
    Join Date
    Jul 2017
    Posts
    91
    Thanks given
    4
    Thanks received
    9
    Rep Power
    10
    anyone got link for this?


    (Sorry for late reply, would just still love to have it xD
    A wise man once said:

    What is love,
    Baby don't hurt me....
    No more :C
    Reply With Quote  
     

  10. #19  
    Registered Member
    Join Date
    Sep 2017
    Posts
    19
    Thanks given
    3
    Thanks received
    3
    Rep Power
    11
    reupload pls
    Reply With Quote  
     

Page 2 of 2 FirstFirst 12

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. Replies: 11
    Last Post: 04-03-2014, 07:48 AM
  2. Replies: 7
    Last Post: 12-24-2013, 07:39 AM
  3. Replies: 7
    Last Post: 03-13-2012, 08:38 AM
  4. [Galkons]Load sprite via cache
    By karl ownz u in forum Help
    Replies: 8
    Last Post: 05-27-2010, 09:02 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •