Convert STexture to class CTexture
This commit is contained in:
1 parent
017b96be5f
commit
f370693dde
45 files changed
+427
-377
No files matched your search
@@ -22,6 +22,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ namespace Vocaluxe.Base
|
|||||||
private static readonly List<CPlaylistElement> _PreviousFileNames = new List<CPlaylistElement>();
|
private static readonly List<CPlaylistElement> _PreviousFileNames = new List<CPlaylistElement>();
|
||||||
|
|
||||||
private static int _Video = -1;
|
private static int _Video = -1;
|
||||||
private static STexture _CurrentVideoTexture = new STexture(-1);
|
private static CTexture _CurrentVideoTexture = new CTexture(-1);
|
||||||
private static readonly Stopwatch _FadeTimer = new Stopwatch();
|
private static readonly Stopwatch _FadeTimer = new Stopwatch();
|
||||||
private static bool _VideoEnabled;
|
private static bool _VideoEnabled;
|
||||||
|
|
||||||
@@ -118,7 +119,7 @@ namespace Vocaluxe.Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static STexture Cover
|
public static CTexture Cover
|
||||||
{
|
{
|
||||||
get { return _CurrentPlaylistElement.Cover; }
|
get { return _CurrentPlaylistElement.Cover; }
|
||||||
}
|
}
|
||||||
@@ -457,7 +458,7 @@ namespace Vocaluxe.Base
|
|||||||
_LoadVideo();
|
_LoadVideo();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static STexture GetVideoTexture()
|
public static CTexture GetVideoTexture()
|
||||||
{
|
{
|
||||||
if (_Video != -1)
|
if (_Video != -1)
|
||||||
{
|
{
|
||||||
@@ -472,7 +473,7 @@ namespace Vocaluxe.Base
|
|||||||
}
|
}
|
||||||
return _CurrentVideoTexture;
|
return _CurrentVideoTexture;
|
||||||
}
|
}
|
||||||
return new STexture(-1);
|
return new CTexture(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool _IsBackgroundFile(CPlaylistElement element)
|
private static bool _IsBackgroundFile(CPlaylistElement element)
|
||||||
@@ -576,7 +577,7 @@ namespace Vocaluxe.Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture Cover
|
public CTexture Cover
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
@@ -31,7 +32,7 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
public string Name;
|
public string Name;
|
||||||
public string Value;
|
public string Value;
|
||||||
public STexture Texture;
|
public CTexture Texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SCoverTheme
|
struct SCoverTheme
|
||||||
@@ -46,11 +47,11 @@ namespace Vocaluxe.Base
|
|||||||
private static readonly XmlWriterSettings _Settings = new XmlWriterSettings();
|
private static readonly XmlWriterSettings _Settings = new XmlWriterSettings();
|
||||||
private static readonly List<SCover> _Cover = new List<SCover>();
|
private static readonly List<SCover> _Cover = new List<SCover>();
|
||||||
private static readonly List<SCoverTheme> _CoverThemes = new List<SCoverTheme>();
|
private static readonly List<SCoverTheme> _CoverThemes = new List<SCoverTheme>();
|
||||||
private static STexture _NoCover = new STexture(-1);
|
private static CTexture _NoCover = new CTexture(-1);
|
||||||
|
|
||||||
private static readonly Object _MutexCover = new Object();
|
private static readonly Object _MutexCover = new Object();
|
||||||
|
|
||||||
public static STexture NoCover
|
public static CTexture NoCover
|
||||||
{
|
{
|
||||||
get { return _NoCover; }
|
get { return _NoCover; }
|
||||||
}
|
}
|
||||||
@@ -97,9 +98,9 @@ namespace Vocaluxe.Base
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a STexture for a given cover name. Returns "NoCover" if the cover does not exist.
|
/// Returns a STexture for a given cover name. Returns "NoCover" if the cover does not exist.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static STexture Cover(string name)
|
public static CTexture Cover(string name)
|
||||||
{
|
{
|
||||||
STexture cov = _NoCover;
|
CTexture cov = _NoCover;
|
||||||
lock (_MutexCover)
|
lock (_MutexCover)
|
||||||
{
|
{
|
||||||
foreach (SCover cover in _Cover)
|
foreach (SCover cover in _Cover)
|
||||||
@@ -132,7 +133,7 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
foreach (SCover cover in _Cover)
|
foreach (SCover cover in _Cover)
|
||||||
{
|
{
|
||||||
STexture texture = cover.Texture;
|
CTexture texture = cover.Texture;
|
||||||
CDraw.RemoveTexture(ref texture);
|
CDraw.RemoveTexture(ref texture);
|
||||||
}
|
}
|
||||||
_Cover.Clear();
|
_Cover.Clear();
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ using SQLiteCommand = Mono.Data.Sqlite.SqliteCommand;
|
|||||||
using SQLiteDataReader = Mono.Data.Sqlite.SqliteDataReader;
|
using SQLiteDataReader = Mono.Data.Sqlite.SqliteDataReader;
|
||||||
#endif
|
#endif
|
||||||
using Community.CsharpSqlite;
|
using Community.CsharpSqlite;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
|
|
||||||
@@ -912,7 +913,7 @@ namespace Vocaluxe.Base
|
|||||||
#endregion Highscores
|
#endregion Highscores
|
||||||
|
|
||||||
#region Cover
|
#region Cover
|
||||||
public static bool GetCover(string coverPath, ref STexture tex, int maxSize)
|
public static bool GetCover(string coverPath, ref CTexture tex, int maxSize)
|
||||||
{
|
{
|
||||||
if (!File.Exists(coverPath))
|
if (!File.Exists(coverPath))
|
||||||
{
|
{
|
||||||
@@ -1141,7 +1142,7 @@ namespace Vocaluxe.Base
|
|||||||
#endregion Cover
|
#endregion Cover
|
||||||
|
|
||||||
#region CreditsRessources
|
#region CreditsRessources
|
||||||
public static bool GetCreditsRessource(string fileName, ref STexture tex)
|
public static bool GetCreditsRessource(string fileName, ref CTexture tex)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
|||||||
+16
-15
@@ -20,6 +20,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
@@ -124,12 +125,12 @@ namespace Vocaluxe.Base
|
|||||||
_Draw.ClearScreen();
|
_Draw.ClearScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static STexture CopyScreen()
|
public static CTexture CopyScreen()
|
||||||
{
|
{
|
||||||
return _Draw.CopyScreen();
|
return _Draw.CopyScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CopyScreen(ref STexture texture)
|
public static void CopyScreen(ref CTexture texture)
|
||||||
{
|
{
|
||||||
_Draw.CopyScreen(ref texture);
|
_Draw.CopyScreen(ref texture);
|
||||||
}
|
}
|
||||||
@@ -139,62 +140,62 @@ namespace Vocaluxe.Base
|
|||||||
_Draw.MakeScreenShot();
|
_Draw.MakeScreenShot();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static STexture AddTexture(Bitmap bitmap)
|
public static CTexture AddTexture(Bitmap bitmap)
|
||||||
{
|
{
|
||||||
return _Draw.AddTexture(bitmap);
|
return _Draw.AddTexture(bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static STexture AddTexture(string texturePath)
|
public static CTexture AddTexture(string texturePath)
|
||||||
{
|
{
|
||||||
return _Draw.AddTexture(texturePath);
|
return _Draw.AddTexture(texturePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static STexture AddTexture(int w, int h, byte[] data)
|
public static CTexture AddTexture(int w, int h, byte[] data)
|
||||||
{
|
{
|
||||||
return _Draw.AddTexture(w, h, data);
|
return _Draw.AddTexture(w, h, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static STexture EnqueueTexture(int w, int h, byte[] data)
|
public static CTexture EnqueueTexture(int w, int h, byte[] data)
|
||||||
{
|
{
|
||||||
return _Draw.EnqueueTexture(w, h, data);
|
return _Draw.EnqueueTexture(w, h, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool UpdateTexture(ref STexture texture, byte[] data)
|
public static bool UpdateTexture(ref CTexture texture, byte[] data)
|
||||||
{
|
{
|
||||||
return _Draw.UpdateTexture(ref texture, data);
|
return _Draw.UpdateTexture(ref texture, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RemoveTexture(ref STexture texture)
|
public static void RemoveTexture(ref CTexture texture)
|
||||||
{
|
{
|
||||||
_Draw.RemoveTexture(ref texture);
|
_Draw.RemoveTexture(ref texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawTexture(STexture texture)
|
public static void DrawTexture(CTexture texture)
|
||||||
{
|
{
|
||||||
_Draw.DrawTexture(texture);
|
_Draw.DrawTexture(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawTexture(STexture texture, SRectF rect)
|
public static void DrawTexture(CTexture texture, SRectF rect)
|
||||||
{
|
{
|
||||||
_Draw.DrawTexture(texture, rect);
|
_Draw.DrawTexture(texture, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false)
|
public static void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false)
|
||||||
{
|
{
|
||||||
_Draw.DrawTexture(texture, rect, color, mirrored);
|
_Draw.DrawTexture(texture, rect, color, mirrored);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
public static void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
||||||
{
|
{
|
||||||
_Draw.DrawTexture(texture, rect, color, bounds, mirrored);
|
_Draw.DrawTexture(texture, rect, color, bounds, mirrored);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawTexture(STexture texture, SRectF rect, SColorF color, float begin, float end)
|
public static void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end)
|
||||||
{
|
{
|
||||||
_Draw.DrawTexture(texture, rect, color, begin, end);
|
_Draw.DrawTexture(texture, rect, color, begin, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawTexture(CStatic staticBounds, STexture texture, EAspect aspect)
|
public static void DrawTexture(CStatic staticBounds, CTexture texture, EAspect aspect)
|
||||||
{
|
{
|
||||||
if (texture.OrigSize.Height <= 0)
|
if (texture.OrigSize.Height <= 0)
|
||||||
return;
|
return;
|
||||||
@@ -207,7 +208,7 @@ namespace Vocaluxe.Base
|
|||||||
texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f));
|
texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
|
public static void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
|
||||||
{
|
{
|
||||||
_Draw.DrawTextureReflection(texture, rect, color, bounds, space, height);
|
_Draw.DrawTextureReflection(texture, rect, color, bounds, space, height);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using System.Drawing;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base.Fonts;
|
using Vocaluxe.Base.Fonts;
|
||||||
using Vocaluxe.Screens;
|
using Vocaluxe.Screens;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.PartyModes;
|
using VocaluxeLib.PartyModes;
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ namespace Vocaluxe.Base
|
|||||||
private float _CursorTargetAlpha;
|
private float _CursorTargetAlpha;
|
||||||
private float _CursorStartAlpha;
|
private float _CursorStartAlpha;
|
||||||
private float _CursorFadingTime;
|
private float _CursorFadingTime;
|
||||||
private STexture _Cursor;
|
private CTexture _Cursor;
|
||||||
private readonly string _CursorName = String.Empty;
|
private readonly string _CursorName = String.Empty;
|
||||||
|
|
||||||
private readonly Stopwatch _Movetimer;
|
private readonly Stopwatch _Movetimer;
|
||||||
|
|||||||
+12
-11
@@ -22,6 +22,7 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using Vocaluxe.Base.Fonts;
|
using Vocaluxe.Base.Fonts;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
|
|
||||||
@@ -224,12 +225,12 @@ namespace Vocaluxe.Base
|
|||||||
return CTheme.GetSkinIndex(partyModeID);
|
return CTheme.GetSkinIndex(partyModeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture GetSkinTexture(string textureName, int partyModeID)
|
public CTexture GetSkinTexture(string textureName, int partyModeID)
|
||||||
{
|
{
|
||||||
return CTheme.GetSkinTexture(textureName, partyModeID);
|
return CTheme.GetSkinTexture(textureName, partyModeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture GetSkinVideoTexture(string videoName, int partyModeID)
|
public CTexture GetSkinVideoTexture(string videoName, int partyModeID)
|
||||||
{
|
{
|
||||||
return CTheme.GetSkinVideoTexture(videoName, partyModeID);
|
return CTheme.GetSkinVideoTexture(videoName, partyModeID);
|
||||||
}
|
}
|
||||||
@@ -332,7 +333,7 @@ namespace Vocaluxe.Base
|
|||||||
CBackgroundMusic.ApplyVolume();
|
CBackgroundMusic.ApplyVolume();
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture GetVideoTexture()
|
public CTexture GetVideoTexture()
|
||||||
{
|
{
|
||||||
return CBackgroundMusic.GetVideoTexture();
|
return CBackgroundMusic.GetVideoTexture();
|
||||||
}
|
}
|
||||||
@@ -340,27 +341,27 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
class CBdraw : IDrawing
|
class CBdraw : IDrawing
|
||||||
{
|
{
|
||||||
public void DrawTexture(STexture texture, SRectF rect)
|
public void DrawTexture(CTexture texture, SRectF rect)
|
||||||
{
|
{
|
||||||
CDraw.DrawTexture(texture, rect);
|
CDraw.DrawTexture(texture, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color)
|
||||||
{
|
{
|
||||||
CDraw.DrawTexture(texture, rect, color);
|
CDraw.DrawTexture(texture, rect, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
||||||
{
|
{
|
||||||
CDraw.DrawTexture(texture, rect, color, bounds, mirrored);
|
CDraw.DrawTexture(texture, rect, color, bounds, mirrored);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight)
|
public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight)
|
||||||
{
|
{
|
||||||
CDraw.DrawTextureReflection(texture, rect, color, bounds, reflectionSpace, reflectionHeight);
|
CDraw.DrawTextureReflection(texture, rect, color, bounds, reflectionSpace, reflectionHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveTexture(ref STexture texture)
|
public void RemoveTexture(ref CTexture texture)
|
||||||
{
|
{
|
||||||
CDraw.RemoveTexture(ref texture);
|
CDraw.RemoveTexture(ref texture);
|
||||||
}
|
}
|
||||||
@@ -680,7 +681,7 @@ namespace Vocaluxe.Base
|
|||||||
return CVideo.Skip(videoStream, startPosition, videoGap);
|
return CVideo.Skip(videoStream, startPosition, videoGap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetFrame(int videoStream, ref STexture videoTexture, float time, out float videoTime)
|
public bool GetFrame(int videoStream, ref CTexture videoTexture, float time, out float videoTime)
|
||||||
{
|
{
|
||||||
return CVideo.GetFrame(videoStream, ref videoTexture, time, out videoTime);
|
return CVideo.GetFrame(videoStream, ref videoTexture, time, out videoTime);
|
||||||
}
|
}
|
||||||
@@ -751,7 +752,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
class CBcover : ICover
|
class CBcover : ICover
|
||||||
{
|
{
|
||||||
public STexture GetNoCover()
|
public CTexture GetNoCover()
|
||||||
{
|
{
|
||||||
return CCover.NoCover;
|
return CCover.NoCover;
|
||||||
}
|
}
|
||||||
@@ -759,7 +760,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
class CBdataBase : IDataBase
|
class CBdataBase : IDataBase
|
||||||
{
|
{
|
||||||
public bool GetCover(string fileName, ref STexture texture, int coverSize)
|
public bool GetCover(string fileName, ref CTexture texture, int coverSize)
|
||||||
{
|
{
|
||||||
return CDataBase.GetCover(fileName, ref texture, coverSize);
|
return CDataBase.GetCover(fileName, ref texture, coverSize);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
@@ -114,7 +115,7 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < _Avatars.Count; i++)
|
for (int i = 0; i < _Avatars.Count; i++)
|
||||||
{
|
{
|
||||||
STexture texture = _Avatars[i].Texture;
|
CTexture texture = _Avatars[i].Texture;
|
||||||
CDraw.RemoveTexture(ref texture);
|
CDraw.RemoveTexture(ref texture);
|
||||||
}
|
}
|
||||||
_Avatars.Clear();
|
_Avatars.Clear();
|
||||||
@@ -127,7 +128,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
foreach (string file in files)
|
foreach (string file in files)
|
||||||
{
|
{
|
||||||
STexture tex = CDraw.AddTexture(file);
|
CTexture tex = CDraw.AddTexture(file);
|
||||||
|
|
||||||
if (tex.Index != -1)
|
if (tex.Index != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using System.Text;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using Vocaluxe.Base.Fonts;
|
using Vocaluxe.Base.Fonts;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
@@ -48,7 +49,7 @@ namespace Vocaluxe.Base
|
|||||||
public string Name;
|
public string Name;
|
||||||
public string Value;
|
public string Value;
|
||||||
|
|
||||||
public STexture Texture;
|
public CTexture Texture;
|
||||||
public int VideoIndex;
|
public int VideoIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +203,7 @@ namespace Vocaluxe.Base
|
|||||||
sk.VideoIndex = CVideo.Load(Path.Combine(_Skins[skinIndex].Path, sk.Value));
|
sk.VideoIndex = CVideo.Load(Path.Combine(_Skins[skinIndex].Path, sk.Value));
|
||||||
CVideo.SetLoop(sk.VideoIndex, true);
|
CVideo.SetLoop(sk.VideoIndex, true);
|
||||||
CVideo.Pause(sk.VideoIndex);
|
CVideo.Pause(sk.VideoIndex);
|
||||||
sk.Texture = new STexture(-1);
|
sk.Texture = new CTexture(-1);
|
||||||
_Skins[skinIndex].VideoList[i] = sk;
|
_Skins[skinIndex].VideoList[i] = sk;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -224,14 +225,14 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
foreach (SSkinElement sk in _Skins[i].SkinList.Values)
|
foreach (SSkinElement sk in _Skins[i].SkinList.Values)
|
||||||
{
|
{
|
||||||
STexture texture = sk.Texture;
|
CTexture texture = sk.Texture;
|
||||||
CDraw.RemoveTexture(ref texture);
|
CDraw.RemoveTexture(ref texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < _Skins[i].VideoList.Count; j++)
|
for (int j = 0; j < _Skins[i].VideoList.Count; j++)
|
||||||
{
|
{
|
||||||
CVideo.Close(_Skins[i].VideoList[j].VideoIndex);
|
CVideo.Close(_Skins[i].VideoList[j].VideoIndex);
|
||||||
STexture videoTexture = _Skins[i].VideoList[j].Texture;
|
CTexture videoTexture = _Skins[i].VideoList[j].Texture;
|
||||||
CDraw.RemoveTexture(ref videoTexture);
|
CDraw.RemoveTexture(ref videoTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -579,12 +580,12 @@ namespace Vocaluxe.Base
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static STexture GetSkinTexture(string textureName, int partyModeID)
|
public static CTexture GetSkinTexture(string textureName, int partyModeID)
|
||||||
{
|
{
|
||||||
int skinIndex = GetSkinIndex(partyModeID);
|
int skinIndex = GetSkinIndex(partyModeID);
|
||||||
if (skinIndex != -1 && textureName != null && _Skins[skinIndex].SkinList.ContainsKey(textureName))
|
if (skinIndex != -1 && textureName != null && _Skins[skinIndex].SkinList.ContainsKey(textureName))
|
||||||
return _Skins[skinIndex].SkinList[textureName].Texture;
|
return _Skins[skinIndex].SkinList[textureName].Texture;
|
||||||
return new STexture(-1);
|
return new CTexture(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetSkinFilePath(string skinName, int partyModeID)
|
public static string GetSkinFilePath(string skinName, int partyModeID)
|
||||||
@@ -604,7 +605,7 @@ namespace Vocaluxe.Base
|
|||||||
return skinName;
|
return skinName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static STexture GetSkinVideoTexture(string videoName, int partyModeID)
|
public static CTexture GetSkinVideoTexture(string videoName, int partyModeID)
|
||||||
{
|
{
|
||||||
int skinIndex = GetSkinIndex(partyModeID);
|
int skinIndex = GetSkinIndex(partyModeID);
|
||||||
if (skinIndex != -1)
|
if (skinIndex != -1)
|
||||||
@@ -626,7 +627,7 @@ namespace Vocaluxe.Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new STexture(-1);
|
return new CTexture(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SkinVideoPause(string videoName, int partyModeID)
|
public static void SkinVideoPause(string videoName, int partyModeID)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using Vocaluxe.Lib.Video;
|
using Vocaluxe.Lib.Video;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
@@ -75,7 +76,7 @@ namespace Vocaluxe.Base
|
|||||||
return _VideoDecoder.GetLength(streamID);
|
return _VideoDecoder.GetLength(streamID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool GetFrame(int streamID, ref STexture frame, float time, out float videoTime)
|
public static bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime)
|
||||||
{
|
{
|
||||||
return _VideoDecoder.GetFrame(streamID, ref frame, time, out videoTime);
|
return _VideoDecoder.GetFrame(streamID, ref frame, time, out videoTime);
|
||||||
}
|
}
|
||||||
@@ -116,7 +117,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
class CVideoPlayer
|
class CVideoPlayer
|
||||||
{
|
{
|
||||||
private STexture _VideoTexture;
|
private CTexture _VideoTexture;
|
||||||
private int _VideoStream;
|
private int _VideoStream;
|
||||||
private readonly Stopwatch _VideoTimer;
|
private readonly Stopwatch _VideoTimer;
|
||||||
private bool _Finished;
|
private bool _Finished;
|
||||||
@@ -135,7 +136,7 @@ namespace Vocaluxe.Base
|
|||||||
public CVideoPlayer()
|
public CVideoPlayer()
|
||||||
{
|
{
|
||||||
_VideoTimer = new Stopwatch();
|
_VideoTimer = new Stopwatch();
|
||||||
_VideoTexture = new STexture(-1);
|
_VideoTexture = new CTexture(-1);
|
||||||
_Finished = false;
|
_Finished = false;
|
||||||
_Loaded = false;
|
_Loaded = false;
|
||||||
}
|
}
|
||||||
@@ -171,7 +172,7 @@ namespace Vocaluxe.Base
|
|||||||
float videoTime = _VideoTimer.ElapsedMilliseconds / 1000f;
|
float videoTime = _VideoTimer.ElapsedMilliseconds / 1000f;
|
||||||
_Finished = CVideo.Finished(_VideoStream);
|
_Finished = CVideo.Finished(_VideoStream);
|
||||||
|
|
||||||
STexture tex = new STexture(-1);
|
CTexture tex = new CTexture(-1);
|
||||||
CVideo.GetFrame(_VideoStream, ref tex, videoTime, out videoTime);
|
CVideo.GetFrame(_VideoStream, ref tex, videoTime, out videoTime);
|
||||||
|
|
||||||
if (tex.Index > 0)
|
if (tex.Index > 0)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using Vocaluxe.Lib.Webcam;
|
using Vocaluxe.Lib.Webcam;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
@@ -46,7 +47,7 @@ namespace Vocaluxe.Base
|
|||||||
CConfig.SaveConfig();
|
CConfig.SaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool GetFrame(ref STexture tex)
|
public static bool GetFrame(ref CTexture tex)
|
||||||
{
|
{
|
||||||
_Webcam.GetFrame(ref tex);
|
_Webcam.GetFrame(ref tex);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Text;
|
using System.Drawing.Text;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base.Fonts
|
namespace Vocaluxe.Base.Fonts
|
||||||
@@ -86,7 +87,7 @@ namespace Vocaluxe.Base.Fonts
|
|||||||
|
|
||||||
public void DrawGlyph(char chr, float x, float y, float z, SColorF color)
|
public void DrawGlyph(char chr, float x, float y, float z, SColorF color)
|
||||||
{
|
{
|
||||||
STexture texture;
|
CTexture texture;
|
||||||
SRectF rect;
|
SRectF rect;
|
||||||
GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect);
|
GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect);
|
||||||
CDraw.DrawTexture(texture, rect, color);
|
CDraw.DrawTexture(texture, rect, color);
|
||||||
@@ -94,7 +95,7 @@ namespace Vocaluxe.Base.Fonts
|
|||||||
|
|
||||||
public void DrawGlyph(char chr, float x, float y, float z, SColorF color, float begin, float end)
|
public void DrawGlyph(char chr, float x, float y, float z, SColorF color, float begin, float end)
|
||||||
{
|
{
|
||||||
STexture texture;
|
CTexture texture;
|
||||||
SRectF rect;
|
SRectF rect;
|
||||||
GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect);
|
GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect);
|
||||||
CDraw.DrawTexture(texture, rect, color, begin, end);
|
CDraw.DrawTexture(texture, rect, color, begin, end);
|
||||||
@@ -102,7 +103,7 @@ namespace Vocaluxe.Base.Fonts
|
|||||||
|
|
||||||
public void DrawGlyphReflection(char chr, float x, float y, float z, SColorF color, float rspace, float rheight)
|
public void DrawGlyphReflection(char chr, float x, float y, float z, SColorF color, float rspace, float rheight)
|
||||||
{
|
{
|
||||||
STexture texture;
|
CTexture texture;
|
||||||
SRectF rect;
|
SRectF rect;
|
||||||
GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect);
|
GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect);
|
||||||
CDraw.DrawTextureReflection(texture, rect, color, rect, rspace, rheight);
|
CDraw.DrawTextureReflection(texture, rect, color, rect, rspace, rheight);
|
||||||
|
|||||||
@@ -23,13 +23,14 @@ using System.Drawing.Drawing2D;
|
|||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
using System.Drawing.Text;
|
using System.Drawing.Text;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base.Fonts
|
namespace Vocaluxe.Base.Fonts
|
||||||
{
|
{
|
||||||
class CGlyph
|
class CGlyph
|
||||||
{
|
{
|
||||||
private STexture _Texture;
|
private CTexture _Texture;
|
||||||
private readonly SizeF _BoundingBox;
|
private readonly SizeF _BoundingBox;
|
||||||
private readonly RectangleF _DrawBounding;
|
private readonly RectangleF _DrawBounding;
|
||||||
public readonly float MaxHeight;
|
public readonly float MaxHeight;
|
||||||
@@ -147,7 +148,7 @@ namespace Vocaluxe.Base.Fonts
|
|||||||
return CFonts.Height / _BoundingBox.Height;
|
return CFonts.Height / _BoundingBox.Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetTextureAndRect(float x, float y, float z, out STexture texture, out SRectF rect)
|
public void GetTextureAndRect(float x, float y, float z, out CTexture texture, out SRectF rect)
|
||||||
{
|
{
|
||||||
texture = _Texture;
|
texture = _Texture;
|
||||||
float factor = _GetFactor();
|
float factor = _GetFactor();
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ using System.Runtime.InteropServices;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using SlimDX.Windows;
|
using SlimDX.Windows;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Draw
|
namespace Vocaluxe.Lib.Draw
|
||||||
@@ -50,7 +51,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
private Size _OldSize;
|
private Size _OldSize;
|
||||||
private Size _SizeBeforeMinimize;
|
private Size _SizeBeforeMinimize;
|
||||||
|
|
||||||
private readonly Dictionary<int, STexture> _Textures;
|
private readonly Dictionary<int, CTexture> _Textures;
|
||||||
private readonly Dictionary<int, Texture> _D3DTextures;
|
private readonly Dictionary<int, Texture> _D3DTextures;
|
||||||
private readonly List<STextureQueue> _Queue;
|
private readonly List<STextureQueue> _Queue;
|
||||||
private readonly Queue<int> _IDs;
|
private readonly Queue<int> _IDs;
|
||||||
@@ -65,7 +66,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
private int _Y;
|
private int _Y;
|
||||||
private int _X;
|
private int _X;
|
||||||
|
|
||||||
private STexture _BlankTexture;
|
private CTexture _BlankTexture;
|
||||||
|
|
||||||
private readonly Queue<STexturedColoredVertex> _Vertices;
|
private readonly Queue<STexturedColoredVertex> _Vertices;
|
||||||
private readonly Queue<Texture> _VerticesTextures;
|
private readonly Queue<Texture> _VerticesTextures;
|
||||||
@@ -80,7 +81,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
public CDirect3D()
|
public CDirect3D()
|
||||||
{
|
{
|
||||||
Icon = new Icon(Path.Combine(Environment.CurrentDirectory, CSettings.Icon));
|
Icon = new Icon(Path.Combine(Environment.CurrentDirectory, CSettings.Icon));
|
||||||
_Textures = new Dictionary<int, STexture>();
|
_Textures = new Dictionary<int, CTexture>();
|
||||||
_D3DTextures = new Dictionary<int, Texture>();
|
_D3DTextures = new Dictionary<int, Texture>();
|
||||||
_Queue = new List<STextureQueue>();
|
_Queue = new List<STextureQueue>();
|
||||||
_IDs = new Queue<int>();
|
_IDs = new Queue<int>();
|
||||||
@@ -676,9 +677,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// Copies the current frame into a texture
|
/// Copies the current frame into a texture
|
||||||
/// <returns>A texture holding the current frame</returns>
|
/// <returns>A texture holding the current frame</returns>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public STexture CopyScreen()
|
public CTexture CopyScreen()
|
||||||
{
|
{
|
||||||
STexture texture = new STexture(-1, _W, _H);
|
CTexture texture = new CTexture(-1, _W, _H);
|
||||||
texture.W2 = _CheckForNextPowerOf2(_W);
|
texture.W2 = _CheckForNextPowerOf2(_W);
|
||||||
texture.H2 = _CheckForNextPowerOf2(_H);
|
texture.H2 = _CheckForNextPowerOf2(_H);
|
||||||
|
|
||||||
@@ -701,7 +702,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// Copies the current frame into a texture
|
/// Copies the current frame into a texture
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="texture">The texture in which the frame is copied to</param>
|
/// <param name="texture">The texture in which the frame is copied to</param>
|
||||||
public void CopyScreen(ref STexture texture)
|
public void CopyScreen(ref CTexture texture)
|
||||||
{
|
{
|
||||||
//Check for actual texture sizes! (W2/H2) as it may be up/downsized compared to OrigSize
|
//Check for actual texture sizes! (W2/H2) as it may be up/downsized compared to OrigSize
|
||||||
if (!_TextureExists(ref texture) || texture.W2 != GetScreenWidth() || texture.H2 != GetScreenHeight())
|
if (!_TextureExists(ref texture) || texture.W2 != GetScreenWidth() || texture.H2 != GetScreenHeight())
|
||||||
@@ -795,7 +796,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="texturePath">The texture's filepath</param>
|
/// <param name="texturePath">The texture's filepath</param>
|
||||||
/// <returns>A STexture object containing the added texture</returns>
|
/// <returns>A STexture object containing the added texture</returns>
|
||||||
public STexture AddTexture(string texturePath)
|
public CTexture AddTexture(string texturePath)
|
||||||
{
|
{
|
||||||
if (File.Exists(texturePath))
|
if (File.Exists(texturePath))
|
||||||
{
|
{
|
||||||
@@ -807,9 +808,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
CLog.LogError("Error loading Texture: " + texturePath);
|
CLog.LogError("Error loading Texture: " + texturePath);
|
||||||
return new STexture(-1);
|
return new CTexture(-1);
|
||||||
}
|
}
|
||||||
STexture s;
|
CTexture s;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
s = AddTexture(bmp);
|
s = AddTexture(bmp);
|
||||||
@@ -821,7 +822,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
CLog.LogError("Can't find File: " + texturePath);
|
CLog.LogError("Can't find File: " + texturePath);
|
||||||
return new STexture(-1);
|
return new CTexture(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -829,10 +830,10 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="bmp">The Bitmap of which the texure will be created from</param>
|
/// <param name="bmp">The Bitmap of which the texure will be created from</param>
|
||||||
/// <returns>A STexture object containing the added texture</returns>
|
/// <returns>A STexture object containing the added texture</returns>
|
||||||
public STexture AddTexture(Bitmap bmp)
|
public CTexture AddTexture(Bitmap bmp)
|
||||||
{
|
{
|
||||||
if (bmp.Height == 0 || bmp.Width == 0)
|
if (bmp.Height == 0 || bmp.Width == 0)
|
||||||
return new STexture(-1);
|
return new CTexture(-1);
|
||||||
int maxSize;
|
int maxSize;
|
||||||
//Apply the right max size
|
//Apply the right max size
|
||||||
switch (CConfig.TextureQuality)
|
switch (CConfig.TextureQuality)
|
||||||
@@ -857,7 +858,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
STexture texture = new STexture(-1, bmp.Width, bmp.Height) {UseFullTexture = true};
|
CTexture texture = new CTexture(-1, bmp.Width, bmp.Height) {UseFullTexture = true};
|
||||||
|
|
||||||
int w = Math.Min(bmp.Width, maxSize);
|
int w = Math.Min(bmp.Width, maxSize);
|
||||||
int h = Math.Min(bmp.Height, maxSize);
|
int h = Math.Min(bmp.Height, maxSize);
|
||||||
@@ -900,13 +901,13 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return _AddTexture(texture, w, data);
|
return _AddTexture(texture, w, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture AddTexture(int w, int h, byte[] data)
|
public CTexture AddTexture(int w, int h, byte[] data)
|
||||||
{
|
{
|
||||||
STexture texture = new STexture(-1, w, h) {W2 = _CheckForNextPowerOf2(w), H2 = _CheckForNextPowerOf2(h)};
|
CTexture texture = new CTexture(-1, w, h) {W2 = _CheckForNextPowerOf2(w), H2 = _CheckForNextPowerOf2(h)};
|
||||||
return _AddTexture(texture, w, data);
|
return _AddTexture(texture, w, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private STexture _AddTexture(STexture texture, int w, byte[] data)
|
private CTexture _AddTexture(CTexture texture, int w, byte[] data)
|
||||||
{
|
{
|
||||||
Texture t = _CreateTexture(ref texture, w, data);
|
Texture t = _CreateTexture(ref texture, w, data);
|
||||||
|
|
||||||
@@ -919,7 +920,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Texture _CreateTexture(ref STexture texture, int w, byte[] data)
|
private Texture _CreateTexture(ref CTexture texture, int w, byte[] 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
|
||||||
@@ -949,9 +950,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture EnqueueTexture(int w, int h, byte[] data)
|
public CTexture EnqueueTexture(int w, int h, byte[] data)
|
||||||
{
|
{
|
||||||
STexture texture = new STexture(-1, w, h);
|
CTexture texture = new CTexture(-1, w, h);
|
||||||
STextureQueue queue = new STextureQueue {Data = data, Height = h, Width = w};
|
STextureQueue queue = new STextureQueue {Data = data, Height = h, Width = w};
|
||||||
|
|
||||||
lock (_MutexTexture)
|
lock (_MutexTexture)
|
||||||
@@ -973,7 +974,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// <param name="texture">The texture to update</param>
|
/// <param name="texture">The texture to update</param>
|
||||||
/// <param name="data">A byte array containing the new texture's data</param>
|
/// <param name="data">A byte array containing the new texture's data</param>
|
||||||
/// <returns>True if succeeded</returns>
|
/// <returns>True if succeeded</returns>
|
||||||
public bool UpdateTexture(ref STexture texture, byte[] data)
|
public bool UpdateTexture(ref CTexture texture, byte[] data)
|
||||||
{
|
{
|
||||||
if ((texture.Index >= 0) && (_Textures.Count > 0) && _TextureExists(ref texture))
|
if ((texture.Index >= 0) && (_Textures.Count > 0) && _TextureExists(ref texture))
|
||||||
{
|
{
|
||||||
@@ -1001,7 +1002,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="texture">The texture to check</param>
|
/// <param name="texture">The texture to check</param>
|
||||||
/// <returns>True if the texture exists</returns>
|
/// <returns>True if the texture exists</returns>
|
||||||
private bool _TextureExists(ref STexture texture)
|
private bool _TextureExists(ref CTexture texture)
|
||||||
{
|
{
|
||||||
lock (_MutexTexture)
|
lock (_MutexTexture)
|
||||||
{
|
{
|
||||||
@@ -1021,7 +1022,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// Removes a texture from the Vram
|
/// Removes a texture from the Vram
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="texture">The texture to be removed</param>
|
/// <param name="texture">The texture to be removed</param>
|
||||||
public void RemoveTexture(ref STexture texture)
|
public void RemoveTexture(ref CTexture texture)
|
||||||
{
|
{
|
||||||
lock (_MutexTexture)
|
lock (_MutexTexture)
|
||||||
{
|
{
|
||||||
@@ -1042,7 +1043,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// Draws a texture
|
/// Draws a texture
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="texture">The texture to be drawn</param>
|
/// <param name="texture">The texture to be drawn</param>
|
||||||
public void DrawTexture(STexture texture)
|
public void DrawTexture(CTexture texture)
|
||||||
{
|
{
|
||||||
DrawTexture(texture, texture.Rect, texture.Color);
|
DrawTexture(texture, texture.Rect, texture.Color);
|
||||||
}
|
}
|
||||||
@@ -1052,7 +1053,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="texture">The texture to be drawn</param>
|
/// <param name="texture">The texture to be drawn</param>
|
||||||
/// <param name="rect">A SRectF struct containing the destination coordinates</param>
|
/// <param name="rect">A SRectF struct containing the destination coordinates</param>
|
||||||
public void DrawTexture(STexture texture, SRectF rect)
|
public void DrawTexture(CTexture texture, SRectF rect)
|
||||||
{
|
{
|
||||||
DrawTexture(texture, rect, texture.Color);
|
DrawTexture(texture, rect, texture.Color);
|
||||||
}
|
}
|
||||||
@@ -1064,7 +1065,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// <param name="rect">A SRectF struct containing the destination coordinates</param>
|
/// <param name="rect">A SRectF struct containing the destination coordinates</param>
|
||||||
/// <param name="color">A SColorF struct containing a color which the texture will be colored in</param>
|
/// <param name="color">A SColorF struct containing a color which the texture will be colored in</param>
|
||||||
/// <param name="mirrored">True if the texture should be mirrored</param>
|
/// <param name="mirrored">True if the texture should be mirrored</param>
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false)
|
||||||
{
|
{
|
||||||
DrawTexture(texture, rect, color, new SRectF(0, 0, CSettings.RenderW, CSettings.RenderH, rect.Z), mirrored);
|
DrawTexture(texture, rect, color, new SRectF(0, 0, CSettings.RenderW, CSettings.RenderH, rect.Z), mirrored);
|
||||||
}
|
}
|
||||||
@@ -1077,7 +1078,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// <param name="color">A SColorF struct containing a color which the texture will be colored in</param>
|
/// <param name="color">A SColorF struct containing a color which the texture will be colored in</param>
|
||||||
/// <param name="bounds">A SRectF struct containing which part of the texture should be drawn</param>
|
/// <param name="bounds">A SRectF struct containing which part of the texture should be drawn</param>
|
||||||
/// <param name="mirrored">True if the texture should be mirrored</param>
|
/// <param name="mirrored">True if the texture should be mirrored</param>
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
||||||
{
|
{
|
||||||
if (_TextureExists(ref texture))
|
if (_TextureExists(ref texture))
|
||||||
{
|
{
|
||||||
@@ -1168,7 +1169,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// <param name="color">A SColorF struct containing a color which the texture will be colored in</param>
|
/// <param name="color">A SColorF struct containing a color which the texture will be colored in</param>
|
||||||
/// <param name="begin">A Value ranging from 0 to 1 containing the beginning of the texture</param>
|
/// <param name="begin">A Value ranging from 0 to 1 containing the beginning of the texture</param>
|
||||||
/// <param name="end">A Value ranging from 0 to 1 containing the ending of the texture</param>
|
/// <param name="end">A Value ranging from 0 to 1 containing the ending of the texture</param>
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, float begin, float end)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end)
|
||||||
{
|
{
|
||||||
if (!_TextureExists(ref texture))
|
if (!_TextureExists(ref texture))
|
||||||
return;
|
return;
|
||||||
@@ -1212,7 +1213,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
/// <param name="bounds">A SRectF struct containing which part of the texture should be drawn</param>
|
/// <param name="bounds">A SRectF struct containing which part of the texture should be drawn</param>
|
||||||
/// <param name="space">The space between the texture and the reflection</param>
|
/// <param name="space">The space between the texture and the reflection</param>
|
||||||
/// <param name="height">The height of the reflection</param>
|
/// <param name="height">The height of the reflection</param>
|
||||||
public void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
|
public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
|
||||||
{
|
{
|
||||||
if (!_TextureExists(ref texture))
|
if (!_TextureExists(ref texture))
|
||||||
return;
|
return;
|
||||||
@@ -1300,7 +1301,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
_Queue.RemoveAt(0);
|
_Queue.RemoveAt(0);
|
||||||
if (!_Textures.ContainsKey(q.ID))
|
if (!_Textures.ContainsKey(q.ID))
|
||||||
continue;
|
continue;
|
||||||
STexture texture = _Textures[q.ID];
|
CTexture texture = _Textures[q.ID];
|
||||||
if (q.Width == texture.OrigSize.Width && q.Height == texture.OrigSize.Height)
|
if (q.Width == texture.OrigSize.Width && q.Height == texture.OrigSize.Height)
|
||||||
{
|
{
|
||||||
texture.W2 = _CheckForNextPowerOf2(texture.OrigSize.Width);
|
texture.W2 = _CheckForNextPowerOf2(texture.OrigSize.Width);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ using System.Runtime.InteropServices;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Draw
|
namespace Vocaluxe.Lib.Draw
|
||||||
@@ -45,7 +46,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
private bool _TopMost;
|
private bool _TopMost;
|
||||||
private Rectangle _Bounds;
|
private Rectangle _Bounds;
|
||||||
|
|
||||||
private readonly List<STexture> _Textures;
|
private readonly List<CTexture> _Textures;
|
||||||
private readonly List<Bitmap> _Bitmaps;
|
private readonly List<Bitmap> _Bitmaps;
|
||||||
|
|
||||||
private readonly Color _ClearColor = Color.DarkBlue;
|
private readonly Color _ClearColor = Color.DarkBlue;
|
||||||
@@ -54,7 +55,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
{
|
{
|
||||||
Icon = new Icon(Path.Combine(Environment.CurrentDirectory, CSettings.Icon));
|
Icon = new Icon(Path.Combine(Environment.CurrentDirectory, CSettings.Icon));
|
||||||
|
|
||||||
_Textures = new List<STexture>();
|
_Textures = new List<CTexture>();
|
||||||
_Bitmaps = new List<Bitmap>();
|
_Bitmaps = new List<Bitmap>();
|
||||||
|
|
||||||
_Keys = new CKeys();
|
_Keys = new CKeys();
|
||||||
@@ -289,11 +290,11 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
_G.Clear(_ClearColor);
|
_G.Clear(_ClearColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture CopyScreen()
|
public CTexture CopyScreen()
|
||||||
{
|
{
|
||||||
Bitmap bmp = new Bitmap(_Backbuffer);
|
Bitmap bmp = new Bitmap(_Backbuffer);
|
||||||
_Bitmaps.Add(bmp);
|
_Bitmaps.Add(bmp);
|
||||||
STexture texture = new STexture(_Bitmaps.Count - 1, bmp.Width, bmp.Height);
|
CTexture texture = new CTexture(_Bitmaps.Count - 1, bmp.Width, bmp.Height);
|
||||||
|
|
||||||
// Add to Texture List
|
// Add to Texture List
|
||||||
_Textures.Add(texture);
|
_Textures.Add(texture);
|
||||||
@@ -301,7 +302,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CopyScreen(ref STexture texture)
|
public void CopyScreen(ref CTexture texture)
|
||||||
{
|
{
|
||||||
if (texture.Index == 0 || texture.W2 != GetScreenWidth() || texture.H2 != GetScreenHeight())
|
if (texture.Index == 0 || texture.W2 != GetScreenWidth() || texture.H2 != GetScreenHeight())
|
||||||
{
|
{
|
||||||
@@ -333,11 +334,11 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
|
|
||||||
public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) {}
|
public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) {}
|
||||||
|
|
||||||
public STexture AddTexture(Bitmap bmp)
|
public CTexture AddTexture(Bitmap bmp)
|
||||||
{
|
{
|
||||||
Bitmap bmp2 = new Bitmap(bmp);
|
Bitmap bmp2 = new Bitmap(bmp);
|
||||||
_Bitmaps.Add(bmp2);
|
_Bitmaps.Add(bmp2);
|
||||||
STexture texture = new STexture(_Bitmaps.Count - 1, bmp.Width, bmp.Height);
|
CTexture texture = new CTexture(_Bitmaps.Count - 1, bmp.Width, bmp.Height);
|
||||||
|
|
||||||
// Add to Texture List
|
// Add to Texture List
|
||||||
texture.TexturePath = String.Empty;
|
texture.TexturePath = String.Empty;
|
||||||
@@ -347,13 +348,13 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture AddTexture(string texturePath)
|
public CTexture AddTexture(string texturePath)
|
||||||
{
|
{
|
||||||
STexture texture = new STexture();
|
CTexture texture = new CTexture();
|
||||||
if (File.Exists(texturePath))
|
if (File.Exists(texturePath))
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (STexture tex in _Textures)
|
foreach (CTexture tex in _Textures)
|
||||||
{
|
{
|
||||||
if (tex.TexturePath == texturePath)
|
if (tex.TexturePath == texturePath)
|
||||||
{
|
{
|
||||||
@@ -373,7 +374,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveTexture(ref STexture texture)
|
public void RemoveTexture(ref CTexture texture)
|
||||||
{
|
{
|
||||||
if ((texture.Index >= 0) && (_Textures.Count > 0))
|
if ((texture.Index >= 0) && (_Textures.Count > 0))
|
||||||
{
|
{
|
||||||
@@ -390,12 +391,12 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture EnqueueTexture(int w, int h, byte[] data)
|
public CTexture EnqueueTexture(int w, int h, byte[] data)
|
||||||
{
|
{
|
||||||
return AddTexture(w, h, data);
|
return AddTexture(w, h, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture AddTexture(int w, int h, byte[] data)
|
public CTexture AddTexture(int w, int h, byte[] data)
|
||||||
{
|
{
|
||||||
using (Bitmap bmp = new Bitmap(w, h))
|
using (Bitmap bmp = new Bitmap(w, h))
|
||||||
{
|
{
|
||||||
@@ -406,7 +407,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdateTexture(ref STexture texture, byte[] data)
|
public bool UpdateTexture(ref CTexture texture, byte[] data)
|
||||||
{
|
{
|
||||||
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
||||||
{
|
{
|
||||||
@@ -418,25 +419,25 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture)
|
public void DrawTexture(CTexture texture)
|
||||||
{
|
{
|
||||||
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
||||||
DrawTexture(texture, texture.Rect, texture.Color);
|
DrawTexture(texture, texture.Rect, texture.Color);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect)
|
public void DrawTexture(CTexture texture, SRectF rect)
|
||||||
{
|
{
|
||||||
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
||||||
DrawTexture(texture, rect, texture.Color);
|
DrawTexture(texture, rect, texture.Color);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false)
|
||||||
{
|
{
|
||||||
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
||||||
DrawTexture(texture, rect, color, rect, mirrored);
|
DrawTexture(texture, rect, color, rect, mirrored);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
||||||
{
|
{
|
||||||
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
||||||
{
|
{
|
||||||
@@ -446,9 +447,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, float begin, float end) {}
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end) {}
|
||||||
|
|
||||||
public void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) {}
|
public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) {}
|
||||||
|
|
||||||
public int GetTextureCount()
|
public int GetTextureCount()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ using System.IO;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using BeginMode = OpenTK.Graphics.OpenGL.BeginMode;
|
using BeginMode = OpenTK.Graphics.OpenGL.BeginMode;
|
||||||
using BlendingFactorDest = OpenTK.Graphics.OpenGL.BlendingFactorDest;
|
using BlendingFactorDest = OpenTK.Graphics.OpenGL.BlendingFactorDest;
|
||||||
@@ -82,7 +83,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
private SClientRect _Restore;
|
private SClientRect _Restore;
|
||||||
private bool _Fullscreen;
|
private bool _Fullscreen;
|
||||||
|
|
||||||
private readonly Dictionary<int, STexture> _Textures;
|
private readonly Dictionary<int, CTexture> _Textures;
|
||||||
private readonly Queue<int> _IDs;
|
private readonly Queue<int> _IDs;
|
||||||
private readonly List<STextureQueue> _Queue;
|
private readonly List<STextureQueue> _Queue;
|
||||||
|
|
||||||
@@ -100,7 +101,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
{
|
{
|
||||||
Icon = new Icon(Path.Combine(Environment.CurrentDirectory, CSettings.Icon));
|
Icon = new Icon(Path.Combine(Environment.CurrentDirectory, CSettings.Icon));
|
||||||
|
|
||||||
_Textures = new Dictionary<int, STexture>();
|
_Textures = new Dictionary<int, CTexture>();
|
||||||
_Queue = new List<STextureQueue>();
|
_Queue = new List<STextureQueue>();
|
||||||
_IDs = new Queue<int>(1000000);
|
_IDs = new Queue<int>(1000000);
|
||||||
|
|
||||||
@@ -465,7 +466,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
catch {}
|
catch {}
|
||||||
STexture[] textures = new STexture[_Textures.Count];
|
CTexture[] textures = new CTexture[_Textures.Count];
|
||||||
_Textures.Values.CopyTo(textures, 0);
|
_Textures.Values.CopyTo(textures, 0);
|
||||||
for (int i = 0; i < _Textures.Count; i++)
|
for (int i = 0; i < _Textures.Count; i++)
|
||||||
RemoveTexture(ref textures[i]);
|
RemoveTexture(ref textures[i]);
|
||||||
@@ -488,9 +489,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture CopyScreen()
|
public CTexture CopyScreen()
|
||||||
{
|
{
|
||||||
STexture texture = new STexture(-1, _W, _H);
|
CTexture texture = new CTexture(-1, _W, _H);
|
||||||
int id = GL.GenTexture();
|
int id = GL.GenTexture();
|
||||||
GL.BindTexture(TextureTarget.Texture2D, id);
|
GL.BindTexture(TextureTarget.Texture2D, id);
|
||||||
texture.ID = id;
|
texture.ID = id;
|
||||||
@@ -518,7 +519,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CopyScreen(ref STexture texture)
|
public void CopyScreen(ref CTexture texture)
|
||||||
{
|
{
|
||||||
//Check for actual texture sizes! (W2/H2) as it may be up/downsized compared to OrigSize
|
//Check for actual texture sizes! (W2/H2) as it may be up/downsized compared to OrigSize
|
||||||
if (!_TextureExists(ref texture) || texture.W2 != GetScreenWidth() || texture.H2 != GetScreenHeight())
|
if (!_TextureExists(ref texture) || texture.W2 != GetScreenWidth() || texture.H2 != GetScreenHeight())
|
||||||
@@ -643,7 +644,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
#region Textures
|
#region Textures
|
||||||
|
|
||||||
#region adding
|
#region adding
|
||||||
public STexture AddTexture(string texturePath)
|
public CTexture AddTexture(string texturePath)
|
||||||
{
|
{
|
||||||
if (File.Exists(texturePath))
|
if (File.Exists(texturePath))
|
||||||
{
|
{
|
||||||
@@ -655,7 +656,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
CLog.LogError("Error loading Texture: " + texturePath);
|
CLog.LogError("Error loading Texture: " + texturePath);
|
||||||
return new STexture(-1);
|
return new CTexture(-1);
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -667,13 +668,13 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
CLog.LogError("Can't find File: " + texturePath);
|
CLog.LogError("Can't find File: " + texturePath);
|
||||||
return new STexture(-1);
|
return new CTexture(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture AddTexture(Bitmap bmp)
|
public CTexture AddTexture(Bitmap bmp)
|
||||||
{
|
{
|
||||||
if (bmp.Height == 0 || bmp.Width == 0)
|
if (bmp.Height == 0 || bmp.Width == 0)
|
||||||
return new STexture(-1);
|
return new CTexture(-1);
|
||||||
|
|
||||||
int maxSize;
|
int maxSize;
|
||||||
switch (CConfig.TextureQuality)
|
switch (CConfig.TextureQuality)
|
||||||
@@ -698,7 +699,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
STexture texture = new STexture(-1, bmp.Width, bmp.Height) {UseFullTexture = true};
|
CTexture texture = new CTexture(-1, bmp.Width, bmp.Height) {UseFullTexture = true};
|
||||||
|
|
||||||
int id = GL.GenTexture();
|
int id = GL.GenTexture();
|
||||||
GL.BindTexture(TextureTarget.Texture2D, id);
|
GL.BindTexture(TextureTarget.Texture2D, id);
|
||||||
@@ -761,9 +762,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture AddTexture(int w, int h, byte[] data)
|
public CTexture AddTexture(int w, int h, byte[] data)
|
||||||
{
|
{
|
||||||
STexture texture = new STexture(-1, w, h);
|
CTexture texture = new CTexture(-1, w, h);
|
||||||
|
|
||||||
_CreateTexture(data, ref texture);
|
_CreateTexture(data, ref texture);
|
||||||
|
|
||||||
@@ -776,7 +777,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _CreateTexture(byte[] data, ref STexture texture)
|
private void _CreateTexture(byte[] data, ref CTexture texture)
|
||||||
{
|
{
|
||||||
int w = texture.OrigSize.Width;
|
int w = texture.OrigSize.Width;
|
||||||
int h = texture.OrigSize.Height;
|
int h = texture.OrigSize.Height;
|
||||||
@@ -822,9 +823,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
texture.TexturePath = String.Empty;
|
texture.TexturePath = String.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture EnqueueTexture(int w, int h, byte[] data)
|
public CTexture EnqueueTexture(int w, int h, byte[] data)
|
||||||
{
|
{
|
||||||
STexture texture = new STexture(-1, w, h);
|
CTexture texture = new CTexture(-1, w, h);
|
||||||
STextureQueue queue = new STextureQueue {Data = data, Height = h, Width = w};
|
STextureQueue queue = new STextureQueue {Data = data, Height = h, Width = w};
|
||||||
|
|
||||||
lock (_MutexTexture)
|
lock (_MutexTexture)
|
||||||
@@ -840,7 +841,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
#endregion adding
|
#endregion adding
|
||||||
|
|
||||||
#region updating
|
#region updating
|
||||||
public bool UpdateTexture(ref STexture texture, byte[] data)
|
public bool UpdateTexture(ref CTexture texture, byte[] data)
|
||||||
{
|
{
|
||||||
if (_TextureExists(ref texture))
|
if (_TextureExists(ref texture))
|
||||||
{
|
{
|
||||||
@@ -882,7 +883,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
#endregion updating
|
#endregion updating
|
||||||
|
|
||||||
public void RemoveTexture(ref STexture texture)
|
public void RemoveTexture(ref CTexture texture)
|
||||||
{
|
{
|
||||||
if ((texture.Index > 0) && (_Textures.Count > 0))
|
if ((texture.Index > 0) && (_Textures.Count > 0))
|
||||||
{
|
{
|
||||||
@@ -899,7 +900,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _TextureExists(ref STexture texture)
|
private bool _TextureExists(ref CTexture texture)
|
||||||
{
|
{
|
||||||
lock (_MutexTexture)
|
lock (_MutexTexture)
|
||||||
{
|
{
|
||||||
@@ -916,22 +917,22 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region drawing
|
#region drawing
|
||||||
public void DrawTexture(STexture texture)
|
public void DrawTexture(CTexture texture)
|
||||||
{
|
{
|
||||||
DrawTexture(texture, texture.Rect, texture.Color);
|
DrawTexture(texture, texture.Rect, texture.Color);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect)
|
public void DrawTexture(CTexture texture, SRectF rect)
|
||||||
{
|
{
|
||||||
DrawTexture(texture, rect, texture.Color);
|
DrawTexture(texture, rect, texture.Color);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false)
|
||||||
{
|
{
|
||||||
DrawTexture(texture, rect, color, new SRectF(0, 0, CSettings.RenderW, CSettings.RenderH, rect.Z), mirrored);
|
DrawTexture(texture, rect, color, new SRectF(0, 0, CSettings.RenderW, CSettings.RenderH, rect.Z), mirrored);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
|
||||||
{
|
{
|
||||||
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon ||
|
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon ||
|
||||||
Math.Abs(color.A) < float.Epsilon)
|
Math.Abs(color.A) < float.Epsilon)
|
||||||
@@ -1039,7 +1040,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, float begin, float end)
|
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end)
|
||||||
{
|
{
|
||||||
if (_TextureExists(ref texture))
|
if (_TextureExists(ref texture))
|
||||||
{
|
{
|
||||||
@@ -1071,7 +1072,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
|
public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
|
||||||
{
|
{
|
||||||
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon ||
|
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon ||
|
||||||
Math.Abs(color.A) < float.Epsilon || height <= float.Epsilon)
|
Math.Abs(color.A) < float.Epsilon || height <= float.Epsilon)
|
||||||
@@ -1180,7 +1181,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
{
|
{
|
||||||
STextureQueue q = _Queue[0];
|
STextureQueue q = _Queue[0];
|
||||||
_Queue.RemoveAt(0);
|
_Queue.RemoveAt(0);
|
||||||
STexture texture = new STexture(-1);
|
CTexture texture = new CTexture(-1);
|
||||||
if (_Textures.ContainsKey(q.ID))
|
if (_Textures.ContainsKey(q.ID))
|
||||||
texture = _Textures[q.ID];
|
texture = _Textures[q.ID];
|
||||||
|
|
||||||
|
|||||||
+15
-14
@@ -18,6 +18,7 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Draw
|
namespace Vocaluxe.Lib.Draw
|
||||||
@@ -34,28 +35,28 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
int GetTextureCount();
|
int GetTextureCount();
|
||||||
|
|
||||||
void ClearScreen();
|
void ClearScreen();
|
||||||
STexture CopyScreen();
|
CTexture CopyScreen();
|
||||||
void CopyScreen(ref STexture texture);
|
void CopyScreen(ref CTexture texture);
|
||||||
void MakeScreenShot();
|
void MakeScreenShot();
|
||||||
|
|
||||||
STexture AddTexture(string texturePath);
|
CTexture AddTexture(string texturePath);
|
||||||
STexture AddTexture(Bitmap bitmap);
|
CTexture AddTexture(Bitmap bitmap);
|
||||||
STexture AddTexture(int w, int h, byte[] data);
|
CTexture AddTexture(int w, int h, byte[] data);
|
||||||
STexture EnqueueTexture(int w, int h, byte[] data);
|
CTexture EnqueueTexture(int w, int h, byte[] data);
|
||||||
bool UpdateTexture(ref STexture texture, byte[] data);
|
bool UpdateTexture(ref CTexture texture, byte[] data);
|
||||||
void RemoveTexture(ref STexture texture);
|
void RemoveTexture(ref CTexture texture);
|
||||||
|
|
||||||
// Basic Draw Methods
|
// Basic Draw Methods
|
||||||
void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2);
|
void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2);
|
||||||
void DrawColor(SColorF color, SRectF rect);
|
void DrawColor(SColorF color, SRectF rect);
|
||||||
void DrawColorReflection(SColorF color, SRectF rect, float space, float height);
|
void DrawColorReflection(SColorF color, SRectF rect, float space, float height);
|
||||||
|
|
||||||
void DrawTexture(STexture texture);
|
void DrawTexture(CTexture texture);
|
||||||
void DrawTexture(STexture texture, SRectF rect);
|
void DrawTexture(CTexture texture, SRectF rect);
|
||||||
void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false);
|
void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false);
|
||||||
void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false);
|
void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false);
|
||||||
void DrawTexture(STexture texture, SRectF rect, SColorF color, float begin, float end);
|
void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end);
|
||||||
|
|
||||||
void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height);
|
void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Video
|
namespace Vocaluxe.Lib.Video
|
||||||
@@ -58,7 +59,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
return 0f;
|
return 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract bool GetFrame(int streamID, ref STexture frame, float time, out float videoTime);
|
public abstract bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime);
|
||||||
|
|
||||||
public virtual bool Skip(int streamID, float start, float gap)
|
public virtual bool Skip(int streamID, float start, float gap)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ using System.Runtime.InteropServices;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Lib.Video.Acinerella;
|
using Vocaluxe.Lib.Video.Acinerella;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Video
|
namespace Vocaluxe.Lib.Video
|
||||||
@@ -90,7 +91,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool GetFrame(int streamID, ref STexture frame, float time, out float videoTime)
|
public override bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime)
|
||||||
{
|
{
|
||||||
videoTime = 0;
|
videoTime = 0;
|
||||||
if (_Initialized)
|
if (_Initialized)
|
||||||
@@ -299,7 +300,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetFrame(ref STexture frame, float time, out float videoTime)
|
public bool GetFrame(ref CTexture frame, float time, out float videoTime)
|
||||||
{
|
{
|
||||||
videoTime = 0;
|
videoTime = 0;
|
||||||
if (!_FileOpened)
|
if (!_FileOpened)
|
||||||
@@ -650,7 +651,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _UploadNewFrame(ref STexture frame)
|
private void _UploadNewFrame(ref CTexture frame)
|
||||||
{
|
{
|
||||||
if (!_FileOpened)
|
if (!_FileOpened)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Lib.Video.Gstreamer;
|
using Vocaluxe.Lib.Video.Gstreamer;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Video
|
namespace Vocaluxe.Lib.Video
|
||||||
@@ -78,7 +79,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
return CGstreamerVideoWrapper.GetVideoLength(streamID);
|
return CGstreamerVideoWrapper.GetVideoLength(streamID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetFrame(int streamID, ref STexture frame, float time, out float videoTime)
|
public bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime)
|
||||||
{
|
{
|
||||||
SManagedFrame managedFrame = CGstreamerVideoWrapper.GetFrame(streamID, time);
|
SManagedFrame managedFrame = CGstreamerVideoWrapper.GetFrame(streamID, time);
|
||||||
videoTime = managedFrame.Videotime;
|
videoTime = managedFrame.Videotime;
|
||||||
@@ -117,7 +118,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
CGstreamerVideoWrapper.UpdateVideo();
|
CGstreamerVideoWrapper.UpdateVideo();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _UploadNewFrame(ref STexture frame, ref byte[] data, int width, int height)
|
private void _UploadNewFrame(ref CTexture frame, ref byte[] data, int width, int height)
|
||||||
{
|
{
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
// */
|
// */
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Video
|
namespace Vocaluxe.Lib.Video
|
||||||
@@ -41,7 +42,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
int GetNumStreams();
|
int GetNumStreams();
|
||||||
|
|
||||||
float GetLength(int streamID);
|
float GetLength(int streamID);
|
||||||
bool GetFrame(int streamID, ref STexture frame, float time, out float videoTime);
|
bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime);
|
||||||
bool Skip(int streamID, float start, float gap);
|
bool Skip(int streamID, float start, float gap);
|
||||||
void SetLoop(int streamID, bool loop);
|
void SetLoop(int streamID, bool loop);
|
||||||
void Pause(int streamID);
|
void Pause(int streamID);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using System.Drawing;
|
|||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Webcam
|
namespace Vocaluxe.Lib.Webcam
|
||||||
@@ -50,7 +51,7 @@ namespace Vocaluxe.Lib.Webcam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetFrame(ref STexture frame)
|
public bool GetFrame(ref CTexture frame)
|
||||||
{
|
{
|
||||||
if (_Webcam != null && _Width > 0 && _Height > 0 && _Data.Length == _Width * _Height * 4)
|
if (_Webcam != null && _Width > 0 && _Height > 0 && _Data.Length == _Width * _Height * 4)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Webcam
|
namespace Vocaluxe.Lib.Webcam
|
||||||
@@ -54,7 +55,7 @@ namespace Vocaluxe.Lib.Webcam
|
|||||||
void Stop();
|
void Stop();
|
||||||
void Close();
|
void Close();
|
||||||
|
|
||||||
bool GetFrame(ref STexture frame);
|
bool GetFrame(ref CTexture frame);
|
||||||
Bitmap GetBitmap();
|
Bitmap GetBitmap();
|
||||||
SWebcamConfig GetConfig();
|
SWebcamConfig GetConfig();
|
||||||
SWebcamDevice[] GetDevices();
|
SWebcamDevice[] GetDevices();
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ using System.Diagnostics;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Base.Fonts;
|
using Vocaluxe.Base.Fonts;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
@@ -126,21 +127,21 @@ namespace Vocaluxe.Screens
|
|||||||
private List<string[]> _Paragraphs;
|
private List<string[]> _Paragraphs;
|
||||||
private List<CText> _ParagraphTexts;
|
private List<CText> _ParagraphTexts;
|
||||||
|
|
||||||
private STexture _TexLogo;
|
private CTexture _TexLogo;
|
||||||
private STexture _TexPerfectNoteStar;
|
private CTexture _TexPerfectNoteStar;
|
||||||
|
|
||||||
private STexture _TexRedDot;
|
private CTexture _TexRedDot;
|
||||||
private STexture _TexBlueDot;
|
private CTexture _TexBlueDot;
|
||||||
|
|
||||||
private STexture _TexNameBrunzel;
|
private CTexture _TexNameBrunzel;
|
||||||
private STexture _TexNameDarkice;
|
private CTexture _TexNameDarkice;
|
||||||
private STexture _TexNameFlokuep;
|
private CTexture _TexNameFlokuep;
|
||||||
private STexture _TexNameFlamefire;
|
private CTexture _TexNameFlamefire;
|
||||||
private STexture _TexNameMesand;
|
private CTexture _TexNameMesand;
|
||||||
private STexture _TexNameBohning;
|
private CTexture _TexNameBohning;
|
||||||
private STexture _TexNameBabene03;
|
private CTexture _TexNameBabene03;
|
||||||
private STexture _TexNamePantero;
|
private CTexture _TexNamePantero;
|
||||||
private STexture _TexNamePinky007;
|
private CTexture _TexNamePinky007;
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
@@ -282,12 +283,12 @@ namespace Vocaluxe.Screens
|
|||||||
return GetNewParticleEffect(numStars, partColor, rect, _TexPerfectNoteStar, partSize, EParticleType.Star);
|
return GetNewParticleEffect(numStars, partColor, rect, _TexPerfectNoteStar, partSize, EParticleType.Star);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _AddNewCreditName(STexture texture, int particleOffsetX, int particleOffsetY, bool bigParticles)
|
private void _AddNewCreditName(CTexture texture, int particleOffsetX, int particleOffsetY, bool bigParticles)
|
||||||
{
|
{
|
||||||
bool isRight = _CreditNames.Count % 2 == 0;
|
bool isRight = _CreditNames.Count % 2 == 0;
|
||||||
int partRectSize = bigParticles ? 25 : 20;
|
int partRectSize = bigParticles ? 25 : 20;
|
||||||
int partCount = bigParticles ? 8 : 6;
|
int partCount = bigParticles ? 8 : 6;
|
||||||
STexture texDot = isRight ? _TexRedDot : _TexBlueDot;
|
CTexture texDot = isRight ? _TexRedDot : _TexBlueDot;
|
||||||
|
|
||||||
CStatic image = GetNewStatic(texture, new SColorF(1, 1, 1, 1), new SRectF(-1, -1, 400, 120, -4));
|
CStatic image = GetNewStatic(texture, new SColorF(1, 1, 1, 1), new SRectF(-1, -1, 400, 120, -4));
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
@@ -53,7 +54,7 @@ namespace Vocaluxe.Screens
|
|||||||
{"EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6"};
|
{"EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6"};
|
||||||
private readonly string[] _SelectSlideDuetPlayer = new string[]
|
private readonly string[] _SelectSlideDuetPlayer = new string[]
|
||||||
{"SelectSlideDuetPlayer1", "SelectSlideDuetPlayer2", "SelectSlideDuetPlayer3", "SelectSlideDuetPlayer4", "SelectSlideDuetPlayer5", "SelectSlideDuetPlayer6"};
|
{"SelectSlideDuetPlayer1", "SelectSlideDuetPlayer2", "SelectSlideDuetPlayer3", "SelectSlideDuetPlayer4", "SelectSlideDuetPlayer5", "SelectSlideDuetPlayer6"};
|
||||||
private readonly STexture[] _OriginalPlayerAvatarTextures = new STexture[CSettings.MaxNumPlayer];
|
private readonly CTexture[] _OriginalPlayerAvatarTextures = new CTexture[CSettings.MaxNumPlayer];
|
||||||
|
|
||||||
private bool _SelectingKeyboardActive;
|
private bool _SelectingKeyboardActive;
|
||||||
private bool _SelectingFast;
|
private bool _SelectingFast;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using System;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Lib.Webcam;
|
using Vocaluxe.Lib.Webcam;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
@@ -45,7 +46,7 @@ namespace Vocaluxe.Screens
|
|||||||
private const string _ButtonExit = "ButtonExit";
|
private const string _ButtonExit = "ButtonExit";
|
||||||
|
|
||||||
private SWebcamConfig _Config;
|
private SWebcamConfig _Config;
|
||||||
private STexture _WebcamTexture = new STexture(-1);
|
private CTexture _WebcamTexture = new CTexture(-1);
|
||||||
private int _DeviceNr;
|
private int _DeviceNr;
|
||||||
private int _CapabilityNr;
|
private int _CapabilityNr;
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ using System.Drawing.Imaging;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
@@ -60,7 +61,7 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
private EEditMode _EditMode;
|
private EEditMode _EditMode;
|
||||||
|
|
||||||
private STexture _WebcamTexture = new STexture(-1);
|
private CTexture _WebcamTexture = new CTexture(-1);
|
||||||
private Bitmap _Snapshot;
|
private Bitmap _Snapshot;
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
|
|
||||||
@@ -367,7 +368,7 @@ namespace Vocaluxe.Screens
|
|||||||
_Statics[_StaticPointsBarBG[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayer;
|
_Statics[_StaticPointsBarBG[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayer;
|
||||||
_Statics[_StaticAvatar[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayer;
|
_Statics[_StaticAvatar[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayer;
|
||||||
|
|
||||||
_Statics[_StaticAvatar[player, numplayer]].Texture = new STexture(-1);
|
_Statics[_StaticAvatar[player, numplayer]].Texture = new CTexture(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ using System.Linq;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Base.Fonts;
|
using Vocaluxe.Base.Fonts;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.Menu.SingNotes;
|
using VocaluxeLib.Menu.SingNotes;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
@@ -96,9 +97,9 @@ namespace Vocaluxe.Screens
|
|||||||
private const float _Volume = 100f;
|
private const float _Volume = 100f;
|
||||||
private int _CurrentVideo = -1;
|
private int _CurrentVideo = -1;
|
||||||
private EAspect _VideoAspect = EAspect.Crop;
|
private EAspect _VideoAspect = EAspect.Crop;
|
||||||
private STexture _CurrentVideoTexture = new STexture(-1);
|
private CTexture _CurrentVideoTexture = new CTexture(-1);
|
||||||
private STexture _CurrentWebcamFrameTexture = new STexture(-1);
|
private CTexture _CurrentWebcamFrameTexture = new CTexture(-1);
|
||||||
private STexture _Background = new STexture(-1);
|
private CTexture _Background = new CTexture(-1);
|
||||||
|
|
||||||
private float _CurrentTime;
|
private float _CurrentTime;
|
||||||
private float _FinishTime;
|
private float _FinishTime;
|
||||||
@@ -411,8 +412,8 @@ namespace Vocaluxe.Screens
|
|||||||
_FadeOut = false;
|
_FadeOut = false;
|
||||||
|
|
||||||
_CurrentVideo = -1;
|
_CurrentVideo = -1;
|
||||||
_CurrentVideoTexture = new STexture(-1);
|
_CurrentVideoTexture = new CTexture(-1);
|
||||||
_CurrentWebcamFrameTexture = new STexture(-1);
|
_CurrentWebcamFrameTexture = new CTexture(-1);
|
||||||
_CurrentBeat = -100;
|
_CurrentBeat = -100;
|
||||||
_CurrentTime = 0f;
|
_CurrentTime = 0f;
|
||||||
_FinishTime = 0f;
|
_FinishTime = 0f;
|
||||||
@@ -453,7 +454,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
if (_Active)
|
if (_Active)
|
||||||
{
|
{
|
||||||
STexture background;
|
CTexture background;
|
||||||
EAspect aspect = EAspect.Crop;
|
EAspect aspect = EAspect.Crop;
|
||||||
if (_CurrentVideo != -1 && CConfig.VideosInSongs == EOffOn.TR_CONFIG_ON && !_Webcam)
|
if (_CurrentVideo != -1 && CConfig.VideosInSongs == EOffOn.TR_CONFIG_ON && !_Webcam)
|
||||||
{
|
{
|
||||||
@@ -1353,7 +1354,7 @@ namespace Vocaluxe.Screens
|
|||||||
foreach (CLine line in voice.Lines.Where(line => line.VisibleInTimeLine))
|
foreach (CLine line in voice.Lines.Where(line => line.VisibleInTimeLine))
|
||||||
{
|
{
|
||||||
STimeRect trect = new STimeRect {StartBeat = line.FirstNoteBeat, EndBeat = line.EndBeat};
|
STimeRect trect = new STimeRect {StartBeat = line.FirstNoteBeat, EndBeat = line.EndBeat};
|
||||||
trect.Rect = GetNewStatic(new STexture(-1),
|
trect.Rect = GetNewStatic(new CTexture(-1),
|
||||||
new SColorF(1f, 1f, 1f, 1f),
|
new SColorF(1f, 1f, 1f, 1f),
|
||||||
new SRectF(
|
new SRectF(
|
||||||
stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.StartBeat, song.BPM) + song.Gap - song.Start) / totalTime),
|
stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.StartBeat, song.BPM) + song.Gap - song.Start) / totalTime),
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
|
namespace VocaluxeLib.Draw
|
||||||
|
{
|
||||||
|
public class CTexture
|
||||||
|
{
|
||||||
|
public int Index;
|
||||||
|
public int PBO;
|
||||||
|
public int ID;
|
||||||
|
|
||||||
|
public string TexturePath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Original size (e.g. of bmp)
|
||||||
|
/// </summary>
|
||||||
|
public readonly Size OrigSize;
|
||||||
|
public float OrigAspect
|
||||||
|
{
|
||||||
|
get { return (float)OrigSize.Width / OrigSize.Height; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Current size when drawn
|
||||||
|
/// </summary>
|
||||||
|
public SRectF Rect;
|
||||||
|
|
||||||
|
public SColorF Color;
|
||||||
|
|
||||||
|
private int _W2, _H2;
|
||||||
|
private float _WidthRatio, _HeightRatio;
|
||||||
|
private bool _UseFullTexture;
|
||||||
|
/// <summary>
|
||||||
|
/// Internal texture width (on device), a power of 2 if necessary
|
||||||
|
/// </summary>
|
||||||
|
public int W2
|
||||||
|
{
|
||||||
|
get { return _W2; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_W2 = value;
|
||||||
|
if (!_UseFullTexture)
|
||||||
|
WidthRatio = (float)OrigSize.Width / _W2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Internal texture height (on device), a power of 2 if necessary
|
||||||
|
/// </summary>
|
||||||
|
public int H2
|
||||||
|
{
|
||||||
|
get { return _H2; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_H2 = value;
|
||||||
|
if (!_UseFullTexture)
|
||||||
|
HeightRatio = (float)OrigSize.Height / _H2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Internal use. Specifies which part of texture memory is actually used
|
||||||
|
/// </summary>
|
||||||
|
public float WidthRatio
|
||||||
|
{
|
||||||
|
get { return _WidthRatio; }
|
||||||
|
private set { _WidthRatio = value; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Internal use. Specifies which part of texture memory is actually used
|
||||||
|
/// </summary>
|
||||||
|
public float HeightRatio
|
||||||
|
{
|
||||||
|
get { return _HeightRatio; }
|
||||||
|
private set { _HeightRatio = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Internal use. Specifies if full texture memory should be used
|
||||||
|
/// Set to true if you resized the original image to the maximum
|
||||||
|
/// </summary>
|
||||||
|
public bool UseFullTexture
|
||||||
|
{
|
||||||
|
get { return _UseFullTexture; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_UseFullTexture = value;
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
WidthRatio = 1;
|
||||||
|
HeightRatio = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WidthRatio = (float)OrigSize.Width / _W2;
|
||||||
|
HeightRatio = (float)OrigSize.Height / _H2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public CTexture(int index, int origWidth = 1, int origHeight = 1)
|
||||||
|
{
|
||||||
|
Index = index;
|
||||||
|
PBO = 0;
|
||||||
|
ID = -1;
|
||||||
|
TexturePath = String.Empty;
|
||||||
|
|
||||||
|
OrigSize = new Size(origWidth, origHeight);
|
||||||
|
Rect = new SRectF(0f, 0f, origWidth, origHeight, 0f);
|
||||||
|
|
||||||
|
Color = new SColorF(1f, 1f, 1f, 1f);
|
||||||
|
|
||||||
|
_W2 = origWidth;
|
||||||
|
_H2 = origHeight;
|
||||||
|
_WidthRatio = 1;
|
||||||
|
_HeightRatio = 1;
|
||||||
|
_UseFullTexture = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
{
|
{
|
||||||
@@ -202,7 +203,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
private bool _DrawTexture()
|
private bool _DrawTexture()
|
||||||
{
|
{
|
||||||
STexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||||
if (texture.OrigSize.Height > 1)
|
if (texture.OrigSize.Height > 1)
|
||||||
{
|
{
|
||||||
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||||
@@ -217,7 +218,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
private bool _DrawVideo()
|
private bool _DrawVideo()
|
||||||
{
|
{
|
||||||
STexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
|
CTexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
|
||||||
if (videoTexture.OrigSize.Height > 1)
|
if (videoTexture.OrigSize.Height > 1)
|
||||||
{
|
{
|
||||||
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||||
@@ -232,7 +233,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
private bool _DrawBackgroundMusicVideo()
|
private bool _DrawBackgroundMusicVideo()
|
||||||
{
|
{
|
||||||
STexture videoTexture = CBase.BackgroundMusic.GetVideoTexture();
|
CTexture videoTexture = CBase.BackgroundMusic.GetVideoTexture();
|
||||||
if (videoTexture.OrigSize.Height > 1)
|
if (videoTexture.OrigSize.Height > 1)
|
||||||
{
|
{
|
||||||
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
{
|
{
|
||||||
@@ -39,8 +40,8 @@ namespace VocaluxeLib.Menu
|
|||||||
private bool _ThemeLoaded;
|
private bool _ThemeLoaded;
|
||||||
private readonly int _PartyModeID;
|
private readonly int _PartyModeID;
|
||||||
|
|
||||||
public STexture Texture;
|
public CTexture Texture;
|
||||||
public STexture SelTexture;
|
public CTexture SelTexture;
|
||||||
public SRectF Rect;
|
public SRectF Rect;
|
||||||
public SColorF Color;
|
public SColorF Color;
|
||||||
public SColorF SelColor;
|
public SColorF SelColor;
|
||||||
@@ -94,8 +95,8 @@ namespace VocaluxeLib.Menu
|
|||||||
Rect = new SRectF();
|
Rect = new SRectF();
|
||||||
Color = new SColorF();
|
Color = new SColorF();
|
||||||
SelColor = new SColorF();
|
SelColor = new SColorF();
|
||||||
Texture = new STexture(-1);
|
Texture = new CTexture(-1);
|
||||||
SelTexture = new STexture(-1);
|
SelTexture = new CTexture(-1);
|
||||||
|
|
||||||
_IsSelText = false;
|
_IsSelText = false;
|
||||||
Text = new CText(_PartyModeID);
|
Text = new CText(_PartyModeID);
|
||||||
@@ -301,7 +302,7 @@ namespace VocaluxeLib.Menu
|
|||||||
if (!Visible && CBase.Settings.GetGameState() != EGameState.EditTheme && !forceDraw)
|
if (!Visible && CBase.Settings.GetGameState() != EGameState.EditTheme && !forceDraw)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
STexture texture;
|
CTexture texture;
|
||||||
|
|
||||||
if (!Selected && !Pressed || !Enabled)
|
if (!Selected && !Pressed || !Enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using System.IO;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu.SingNotes;
|
using VocaluxeLib.Menu.SingNotes;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
|
|
||||||
@@ -478,7 +479,7 @@ namespace VocaluxeLib.Menu
|
|||||||
return new CStatic(oldStatic);
|
return new CStatic(oldStatic);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CStatic GetNewStatic(STexture texture, SColorF color, SRectF rect)
|
public CStatic GetNewStatic(CTexture texture, SColorF color, SRectF rect)
|
||||||
{
|
{
|
||||||
return new CStatic(_PartyModeID, texture, color, rect);
|
return new CStatic(_PartyModeID, texture, color, rect);
|
||||||
}
|
}
|
||||||
@@ -523,7 +524,7 @@ namespace VocaluxeLib.Menu
|
|||||||
return new CPlaylist(_PartyModeID);
|
return new CPlaylist(_PartyModeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, STexture texture, float size, EParticleType type)
|
public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, CTexture texture, float size, EParticleType type)
|
||||||
{
|
{
|
||||||
return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type);
|
return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
{
|
{
|
||||||
@@ -69,8 +70,8 @@ namespace VocaluxeLib.Menu
|
|||||||
public SRectF Rect;
|
public SRectF Rect;
|
||||||
private readonly List<CTile> _Tiles;
|
private readonly List<CTile> _Tiles;
|
||||||
|
|
||||||
private STexture _TextureEmptyTile;
|
private CTexture _TextureEmptyTile;
|
||||||
private STexture _TextureTileSelected;
|
private CTexture _TextureTileSelected;
|
||||||
|
|
||||||
public SColorF ColorEmptyTile;
|
public SColorF ColorEmptyTile;
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
{
|
{
|
||||||
@@ -45,7 +46,7 @@ namespace VocaluxeLib.Menu
|
|||||||
#region private vars
|
#region private vars
|
||||||
private readonly int _PartyModeID;
|
private readonly int _PartyModeID;
|
||||||
private readonly string _TextureName;
|
private readonly string _TextureName;
|
||||||
private readonly STexture _Texture;
|
private readonly CTexture _Texture;
|
||||||
private SRectF _Rect;
|
private SRectF _Rect;
|
||||||
private float _Size;
|
private float _Size;
|
||||||
private SColorF _Color;
|
private SColorF _Color;
|
||||||
@@ -115,7 +116,7 @@ namespace VocaluxeLib.Menu
|
|||||||
{
|
{
|
||||||
_PartyModeID = partyModeID;
|
_PartyModeID = partyModeID;
|
||||||
_TextureName = textureName;
|
_TextureName = textureName;
|
||||||
_Texture = new STexture(-1);
|
_Texture = new CTexture(-1);
|
||||||
_Color = color;
|
_Color = color;
|
||||||
_Rect = new SRectF(x, y, size, size, z);
|
_Rect = new SRectF(x, y, size, size, z);
|
||||||
_Size = size;
|
_Size = size;
|
||||||
@@ -134,7 +135,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_Rotation = (float)(CBase.Game.GetRandomDouble() * 360.0);
|
_Rotation = (float)(CBase.Game.GetRandomDouble() * 360.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CParticle(int partyModeID, STexture texture, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize,
|
public CParticle(int partyModeID, CTexture texture, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize,
|
||||||
EParticleType type)
|
EParticleType type)
|
||||||
{
|
{
|
||||||
_PartyModeID = partyModeID;
|
_PartyModeID = partyModeID;
|
||||||
@@ -312,7 +313,7 @@ namespace VocaluxeLib.Menu
|
|||||||
private SThemeParticleEffect _Theme;
|
private SThemeParticleEffect _Theme;
|
||||||
private bool _ThemeLoaded;
|
private bool _ThemeLoaded;
|
||||||
|
|
||||||
public STexture Texture;
|
public CTexture Texture;
|
||||||
public SColorF Color;
|
public SColorF Color;
|
||||||
public SRectF Rect;
|
public SRectF Rect;
|
||||||
|
|
||||||
@@ -356,7 +357,7 @@ namespace VocaluxeLib.Menu
|
|||||||
Rect = rect;
|
Rect = rect;
|
||||||
Color = color;
|
Color = color;
|
||||||
_Theme.TextureName = textureName;
|
_Theme.TextureName = textureName;
|
||||||
Texture = new STexture(-1);
|
Texture = new CTexture(-1);
|
||||||
_MaxNumber = maxNumber;
|
_MaxNumber = maxNumber;
|
||||||
_Size = size;
|
_Size = size;
|
||||||
_Type = type;
|
_Type = type;
|
||||||
@@ -365,7 +366,7 @@ namespace VocaluxeLib.Menu
|
|||||||
Visible = true;
|
Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, STexture texture, float size, EParticleType type)
|
public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, CTexture texture, float size, EParticleType type)
|
||||||
{
|
{
|
||||||
_PartyModeID = partyModeID;
|
_PartyModeID = partyModeID;
|
||||||
_Theme = new SThemeParticleEffect();
|
_Theme = new SThemeParticleEffect();
|
||||||
@@ -602,7 +603,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public void UnloadTextures()
|
public void UnloadTextures()
|
||||||
{
|
{
|
||||||
Texture = new STexture();
|
Texture = new CTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadTextures()
|
public void LoadTextures()
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
{
|
{
|
||||||
@@ -127,7 +128,7 @@ namespace VocaluxeLib.Menu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private STexture _GetTextureValue(string value)
|
private CTexture _GetTextureValue(string value)
|
||||||
{
|
{
|
||||||
return CBase.Theme.GetSkinTexture(value, _PartyModeID);
|
return CBase.Theme.GetSkinTexture(value, _PartyModeID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
{
|
{
|
||||||
@@ -110,7 +111,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
private readonly List<string> _ValueNames;
|
private readonly List<string> _ValueNames;
|
||||||
private readonly List<int> _ValuePartyModeIDs;
|
private readonly List<int> _ValuePartyModeIDs;
|
||||||
private readonly List<STexture> _Textures;
|
private readonly List<CTexture> _Textures;
|
||||||
private readonly List<int> _ValueIndexes;
|
private readonly List<int> _ValueIndexes;
|
||||||
|
|
||||||
private readonly List<SRectF> _ValueBounds = new List<SRectF>();
|
private readonly List<SRectF> _ValueBounds = new List<SRectF>();
|
||||||
@@ -178,7 +179,7 @@ namespace VocaluxeLib.Menu
|
|||||||
MaxW = 0f;
|
MaxW = 0f;
|
||||||
|
|
||||||
_Selected = false;
|
_Selected = false;
|
||||||
_Textures = new List<STexture>();
|
_Textures = new List<CTexture>();
|
||||||
_ValueIndexes = new List<int>();
|
_ValueIndexes = new List<int>();
|
||||||
_ValueNames = new List<string>();
|
_ValueNames = new List<string>();
|
||||||
_ValuePartyModeIDs = new List<int>();
|
_ValuePartyModeIDs = new List<int>();
|
||||||
@@ -226,7 +227,7 @@ namespace VocaluxeLib.Menu
|
|||||||
MaxW = slide.MaxW;
|
MaxW = slide.MaxW;
|
||||||
|
|
||||||
_Selected = slide._Selected;
|
_Selected = slide._Selected;
|
||||||
_Textures = new List<STexture>(slide._Textures);
|
_Textures = new List<CTexture>(slide._Textures);
|
||||||
_ValueIndexes = new List<int>(slide._ValueIndexes);
|
_ValueIndexes = new List<int>(slide._ValueIndexes);
|
||||||
_ValueNames = new List<string>(slide._ValueNames);
|
_ValueNames = new List<string>(slide._ValueNames);
|
||||||
_ValueBounds = new List<SRectF>(slide._ValueBounds);
|
_ValueBounds = new List<SRectF>(slide._ValueBounds);
|
||||||
@@ -530,20 +531,20 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public void AddValue(string value, int partyModeID)
|
public void AddValue(string value, int partyModeID)
|
||||||
{
|
{
|
||||||
AddValue(value, new STexture(-1), _ValueIndexes.Count, partyModeID);
|
AddValue(value, new CTexture(-1), _ValueIndexes.Count, partyModeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddValue(string value, STexture texture)
|
public void AddValue(string value, CTexture texture)
|
||||||
{
|
{
|
||||||
AddValue(value, texture, _ValueIndexes.Count, _PartyModeID);
|
AddValue(value, texture, _ValueIndexes.Count, _PartyModeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _AddValue(string value, STexture texture, int valueIndex)
|
private void _AddValue(string value, CTexture texture, int valueIndex)
|
||||||
{
|
{
|
||||||
AddValue(value, texture, valueIndex, _PartyModeID);
|
AddValue(value, texture, valueIndex, _PartyModeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddValue(string value, STexture texture, int valueIndex, int partyModeID)
|
public void AddValue(string value, CTexture texture, int valueIndex, int partyModeID)
|
||||||
{
|
{
|
||||||
_ValueNames.Add(value);
|
_ValueNames.Add(value);
|
||||||
_Textures.Add(texture);
|
_Textures.Add(texture);
|
||||||
@@ -559,12 +560,12 @@ namespace VocaluxeLib.Menu
|
|||||||
public void AddValues(IEnumerable<string> values)
|
public void AddValues(IEnumerable<string> values)
|
||||||
{
|
{
|
||||||
foreach (string value in values)
|
foreach (string value in values)
|
||||||
_AddValue(value, new STexture(-1), _PartyModeID);
|
_AddValue(value, new CTexture(-1), _PartyModeID);
|
||||||
|
|
||||||
_ValueBounds.Clear();
|
_ValueBounds.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddValues(string[] values, STexture[] textures)
|
public void AddValues(string[] values, CTexture[] textures)
|
||||||
{
|
{
|
||||||
if (values.Length != textures.Length)
|
if (values.Length != textures.Length)
|
||||||
return;
|
return;
|
||||||
@@ -590,10 +591,10 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public void RenameValue(int selection, string newName)
|
public void RenameValue(int selection, string newName)
|
||||||
{
|
{
|
||||||
RenameValue(selection, newName, new STexture(-1));
|
RenameValue(selection, newName, new CTexture(-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RenameValue(int selection, string newName, STexture newTexture)
|
public void RenameValue(int selection, string newName, CTexture newTexture)
|
||||||
{
|
{
|
||||||
if (selection < 0 && selection >= _ValueNames.Count)
|
if (selection < 0 && selection >= _ValueNames.Count)
|
||||||
return;
|
return;
|
||||||
@@ -696,15 +697,15 @@ namespace VocaluxeLib.Menu
|
|||||||
if (!Visible && CBase.Settings.GetGameState() != EGameState.EditTheme)
|
if (!Visible && CBase.Settings.GetGameState() != EGameState.EditTheme)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
STexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||||
STexture textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID);
|
CTexture textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID);
|
||||||
STexture textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID);
|
CTexture textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID);
|
||||||
|
|
||||||
STexture selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
|
CTexture selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
|
||||||
STexture selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID);
|
CTexture selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID);
|
||||||
STexture selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID);
|
CTexture selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID);
|
||||||
|
|
||||||
STexture highlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID);
|
CTexture highlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID);
|
||||||
|
|
||||||
if (Selected)
|
if (Selected)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
{
|
{
|
||||||
@@ -42,8 +43,8 @@ namespace VocaluxeLib.Menu
|
|||||||
return _Theme.Name;
|
return _Theme.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private STexture _Texture;
|
private CTexture _Texture;
|
||||||
public STexture Texture
|
public CTexture Texture
|
||||||
{
|
{
|
||||||
get { return _Texture.Index != -1 ? _Texture : CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
|
get { return _Texture.Index != -1 ? _Texture : CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_Theme = new SThemeStatic();
|
_Theme = new SThemeStatic();
|
||||||
_ThemeLoaded = false;
|
_ThemeLoaded = false;
|
||||||
|
|
||||||
_Texture = new STexture(-1);
|
_Texture = new CTexture(-1);
|
||||||
Color = new SColorF();
|
Color = new SColorF();
|
||||||
Rect = new SRectF();
|
Rect = new SRectF();
|
||||||
Reflection = false;
|
Reflection = false;
|
||||||
@@ -100,7 +101,7 @@ namespace VocaluxeLib.Menu
|
|||||||
Visible = s.Visible;
|
Visible = s.Visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CStatic(int partyModeID, STexture texture, SColorF color, SRectF rect)
|
public CStatic(int partyModeID, CTexture texture, SColorF color, SRectF rect)
|
||||||
{
|
{
|
||||||
_PartyModeID = partyModeID;
|
_PartyModeID = partyModeID;
|
||||||
_Theme = new SThemeStatic();
|
_Theme = new SThemeStatic();
|
||||||
@@ -124,7 +125,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_Theme = new SThemeStatic {TextureName = textureSkinName};
|
_Theme = new SThemeStatic {TextureName = textureSkinName};
|
||||||
_ThemeLoaded = false;
|
_ThemeLoaded = false;
|
||||||
|
|
||||||
_Texture = new STexture(-1);
|
_Texture = new CTexture(-1);
|
||||||
Color = color;
|
Color = color;
|
||||||
Rect = rect;
|
Rect = rect;
|
||||||
Reflection = false;
|
Reflection = false;
|
||||||
@@ -238,7 +239,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public void Draw(float scale, float z, EAspect aspect, bool forceDraw = false)
|
public void Draw(float scale, float z, EAspect aspect, bool forceDraw = false)
|
||||||
{
|
{
|
||||||
STexture texture = _Texture.Index != -1 ? _Texture : CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
CTexture texture = _Texture.Index != -1 ? _Texture : CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||||
|
|
||||||
SRectF bounds = new SRectF(
|
SRectF bounds = new SRectF(
|
||||||
Rect.X - Rect.W * (scale - 1f),
|
Rect.X - Rect.W * (scale - 1f),
|
||||||
|
|||||||
+12
-11
@@ -21,6 +21,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
@@ -113,8 +114,8 @@ namespace VocaluxeLib.Menu
|
|||||||
{
|
{
|
||||||
string GetThemeScreensPath(int partyModeID);
|
string GetThemeScreensPath(int partyModeID);
|
||||||
int GetSkinIndex(int partyModeID);
|
int GetSkinIndex(int partyModeID);
|
||||||
STexture GetSkinTexture(string textureName, int partyModeID);
|
CTexture GetSkinTexture(string textureName, int partyModeID);
|
||||||
STexture GetSkinVideoTexture(string videoName, int partyModeID);
|
CTexture GetSkinVideoTexture(string videoName, int partyModeID);
|
||||||
|
|
||||||
void SkinVideoResume(string videoName, int partyModeID);
|
void SkinVideoResume(string videoName, int partyModeID);
|
||||||
void SkinVideoPause(string videoName, int partyModeID);
|
void SkinVideoPause(string videoName, int partyModeID);
|
||||||
@@ -144,17 +145,17 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
void ApplyVolume();
|
void ApplyVolume();
|
||||||
|
|
||||||
STexture GetVideoTexture();
|
CTexture GetVideoTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IDrawing
|
public interface IDrawing
|
||||||
{
|
{
|
||||||
void DrawTexture(STexture texture, SRectF rect);
|
void DrawTexture(CTexture texture, SRectF rect);
|
||||||
void DrawTexture(STexture texture, SRectF rect, SColorF color);
|
void DrawTexture(CTexture texture, SRectF rect, SColorF color);
|
||||||
void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false);
|
void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false);
|
||||||
void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight);
|
void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight);
|
||||||
|
|
||||||
void RemoveTexture(ref STexture texture);
|
void RemoveTexture(ref CTexture texture);
|
||||||
|
|
||||||
void DrawColor(SColorF color, SRectF rect);
|
void DrawColor(SColorF color, SRectF rect);
|
||||||
void DrawColorReflection(SColorF color, SRectF rect, float space, float height);
|
void DrawColorReflection(SColorF color, SRectF rect, float space, float height);
|
||||||
@@ -259,7 +260,7 @@ namespace VocaluxeLib.Menu
|
|||||||
{
|
{
|
||||||
int Load(string videoFileName);
|
int Load(string videoFileName);
|
||||||
bool Skip(int videoStream, float startPosition, float videoGap);
|
bool Skip(int videoStream, float startPosition, float videoGap);
|
||||||
bool GetFrame(int videoStream, ref STexture videoTexture, float time, out float videoTime);
|
bool GetFrame(int videoStream, ref CTexture videoTexture, float time, out float videoTime);
|
||||||
bool IsFinished(int videoStream);
|
bool IsFinished(int videoStream);
|
||||||
bool Close(int videoStream);
|
bool Close(int videoStream);
|
||||||
}
|
}
|
||||||
@@ -282,12 +283,12 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public interface ICover
|
public interface ICover
|
||||||
{
|
{
|
||||||
STexture GetNoCover();
|
CTexture GetNoCover();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IDataBase
|
public interface IDataBase
|
||||||
{
|
{
|
||||||
bool GetCover(string fileName, ref STexture texture, int coverSize);
|
bool GetCover(string fileName, ref CTexture texture, int coverSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IControllers
|
public interface IControllers
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu.SingNotes
|
namespace VocaluxeLib.Menu.SingNotes
|
||||||
{
|
{
|
||||||
@@ -475,9 +476,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
|||||||
|
|
||||||
SRectF noteRect = new SRectF(rect.X + dw, rect.Y + dh, rect.W - 2 * dw, rect.H - 2 * dh, rect.Z);
|
SRectF noteRect = new SRectF(rect.X + dw, rect.Y + dh, rect.W - 2 * dw, rect.H - 2 * dh, rect.Z);
|
||||||
|
|
||||||
STexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||||
STexture noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID);
|
CTexture noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID);
|
||||||
STexture noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID);
|
CTexture noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID);
|
||||||
|
|
||||||
//Width of each of the ends (round parts)
|
//Width of each of the ends (round parts)
|
||||||
//Need 2 of them so use minimum
|
//Need 2 of them so use minimum
|
||||||
@@ -522,9 +523,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
|||||||
rect.Z
|
rect.Z
|
||||||
);
|
);
|
||||||
|
|
||||||
STexture noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID);
|
CTexture noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID);
|
||||||
STexture noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID);
|
CTexture noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID);
|
||||||
STexture noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID);
|
CTexture noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID);
|
||||||
|
|
||||||
float dx = r.H * noteBackgroundBegin.OrigAspect;
|
float dx = r.H * noteBackgroundBegin.OrigAspect;
|
||||||
if (2 * dx > r.W)
|
if (2 * dx > r.W)
|
||||||
@@ -617,7 +618,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
|||||||
rect.Z
|
rect.Z
|
||||||
);
|
);
|
||||||
|
|
||||||
STexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||||
float dx = r.H * noteBegin.OrigAspect;
|
float dx = r.H * noteBegin.OrigAspect;
|
||||||
if (2 * dx > r.W)
|
if (2 * dx > r.W)
|
||||||
dx = r.W / 2;
|
dx = r.W / 2;
|
||||||
@@ -674,7 +675,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
|||||||
_PlayerNotes[n].Color.B,
|
_PlayerNotes[n].Color.B,
|
||||||
_PlayerNotes[n].Color.A * _PlayerNotes[n].Alpha);
|
_PlayerNotes[n].Color.A * _PlayerNotes[n].Alpha);
|
||||||
|
|
||||||
STexture toneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID);
|
CTexture toneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID);
|
||||||
CBase.Drawing.DrawTexture(toneHelper, drawRect, color);
|
CBase.Drawing.DrawTexture(toneHelper, drawRect, color);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,14 +18,15 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu.SongMenu
|
namespace VocaluxeLib.Menu.SongMenu
|
||||||
{
|
{
|
||||||
public class CCategory
|
public class CCategory
|
||||||
{
|
{
|
||||||
public readonly string Name;
|
public readonly string Name;
|
||||||
private STexture _CoverTextureSmall = new STexture(-1);
|
private CTexture _CoverTextureSmall = new CTexture(-1);
|
||||||
private STexture _CoverTextureBig = new STexture(-1);
|
private CTexture _CoverTextureBig = new CTexture(-1);
|
||||||
private bool _CoverBigLoaded;
|
private bool _CoverBigLoaded;
|
||||||
public readonly List<CSongPointer> Songs = new List<CSongPointer>();
|
public readonly List<CSongPointer> Songs = new List<CSongPointer>();
|
||||||
|
|
||||||
@@ -34,14 +35,14 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
Name = name;
|
Name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture CoverTextureSmall
|
public CTexture CoverTextureSmall
|
||||||
{
|
{
|
||||||
get { return _CoverTextureSmall; }
|
get { return _CoverTextureSmall; }
|
||||||
|
|
||||||
set { _CoverTextureSmall = value; }
|
set { _CoverTextureSmall = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture CoverTextureBig
|
public CTexture CoverTextureBig
|
||||||
{
|
{
|
||||||
get { return _CoverBigLoaded ? _CoverTextureBig : _CoverTextureSmall; }
|
get { return _CoverBigLoaded ? _CoverTextureBig : _CoverTextureSmall; }
|
||||||
set
|
set
|
||||||
@@ -53,7 +54,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CCategory(string name, STexture coverSmall, STexture coverBig)
|
public CCategory(string name, CTexture coverSmall, CTexture coverBig)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
CoverTextureSmall = coverSmall;
|
CoverTextureSmall = coverSmall;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu.SingNotes;
|
using VocaluxeLib.Menu.SingNotes;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu.SongMenu
|
namespace VocaluxeLib.Menu.SongMenu
|
||||||
@@ -71,8 +72,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
{
|
{
|
||||||
private bool _CoverSmallLoaded;
|
private bool _CoverSmallLoaded;
|
||||||
private bool _CoverBigLoaded;
|
private bool _CoverBigLoaded;
|
||||||
private STexture _CoverTextureSmall = new STexture(-1);
|
private CTexture _CoverTextureSmall = new CTexture(-1);
|
||||||
private STexture _CoverTextureBig = new STexture(-1);
|
private CTexture _CoverTextureBig = new CTexture(-1);
|
||||||
|
|
||||||
public SMedley Medley;
|
public SMedley Medley;
|
||||||
|
|
||||||
@@ -96,7 +97,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
|
|
||||||
public bool NotesLoaded { get; private set; }
|
public bool NotesLoaded { get; private set; }
|
||||||
|
|
||||||
public STexture CoverTextureSmall
|
public CTexture CoverTextureSmall
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -112,7 +113,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public STexture CoverTextureBig
|
public CTexture CoverTextureBig
|
||||||
{
|
{
|
||||||
get { return _CoverBigLoaded ? _CoverTextureBig : _CoverTextureSmall; }
|
get { return _CoverBigLoaded ? _CoverTextureBig : _CoverTextureSmall; }
|
||||||
set
|
set
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.PartyModes;
|
using VocaluxeLib.PartyModes;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu.SongMenu
|
namespace VocaluxeLib.Menu.SongMenu
|
||||||
@@ -104,7 +105,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
private readonly List<int> _Streams = new List<int>();
|
private readonly List<int> _Streams = new List<int>();
|
||||||
private int _Actsong = -1;
|
private int _Actsong = -1;
|
||||||
private int _Actsongstream = -1;
|
private int _Actsongstream = -1;
|
||||||
protected STexture _Vidtex = new STexture(-1);
|
protected CTexture _Vidtex = new CTexture(-1);
|
||||||
|
|
||||||
protected bool _Initialized;
|
protected bool _Initialized;
|
||||||
protected int _LastKnownNumSongs;
|
protected int _LastKnownNumSongs;
|
||||||
@@ -463,7 +464,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
public virtual void OnShow()
|
public virtual void OnShow()
|
||||||
{
|
{
|
||||||
_Actsongstream = -1;
|
_Actsongstream = -1;
|
||||||
_Vidtex = new STexture(-1);
|
_Vidtex = new CTexture(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnHide()
|
public virtual void OnHide()
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using System.Collections.Generic;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.PartyModes;
|
using VocaluxeLib.PartyModes;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu.SongMenu
|
namespace VocaluxeLib.Menu.SongMenu
|
||||||
@@ -37,8 +38,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
private CStatic _MedleyCalcIcon;
|
private CStatic _MedleyCalcIcon;
|
||||||
private CStatic _MedleyTagIcon;
|
private CStatic _MedleyTagIcon;
|
||||||
|
|
||||||
private STexture _CoverBigTexture;
|
private CTexture _CoverBigTexture;
|
||||||
private STexture _CoverTexture;
|
private CTexture _CoverTexture;
|
||||||
|
|
||||||
private CText _Artist;
|
private CText _Artist;
|
||||||
private CText _Title;
|
private CText _Title;
|
||||||
|
|||||||
+3
-116
@@ -21,6 +21,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
using VocaluxeLib.Menu.SingNotes;
|
using VocaluxeLib.Menu.SingNotes;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
@@ -99,120 +100,6 @@ namespace VocaluxeLib.Menu
|
|||||||
public int Y;
|
public int Y;
|
||||||
public int Z;
|
public int Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct STexture
|
|
||||||
{
|
|
||||||
public int Index;
|
|
||||||
public int PBO;
|
|
||||||
public int ID;
|
|
||||||
|
|
||||||
public string TexturePath;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Original size (e.g. of bmp)
|
|
||||||
/// </summary>
|
|
||||||
public readonly Size OrigSize;
|
|
||||||
public float OrigAspect
|
|
||||||
{
|
|
||||||
get { return (float)OrigSize.Width / OrigSize.Height; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Current size when drawn
|
|
||||||
/// </summary>
|
|
||||||
public SRectF Rect;
|
|
||||||
|
|
||||||
public SColorF Color;
|
|
||||||
|
|
||||||
private int _W2, _H2;
|
|
||||||
private float _WidthRatio, _HeightRatio;
|
|
||||||
private bool _UseFullTexture;
|
|
||||||
/// <summary>
|
|
||||||
/// Internal texture width (on device), a power of 2 if necessary
|
|
||||||
/// </summary>
|
|
||||||
public int W2
|
|
||||||
{
|
|
||||||
get { return _W2; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_W2 = value;
|
|
||||||
if (!_UseFullTexture)
|
|
||||||
WidthRatio = (float)OrigSize.Width / _W2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Internal texture height (on device), a power of 2 if necessary
|
|
||||||
/// </summary>
|
|
||||||
public int H2
|
|
||||||
{
|
|
||||||
get { return _H2; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_H2 = value;
|
|
||||||
if (!_UseFullTexture)
|
|
||||||
HeightRatio = (float)OrigSize.Height / _H2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Internal use. Specifies which part of texture memory is actually used
|
|
||||||
/// </summary>
|
|
||||||
public float WidthRatio
|
|
||||||
{
|
|
||||||
get { return _WidthRatio; }
|
|
||||||
private set { _WidthRatio = value; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Internal use. Specifies which part of texture memory is actually used
|
|
||||||
/// </summary>
|
|
||||||
public float HeightRatio
|
|
||||||
{
|
|
||||||
get { return _HeightRatio; }
|
|
||||||
private set { _HeightRatio = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Internal use. Specifies if full texture memory should be used
|
|
||||||
/// Set to true if you resized the original image to the maximum
|
|
||||||
/// </summary>
|
|
||||||
public bool UseFullTexture
|
|
||||||
{
|
|
||||||
get { return _UseFullTexture; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_UseFullTexture = value;
|
|
||||||
if (value)
|
|
||||||
{
|
|
||||||
WidthRatio = 1;
|
|
||||||
HeightRatio = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WidthRatio = (float)OrigSize.Width / _W2;
|
|
||||||
HeightRatio = (float)OrigSize.Height / _H2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public STexture(int index, int origWidth = 1, int origHeight = 1)
|
|
||||||
{
|
|
||||||
Index = index;
|
|
||||||
PBO = 0;
|
|
||||||
ID = -1;
|
|
||||||
TexturePath = String.Empty;
|
|
||||||
|
|
||||||
OrigSize = new Size(origWidth, origHeight);
|
|
||||||
Rect = new SRectF(0f, 0f, origWidth, origHeight, 0f);
|
|
||||||
|
|
||||||
Color = new SColorF(1f, 1f, 1f, 1f);
|
|
||||||
|
|
||||||
_W2 = origWidth;
|
|
||||||
_H2 = origHeight;
|
|
||||||
_WidthRatio = 1;
|
|
||||||
_HeightRatio = 1;
|
|
||||||
_UseFullTexture = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion Drawing
|
#endregion Drawing
|
||||||
|
|
||||||
#region Inputs
|
#region Inputs
|
||||||
@@ -307,14 +194,14 @@ namespace VocaluxeLib.Menu
|
|||||||
public struct SAvatar
|
public struct SAvatar
|
||||||
{
|
{
|
||||||
public string FileName;
|
public string FileName;
|
||||||
public STexture Texture;
|
public CTexture Texture;
|
||||||
|
|
||||||
// ReSharper disable UnusedParameter.Local
|
// ReSharper disable UnusedParameter.Local
|
||||||
public SAvatar(int dummy)
|
public SAvatar(int dummy)
|
||||||
// ReSharper restore UnusedParameter.Local
|
// ReSharper restore UnusedParameter.Local
|
||||||
{
|
{
|
||||||
FileName = String.Empty;
|
FileName = String.Empty;
|
||||||
Texture = new STexture(-1);
|
Texture = new CTexture(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion Profiles
|
#endregion Profiles
|
||||||
|
|||||||
@@ -130,6 +130,7 @@
|
|||||||
<Compile Include="Menu\CStatic.cs" />
|
<Compile Include="Menu\CStatic.cs" />
|
||||||
<Compile Include="Menu\CText.cs" />
|
<Compile Include="Menu\CText.cs" />
|
||||||
<Compile Include="Menu\CScreenSetting.cs" />
|
<Compile Include="Menu\CScreenSetting.cs" />
|
||||||
|
<Compile Include="Draw\CTexture.cs" />
|
||||||
<Compile Include="Menu\CXMLReader.cs" />
|
<Compile Include="Menu\CXMLReader.cs" />
|
||||||
<Compile Include="Menu\Enums.cs" />
|
<Compile Include="Menu\Enums.cs" />
|
||||||
<Compile Include="Menu\IMenu.cs" />
|
<Compile Include="Menu\IMenu.cs" />
|
||||||
|
|||||||
Reference in new issue
Block a user