public void DrawLayers() { IOrderedEnumerable <Layer> source = this._hybridList.OrderBy <Layer, int>((Func <Layer, int>)(l => - l.depth)); if (this._lastDrawIndexCount == 0) { this._lastDrawIndexCount = this._hybridList.Count; } int num1 = 0; for (int index = 0; index < this._hybridList.Count; ++index) { Layer layer = source.ElementAt <Layer>(index); if (layer.visible && (Layer.lighting || layer != this._lighting && layer != this._lighting2)) { int num2 = 1; if (layer == Layer.Game) { num2 = 3; } float x = (float)(2.0 / (double)this._lastDrawIndexCount * (double)num1 / 2.0); float y = (float)(2.0 / (double)this._lastDrawIndexCount * (double)(num1 + num2) / 2.0); layer.depthSpan = new Vec2(x, y); layer.Draw(true); num1 += num2; } } this._lastDrawIndexCount = num1; }
public void DrawTargetLayers() { IOrderedEnumerable <Layer> source = this._hybridList.OrderBy <Layer, int>((Func <Layer, int>)(l => - l.depth)); uint num = 0; for (int index = 0; index < this._hybridList.Count; ++index) { Layer layer = source.ElementAt <Layer>(index); if (layer.visible && layer.isTargetLayer && (Layer.lighting || layer != this._lighting && layer != this._lighting2)) { float x = (float)(2.0 / (double)this._hybridList.Count * (double)index / 2.0); float y = (float)(2.0 / (double)this._hybridList.Count * (double)(index + 1) / 2.0); layer.depthSpan = new Vec2(x, y); layer.Draw(true, true); ++num; } } }