NOTE:
"Fill Zero" mean that this field still is existed but you should fill zero for it.
"Skip" mean that this field is entirely not existed. You should not consider it anymore.
This section will introduce the buffer format of CKStateChunk.
Buffer format is the real format of CKStateChunk stored in file.
CKStateChunk::ConvertFromBuffer
and CKStateChunk::ConvertToBuffer
can convert between CKStateChunk and its buffer format.
According to the value of CK_STATECHUNK_CHUNKVERSION, we split it into 3 different format.
The unit of m_DataDwSize is CKDWORD(uint32), not char(uint8).
The core data of CKStateChunk is aligned with 4 byte boundary. so this is the reason why the unit of
m_DataDwSize is CKDWORD.
Every reading and writing of m_pData should notice this unit issue.
uint16 m_DataVersion
The type of m_DataVersion is CK_STATECHUNK_DATAVERSION. |
uint16 m_ChunkVersion
The type of m_ChunkVersion is CK_STATECHUNK_CHUNKVERSION. |
uint32 m_ClassId
The type of m_ClassId is CK_CLASSID. |
uint32 m_DataDwSize
The size of CKStateChunk core data. |
uint32 m_ObjectListSize
The size of object list. |
uint32 m_ChunkListSize
The size of chunk list |
uint32[] m_pData
The core data. Its length is indicated by m_DataDwSize. |
uint32[] m_ObjectList
The object list. Its length is indicated by m_ObjectListSize. |
uint32[] m_ChunkList
The chunk list. Its length is indicated by m_ChunkListSize. |
uint32 m_ManagerListSize
The size of manager list |
uint32[] m_ManagerList
The manager list. Its length is indicated by m_ManagerListSize. |
uint8 m_DataVersion
The type of m_DataVersion is CK_STATECHUNK_DATAVERSION. |
uint8 m_ClassId
The type of m_ClassId is CK_CLASSID. |
uint8 m_ChunkVersion
The type of m_ChunkVersion is CK_STATECHUNK_CHUNKVERSION. |
uint8 m_Options
The type of m_Options is CK_STATECHUNK_CHUNKOPTIONS. |
uint32 m_DataDwSize
The size of CKStateChunk core data. |
uint32[] m_pData
The core data. Its length is indicated by m_DataDwSize. |
Enabled when m_Options has CHNK_OPTION_IDS. Skip if not have. |
Enabled when m_Options has CHNK_OPTION_CHN. Skip if not have. |
Enabled when m_Options has CHNK_OPTION_MAN. Skip if not have. |
This section introduce the format of CKStateChunk core data, the format of m_pData
.
The core data is filled by various Identifiers following various data.
It is related to the function of CKStateChunk.
A single identifier area. |
|
...
More identifier area as much as you like. |
The last m_NextIdentifier should set to zero to indicate the end of the series of identifier area. |
According to the value of CK_STATECHUNK_CHUNKVERSION, we split it into 3 different format.
uint32 m_SubChunkSize
The sum of all following variables' size. |
uint32 m_ClassId
The CK_CLASSID of sub chunk. |
uint32 m_DataDwSize
The size of core data in sub chunk. |
uint32 Blank
A blank. I don't know why |
uint32[] m_pData
The core data. Its length is indicated by m_DataDwSize. |
uint16 m_DataVersion
The CK_STATECHUNK_DATAVERSION of sub chunk. |
uint16 m_ChunkVersion
The CK_STATECHUNK_CHUNKVERSION of sub chunk. |
uint32 m_ObjectListSize
The size of sub chunk object list. |
uint32 m_ChunkListSize
The size of sub chunk chunk list |
uint32[] m_ObjectList
The object list. Its length is indicated by m_ObjectListSize. |
uint32[] m_ChunkList
The chunk list. Its length is indicated by m_ChunkListSize. |
uint32 m_ManagerListSize
The size of sub chunk manager list |
uint32[] m_ManagerList
The manager list. Its length is indicated by m_ManagerListSize. |