Thread: Sprite Rips
View Single Post
Ice M A N

JCF Member

Joined: Jan 2001

Posts: 580

Ice M A N is doing well so far

Feb 3, 2006, 08:45 PM
Ice M A N is offline
Reply With Quote
Quote:
Originally Posted by Monolith
Ice M A N: Before you start churning out more bitmaps, you might want to fix your compliance with the bitmap file format. Windows Explorer and MS Paint seem to not like them very much.

bfSize in the BITMAPFILEHEADER looks way off.
You may want to set biSizeImage.
You should probably set dwColorUsed and dwColorImportant to both 256.
You may want to set both biXPelsPerMeter and biYPelsPerMeter to something other than 0.
And if all that doesn't work, maybe you should flip them over and use bottom-up bitmaps.
OK. Thanks for that. I'll fix all the zero things (http://www.fortunecity.com/skyscrape.../bmpffrmt.html was my reference for thinking they should be OK), and bfsize is off because I had to pad the image to be a multiple of 4 bytes wide.. I was reusing old code which I used for tilesets (where I didn't have to worry about that).. and I didn't update bfsize accordingly. I didn't notice since OSX's finder, Photoshop, and Camino (mozilla-derived OSX browser) all rendered them right... EDIT: well, in addition to the pad by 4 thing, bfSize was way off because I had bfOffBits in the calculation, but it was endian swapped, which made the outrageous result.. Anyway, they may be fixed now (I redid all that I had up previously.. took about a minute includeing zipping and uploading..)

and UF, zlib is just the compression thrown over a custom format... there's more to figureing out the file format than just being able to use the zlib library...

Last edited by Ice M A N; Feb 3, 2006 at 09:34 PM.