Quote:
Originally Posted by Unknown Rabbit
I'll update data1 in j2l files on the wiki if you explain what that stuff is in words or a struct instead of oddly-colored php.
|
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.
|