Game Development Reference
In-Depth Information
start = file.GetPosition();
end = GetSectionEnd(file);
while(file.GetPosition()<(UINT)end){
file.ReadString(line);
if (line.Find("SCENE_FILENAME")!=-1){
if (ParseTokens(line,tokens,5)<2) return FALSE;
strcpy(name,tokens[1].name);
continue;
}
if (line.Find("SCENE_FIRSTFRAME")!=-1){
if (ParseTokens(line,tokens,5)<2) return FALSE;
firstframe = atoi(tokens[1].name);
continue;
}
if (line.Find("SCENE_LASTFRAME")!=-1){
if (ParseTokens(line,tokens,5)<2) return FALSE;
lastframe = atoi(tokens[1].name);
continue;
}
if (line.Find("SCENE_FRAMESPEED")!=-1){
if (ParseTokens(line,tokens,5)<2) return FALSE;
fps = atoi(tokens[1].name);
continue;
}
if (line.Find("SCENE_TICKSPERFRAME")!=-1){
if (ParseTokens(line,tokens,5)<2) return FALSE;
ticksperframe = (double)atoi(tokens[1].name);
continue;
}
if (line.Find("SCENE_BACKGROUND_STATIC")!=-1){
if (ParseTokens(line,tokens,5)<4) return FALSE;
bgCol.x = (float)atof(tokens[1].name);
bgCol.y = (float)atof(tokens[2].name);
bgCol.z = (float)atof(tokens[3].name);
}
if (line.Find("SCENE_AMBIENT_STATIC")!=-1){
if (ParseTokens(line,tokens,5)<4) return FALSE;
ambient.x = (float)atof(tokens[1].name);
ambient.y = (float)atof(tokens[2].name);
ambient.z = (float)atof(tokens[3].name);
}
Search Nedrilad ::




Custom Search