Matman will create several hi-color maps for us in this case

http://tauniverse.com/forum/showthread.php?t=40937
Code: Select all
pcode, c style
char= 8 bits, and int= 32 bits, long long= 64 bits.
//-------------------- The offset is always start from file start.
// When someone isn't, will mark it out.
struct tagNewMapFormat
{
unsigned int ("TA3D");
unsigned char ub_MapFormatVersion;// 0 for alpha, 0x1-0xf for beta,
//0x10 and more for release version,
//backward compatibility
struct mapinfo minfo_CurrentMap;//mapinfo
unsigned int ui_OffsetPalette; //0 for 32 bits,
//otherwise it was offset of palette
unsigned int ui_OffsetAnimTable;// offset of Anim object struct array
unsigned int ui_OffsetAnimArray;// offset of Anim's pos struct array
unsigned int ui_OffsetMimaMap; // think it can be a picture format,
//like jpeg/ bmp/ or what
unsigned int ui_OffsetHeightTable; // same as its name
unsigned short int ("UN");
unsigned byte ub_Data[1];// this array's size define by mapinfo's width* height and palette. It just save color of map pos in linear
} NewMapFormat ;
//-----------
/* here is the struct of detail */
//
typedef struct mapinfo
{
unsigned int ui_Width;
unsigned int ui_Height;
unsigned int ui_Level;
unsigned int ui_reserve;
} MapInfo;
typedef struct Position
{
unsigned int ui_X;
unsigned int ui_Y;
unsigned int ui_reserve;
} Position;
//------------
//Palette array start as ("PALE"), end as ("ELAP")
//The Palette Element is locate by sub, so a sub member is useful. but more for alignment
typedef struct tagPaletteElement
{
unsigned byte ub_Red;
unsigned byte ub_Blue;
unsigned byte ub_Green;
unsigned byte ub_CurrentSub;
} PaletteElement;
//---------------
//Anim array start as ("ANIM"), end as ("MINA")
typedef struct tagAnim
{
unsigned int ui_CurrentObjectSize;// the size of current struct,
//include all of this struct.
//But there are some spec value.
/*
0xffff ffff== zero truncated style string, for ARTub_data is anim object name;
0xffff fffe~ 0xffff fff0== reserve
*/
unsigned byte ARYub_data[1];//the array size define by ui_CurrentObjectSize
}
//-----------------
//Anim pos array struct start as ("AMIA"), end as "AIMA"
typedef struct tagAnimPos
{
struct Position pos_CurrentAnim;
unsigned int ui_AnimSub;// this sub used in locate the anim in anim objects array
} AnimPos;
//------------
//Mimamap live as a struct
typedef struct tagMimaMapInfo
{
unsigned int ("MIMP");//magic
unsigned int ui_CurrentStructSize;
unsigned byte ub_Data[1];// the size define by ui_CurrentStructSize
} MimaMapInfo;
//----------
//Height is a array of HeightPos Struct
// height live as this:
// a array of height pos struct, when last pos's height is same as current pos, avoid current pos' height pos but check next pos's height, so loop to the height be change, and
just save change height pos. When the X loop to 0, always record the one height pos;
typedef struct tagHeightPos
{
struct Position pos_CurrentPos;
unsigned short int height;//do we need that much height?
}
This can be quite big, remember width and height are in units of 16pixels. For instance:xpoy wrote:Code: Select all
unsigned byte ub_Data[1];// this array's size define by mapinfo's width* height and palette. It just save color of map pos in linear
Code: Select all
with = 768 (in blocs of 16pixels)
height = 768 (in blocs of 16pixels)
bpp = 32bits (R,G,B,alpha)
size = (768 * 16)² * 4 = 576 MB!
Users browsing this forum: No registered users and 4 guests