Game Development Reference
In-Depth Information
CString braceline, line, name;
int filepos, strpos;
//If the function is called with a zero value for endpos then
//this value is set to the file length of bvhfile
if (!endpos) endpos = bvhfile.GetLength();
//The file is scanned to find the next ROOT or JOINT element
//If ROOT or JOINT is not found then the funciton returns FALSE
if (!bvhfile.ReadString(line)) return FALSE;
filepos = bvhfile.GetPosition();
if (filepos > endpos) return TRUE;
strpos = line.Find(”ROOT”);
if (strpos!=-1){
name = line.Right(line.GetLength() - 5 - strpos);
strpos = line.Find(”JOINT”);
if (strpos!=-1){
name = line.Right(line.GetLength() - 6 - strpos);
//Add the new item
bone = bones.AddBone(name, parent);
if (!bone) return FALSE;
//Allow for finding end brace by storing current brace line and
//Altering the opening brace to a closing brace
strpos = braceline.Find('{');
if (strpos==-1) return FALSE;
braceline.SetAt(strpos, '}');
filepos = bvhfile.GetPosition();
Search Nedrilad ::

Custom Search