General.ErrorLogger.Add(ErrorType.Warning,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+skyType+" scroll speed value, but got '"+token+"'");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
continue;
}
if(skyType=="sky1")
mapInfo.Sky1ScrollSpeed=scrollSpeed;
else
mapInfo.Sky2ScrollSpeed=scrollSpeed;
}else{
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
}
}else{
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+skyType+" texture name.");
}
//old format
}else{
//token should be sky1/2 name
if(!string.IsNullOrEmpty(token)){
if(skyType=="sky1")
mapInfo.Sky1=token;
else
mapInfo.Sky2=token;
//try to read scroll speed
SkipWhitespace(true);
token=StripTokenQuotes(ReadToken());
floatscrollSpeed=0;
if(!ReadSignedFloat(token,refscrollSpeed)){
// Not numeric!
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
continue;
}
if(skyType=="sky1")
mapInfo.Sky1ScrollSpeed=scrollSpeed;
else
mapInfo.Sky2ScrollSpeed=scrollSpeed;
}else{
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+skyType+" texture name.");
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+fadeType+" color values, but got '"+token+"'");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+fadeType+" red value, but got '"+parts[0]+"'");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+fadeType+" green value, but got '"+parts[1]+"'");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+fadeType+" blue value, but got '"+parts[2]+"'");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
continue;
}
color.Red=(float)r/255;
color.Green=(float)g/255;
color.Blue=(float)b/255;
if(fadeType=="fade")
mapInfo.FadeColor=color;
else
mapInfo.OutsideFogColor=color;
}
}else{
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+fadeType+" color value.");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
}
//old format
}else{
//token should contain red color value or color name...
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+fadeType+" green value, but got '"+token+"'");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+fadeType+" blue value, but got '"+token+"'");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
continue;
}
color.Red=(float)r/255;
color.Green=(float)g/255;
color.Blue=(float)b/255;
if(fadeType=="fade")
mapInfo.FadeColor=color;
else
mapInfo.OutsideFogColor=color;
}else{
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+fadeType+" color value.");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+shadeType+" value, but got '"+token+"'");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again
General.ErrorLogger.Add(ErrorType.Error,"Unexpected token found in '"+sourcename+"' at line "+GetCurrentLineNumber()+": expected "+densityType+" value, but got '"+token+"'");
datastream.Seek(-token.Length-1,SeekOrigin.Current);//step back and try parsing this token again