General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Red Color value, but got '"+token+"'");
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Green Color value, but got '"+token+"'");
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Blue Color value, but got '"+token+"'");
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Size value, but got '"+token+"'");
gotErrors=true;
break;
}
light.PrimaryRadius*=2;
}else{
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": '"+token+"' is not valid property for "+lightType);
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Offset X value, but got '"+token+"'");
gotErrors=true;
break;
}
SkipWhitespace(true);
token=StripTokenQuotes(ReadToken());
if(!ReadSignedFloat(token,reflight.Offset.Z)){
// Not numeric!
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Offset Y value, but got '"+token+"'");
gotErrors=true;
break;
}
SkipWhitespace(true);
token=StripTokenQuotes(ReadToken());
if(!ReadSignedFloat(token,reflight.Offset.Y)){
// Not numeric!
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Offset Z value, but got '"+token+"'");
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Subtractive value, but got '"+token+"'");
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Dontlightself value, but got '"+token+"'");
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Interval value, but got '"+token+"'");
General.ErrorLogger.Add(ErrorType.Warning,"Warning in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": Interval value should be greater than zero");
//I wrote logic for dynamic lights animation first, so here I modify gldefs settings to fit in existing logic
if(lightType==GldefsLightType.PULSE){
light.Interval=(int)(interval*35);//measured in tics (35 per second) in PointLightPulse, measured in seconds in gldefs' PulseLight
}else{//FLICKER2. Seems like PointLightFlickerRandom to me
light.Interval=(int)(interval*350);//0.1 is one second for FlickerLight2
}
}else{
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": '"+token+"' is not valid property for "+lightType);
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected SecondarySize value, but got '"+token+"'");
gotErrors=true;
break;
}
light.SecondaryRadius*=2;
}else{
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": '"+token+"' is not valid property for "+lightType);
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Chance value, but got '"+token+"'");
gotErrors=true;
break;
}
//transforming from 0.0 .. 1.0 to 0 .. 359 to fit in existing logic
light.Interval=(int)(chance*359.0f);
}else{
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": '"+token+"' is not valid property for "+lightType);
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": expected Scale value, but got '"+token+"'");
gotErrors=true;
break;
}
if(scale>1.0f){
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": scale must be in 0.0 - 1.0 range, but is "+scale);
gotErrors=true;
break;
}
//sector light doesn't have animation, so we will store it's size in Interval
//transforming from 0.0 .. 1.0 to 0 .. 10 to preserve value.
light.Interval=(int)(scale*10.0f);
}else{
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": '"+token+"' is not valid property for "+lightType);
General.ErrorLogger.Add(ErrorType.Warning,"'"+sourcefilename+"', line "+GetCurrentLineNumber()+": light Color is "+light.Color.Red+","+light.Color.Green+","+light.Color.Blue+". It won't be shown in GZDoom!");
General.ErrorLogger.Add(ErrorType.Warning,"'"+sourcefilename+"', line "+GetCurrentLineNumber()+": 'Size' and 'SecondarySize' are 0. This light won't be shown in GZDoom!");
General.ErrorLogger.Add(ErrorType.Warning,"Light declaration not found for light '"+token+"' ('"+sourcefilename+"', line "+GetCurrentLineNumber()+")");
General.ErrorLogger.Add(ErrorType.Error,"Error in '"+sourcefilename+"' at line "+GetCurrentLineNumber()+": got #include directive with missing or incorrect path: '"+includeLump+"'");