Merge branch 'develop' of git://github.com/xDarkice/Vocaluxe into develop
This commit is contained in:
commit
f9d7de5f76
4 files changed
+41
-17
No files matched your search
@@ -1187,6 +1187,8 @@ namespace Vocaluxe.Base
|
|||||||
Graphics g = Graphics.FromImage(bmp);
|
Graphics g = Graphics.FromImage(bmp);
|
||||||
g.DrawImage(origin, new Rectangle(0, 0, w, h));
|
g.DrawImage(origin, new Rectangle(0, 0, w, h));
|
||||||
g.Dispose();
|
g.Dispose();
|
||||||
|
if (origin != null)
|
||||||
|
origin.Dispose();
|
||||||
|
|
||||||
byte[] data = new byte[w * h * 4];
|
byte[] data = new byte[w * h * 4];
|
||||||
|
|
||||||
@@ -1484,6 +1486,8 @@ namespace Vocaluxe.Base
|
|||||||
Graphics g = Graphics.FromImage(bmp);
|
Graphics g = Graphics.FromImage(bmp);
|
||||||
g.DrawImage(origin, new Rectangle(0, 0, w, h));
|
g.DrawImage(origin, new Rectangle(0, 0, w, h));
|
||||||
g.Dispose();
|
g.Dispose();
|
||||||
|
if (origin != null)
|
||||||
|
origin.Dispose();
|
||||||
tex = CDraw.AddTexture(bmp);
|
tex = CDraw.AddTexture(bmp);
|
||||||
byte[] data = new byte[w * h * 4];
|
byte[] data = new byte[w * h * 4];
|
||||||
|
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ namespace Vocaluxe.Base
|
|||||||
Bitmap bmp = new Bitmap(origin, w, h);
|
Bitmap bmp = new Bitmap(origin, w, h);
|
||||||
STexture tex = _Draw.AddTexture(bmp);
|
STexture tex = _Draw.AddTexture(bmp);
|
||||||
bmp.Dispose();
|
bmp.Dispose();
|
||||||
|
origin.Dispose();
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -881,7 +881,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
CLog.LogError("Error loading Texture: " + TexturePath);
|
CLog.LogError("Error loading Texture: " + TexturePath);
|
||||||
return new STexture(-1);
|
return new STexture(-1);
|
||||||
}
|
}
|
||||||
return AddTexture(bmp, TexturePath);
|
STexture s = AddTexture(bmp, TexturePath);
|
||||||
|
bmp.Dispose();
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
CLog.LogError("Can't find File: " + TexturePath);
|
CLog.LogError("Can't find File: " + TexturePath);
|
||||||
return new STexture(-1);
|
return new STexture(-1);
|
||||||
@@ -944,23 +946,27 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
texture.w2 = (float)CheckForNextPowerOf2(w);
|
texture.w2 = (float)CheckForNextPowerOf2(w);
|
||||||
texture.h2 = (float)CheckForNextPowerOf2(h);
|
texture.h2 = (float)CheckForNextPowerOf2(h);
|
||||||
|
|
||||||
//Create a new Bitmap with the new sizes
|
if (texture.w2 != bmp.Width || texture.h2 != bmp.Height)
|
||||||
Bitmap bmp2 = new Bitmap((int)texture.w2, (int)texture.h2);
|
{
|
||||||
//Scale the texture
|
//Create a new Bitmap with the new sizes
|
||||||
Graphics g = Graphics.FromImage(bmp2);
|
Bitmap bmp2 = new Bitmap((int)texture.w2, (int)texture.h2);
|
||||||
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
|
//Scale the texture
|
||||||
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
|
Graphics g = Graphics.FromImage(bmp2);
|
||||||
g.DrawImage(bmp, new Rectangle(0, 0, bmp2.Width, bmp2.Height));
|
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
|
||||||
g.Dispose();
|
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
|
||||||
|
g.DrawImage(bmp, new Rectangle(0, 0, bmp2.Width, bmp2.Height));
|
||||||
|
g.Dispose();
|
||||||
|
bmp = bmp2;
|
||||||
|
}
|
||||||
|
|
||||||
texture.width_ratio = 1f;
|
texture.width_ratio = 1f;
|
||||||
texture.height_ratio = 1f;
|
texture.height_ratio = 1f;
|
||||||
|
|
||||||
//Fill the new Bitmap with the texture data
|
//Fill the new Bitmap with the texture data
|
||||||
BitmapData bmp_data = bmp2.LockBits(new Rectangle(0, 0, bmp2.Width, bmp2.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
BitmapData bmp_data = bmp.LockBits(new Rectangle(0, 0, (int)texture.w2, (int)texture.h2), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||||
byte[] Data = new byte[4 * bmp2.Width * bmp2.Height];
|
byte[] Data = new byte[4 * (int)texture.w2 * (int)texture.h2];
|
||||||
Marshal.Copy(bmp_data.Scan0, Data, 0, Data.Length);
|
Marshal.Copy(bmp_data.Scan0, Data, 0, Data.Length);
|
||||||
bmp2.UnlockBits(bmp_data);
|
bmp.UnlockBits(bmp_data);
|
||||||
|
|
||||||
//Create a new texture in the managed pool, which does not need to be recreated on a lost device
|
//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
|
//because a copy of the texture is hold in the Ram
|
||||||
@@ -969,14 +975,13 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
DataRectangle rect = t.LockRectangle(0, LockFlags.Discard);
|
DataRectangle rect = t.LockRectangle(0, LockFlags.Discard);
|
||||||
for (int i = 0; i < Data.Length; )
|
for (int i = 0; i < Data.Length; )
|
||||||
{
|
{
|
||||||
rect.Data.Write(Data, i, 4 * bmp2.Width);
|
rect.Data.Write(Data, i, 4 * (int)texture.w2);
|
||||||
i += 4 * bmp2.Width;
|
i += 4 * (int)texture.w2;
|
||||||
rect.Data.Position = rect.Data.Position - 4 * bmp2.Width;
|
rect.Data.Position = rect.Data.Position - 4 * (int)texture.w2;
|
||||||
rect.Data.Position += rect.Pitch;
|
rect.Data.Position += rect.Pitch;
|
||||||
}
|
}
|
||||||
t.UnlockRectangle(0);
|
t.UnlockRectangle(0);
|
||||||
|
|
||||||
bmp2.Dispose();
|
|
||||||
bmp_data = null;
|
bmp_data = null;
|
||||||
|
|
||||||
// Add to Texture List
|
// Add to Texture List
|
||||||
|
|||||||
@@ -207,6 +207,12 @@ namespace Vocaluxe.Screens
|
|||||||
case Keys.Escape:
|
case Keys.Escape:
|
||||||
if ((CSongs.Category < 0 || _sso.Sorting.Tabs == EOffOn.TR_CONFIG_OFF) && !_sso.Selection.PartyMode && !_SearchActive)
|
if ((CSongs.Category < 0 || _sso.Sorting.Tabs == EOffOn.TR_CONFIG_OFF) && !_sso.Selection.PartyMode && !_SearchActive)
|
||||||
CGraphics.FadeTo(EScreens.ScreenMain);
|
CGraphics.FadeTo(EScreens.ScreenMain);
|
||||||
|
if (_SearchActive)
|
||||||
|
{
|
||||||
|
_SearchActive = false;
|
||||||
|
_SearchText = String.Empty;
|
||||||
|
ApplyNewSearchFilter(_SearchText);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
@@ -480,7 +486,15 @@ namespace Vocaluxe.Screens
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CSongs.Category < 0 && !_sso.Selection.PartyMode)
|
if (_SearchActive)
|
||||||
|
{
|
||||||
|
_SearchActive = false;
|
||||||
|
_SearchText = String.Empty;
|
||||||
|
ApplyNewSearchFilter(_SearchText);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CSongs.Category < 0 && !_sso.Selection.PartyMode && !_SearchActive)
|
||||||
{
|
{
|
||||||
CGraphics.FadeTo(EScreens.ScreenMain);
|
CGraphics.FadeTo(EScreens.ScreenMain);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in new issue
Block a user