Game Development Reference
In-Depth Information
try{
file.Open(filename,CFile::modeRead);
}
catch(CFileException e){
AfxMessageBox("3DS ASCII import error: problem opening
file");
return FALSE;
}
file.ReadString(line);
if (line.Find("3DSMAX_ASCIIEXPORT")==-1){
AfxMessageBox("3DS ASCII Import error: Unexpected header
line");
return FALSE;
}
while(1){
if (!file.ReadString(line)) break;
if (line.Find("SCENE ")!=-1){
if (!ReadSceneInfo(file)) return FALSE;
continue;
}
if (line.Find("MATERIAL_LIST")!=-1){
if (!ReadMaterialList(file)) return FALSE;
continue;
}
if (line.Find("GEOMOBJECT")!=-1){
if (!ReadObject(file)) return FALSE;
continue;
}
if (line.Find("CAMERAOBJECT")!=-1){
if (!ReadCamera(file)) return FALSE;
continue;
}
if (line.Find("LIGHTOBJECT")!=-1){
if (!ReadLight(file)) return FALSE;
continue;
}
}
//Assign parent pointers using loaded parent names
CToon3DObject *obj = objList.next, *tmpobj;
while(obj){
if (obj->parentname!="noparent"){
Search Nedrilad ::




Custom Search