Yes.. RLE compressesion is used on a crapload of the file formats, though not exclusively..
Also, the code you have is slightly buggy (the "kludgey" bit was fixed year(s?) ago).. at the end of an RLE block, regardless of if it's a copying run or a literal run, it ends in 0x00 then the last byte, and the other 2 bytes skipped by the kludge are the compressed site bytes of the following RLE block.. or so I think. It's been a LONG time since I looked at it. (Right now it skips these 4 bytes and outputes a duplicate of the 2nd last byte IIRC)
Glad someone can make some use out of it... I didn't find it would be really worth the time to show things like that off, but more power to ya..
Oh.. and that level making program is due for a complete rewrite. Insanely buggy and difficult to understand/use.. And I've still never finished my JJ1 tileset compiler. I used to have one which worked with very particular raw images, but I've since lost it and never had the time to rewrite it (let alone work with many image formats, or whatever)
|