/// <summary>Draws the scene by invoking the <see cref="EcsSystem.Draw"/> /// method on all systems in the scene.</summary> /// <param name="t">The total game time, in seconds.</param> /// <param name="dt">The game time, in seconds, since the last call to this method.</param> public override void Draw(float t, float dt) { GfxUtil.SetRT(mRT); Game1.Inst.GraphicsDevice.Clear(Color.White); base.Draw(t, dt); GfxUtil.SetRT(null); GfxUtil.DrawFsQuad(mDistortFX); }
/// <summary>Draws the scene by invoking the <see cref="EcsSystem.Draw"/> /// method on all systems in the scene.</summary> /// <param name="t">The total game time, in seconds.</param> /// <param name="dt">The game time, in seconds, since the last call to this method.</param> public override void Draw(float t, float dt) { { // TODO: CameraSystem no longer supports anything but chase cam, so manual setup below. var cam = (CCamera)Game1.Inst.Scene.GetComponentFromEntity <CCamera>(mCamID); var camTransf = (CTransform)Game1.Inst.Scene.GetComponentFromEntity <CTransform>(mCamID); cam.View = Matrix.CreateLookAt(camTransf.Position, cam.Target, Vector3.Up); } GfxUtil.SetRT(mRT); Game1.Inst.GraphicsDevice.Clear(Color.White); base.Draw(t, dt); GfxUtil.SetRT(null); GfxUtil.DrawFsQuad(mDistortFX); }
public override void Draw(float t, float dt) { if (shouldLeave) // TODO: When we parallelise this probably won't work. { CScore score = (CScore)Game1.Inst.Scene.GetComponentFromEntity <CScore>(player); SfxUtil.PlaySound("Sounds/Effects/horny_end"); Game1.Inst.LeaveScene(); Game1.Inst.EnterScene(new EndGameScene(passedTime, score.Score, won)); } var camera = (CCamera)GetComponentFromEntity <CCamera>(player); if (camera.Position.Y < configs.WaterHeight) { GfxUtil.SetRT(mRT); base.Draw(t, dt); GfxUtil.SetRT(null); mUnderWaterFx.Parameters["SrcTex"].SetValue(mRT); mUnderWaterFx.Parameters["Phase"].SetValue(t); GfxUtil.DrawFsQuad(mUnderWaterFx); } else if (configs.IsRaining) { GfxUtil.SetRT(mRT); base.Draw(t, dt); GfxUtil.SetRT(null); mPostProcessor.ApplyPostProcess(t, dt, mRT); } else { GfxUtil.SetRT(null); base.Draw(t, dt); } mHud.Update(); mHud.Draw(player); }