From a4f39e6145930d9c10ca7a86487d51a3d9d4509a Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sun, 6 Dec 2015 11:35:01 +0100 Subject: [PATCH 1/2] Add an option to strech the rendered area instead of displaying black bars (closes #33) --- Vocaluxe/Base/CConfig.cs | 1 + Vocaluxe/Lib/Draw/CDirect3D.cs | 5 ++++- Vocaluxe/Lib/Draw/COpenGL.cs | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 3f735283..102967eb 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -89,6 +89,7 @@ namespace Vocaluxe.Base [DefaultValue(60f)] public float MaxFPS; [DefaultValue(EOffOn.TR_CONFIG_ON)] public EOffOn VSync; [DefaultValue(EOffOn.TR_CONFIG_ON)] public EOffOn FullScreen; + [DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn Strech; [DefaultValue(0.4f), XmlRanged(0, 3)] public float FadeTime; } diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 6289f02a..69ad1b7c 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -207,7 +207,10 @@ namespace Vocaluxe.Lib.Draw _H = _Form.ClientSize.Height; _W = _Form.ClientSize.Width; - _AdjustAspect(false); + if (CConfig.Config.Graphics.Strech != EOffOn.TR_CONFIG_ON) + { + _AdjustAspect(false); + } //Apply the new sizes to the PresentParameters _PresentParameters.BackBufferWidth = _Form.ClientSize.Width; diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index 4c78c436..c9550995 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -219,7 +219,11 @@ namespace Vocaluxe.Lib.Draw _W = _Control.Width; _CurrentAlignment = CConfig.Config.Graphics.ScreenAlignment; - _AdjustAspect(true); + if (CConfig.Config.Graphics.Strech != EOffOn.TR_CONFIG_ON) + { + _AdjustAspect(true); + } + _AdjustNewBorders(); GL.Viewport(_X, _Y, _W, _H); } From c41e922ac6dca68e16c9d83a6035f446c061249b Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sun, 6 Dec 2015 12:37:47 +0100 Subject: [PATCH 2/2] Added description and fixed typo --- Vocaluxe/Base/CConfig.cs | 4 +++- Vocaluxe/Lib/Draw/CDirect3D.cs | 2 +- Vocaluxe/Lib/Draw/COpenGL.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 102967eb..6e347131 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -89,7 +89,7 @@ namespace Vocaluxe.Base [DefaultValue(60f)] public float MaxFPS; [DefaultValue(EOffOn.TR_CONFIG_ON)] public EOffOn VSync; [DefaultValue(EOffOn.TR_CONFIG_ON)] public EOffOn FullScreen; - [DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn Strech; + [DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn Stretch; [DefaultValue(0.4f), XmlRanged(0, 3)] public float FadeTime; } @@ -469,6 +469,8 @@ namespace Vocaluxe.Base return "Server Encryption On/Off: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))); case "ServerPort": return "Server Port (default: 3000) [1..65535]"; + case "Stretch": + return "Stretch view to full window size: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))); default: return null; } diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 69ad1b7c..fc58ebb1 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -207,7 +207,7 @@ namespace Vocaluxe.Lib.Draw _H = _Form.ClientSize.Height; _W = _Form.ClientSize.Width; - if (CConfig.Config.Graphics.Strech != EOffOn.TR_CONFIG_ON) + if (CConfig.Config.Graphics.Stretch != EOffOn.TR_CONFIG_ON) { _AdjustAspect(false); } diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index c9550995..46cb7d15 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -219,7 +219,7 @@ namespace Vocaluxe.Lib.Draw _W = _Control.Width; _CurrentAlignment = CConfig.Config.Graphics.ScreenAlignment; - if (CConfig.Config.Graphics.Strech != EOffOn.TR_CONFIG_ON) + if (CConfig.Config.Graphics.Stretch != EOffOn.TR_CONFIG_ON) { _AdjustAspect(true); }