Game Development Reference
In-Depth Information
tmpobj = objList.next;
while(tmpobj){
if (tmpobj->name == obj->parentname){
obj->parent = tmpobj;
break;
}
tmpobj = tmpobj->next;
}
if (!obj->parent){
line.Format("%s parent object %s not found in object
list",
LPCTSTR(obj->name), LPCTSTR(obj->parentname));
AfxMessageBox(line);
obj->parentname = "noparent";
}
}
obj = obj->next;
}
if (!lightList.next) CreateDefaultLight();
file.Close();
return TRUE;
}
Reading the SCENE section
When reading the SCENE section we first make use of the function
GetSectionEnd to find the matching end brace. Then the function enters
a loop which has the exit condition that the file position exceeds the value
returned by the GetSectionEnd function. The scheme for most of the
readers is the same, read the next line and search for certain expected
tags. If a tag is found then process it using ParseTokens ; if it is a simple
single line tag or a subroutine or if it is a complex multi-line section. The
SCENE section contains no subsections unless background colour or
ambient animation is implemented.
BOOL C3DSAscii::ReadSceneInfo(CStdioFile &file)
{
CString line;
TOKEN tokens[5];
int start, end;
Search Nedrilad ::




Custom Search