Cupcakus Posted July 24, 2010 Share Posted July 24, 2010 (edited) Hey All, I picked up a Lynx at California Extreme, and because I'm completely nuts, I can't truly enjoy a new game console, until I've written code for it, and I understand how it works. Long story short, I was having trouble getting my head wrapped around how the sprite data has to be set up for packed sprites, so I wrote a tool to convert 16 color bitmaps into Lynx packed sprite data. Tools like this may already exist, but in any case, I thought I'd share the tool and it's source in case anyone else wants a head start, or wants to make the tool more useful. It could be better, IE: by changing the draw direction in the data it may be possible to get better compression, but I'm not figuring out the algorithm to do that :-). Depending on how many repeating pixels you have in your sprite, you can get a lot of space savings by packing your sprites up with this tool. I used VC++ 2008, but it's all std c, so you should be able to compile it for Linux or Mac by removing the precompiled header nonsense. lynxspr_exe.zip lynxspr_src.zip Edited July 24, 2010 by Cupcakus Quote Link to comment Share on other sites More sharing options...
matashen Posted July 25, 2010 Share Posted July 25, 2010 Hey All, I picked up a Lynx at California Extreme, and because I'm completely nuts, I can't truly enjoy a new game console, until I've written code for it, and I understand how it works. Long story short, I was having trouble getting my head wrapped around how the sprite data has to be set up for packed sprites, so I wrote a tool to convert 16 color bitmaps into Lynx packed sprite data. Tools like this may already exist, but in any case, I thought I'd share the tool and it's source in case anyone else wants a head start, or wants to make the tool more useful. It could be better, IE: by changing the draw direction in the data it may be possible to get better compression, but I'm not figuring out the algorithm to do that :-). Depending on how many repeating pixels you have in your sprite, you can get a lot of space savings by packing your sprites up with this tool. I used VC++ 2008, but it's all std c, so you should be able to compile it for Linux or Mac by removing the precompiled header nonsense. there already exists sprpck in the bll package i attached it sprpck.zip Quote Link to comment Share on other sites More sharing options...
Wookie Posted July 25, 2010 Share Posted July 25, 2010 Still, his work is great. This isn't a well known/documented part of Lynx development. I think I'll add a section to my Lynx documentation describing the packing algorithm and why it is that way. Quote Link to comment Share on other sites More sharing options...
Cupcakus Posted July 25, 2010 Author Share Posted July 25, 2010 Yah I figured this tool already existed, I was curious to see if both tools produced the same size packed sprite or if there was a difference. However the sprpck you attached only has a cygwin.dll in it :-) Quote Link to comment Share on other sites More sharing options...
matashen Posted July 25, 2010 Share Posted July 25, 2010 Yah I figured this tool already existed, I was curious to see if both tools produced the same size packed sprite or if there was a difference. However the sprpck you attached only has a cygwin.dll in it :-) I would only give to all lynx developers the sprpck in this way Everyone can use what he/she wants. And thanks to post also the source - very interesting Quote Link to comment Share on other sites More sharing options...
sage Posted August 22, 2010 Share Posted August 22, 2010 Nice alternative to sprpck as this is sometimes a bit unstable and the code not really readable. Can you please add a Makefile for the linux people with the following content: all: lynxspr lynxspr: lynxspr.cpp targetver.h stdafx.h stdafx.cpp and wrap the #include "tchar.h" into a #if __WINDOWS(or how this is defined) / #endif as this is not needed&existing on linux. Thanks. Quote Link to comment Share on other sites More sharing options...
sage Posted August 22, 2010 Share Posted August 22, 2010 Yah I figured this tool already existed, I was curious to see if both tools produced the same size packed sprite or if there was a difference. However the sprpck you attached only has a cygwin.dll in it :-) So, how big is the difference? Did you make some extensive tests? Which one has the better packing rate in your case? Quote Link to comment Share on other sites More sharing options...
Wookie Posted August 25, 2010 Share Posted August 25, 2010 I'm not sure if this was the latest and greatest version of sprpck (1.98), but 8 months ago I cleaned it up so that it would build and run on Linux: http://bitbucket.org/wookie/sprpck Quote Link to comment Share on other sites More sharing options...
sage Posted September 9, 2010 Share Posted September 9, 2010 I'm not sure if this was the latest and greatest version of sprpck (1.98), but 8 months ago I cleaned it up so that it would build and run on Linux: http://bitbucket.org/wookie/sprpck Well 1.98 was the latest version (which also compiled with linux without problems afaik). At least i am using it all the time. you can find it in karri's repo in the folder newcc65. Quote Link to comment Share on other sites More sharing options...
Wookie Posted September 9, 2010 Share Posted September 9, 2010 I must have just added autotools scripts. --Wookie Quote Link to comment Share on other sites More sharing options...
Cupcakus Posted October 10, 2010 Author Share Posted October 10, 2010 Yah I figured this tool already existed, I was curious to see if both tools produced the same size packed sprite or if there was a difference. However the sprpck you attached only has a cygwin.dll in it :-) So, how big is the difference? Did you make some extensive tests? Which one has the better packing rate in your case? The results were exactly the same, which is encouraging I guess. Quote Link to comment Share on other sites More sharing options...
sage Posted October 11, 2010 Share Posted October 11, 2010 Yah I figured this tool already existed, I was curious to see if both tools produced the same size packed sprite or if there was a difference. However the sprpck you attached only has a cygwin.dll in it :-) So, how big is the difference? Did you make some extensive tests? Which one has the better packing rate in your case? The results were exactly the same, which is encouraging I guess. Interessting, in my case the "old" sprpck had a better performance. means better pack rate. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.