View Single Post
Jerrythabest Jerrythabest's Avatar

JCF Member

Joined: Apr 2005

Posts: 2,602

Jerrythabest is a forum legendJerrythabest is a forum legendJerrythabest is a forum legend

Oct 23, 2010, 10:14 AM
Jerrythabest is offline
Reply With Quote
Quote:
Originally Posted by Neobeo View Post
Basically, it's a run-length encoding similar to that of J2A. After the 128 bytes of transparency mask, there is a variable-length number of bytes that contain instructions saying how to draw stuff. In some sort of pseudocode:
Code:
For each row {
    Read one byte (this tells you how many contiguous opaque regions there are in the row) and call this byte n
    The next 2n bytes tell you alternatingly how many bytes to skip and how many bytes to draw
}
So basically, a fully transparent tile would have 32 "00"s after the 128-byte string (thus a total of 160). Whereas a fully opaque tile would have 32 "01 00 20" (in hex) which means, read 2 bytes, skip 0 pixels, draw 32 pixels ==> total of 128 + 3 * 32 = 224 pixels.
Does this mean you can make parts of a tile transparent regardless of the colours used for those pixels in the tile, by changing the data3 description of the tile?
__________________