refactor: change repo layout
This commit is contained in:
16
Assets/Docs/CKStateChunk/CKStateChunk.css
Normal file
16
Assets/Docs/CKStateChunk/CKStateChunk.css
Normal file
@@ -0,0 +1,16 @@
|
||||
body {
|
||||
font-family: 'Times New Roman', Times, serif;
|
||||
}
|
||||
|
||||
td {
|
||||
min-width: 15em;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: 'Courier New', Courier, monospace;
|
||||
}
|
||||
pre {
|
||||
font-family: 'Courier New', Courier, monospace;
|
||||
}
|
||||
279
Assets/Docs/CKStateChunk/CKStateChunk.html
Normal file
279
Assets/Docs/CKStateChunk/CKStateChunk.html
Normal file
@@ -0,0 +1,279 @@
|
||||
<!DOCTYPE html>
|
||||
<link rel="stylesheet" type="text/css" href="CKStateChunk.css" />
|
||||
<script src="CKStateChunk.js"></script>
|
||||
|
||||
<body>
|
||||
<h1>CKStateChunk Data Structure</h1>
|
||||
<p>
|
||||
NOTE:<br />
|
||||
"Fill Zero" mean that this field still is existed but you should fill zero for it.<br />
|
||||
"Skip" mean that this field is entirely not existed. You should not consider it anymore.
|
||||
</p>
|
||||
|
||||
<h2>Buffer Format</h2>
|
||||
<p>
|
||||
This section will introduce the buffer format of CKStateChunk.<br />
|
||||
Buffer format is the real format of CKStateChunk stored in file.<br />
|
||||
<code>CKStateChunk::ConvertFromBuffer</code> and <code>CKStateChunk::ConvertToBuffer</code> can convert between CKStateChunk and its buffer format.
|
||||
</p>
|
||||
<p>According to the value of CK_STATECHUNK_CHUNKVERSION, we split it into 3 different format.</p>
|
||||
<ul>
|
||||
<li>value < CHUNK_VERSION2: Very Old Format</li>
|
||||
<li>value = CHUNK_VERSION2: Old Format</li>
|
||||
<li>value > CHUNK_VERSION2: New Format</li>
|
||||
</ul>
|
||||
<p>
|
||||
The unit of m_DataDwSize is CKDWORD(uint32), not char(uint8).<br />
|
||||
The core data of CKStateChunk is aligned with 4 byte boundary. so this is the reason why the unit of
|
||||
m_DataDwSize is CKDWORD.<br />
|
||||
Every reading and writing of m_pData should notice this unit issue.
|
||||
</p>
|
||||
<h3>Very Old Format</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td id="buf-fmt-vold-DataVersion">
|
||||
<code>uint16 m_DataVersion</code>
|
||||
<p>The type of m_DataVersion is CK_STATECHUNK_DATAVERSION.</p>
|
||||
</td>
|
||||
<td id="buf-fmt-vold-ChunkVersion">
|
||||
<code>uint16 m_ChunkVersion</code>
|
||||
<p>The type of m_ChunkVersion is CK_STATECHUNK_CHUNKVERSION.</p>
|
||||
</td>
|
||||
<td id="buf-fmt-vold-ClassId">
|
||||
<code>uint32 m_ClassId</code>
|
||||
<p>The type of m_ClassId is CK_CLASSID.</p>
|
||||
</td>
|
||||
<td id="buf-fmt-vold-DataDwSize">
|
||||
<code>uint32 m_DataDwSize</code>
|
||||
<p>The size of CKStateChunk core data.</p>
|
||||
</td>
|
||||
<td id="buf-fmt-vold-ObjectListSize">
|
||||
<code>uint32 m_ObjectListSize</code>
|
||||
<p>The size of object list.</p>
|
||||
</td>
|
||||
<td id="buf-fmt-vold-ChunkListSize">
|
||||
<code>uint32 m_ChunkListSize</code>
|
||||
<p>The size of chunk list</p>
|
||||
</td>
|
||||
<td id="buf-fmt-vold-pData">
|
||||
<code>uint32[] m_pData</code>
|
||||
<p>The core data. Its length is indicated by m_DataDwSize.</p>
|
||||
</td>
|
||||
<td id="buf-fmt-vold-ObjectList">
|
||||
<code>uint32[] m_ObjectList</code>
|
||||
<p>The object list. Its length is indicated by m_ObjectListSize.</p>
|
||||
</td>
|
||||
<td id="buf-fmt-vold-ChunkList">
|
||||
<code>uint32[] m_ChunkList</code>
|
||||
<p>The chunk list. Its length is indicated by m_ChunkListSize.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>Old Format</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="ph" target="buf-fmt-vold-DataVersion"></td>
|
||||
<td class="ph" target="buf-fmt-vold-ChunkVersion"></td>
|
||||
<td class="ph" target="buf-fmt-vold-ClassId"></td>
|
||||
<td class="ph" target="buf-fmt-vold-DataDwSize"></td>
|
||||
<td class="ph" target="buf-fmt-vold-ObjectListSize"></td>
|
||||
<td class="ph" target="buf-fmt-vold-ChunkListSize"></td>
|
||||
<td>
|
||||
<code>uint32 m_ManagerListSize</code>
|
||||
<p>The size of manager list</p>
|
||||
</td>
|
||||
<td class="ph" target="buf-fmt-vold-pData"></td>
|
||||
<td class="ph" target="buf-fmt-vold-ObjectList"></td>
|
||||
<td class="ph" target="buf-fmt-vold-ChunkList"></td>
|
||||
<td>
|
||||
<code>uint32[] m_ManagerList</code>
|
||||
<p>The manager list. Its length is indicated by m_ManagerListSize.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>New Format</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<code>uint8 m_DataVersion</code>
|
||||
<p>The type of m_DataVersion is CK_STATECHUNK_DATAVERSION.</p>
|
||||
</td>
|
||||
<td>
|
||||
<code>uint8 m_ClassId</code>
|
||||
<p>The type of m_ClassId is CK_CLASSID.</p>
|
||||
</td>
|
||||
<td>
|
||||
<code>uint8 m_ChunkVersion</code>
|
||||
<p>The type of m_ChunkVersion is CK_STATECHUNK_CHUNKVERSION.</p>
|
||||
</td>
|
||||
<td>
|
||||
<code>uint8 m_Options</code>
|
||||
<p>The type of m_Options is CK_STATECHUNK_CHUNKOPTIONS.</p>
|
||||
</td>
|
||||
<td>
|
||||
<code>uint32 m_DataDwSize</code>
|
||||
<p>The size of CKStateChunk core data.</p>
|
||||
</td>
|
||||
<td>
|
||||
<code>uint32[] m_pData</code>
|
||||
<p>The core data. Its length is indicated by m_DataDwSize.</p>
|
||||
</td>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td><code>uint32 m_ObjectListSize</code></td>
|
||||
<td><code>uint32[] m_ObjectList</code></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>Enabled when m_Options has CHNK_OPTION_IDS. Skip if not have.</p>
|
||||
</td>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td><code>uint32 m_ChunkListSize</code></td>
|
||||
<td><code>uint32[] m_ChunkList</code></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>Enabled when m_Options has CHNK_OPTION_CHN. Skip if not have.</p>
|
||||
</td>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td><code>uint32 m_ManagerListSize</code></td>
|
||||
<td><code>uint32[] m_ManagerList</code></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>Enabled when m_Options has CHNK_OPTION_MAN. Skip if not have.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2>Core Data Format</h2>
|
||||
<p>
|
||||
This section introduce the format of CKStateChunk core data, the format of <code>m_pData</code>.<br />
|
||||
The core data is filled by various Identifiers following various data.<br />
|
||||
It is related to the function of CKStateChunk.
|
||||
</p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table id="core-data-fmt-item">
|
||||
<tr>
|
||||
<td><code>uint32 m_Identifier</code></td>
|
||||
<td><code>uint32 m_NextIdentifier</code></td>
|
||||
<td><code>uint32[] m_Payload</code></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
A single identifier area.<br />
|
||||
m_Identifier is the unique magic word of this identifier area for CKStateChunk locating this area.<br />
|
||||
m_NextIdentifier is a relative pointer. It point to the m_Identifier in next identifier area and is relative to the start of core data.<br />
|
||||
Thus, the size of each identifier area can be simply computed by the absolute diff to adjacent m_NextIdentifier (<code>*m_pData[pos] - pos</code>)<br />
|
||||
m_Payload is the data of this identifier area and can be read or written by various CKStateChunk read write functions.<br />
|
||||
The minimum block size of m_Payload is uint32. It mean that all data must be aligned to uint32 boundary when saving.
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<table class="ph" target="core-data-fmt-item"></table>
|
||||
</td>
|
||||
<td>
|
||||
<code>...</code>
|
||||
<p>More identifier area as much as you like.</p>
|
||||
</td>
|
||||
<td>
|
||||
<table class="ph" target="core-data-fmt-item"></table>
|
||||
<p>The last m_NextIdentifier should set to zero to indicate the end of the series of identifier area.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2>SubChunk Format</h2>
|
||||
<p>According to the value of CK_STATECHUNK_CHUNKVERSION, we split it into 3 different format.</p>
|
||||
<ul>
|
||||
<li>value < CHUNK_VERSION1: Very Old Format</li>
|
||||
<li>value = CHUNK_VERSION1: Old Format</li>
|
||||
<li>value > CHUNK_VERSION1: New Format</li>
|
||||
</ul>
|
||||
<h3>Very Old Format</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td id="subchk-fmt-vold-SubChunkSize">
|
||||
<code>uint32 m_SubChunkSize</code>
|
||||
<p>The sum of all following variables' size.</p>
|
||||
</td>
|
||||
<td id="subchk-fmt-vold-ClassId">
|
||||
<code>uint32 m_ClassId</code>
|
||||
<p>The CK_CLASSID of sub chunk.</p>
|
||||
</td>
|
||||
<td id="subchk-fmt-vold-DataDwSize">
|
||||
<code>uint32 m_DataDwSize</code>
|
||||
<p>The size of core data in sub chunk.</p>
|
||||
</td>
|
||||
<td>
|
||||
<code><i>uint32 Blank</i></code>
|
||||
<p>A blank. I don't know why</p>
|
||||
</td>
|
||||
<td id="subchk-fmt-vold-pData">
|
||||
<code>uint32[] m_pData</code>
|
||||
<p>The core data. Its length is indicated by m_DataDwSize.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>Old Format</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="ph" target="subchk-fmt-vold-SubChunkSize"></td>
|
||||
<td class="ph" target="subchk-fmt-vold-ClassId"></td>
|
||||
<td id="subchk-fmt-old-DataVersion">
|
||||
<code>uint16 m_DataVersion</code>
|
||||
<p>The CK_STATECHUNK_DATAVERSION of sub chunk.</p>
|
||||
</td>
|
||||
<td id="subchk-fmt-old-ChunkVersion">
|
||||
<code>uint16 m_ChunkVersion</code>
|
||||
<p>The CK_STATECHUNK_CHUNKVERSION of sub chunk.</p>
|
||||
</td>
|
||||
<td class="ph" target="subchk-fmt-vold-DataDwSize"></td>
|
||||
<td id="subchk-fmt-old-ObjectListSize">
|
||||
<code>uint32 m_ObjectListSize</code>
|
||||
<p>The size of sub chunk object list.</p>
|
||||
</td>
|
||||
<td id="subchk-fmt-old-ChunkListSize">
|
||||
<code>uint32 m_ChunkListSize</code>
|
||||
<p>The size of sub chunk chunk list</p>
|
||||
</td>
|
||||
<td class="ph" target="subchk-fmt-vold-pData"></td>
|
||||
<td id="subchk-fmt-old-ObjectList">
|
||||
<code>uint32[] m_ObjectList</code>
|
||||
<p>The object list. Its length is indicated by m_ObjectListSize.</p>
|
||||
</td>
|
||||
<td id="subchk-fmt-old-ChunkList">
|
||||
<code>uint32[] m_ChunkList</code>
|
||||
<p>The chunk list. Its length is indicated by m_ChunkListSize.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>New Format</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="ph" target="subchk-fmt-vold-SubChunkSize"></td>
|
||||
<td class="ph" target="subchk-fmt-vold-ClassId"></td>
|
||||
<td class="ph" target="subchk-fmt-old-DataVersion"></td>
|
||||
<td class="ph" target="subchk-fmt-old-ChunkVersion"></td>
|
||||
<td class="ph" target="subchk-fmt-vold-DataDwSize"></td>
|
||||
<td class="ph" target="subchk-fmt-old-ObjectListSize"></td>
|
||||
<td class="ph" target="subchk-fmt-old-ChunkListSize"></td>
|
||||
<td>
|
||||
<code>uint32 m_ManagerListSize</code>
|
||||
<p>The size of sub chunk manager list</p>
|
||||
</td>
|
||||
<td class="ph" target="subchk-fmt-vold-pData"></td>
|
||||
<td class="ph" target="subchk-fmt-old-ObjectList"></td>
|
||||
<td class="ph" target="subchk-fmt-old-ChunkList"></td>
|
||||
<td>
|
||||
<code>uint32[] m_ManagerList</code>
|
||||
<p>The manager list. Its length is indicated by m_ManagerListSize.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
39
Assets/Docs/CKStateChunk/CKStateChunk.js
Normal file
39
Assets/Docs/CKStateChunk/CKStateChunk.js
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
function FixTableStyle() {
|
||||
let tables = document.querySelectorAll("table");
|
||||
for (let index = 0; index < tables.length; index++) {
|
||||
let singletable = tables[index];
|
||||
singletable.setAttribute("border", "1");
|
||||
singletable.setAttribute("cellspacing", "1");
|
||||
singletable.setAttribute("cellpadding", "10");
|
||||
}
|
||||
}
|
||||
|
||||
function TableCopyer() {
|
||||
let phs = document.querySelectorAll(".ph");
|
||||
for (let index = 0; index < phs.length; index++) {
|
||||
let ph = phs[index];
|
||||
let phparent = ph.parentNode;
|
||||
|
||||
let phtarget = ph.getAttribute("target");
|
||||
if (phtarget === null) {
|
||||
phparent.removeChild(ph);
|
||||
continue;
|
||||
}
|
||||
|
||||
let target = document.querySelector("#" + phtarget);
|
||||
if (target === null) {
|
||||
phparent.removeChild(ph);
|
||||
continue;
|
||||
}
|
||||
|
||||
let clonetarget = target.cloneNode(true);
|
||||
clonetarget.removeAttribute("id");
|
||||
phparent.replaceChild(clonetarget, ph);
|
||||
}
|
||||
}
|
||||
|
||||
window.onload=function() {
|
||||
FixTableStyle();
|
||||
TableCopyer();
|
||||
};
|
||||
12
Assets/Docs/IDAExportAddrConv.py
Normal file
12
Assets/Docs/IDAExportAddrConv.py
Normal file
@@ -0,0 +1,12 @@
|
||||
def Conv(strl: str):
|
||||
if len(strl) & 3 != 0:
|
||||
print('Invalid length!')
|
||||
return
|
||||
|
||||
idaBytes = tuple(strl[i:i+2] for i in range(0, len(strl), 2))
|
||||
for i in range(0, len(idaBytes), 4):
|
||||
print(idaBytes[i+3] + idaBytes[i+2] + idaBytes[i+1] + idaBytes[i])
|
||||
|
||||
while True:
|
||||
Conv(input("data> "))
|
||||
|
||||
402
Assets/Docs/Recorder.txt
Normal file
402
Assets/Docs/Recorder.txt
Normal file
@@ -0,0 +1,402 @@
|
||||
CKFile in VT21: 0xC8, 200, count50; in VT25: 0xE0, 224, count 56
|
||||
lost 24 byte, 6 fields or 2 lists
|
||||
|
||||
|
||||
|
||||
Important CK Class size
|
||||
CKObject no change. 0x14(20)
|
||||
CKSceneObject no change 0x1C(28), share Load/Save with CKObject
|
||||
|
||||
CKBehavior no change 0x6C(108)
|
||||
CKBeObject 0x50(80) count 20
|
||||
|
||||
CKGroup 0x68(104) count 26
|
||||
CKMaterial 0xF0(240) count 90
|
||||
CKTexture 0x94(148) count 52
|
||||
CKMesh 0x104(260) count 65
|
||||
|
||||
CKRenderObject 0x58(88) count 22, share Load/Save with CKBeObject
|
||||
CK3dEntity 0x1A8(424) count 106
|
||||
CK3dObject 0x1A8(424) count 106 same as CK3dEntity
|
||||
|
||||
|
||||
|
||||
m_FileName
|
||||
in VT21 +34, 136
|
||||
in VT25 +31, 124
|
||||
|
||||
m_MappedFile
|
||||
in VT21 +37, 148
|
||||
in VT25 +34, 136
|
||||
|
||||
m_Context
|
||||
in VT21 +35, 140
|
||||
in VT25 +32, 128
|
||||
|
||||
VxMemoryMappedFile and CKFileInfo seems no change
|
||||
CKFileObject still no change
|
||||
CKFilePluginDependencies still no change
|
||||
CKFileManagerData no change (12)
|
||||
|
||||
CKStateChunk is 0x28u black box
|
||||
CKBufferParser also is 0x10u black box
|
||||
|
||||
typedef char* CKSTRING;
|
||||
typedef char CKCHAR;
|
||||
typedef int CKBOOL;
|
||||
typedef unsigned char CKBYTE;
|
||||
typedef unsigned int CKDWORD;
|
||||
typedef unsigned short CKWORD;
|
||||
typedef int CKERROR;
|
||||
typedef void* CKSOUNDHANDLE;
|
||||
typedef int CKParameterType;
|
||||
typedef int CKOperationType;
|
||||
typedef int CKMessageType;
|
||||
typedef int CKAttributeType;
|
||||
typedef int CKAttributeCategory;
|
||||
|
||||
|
||||
struct CKGUID {
|
||||
DWORD d1,d2;
|
||||
};
|
||||
|
||||
struct XBaseString {
|
||||
// the string
|
||||
char* m_Buffer;
|
||||
// the length of the string
|
||||
WORD m_Length;
|
||||
// the allocated size
|
||||
WORD m_Allocated;
|
||||
};
|
||||
|
||||
struct XArray {
|
||||
// elements start {secret}
|
||||
DWORD* m_Begin;
|
||||
// elements end {secret}
|
||||
DWORD* m_End;
|
||||
// reserved end {secret}
|
||||
DWORD* m_AllocatedEnd;
|
||||
};
|
||||
struct XIntArray {
|
||||
int* m_Begin;
|
||||
int* m_End;
|
||||
int* m_AllocatedEnd;
|
||||
};
|
||||
struct XClassArray {
|
||||
DWORD* m_Begin;
|
||||
DWORD* m_End;
|
||||
DWORD* m_AllocatedEnd;
|
||||
};
|
||||
struct XSArray {
|
||||
DWORD* m_Begin;
|
||||
DWORD* m_End;
|
||||
};
|
||||
struct XBitArray {
|
||||
DWORD m_Data_Flags;
|
||||
DWORD m_Size;
|
||||
};
|
||||
|
||||
struct CKAttributeVal {
|
||||
CKAttributeType AttribType;
|
||||
CK_ID Parameter;
|
||||
};
|
||||
|
||||
struct VxImageDescEx {
|
||||
int Size; // Size of the structure
|
||||
DWORD Flags; // Reserved for special formats (such as compressed ) 0 otherwise
|
||||
|
||||
int Width; // Width in pixel of the image
|
||||
int Height; // Height in pixel of the image
|
||||
union {
|
||||
int BytesPerLine; // Pitch (width in bytes) of the image
|
||||
int TotalImageSize; // For compressed image (DXT1...) the total size of the image
|
||||
};
|
||||
int BitsPerPixel; // Number of bits per pixel
|
||||
union {
|
||||
DWORD RedMask; // Mask for Red component
|
||||
DWORD BumpDuMask; // Mask for Bump Du component
|
||||
};
|
||||
union {
|
||||
DWORD GreenMask; // Mask for Green component
|
||||
DWORD BumpDvMask; // Mask for Bump Dv component
|
||||
};
|
||||
union {
|
||||
DWORD BlueMask; // Mask for Blue component
|
||||
DWORD BumpLumMask; // Mask for Luminance component
|
||||
|
||||
};
|
||||
DWORD AlphaMask; // Mask for Alpha component
|
||||
|
||||
short BytesPerColorEntry; // ColorMap Stride
|
||||
short ColorMapEntries; // If other than 0 image is palletized
|
||||
|
||||
BYTE* ColorMap; // Palette colors
|
||||
BYTE* Image; // Image
|
||||
};
|
||||
|
||||
// <T, K> = <int, CK_ID>
|
||||
struct XHashTable_int_int_::Entry
|
||||
{
|
||||
int key;
|
||||
int data;
|
||||
struct XHashTable_int_int_::Entry *next;
|
||||
} *XHashTable_int_int_::pEntry;
|
||||
struct XHashTable_int_int_ {
|
||||
struct XHashTable_int_int_::XSArray_pEntry_ {
|
||||
XHashTable_int_int_::pEntry* m_Begin;
|
||||
XHashTable_int_int_::pEntry* m_End;
|
||||
}m_Table;
|
||||
struct XHashTable_int_int_::XClassArray_pEntry_ {
|
||||
XHashTable_int_int_::Entry* m_Begin;
|
||||
XHashTable_int_int_::Entry* m_End;
|
||||
XHashTable_int_int_::Entry* m_AllocatedEnd;
|
||||
}m_Pool;
|
||||
};
|
||||
struct XHashTable_int_int_::Iterator {
|
||||
XHashTable_int_int_::pEntry m_Node;
|
||||
XHashTable_int_int_* m_Table;
|
||||
};
|
||||
typedef XHashTable_int_int_ XFileObjectsTable;
|
||||
typedef XHashTable_int_int_ XAttributeList;
|
||||
|
||||
|
||||
struct CKObject {
|
||||
DWORD* vtable;
|
||||
CK_ID m_ID;
|
||||
CKSTRING m_Name;
|
||||
CKDWORD m_ObjectFlags;
|
||||
CKContext *m_Context;
|
||||
};
|
||||
|
||||
struct CKSceneObject : CKObject {
|
||||
XBitArray m_Scenes;
|
||||
};
|
||||
struct CKBeObject : CKSceneObject {
|
||||
XBitArray m_Groups;
|
||||
XArray* m_ScriptArray;
|
||||
XArray* m_LastFrameMessages;
|
||||
DWORD m_Waiting; // expanded from unsigned short
|
||||
DWORD m_Priority; // expanded from signed short
|
||||
float m_LastExecutionTime;
|
||||
XAttributeList* m_Attributes;
|
||||
CKDWORD* m_unknow15;
|
||||
CKDWORD m_unknow16;
|
||||
CKDWORD m_AttributeCount;
|
||||
CKDWORD m_unknow18;
|
||||
CKDWORD m_unknow19;
|
||||
};
|
||||
|
||||
struct BehaviorBlockData{};
|
||||
struct BehaviorGraphData{};
|
||||
struct CKBehavior : CKSceneObject {
|
||||
CK_ID m_Owner;
|
||||
CK_ID m_BehParent;
|
||||
XSObjectPointerArray m_InputArray;
|
||||
XSObjectPointerArray m_OutputArray;
|
||||
XSObjectPointerArray m_InParameter;
|
||||
XSObjectPointerArray m_OutParameter;
|
||||
XSObjectPointerArray m_LocalParameter;
|
||||
CK_CLASSID m_CompatibleClassID;
|
||||
int m_Priority;
|
||||
CKDWORD m_Flags;
|
||||
CKStateChunk * m_InterfaceChunk;
|
||||
BehaviorGraphData* m_GraphData;
|
||||
BehaviorBlockData* m_BlockData;
|
||||
float m_LastExecutionTime;
|
||||
CK_ID m_InputTargetParam;
|
||||
};
|
||||
|
||||
struct CKFileInfo
|
||||
{
|
||||
DWORD ProductVersion; // Virtools Version (Dev/Creation). (CK_VIRTOOLS_VERSION)
|
||||
DWORD ProductBuild; // Virtools Build Number.
|
||||
DWORD FileWriteMode; // Options used to save this file. (CK_FILE_WRITEMODE)
|
||||
DWORD FileVersion; // Version of file format when file was saved.
|
||||
DWORD CKVersion; // Version of CK when file was saved.
|
||||
DWORD FileSize; // Size of file in bytes.
|
||||
DWORD ObjectCount; // Number of objects stored in the file.
|
||||
DWORD ManagerCount; // Number of managers which saved data in the file.
|
||||
DWORD MaxIDSaved; // Maximum Object identifier saved
|
||||
DWORD Crc; // Crc of data
|
||||
DWORD Hdr1PackSize; // Reserved
|
||||
DWORD Hdr1UnPackSize; // Reserved
|
||||
DWORD DataPackSize; // Reserved
|
||||
DWORD DataUnPackSize; // Reserved
|
||||
};
|
||||
|
||||
struct CKFileObject {
|
||||
CK_ID Object; // ID of the object being load/saved (as it will be/was saved in the file)
|
||||
CK_ID CreatedObject; // ID of the object being created
|
||||
CK_CLASSID ObjectCid; // Class Identifier of the object
|
||||
CKObject* ObjPtr; // A pointer to the object itself (as CreatedObject when loading)
|
||||
CKSTRING Name; // Name of the Object
|
||||
CKStateChunk* Data; // A CKStateChunk that contains object information
|
||||
int PostPackSize; // When compressed chunk by chunk : size of Data after compression
|
||||
int PrePackSize; // When compressed chunk by chunk : size of Data before compression
|
||||
CK_FO_OPTIONS Options; // When loading an object it may be renamed , use to replace another object
|
||||
int FileIndex; // Position of the object data inside uncompressed file buffer
|
||||
CKDWORD SaveFlags; // Flags used when this object was saved.
|
||||
};
|
||||
|
||||
struct CKFileManagerData {
|
||||
CKStateChunk *data;
|
||||
CKGUID Manager;
|
||||
}
|
||||
|
||||
struct CKFilePluginDependencies{
|
||||
int m_PluginCategory;
|
||||
XArray/*<CKGUID>*/ m_Guids;
|
||||
XBitArray ValidGuids;
|
||||
};
|
||||
|
||||
struct VxMemoryMappedFile {
|
||||
void* m_hFile;
|
||||
void* m_hFileMapping; // Handle of memory mapped file
|
||||
void* m_pMemoryMappedFileBase;
|
||||
DWORD m_cbFile;
|
||||
DWORD m_errCode;
|
||||
};
|
||||
|
||||
struct CKStateChunkParser {
|
||||
DWORD m_CurrentPos;
|
||||
DWORD m_DataSize;
|
||||
DWORD m_PrevIdentifierPos;
|
||||
};
|
||||
struct IntListStruct {
|
||||
DWORD m_Count;
|
||||
DWORD m_Allocated;
|
||||
DWORD* m_pData;
|
||||
};
|
||||
struct CKStateChunkProp {
|
||||
WORD m_DataVersion;
|
||||
WORD m_ChunkVersion;
|
||||
};
|
||||
struct CKStateChunk {
|
||||
CK_CLASSID m_ClassId;
|
||||
|
||||
DWORD m_DataDwordSize;
|
||||
DWORD* m_pData;
|
||||
|
||||
CKStateChunkProp m_ChunkProps;
|
||||
|
||||
CKStateChunkParser* m_Parser;
|
||||
|
||||
IntListStruct* m_ObjectIdList;
|
||||
IntListStruct* m_SubChunkList;
|
||||
IntListStruct* m_ManagerIntList;
|
||||
|
||||
CKFile* m_BindFile;
|
||||
DWORD m_unknow;
|
||||
};
|
||||
struct ChunkIteratorData { // 0x40 count 16
|
||||
DWORD m_ChunkVersion;
|
||||
DWORD* m_pData;
|
||||
DWORD m_DataDwordSize;
|
||||
DWORD unknow_3;
|
||||
DWORD* m_ObjList_pData;
|
||||
DWORD m_ObjList_Count;
|
||||
DWORD* m_ChkList_pData;
|
||||
DWORD m_ChkList_Count;
|
||||
|
||||
DWORD unknow_8;
|
||||
DWORD unknow_9;
|
||||
DWORD unknow_10;
|
||||
DWORD unknow_11;
|
||||
DWORD unknow_12;
|
||||
DWORD unknow_13;
|
||||
|
||||
CKDependenciesContext* m_DepCtx;
|
||||
CKContext* m_Ctx;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct CKBufferParser {
|
||||
char* m_MemBegin;
|
||||
DWORD m_MemPos;
|
||||
CKBOOL m_NeedManualFree;
|
||||
DWORD m_MemSize;
|
||||
};
|
||||
|
||||
struct XArray_CKFileObject_ {
|
||||
CKFileObject* m_Begin;
|
||||
CKFileObject* m_End;
|
||||
CKFileObject* m_AllocatedEnd;
|
||||
};
|
||||
struct XArray_CKFileManagerData_ {
|
||||
CKFileManagerData* m_Begin;
|
||||
CKFileManagerData* m_End;
|
||||
CKFileManagerData* m_AllocatedEnd;
|
||||
};
|
||||
struct XClassArray_CKFilePluginDependencies_ {
|
||||
CKFilePluginDependencies* m_Begin;
|
||||
CKFilePluginDependencies* m_End;
|
||||
CKFilePluginDependencies* m_AllocatedEnd;
|
||||
};
|
||||
struct XClassArray_XIntArray_ {
|
||||
XIntArray* m_Begin;
|
||||
XIntArray* m_End;
|
||||
XIntArray* m_AllocatedEnd;
|
||||
};
|
||||
struct XClassArray_XString_ {
|
||||
XString* m_Begin;
|
||||
XString* m_End;
|
||||
XString* m_AllocatedEnd;
|
||||
};
|
||||
|
||||
struct CKFile {
|
||||
// 0
|
||||
int m_SaveIDMax; // Maximum CK_ID found when saving or loading objects {secret}
|
||||
XArray_CKFileObject_ m_FileObjects; // List of objects being saved / loaded {secret}
|
||||
XArray_CKFileManagerData_ m_ManagersData; // Manager Data loaded {secret}
|
||||
XClassArray_CKFilePluginDependencies_ m_PluginsDep; // Plugins dependencies for this file {secret}
|
||||
XClassArray_XIntArray_ m_IndexByClassId; // List of index in the m_FileObjects table sorted by ClassID {secret}
|
||||
XClassArray_XString_ m_IncludedFiles; // List of files that should be inserted in the CMO file. {secret}
|
||||
// 16
|
||||
CKFileInfo m_FileInfo; // Headers summary {secret}
|
||||
// 16 + 14 = 30
|
||||
// guess
|
||||
DWORD unknow_fields;
|
||||
XBitArray m_AlreadySavedMask; // BitArray of IDs already saved {secret}
|
||||
// 30 + 3 = 33
|
||||
CKDWORD m_Flags; // Flags used to save file {secret} CK_LOAD_FLAGS
|
||||
CKSTRING m_FileName; // Current file name {secret}
|
||||
CKContext* m_Context; // CKContext on which file is loaded/Saved {secret}
|
||||
CKBufferParser* m_Parser;
|
||||
VxMemoryMappedFile* m_MappedFile;
|
||||
// 33 + 5 = 38
|
||||
// guess
|
||||
XFileObjectsTable m_ObjectsHashTable;
|
||||
// 38 + 5 = 43
|
||||
//[guess]
|
||||
CKBOOL m_SceneSaved;
|
||||
CKBOOL m_ReadFileDataDone;
|
||||
// 43 + 2 = 45
|
||||
XBitArray m_AlreadyReferencedMask; // BitArray of IDs already referenced {secret}
|
||||
XObjectPointerArray m_ReferencedObjects;
|
||||
// 45 + 2 + 3 = 50
|
||||
};
|
||||
|
||||
VxTimeProfiler m_Chrono;
|
||||
|
||||
XFileObjectsTable m_ObjectsHashTable;
|
||||
//#ifdef USECHUNKTABLE
|
||||
XClassArray/*<CKFileChunk>*/ m_FileChunks; // Instead of allocating chunk per chunk a whole memory buffer is allocated to store all chunks and their readers
|
||||
CKFileChunk* m_ObjectChunks;
|
||||
CKFileChunk* m_ManagersChunks;
|
||||
VxMemoryPool m_ChunkBuffers; // Store all decompressed file buffer in memory so that all chunks directly points to it...
|
||||
// can only work for recent files ( > 2.0)
|
||||
BYTE* m_CurrentChunkBufferPtr;
|
||||
//#endif
|
||||
|
||||
CKBOOL m_ReadFileDataDone;
|
||||
CKBOOL m_SceneSaved;
|
||||
//-----------
|
||||
XIntArray m_DuplicateNameFounds; // A List of file object index for which a existing object with the same name has been
|
||||
// found, this list is build if the load option contains CK_LOAD_AUTOMATICMODE or CK_LOAD_DODIALOG
|
||||
|
||||
//-----
|
||||
XBitArray m_AlreadySavedMask; // BitArray of IDs already saved {secret}
|
||||
XBitArray m_AlreadyReferencedMask; // BitArray of IDs already referenced {secret}
|
||||
XObjectPointerArray m_ReferencedObjects;
|
||||
};
|
||||
Reference in New Issue
Block a user