Changed texture sizes to more reasonable int
This commit is contained in:
1 parent
1bfc76e4d3
commit
151fab8857
22 files changed
+67
-66
No files matched your search
@@ -146,7 +146,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
_Rand = rand;
|
||||
}
|
||||
|
||||
public CCombination GetNextCombination(List<int> playerNrDemand)
|
||||
public CCombination GetNextCombination(IEnumerable<int> playerNrDemand)
|
||||
{
|
||||
if (_Combs.Count == 0)
|
||||
_Create();
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace Vocaluxe.Base
|
||||
RectangleF bounds = new RectangleF(staticBounds.Rect.X, staticBounds.Rect.Y, staticBounds.Rect.W, staticBounds.Rect.H);
|
||||
RectangleF rect;
|
||||
|
||||
CHelper.SetRect(bounds, out rect, texture.Width / texture.Height, aspect);
|
||||
CHelper.SetRect(bounds, out rect, (float)texture.Width / texture.Height, aspect);
|
||||
DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, staticBounds.Rect.Z),
|
||||
texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f));
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Vocaluxe.Base
|
||||
float videoTime = _VideoTimer.ElapsedMilliseconds / 1000f;
|
||||
_Finished = CVideo.Finished(_VideoStream);
|
||||
|
||||
STexture tex = new STexture(-1) {Height = 0f};
|
||||
STexture tex = new STexture(-1) {Height = 0};
|
||||
CVideo.GetFrame(_VideoStream, ref tex, videoTime, out videoTime);
|
||||
|
||||
if (tex.Height > 0)
|
||||
@@ -182,7 +182,7 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
RectangleF bounds = new RectangleF(0f, 0f, CSettings.RenderW, CSettings.RenderH);
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, _VideoTexture.Width / _VideoTexture.Height, EAspect.Crop);
|
||||
CHelper.SetRect(bounds, out rect, (float)_VideoTexture.Width / _VideoTexture.Height, EAspect.Crop);
|
||||
|
||||
CDraw.DrawTexture(_VideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CSettings.ZFar / 4));
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Vocaluxe.Base.Fonts
|
||||
|
||||
private static void _BuildFonts()
|
||||
{
|
||||
foreach (var font in _Fonts)
|
||||
foreach (SFont font in _Fonts)
|
||||
{
|
||||
font.Normal.Dispose();
|
||||
font.Bold.Dispose();
|
||||
@@ -257,8 +257,8 @@ namespace Vocaluxe.Base.Fonts
|
||||
Height = height;
|
||||
SetFont(text.Font);
|
||||
Style = text.Style;
|
||||
var result = new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text, text.TranslationID)),
|
||||
GetTextHeight(CLanguage.Translate(text.Text, text.TranslationID)));
|
||||
RectangleF result = new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text, text.TranslationID)),
|
||||
GetTextHeight(CLanguage.Translate(text.Text, text.TranslationID)));
|
||||
//restore old values
|
||||
Height = oldHeight;
|
||||
_CurrentFont = oldFont;
|
||||
|
||||
@@ -121,6 +121,7 @@ namespace Vocaluxe.Base.Fonts
|
||||
_DrawBounding.Width = _Texture.Width;
|
||||
_DrawBounding.Height = _Texture.Height;*/
|
||||
#pragma warning disable 162
|
||||
// ReSharper disable HeuristicUnreachableCode
|
||||
if (false)
|
||||
{
|
||||
if (outline > 0)
|
||||
@@ -128,6 +129,7 @@ namespace Vocaluxe.Base.Fonts
|
||||
else
|
||||
bmpCropped.Save("font/" + chr + CFonts.Style + "2.png", ImageFormat.Png);
|
||||
}
|
||||
// ReSharper restore HeuristicUnreachableCode
|
||||
#pragma warning restore 162
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
/// <param name="texture">The texture in which the frame is copied to</param>
|
||||
public void CopyScreen(ref STexture texture)
|
||||
{
|
||||
if (!_TextureExists(ref texture) || (int)texture.Width != GetScreenWidth() || (int)texture.Height != GetScreenHeight())
|
||||
if (!_TextureExists(ref texture) || texture.Width != GetScreenWidth() || texture.Height != GetScreenHeight())
|
||||
{
|
||||
RemoveTexture(ref texture);
|
||||
texture = CopyScreen();
|
||||
@@ -758,8 +758,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
/// <param name="y2">The end y-value</param>
|
||||
public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
var lineVector = new Vector2[] {new Vector2(x1, y1), new Vector2(x2, y2)};
|
||||
using (var line = new Line(_Device))
|
||||
Vector2[] lineVector = new Vector2[] {new Vector2(x1, y1), new Vector2(x2, y2)};
|
||||
using (Line line = new Line(_Device))
|
||||
{
|
||||
line.Antialias = true;
|
||||
line.Begin();
|
||||
@@ -872,9 +872,9 @@ namespace Vocaluxe.Lib.Draw
|
||||
else if (h > maxSize)
|
||||
newH = maxSize;
|
||||
else if (w > h)
|
||||
newW = (int)_CheckForNextPowerOf2(w);
|
||||
newW = _CheckForNextPowerOf2(w);
|
||||
else
|
||||
newH = (int)_CheckForNextPowerOf2(h);
|
||||
newH = _CheckForNextPowerOf2(h);
|
||||
|
||||
Bitmap bmp2 = null;
|
||||
byte[] data;
|
||||
@@ -943,18 +943,18 @@ namespace Vocaluxe.Lib.Draw
|
||||
texture.Height = h;
|
||||
texture.W2 = _CheckForNextPowerOf2(w);
|
||||
texture.H2 = _CheckForNextPowerOf2(h);
|
||||
texture.WidthRatio = w / texture.W2;
|
||||
texture.HeightRatio = h / texture.H2;
|
||||
texture.WidthRatio = (float)w / texture.W2;
|
||||
texture.HeightRatio = (float)h / texture.H2;
|
||||
|
||||
//Create a new texture in the managed pool, which does not need to be recreated on a lost device
|
||||
//because a copy of the texture is hold in the Ram
|
||||
Texture t = null;
|
||||
try
|
||||
{
|
||||
t = new Texture(_Device, (int)texture.W2, (int)texture.H2, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed);
|
||||
t = new Texture(_Device, texture.W2, texture.H2, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed);
|
||||
//Lock the texture and fill it with the data
|
||||
DataRectangle rect = t.LockRectangle(0, LockFlags.Discard);
|
||||
int rowWidth = 4 * (int)texture.W2;
|
||||
int rowWidth = 4 * texture.W2;
|
||||
for (int i = 0; i + rowWidth <= data.Length; i += 4 * w)
|
||||
{
|
||||
rect.Data.Write(data, i, rowWidth);
|
||||
@@ -1010,7 +1010,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
lock (_MutexTexture)
|
||||
{
|
||||
DataRectangle rect = _D3DTextures[texture.Index].LockRectangle(0, LockFlags.Discard);
|
||||
int w = (int)texture.Width;
|
||||
int w = texture.Width;
|
||||
for (int i = 0; i < data.Length; i += 4 * w)
|
||||
{
|
||||
rect.Data.Write(data, i, 4 * w);
|
||||
@@ -1378,13 +1378,13 @@ namespace Vocaluxe.Lib.Draw
|
||||
/// </summary>
|
||||
/// <param name="n">The value of which the next power of two will be calculated</param>
|
||||
/// <returns>The next power of two</returns>
|
||||
private float _CheckForNextPowerOf2(float n)
|
||||
private int _CheckForNextPowerOf2(int n)
|
||||
{
|
||||
if (_NonPowerOf2TextureSupported)
|
||||
return n;
|
||||
if (n < 0)
|
||||
throw new ArgumentOutOfRangeException("n", "Must be positive.");
|
||||
return (float)Math.Pow(2, Math.Ceiling(Math.Log(n, 2)));
|
||||
return (int)Math.Pow(2, Math.Ceiling(Math.Log(n, 2)));
|
||||
}
|
||||
|
||||
private SlimDX.Matrix _CalculateRotationMatrix(float rot, float rx1, float rx2, float ry1, float ry2)
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
public void CopyScreen(ref STexture texture)
|
||||
{
|
||||
if (texture.Index == 0 || (int)texture.Width != GetScreenWidth() || (int)texture.Height != GetScreenHeight())
|
||||
if (texture.Index == 0 || texture.Width != GetScreenWidth() || texture.Height != GetScreenHeight())
|
||||
{
|
||||
RemoveTexture(ref texture);
|
||||
texture = CopyScreen();
|
||||
|
||||
@@ -501,12 +501,12 @@ namespace Vocaluxe.Lib.Draw
|
||||
texture.W2 = MathHelper.NextPowerOfTwo(texture.Width);
|
||||
texture.H2 = MathHelper.NextPowerOfTwo(texture.Height);
|
||||
|
||||
texture.WidthRatio = texture.Width / texture.W2;
|
||||
texture.HeightRatio = texture.Height / texture.H2;
|
||||
texture.WidthRatio = (float)texture.Width / texture.W2;
|
||||
texture.HeightRatio = (float)texture.Height / texture.H2;
|
||||
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, (int)texture.W2, (int)texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, texture.W2, texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
GL.CopyTexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, _X, _Y, (int)texture.Width, (int)texture.Height);
|
||||
GL.CopyTexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, _X, _Y, texture.Width, texture.Height);
|
||||
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
@@ -537,7 +537,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
|
||||
GL.CopyTexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, 0, 0, (int)texture.Width, (int)texture.Height);
|
||||
GL.CopyTexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, 0, 0, texture.Width, texture.Height);
|
||||
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
}
|
||||
@@ -737,7 +737,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
texture.H2 = MathHelper.NextPowerOfTwo(h);
|
||||
try
|
||||
{
|
||||
using (Bitmap bmp2 = new Bitmap((int)texture.W2, (int)texture.H2))
|
||||
using (Bitmap bmp2 = new Bitmap(texture.W2, texture.H2))
|
||||
{
|
||||
Graphics g = Graphics.FromImage(bmp2);
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
@@ -750,7 +750,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
BitmapData bmpData = bmp2.LockBits(new Rectangle(0, 0, bmp2.Width, bmp2.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, (int)texture.W2, (int)texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, texture.W2, texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, bmpData.Width, bmpData.Height, PixelFormat.Bgra, PixelType.UnsignedByte, bmpData.Scan0);
|
||||
|
||||
@@ -759,7 +759,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
}
|
||||
catch
|
||||
{
|
||||
CLog.LogError(w + " " + h + " " + (int)texture.W2 + " " + (int)texture.H2);
|
||||
CLog.LogError(w + " " + h + " " + texture.W2 + " " + texture.H2);
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -828,10 +828,10 @@ namespace Vocaluxe.Lib.Draw
|
||||
texture.W2 = MathHelper.NextPowerOfTwo(texture.Width);
|
||||
texture.H2 = MathHelper.NextPowerOfTwo(texture.Height);
|
||||
|
||||
texture.WidthRatio = texture.Width / texture.W2;
|
||||
texture.HeightRatio = texture.Height / texture.H2;
|
||||
texture.WidthRatio = (float)texture.Width / texture.W2;
|
||||
texture.HeightRatio = (float)texture.Height / texture.H2;
|
||||
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, (int)texture.W2, (int)texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, texture.W2, texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, w, h, PixelFormat.Bgra, PixelType.UnsignedByte, data);
|
||||
|
||||
@@ -887,7 +887,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
GL.UnmapBuffer(BufferTarget.PixelUnpackBuffer);
|
||||
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, texture.Width, texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0);
|
||||
@@ -897,7 +897,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, data);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, texture.Width, texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, data);
|
||||
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge);
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
|
||||
@@ -661,7 +661,7 @@ namespace Vocaluxe.Lib.Video
|
||||
|
||||
if (num >= 0)
|
||||
{
|
||||
if (frame.Index == -1 || _Width != (int)frame.Width || _Height != (int)frame.Height)
|
||||
if (frame.Index == -1 || _Width != frame.Width || _Height != frame.Height)
|
||||
{
|
||||
CDraw.RemoveTexture(ref frame);
|
||||
frame = CDraw.AddTexture(_Width, _Height, _FrameBuffer[num].Data);
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Vocaluxe.Lib.Video
|
||||
{
|
||||
if (data == null)
|
||||
return;
|
||||
if (frame.Index == -1 || width != (int)frame.Width || height != (int)frame.Height || data.Length == 0)
|
||||
if (frame.Index == -1 || width != frame.Width || height != frame.Height || data.Length == 0)
|
||||
{
|
||||
CDraw.RemoveTexture(ref frame);
|
||||
frame = CDraw.AddTexture(width, height, data);
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Vocaluxe.Lib.Webcam
|
||||
{
|
||||
lock (_MutexData)
|
||||
{
|
||||
if (frame.Index == -1 || _Width != (int)frame.Width || _Height != (int)frame.Height)
|
||||
if (frame.Index == -1 || _Width != frame.Width || _Height != frame.Height)
|
||||
{
|
||||
CDraw.RemoveTexture(ref frame);
|
||||
frame = CDraw.AddTexture(_Width, _Height, _Data);
|
||||
|
||||
@@ -317,7 +317,7 @@ namespace Vocaluxe.Screens
|
||||
base.OnShow();
|
||||
|
||||
//Vocaluxe-Logo
|
||||
_Logo = GetNewStatic(_TexLogo, new SColorF(1, 1, 1, 1), new SRectF((CSettings.RenderW - _TexLogo.Width) / 2, -270, _TexLogo.Width, _TexLogo.Height, -2));
|
||||
_Logo = GetNewStatic(_TexLogo, new SColorF(1, 1, 1, 1), new SRectF((float)(CSettings.RenderW - _TexLogo.Width) / 2, -270, _TexLogo.Width, _TexLogo.Height, -2));
|
||||
|
||||
//Little stars for logo
|
||||
int numstars = (int)(_Logo.Rect.W * 0.25f / 2f);
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Vocaluxe.Screens
|
||||
private bool _SelectingKeyboardActive;
|
||||
private bool _SelectingFast;
|
||||
private int _SelectingSwitchNr = -1;
|
||||
private int _SelectingFastPlayerNr = 0;
|
||||
private int _SelectingFastPlayerNr;
|
||||
private int _SelectedPlayerNr = -1;
|
||||
|
||||
public override void Init()
|
||||
@@ -430,7 +430,7 @@ namespace Vocaluxe.Screens
|
||||
CConfig.Players[_SelectingSwitchNr] = string.Empty;
|
||||
//Update texture and name
|
||||
_Statics[_StaticPlayerAvatar[_SelectingSwitchNr]].Texture = _OriginalPlayerAvatarTextures[_SelectingSwitchNr];
|
||||
_Texts[_TextPlayer[_SelectingSwitchNr]].Text = CProfiles.GetPlayerName(-1, (_SelectingSwitchNr+1));
|
||||
_Texts[_TextPlayer[_SelectingSwitchNr]].Text = CProfiles.GetPlayerName(-1, (_SelectingSwitchNr + 1));
|
||||
}
|
||||
//Update Game-infos with new player
|
||||
CGame.Players[i].ProfileID = _SelectedPlayerNr;
|
||||
@@ -447,7 +447,7 @@ namespace Vocaluxe.Screens
|
||||
break;
|
||||
}
|
||||
//Selected player is dropped out of area
|
||||
else if (_SelectingSwitchNr > -1)
|
||||
if (_SelectingSwitchNr > -1)
|
||||
{
|
||||
//Update Game-infos with new player
|
||||
CGame.Players[_SelectingSwitchNr].ProfileID = -1;
|
||||
@@ -569,7 +569,7 @@ namespace Vocaluxe.Screens
|
||||
else
|
||||
stopSelectingFast = true;
|
||||
}
|
||||
else if(mouseEvent.MB)
|
||||
else if (mouseEvent.MB)
|
||||
{
|
||||
_ResetPlayerSelections();
|
||||
_SelectingFast = true;
|
||||
|
||||
@@ -469,7 +469,7 @@ namespace Vocaluxe.Screens
|
||||
background = _Background;
|
||||
RectangleF bounds = new RectangleF(0, 0, CSettings.RenderW, CSettings.RenderH);
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, background.Width / background.Height, aspect);
|
||||
CHelper.SetRect(bounds, out rect, (float)background.Width / background.Height, aspect);
|
||||
|
||||
CDraw.DrawTexture(_Background, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, 0f),
|
||||
_Background.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f));
|
||||
|
||||
@@ -41,17 +41,17 @@ namespace Vocaluxe.Screens
|
||||
base.Init();
|
||||
const string test = "Ö ÄÜabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPGRSTUVWGXZ1234567890";
|
||||
SColorF color = new SColorF(1, 0, 0, 1);
|
||||
CText text = new CText(10, 50, 1, 32, 0, EAlignment.Left, EStyle.Normal, "Normal", color, "jÄNormal Text" + test, -1, 26, 0);
|
||||
CText text = new CText(10, 50, 1, 32, 0, EAlignment.Left, EStyle.Normal, "Normal", color, "jÄNormal Text" + test, -1, 26, 1);
|
||||
_AddText(text);
|
||||
text = new CText(10, 90, 1, 32, 0, EAlignment.Left, EStyle.Bold, "Normal", color, "jÄBold Text" + test, -1, 26, 0);
|
||||
text = new CText(10, 90, 1, 32, 0, EAlignment.Left, EStyle.Bold, "Normal", color, "jÄBold Text" + test, -1, 26, 1);
|
||||
_AddText(text);
|
||||
text = new CText(10, 130, 1, 32, 0, EAlignment.Left, EStyle.Italic, "Normal", color, "jÄItalic Text" + test, -1, 26, 0);
|
||||
text = new CText(10, 130, 1, 32, 0, EAlignment.Left, EStyle.Italic, "Normal", color, "jÄItalic Text" + test, -1, 26, 1);
|
||||
_AddText(text);
|
||||
text = new CText(10, 170, 1, 32, 0, EAlignment.Left, EStyle.Normal, "Outline", color, "jÄNormal Text" + test, -1, 50, 0);
|
||||
text = new CText(10, 170, 1, 32, 0, EAlignment.Left, EStyle.Normal, "Outline", color, "jÄNormal Text" + test, -1, 50, 1);
|
||||
_AddText(text);
|
||||
text = new CText(10, 210, 1, 32, 0, EAlignment.Left, EStyle.Bold, "Outline", color, "jÄBold Text" + test, -1, 100, 0);
|
||||
text = new CText(10, 210, 1, 32, 0, EAlignment.Left, EStyle.Bold, "Outline", color, "jÄBold Text" + test, -1, 100, 1);
|
||||
_AddText(text);
|
||||
text = new CText(10, 250, 1, 32, 0, EAlignment.Left, EStyle.Italic, "Outline", color, "jÄItalic Text" + test, -1, 150, 0);
|
||||
text = new CText(10, 250, 1, 32, 0, EAlignment.Left, EStyle.Italic, "Outline", color, "jÄItalic Text" + test, -1, 150, 1);
|
||||
_AddText(text);
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, texture.Width / texture.Height, EAspect.Crop);
|
||||
CHelper.SetRect(bounds, out rect, (float)texture.Width / texture.Height, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
return true;
|
||||
@@ -222,7 +222,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, videoTexture.Width / videoTexture.Height, EAspect.Crop);
|
||||
CHelper.SetRect(bounds, out rect, (float)videoTexture.Width / videoTexture.Height, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(videoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
return true;
|
||||
@@ -237,7 +237,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, videoTexture.Width / videoTexture.Height, EAspect.Crop);
|
||||
CHelper.SetRect(bounds, out rect, (float)videoTexture.Width / videoTexture.Height, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(videoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
return true;
|
||||
|
||||
@@ -348,7 +348,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void HandleMouse(SMouseEvent mevent)
|
||||
{
|
||||
for (int i = 0; i < _Tiles.Count; i++ )
|
||||
for (int i = 0; i < _Tiles.Count; i++)
|
||||
{
|
||||
if (CHelper.IsInBounds(_Tiles[i].Avatar.Rect, mevent))
|
||||
{
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
RectangleF bounds2 = new RectangleF(bounds.X, bounds.Y, bounds.W, bounds.H);
|
||||
RectangleF rect2;
|
||||
CHelper.SetRect(bounds2, out rect2, texture.Width / texture.Height, aspect);
|
||||
CHelper.SetRect(bounds2, out rect2, (float)texture.Width / texture.Height, aspect);
|
||||
|
||||
rect.X = rect2.X;
|
||||
rect.Y = rect2.Y;
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Do NOT read/write this anywhere but in _UpdateTextPosition!
|
||||
/// Do NOT read/write this anywhere but in _UpdateTextPosition!
|
||||
/// </summary>
|
||||
private SRectF _Rect;
|
||||
public SRectF Rect
|
||||
@@ -499,8 +499,8 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void DrawRelative(float rx, float ry, float reflectionHeight = 0f, float reflectionSpace = 0f, float rectHeight = 0f)
|
||||
{
|
||||
var oldReflectionSpace = ReflectionSpace;
|
||||
var oldReflectionHeight = ReflectionHeight;
|
||||
float oldReflectionSpace = ReflectionSpace;
|
||||
float oldReflectionHeight = ReflectionHeight;
|
||||
if (reflectionHeight > 0)
|
||||
{
|
||||
ReflectionSpace = (rectHeight - Rect.Y - Rect.H) * 2 + reflectionSpace;
|
||||
|
||||
@@ -459,7 +459,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_CoverBig.Draw(1f, EAspect.Crop);
|
||||
RectangleF bounds = new RectangleF(_CoverBig.Rect.X, _CoverBig.Rect.Y, _CoverBig.Rect.W, _CoverBig.Rect.H);
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, _Vidtex.Width / _Vidtex.Height, EAspect.Crop);
|
||||
CHelper.SetRect(bounds, out rect, (float)_Vidtex.Width / _Vidtex.Height, EAspect.Crop);
|
||||
SRectF vidRect = new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z);
|
||||
SRectF vidRectBounds = new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f);
|
||||
|
||||
|
||||
@@ -108,12 +108,12 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public string TexturePath;
|
||||
|
||||
public float Width;
|
||||
public float Height;
|
||||
public int Width;
|
||||
public int Height;
|
||||
public SRectF Rect;
|
||||
|
||||
public float W2; //power of 2 width
|
||||
public float H2; //power of 2 height
|
||||
public int W2; //power of 2 width
|
||||
public int H2; //power of 2 height
|
||||
public float WidthRatio;
|
||||
public float HeightRatio;
|
||||
|
||||
@@ -126,12 +126,12 @@ namespace VocaluxeLib.Menu
|
||||
ID = -1;
|
||||
TexturePath = String.Empty;
|
||||
|
||||
Width = 1f;
|
||||
Height = 1f;
|
||||
Width = 1;
|
||||
Height = 1;
|
||||
Rect = new SRectF(0f, 0f, 1f, 1f, 0f);
|
||||
|
||||
W2 = 2f;
|
||||
H2 = 2f;
|
||||
W2 = 1;
|
||||
H2 = 1;
|
||||
WidthRatio = 0.5f;
|
||||
HeightRatio = 0.5f;
|
||||
|
||||
|
||||
Reference in new issue
Block a user