Game Development Reference
In-Depth Information
The token NODE_NAME is followed by the name of the object. The
token NODE_PARENT is followed by the name of the parent. The token
NODE_TM is a subsection read with the separate function ReadNodeTM .
The token MESH is read with the function ReadMesh . The token TM_
ANIMATION is read with the function ReadAnimation . The token MATE-
RIAL_REF gives a single index into the MATERIAL_LIST for this object's
surface data. The token WIREFRAME_COLOR provides a single colour
surface for objects with no surface data.
BOOL C3DSAscii::ReadObject(CStdioFile &file)
{
CString line, tmp;
int start, end, index;
TOKEN tokens[5];
CToon3DObject *obj = &objList;
while(obj->next) obj = obj->next;
obj->next = new CToon3DObject;
obj = obj->next;
if (!obj) return FALSE;
start = file.GetPosition();
end = GetSectionEnd(file);
while(file.GetPosition()<(UINT)end){
file.ReadString(line);
if (line.Find("NODE_NAME")!=-1){
if (ParseTokens(line,tokens,5)<2) return FALSE;
obj->name=tokens[1].name;
continue;
}
if (line.Find("NODE_PARENT")!=-1){
if (ParseTokens(line, tokens, 5)<2) return FALSE;
obj->parentname = tokens[1].name;
continue;
}
if (line.Find("NODE_TM")!=-1){
if (!ReadNodeTM(file, obj)) return FALSE;
continue;
}
if (line.Find("MESH ")!=-1){
if (!ReadMesh(file, obj)) return FALSE;
continue;
Search Nedrilad ::




Custom Search