protected void CreateSlice(Texture2D brushtex, int screenWidth, int x, int lineHeight, float wallDistance, bool columnSide, float texPos) { // Set the starting color based on the side displayed Color multColor = map.rowSideShading; if (columnSide == true) multColor = map.columnSideShading; // Shade the column depending on it's distance. float distanceScale = (lineHeight / map.distanceShadingScale); distanceScale = distanceScale > 1.0 ? 1.0f : distanceScale; multColor.R = (byte)(multColor.R * distanceScale); multColor.G = (byte)(multColor.G * distanceScale); multColor.B = (byte)(multColor.B * distanceScale); ScreenSplice newSplice = new ScreenSplice(brushtex, x, lineHeight, wallDistance, texPos, multColor); AddSplice(newSplice); }
/// <summary> /// Adds a splice to the list of splices to render /// </summary> protected void AddSplice(ScreenSplice splice) { if (splices[splice.x] == null) { splices[splice.x] = new List<ScreenSplice>(); } splices[splice.x].Add(splice); }