View Single Post
Old 06-22-2004, 12:36 AM   #8 (permalink)
Banshee
Senior Member
 
Join Date: Dec 2002
Location: Brazil
Posts: 168
Default

The first part is correct, Olaf's document says the same thing:

Quote:
Originally Posted by Olaf
struct t_tmp_ts_header
{
__int32 cblocks_x; // width of blocks
__int32 cblocks_y; // height in blocks
__int32 cx; // width of each block, always 48
__int32 cy; // height of each block, always 24
};


Then, you said you have a value that varies accordingt to the number of files... Olaf also wrote something similar:

Quote:
Originally Posted by Olaf
Directly after that, there is an index of the tiles. This index consists of c_files __int32 entries. When such an entry is zero, there is no tile. Otherwise, it's an offset from the start of the file and points to a TMP TS image header.
so, basically, it's the offset of the first image. Calculated by the size of the header, probably.

The part you couldnt figure out is the body:

Quote:
Originally Posted by Olaf
struct t_tmp_image_header
{
__int32 x; // position
__int32 y;
__int32 unknown1[3];
__int32 x_extra; // position of extra graphics
__int32 y_extra;
__int32 cx_extra; // size of extra graphics
__int32 cy_extra;
__int32 unknown2[4];
};
How does this position works? Position of what and where? What could be these extra graphics? Sorry, but I lack experience with this kind of graphic.

Then, I couldnt figure out what Olaf means with:

Quote:
Originally Posted by Olaf
The normal graphics of a tile are horizontal. The (optional) extra graphics of a tile are vertical. If cx_extra is between 0 and 256, the extra graphics are present.
The normal graphics can be found directly after the TMP TS image header. It's a 576 byte block. Because TS uses an isometric grid, the tile is not rectangular. The first line has 4 pixels, the second line has eight pixels. Line 12 has 48 pixels, line 13 has 44 pixels and line 22 has 4 pixels.
After the normal graphics, there's another 576 byte block. This block probably contains height data.
Then you have the extra graphics (if present). They're rectangular, so it's a block of cx_extra * cy_extra bytes. They should be drawn at x_extra,y_extra.
Banshee is offline   Reply With Quote