public void Render() { bool flag = false; DuckGame.Graphics.Clear(this.backgroundColor * DuckGame.Graphics.fade); for (int key = 0; key < this.currentObject; ++key) { if (this._states.ContainsKey(key)) { if (flag) { DuckGame.Graphics.screen.End(); } RecorderFrameStateChange state = this._states[key]; flag = true; MTEffect mtEffectFromIndex = Content.GetMTEffectFromIndex(state.effectIndex); if (Layer.IsBasicLayerEffect(mtEffectFromIndex)) { mtEffectFromIndex.effect.Parameters["fade"].SetValue((Vector3) new Vec3(DuckGame.Graphics.fade)); mtEffectFromIndex.effect.Parameters["add"].SetValue((Vector3) new Vec3(DuckGame.Graphics.fadeAdd)); } DuckGame.Graphics.screen.Begin(state.sortMode, state.blendState, state.samplerState, state.depthStencilState, state.rasterizerState, Content.GetMTEffectFromIndex(state.effectIndex), state.camera); DuckGame.Graphics.SetScissorRectangle(state.scissor); } DuckGame.Graphics.DrawRecorderItem(ref this.objects[key]); } if (!flag) { return; } DuckGame.Graphics.screen.End(); }
public void Render(ref RecorderFrame lerpFrame, float dist) { bool flag = false; DuckGame.Graphics.Clear(Color.Lerp(this.backgroundColor, lerpFrame.backgroundColor, dist) * DuckGame.Graphics.fade); for (int key = 0; key < this.currentObject; ++key) { if (this._states.ContainsKey(key)) { if (flag) { DuckGame.Graphics.screen.End(); } RecorderFrameStateChange state = this._states[key]; if (lerpFrame.HasStateWithIndex(state.stateIndex)) { lerpFrame.GetStateWithIndex(state.stateIndex); } flag = true; DuckGame.Graphics.SetScissorRectangle(state.scissor); DuckGame.Graphics.screen.Begin(state.sortMode, state.blendState, state.samplerState, state.depthStencilState, state.rasterizerState, Content.GetMTEffectFromIndex(state.effectIndex), state.camera); } RecorderFrameItem lerpTo = this.objects[key]; lerpFrame.sortedObjects.TryGetValue(lerpTo.spriteThingDraw, out lerpTo); if ((double)(lerpTo.topLeft - this.objects[key].topLeft).lengthSq > 2048.0) { lerpTo = this.objects[key]; } DuckGame.Graphics.DrawRecorderItemLerped(ref this.objects[key], ref lerpTo, dist); } if (!flag) { return; } DuckGame.Graphics.screen.End(); }