From 7f8e974fe15881ccaa1ebc94ab1630bfc2f05dc8 Mon Sep 17 00:00:00 2001 From: Flamefire Date: Sat, 13 Sep 2014 17:51:55 +0200 Subject: [PATCH] Rename CTexture to CTextureRef to reflect it is only a reference --- Vocaluxe/Base/CBackgroundMusic.cs | 48 +++++++++++-------- Vocaluxe/Base/CCover.cs | 8 ++-- Vocaluxe/Base/CCursor.cs | 2 +- Vocaluxe/Base/CDataBase.cs | 4 +- Vocaluxe/Base/CDraw.cs | 32 ++++++------- Vocaluxe/Base/CMain.cs | 26 +++++----- Vocaluxe/Base/CPlaylistElement.cs | 2 +- Vocaluxe/Base/CProfiles.cs | 4 +- Vocaluxe/Base/CTheme.cs | 6 +-- Vocaluxe/Base/CVideo.cs | 2 +- Vocaluxe/Base/CVideoPlayer.cs | 2 +- Vocaluxe/Base/CWebcam.cs | 2 +- Vocaluxe/Base/Fonts/CFont.cs | 6 +-- Vocaluxe/Base/Fonts/CGlyph.cs | 4 +- Vocaluxe/Lib/Database/CCoverDB.cs | 2 +- Vocaluxe/Lib/Database/CResourceDB.cs | 2 +- Vocaluxe/Lib/Draw/CDirect3D.cs | 24 +++++----- Vocaluxe/Lib/Draw/CDrawBase.cs | 44 ++++++++--------- Vocaluxe/Lib/Draw/CDrawWinForm.cs | 46 +++++++++--------- Vocaluxe/Lib/Draw/COpenGL.cs | 24 +++++----- Vocaluxe/Lib/Draw/IDraw.cs | 30 ++++++------ Vocaluxe/Lib/Video/Acinerella/CDecoder.cs | 2 +- .../Lib/Video/Acinerella/CDecoderThread.cs | 2 +- Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs | 2 +- Vocaluxe/Lib/Video/IVideoDecoder.cs | 2 +- Vocaluxe/Lib/Webcam/CAForgeNet.cs | 2 +- Vocaluxe/Lib/Webcam/IWebcam.cs | 2 +- Vocaluxe/Screens/CPopupScreenServerQR.cs | 10 ++-- Vocaluxe/Screens/CScreenCredits.cs | 30 ++++++------ Vocaluxe/Screens/CScreenNames.cs | 2 +- Vocaluxe/Screens/CScreenOptionsVideo.cs | 2 +- Vocaluxe/Screens/CScreenProfiles.cs | 2 +- Vocaluxe/Screens/CScreenSing.cs | 8 ++-- .../Draw/{CTexture.cs => CTextureRef.cs} | 4 +- VocaluxeLib/IBasic.cs | 30 ++++++------ VocaluxeLib/Menu/CBackground.cs | 16 +++---- VocaluxeLib/Menu/CButton.cs | 6 +-- VocaluxeLib/Menu/CMenu.cs | 4 +- VocaluxeLib/Menu/CMenuPartyNameSelection.cs | 2 +- VocaluxeLib/Menu/CNameSelection.cs | 6 +-- VocaluxeLib/Menu/CParticle.cs | 8 ++-- VocaluxeLib/Menu/CScreenSetting.cs | 2 +- VocaluxeLib/Menu/CSelectSlide.cs | 30 ++++++------ VocaluxeLib/Menu/CStatic.cs | 8 ++-- VocaluxeLib/Menu/SingNotes/CSingNotes.cs | 16 +++---- .../Menu/SongMenu/CSongMenuTileBoard.cs | 6 +-- VocaluxeLib/Profile/CAvatar.cs | 8 ++-- VocaluxeLib/Songs/CCategory.cs | 8 ++-- VocaluxeLib/Songs/CSong.cs | 8 ++-- VocaluxeLib/Utils/Player/CSongPlayer.cs | 25 ++++------ VocaluxeLib/VocaluxeLib.csproj | 2 +- 51 files changed, 290 insertions(+), 285 deletions(-) rename VocaluxeLib/Draw/{CTexture.cs => CTextureRef.cs} (96%) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index d34d5432..396eda6d 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -52,25 +52,26 @@ namespace Vocaluxe.Base public static bool VideoEnabled { get { return _PlaysPreview ? _PreviewPlayer.VideoEnabled : _SongPlayer.VideoEnabled; } - set { - if(_PlaysPreview) + set + { + if (_PlaysPreview) _PreviewPlayer.VideoEnabled = value; - else + else _SongPlayer.VideoEnabled = value; } } - public static bool CanSing - { - get + public static bool CanSing + { + get { if (_PlaysPreview) return false; + else if (_BGMusicFiles.Contains(_CurrentPlaylistElement)) + return false; else - if (_BGMusicFiles.Contains(_CurrentPlaylistElement)) - return false; - else return true; - } + return true; + } } public static bool Disabled @@ -85,7 +86,8 @@ namespace Vocaluxe.Base } } - public static bool RepeatSong { + public static bool RepeatSong + { get { return _SongPlayer.RepeatSong; } set { _SongPlayer.RepeatSong = value; } } @@ -100,13 +102,20 @@ namespace Vocaluxe.Base get { return _SongPlayer.SongHasVideo; } } - public static bool IsPlaying { get { return _PlaysPreview ? _PreviewPlayer.IsPlaying : _SongPlayer.IsPlaying; } } + public static bool IsPlaying + { + get { return _PlaysPreview ? _PreviewPlayer.IsPlaying : _SongPlayer.IsPlaying; } + } - public static bool IsPlayingPreview { get { return _PlaysPreview; } } + public static bool IsPlayingPreview + { + get { return _PlaysPreview; } + } public static string ArtistAndTitle { - get { + get + { if (_PlaysPreview) return _PreviewPlayer.ArtistAndTitle; else @@ -119,7 +128,7 @@ namespace Vocaluxe.Base get { return _PlaysPreview ? _PreviewPlayer.Length : _SongPlayer.Length; } } - public static CTexture Cover + public static CTextureRef Cover { get { return _PlaysPreview ? _PreviewPlayer.Cover : _SongPlayer.Cover; } } @@ -184,12 +193,14 @@ namespace Vocaluxe.Base if (_PlaysPreview) _PreviewPlayer.Play(); - else if(CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF) + else if (CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF) + { if (_SongPlayer.SongLoaded) //Resume _SongPlayer.TogglePause(); else Next(); + } } public static void Stop() @@ -278,7 +289,7 @@ namespace Vocaluxe.Base public static void Update() { - if (!IsPlaying && (!_SongPlayer.SongLoaded || !_PreviewPlayer.SongLoaded) ) + if (!IsPlaying && (!_SongPlayer.SongLoaded || !_PreviewPlayer.SongLoaded)) return; if (_PlaysPreview) @@ -291,7 +302,7 @@ namespace Vocaluxe.Base } } - public static CTexture GetVideoTexture() + public static CTextureRef GetVideoTexture() { return _PlaysPreview ? _PreviewPlayer.GetVideoTexture() : _SongPlayer.GetVideoTexture(); } @@ -439,6 +450,5 @@ namespace Vocaluxe.Base { return _BGMusicFiles.Contains(element); } - } } \ No newline at end of file diff --git a/Vocaluxe/Base/CCover.cs b/Vocaluxe/Base/CCover.cs index 61692ce7..50293b3d 100644 --- a/Vocaluxe/Base/CCover.cs +++ b/Vocaluxe/Base/CCover.cs @@ -32,10 +32,10 @@ namespace Vocaluxe.Base static class CCover { - private static readonly Dictionary _Covers = new Dictionary(); + private static readonly Dictionary _Covers = new Dictionary(); private static readonly List _CoverThemes = new List(); - public static CTexture NoCover { get; private set; } + public static CTextureRef NoCover { get; private set; } public static void Init() { @@ -81,7 +81,7 @@ namespace Vocaluxe.Base /// /// Returns a STexture for a given cover name. Returns "NoCover" if the cover does not exist. /// - public static CTexture Cover(string name) + public static CTextureRef Cover(string name) { lock (_Covers) { @@ -116,7 +116,7 @@ namespace Vocaluxe.Base { foreach (string key in _Covers.Keys) { - CTexture texture = _Covers[key]; + CTextureRef texture = _Covers[key]; CDraw.RemoveTexture(ref texture); } _Covers.Clear(); diff --git a/Vocaluxe/Base/CCursor.cs b/Vocaluxe/Base/CCursor.cs index 46a6e2b1..01ede32b 100644 --- a/Vocaluxe/Base/CCursor.cs +++ b/Vocaluxe/Base/CCursor.cs @@ -27,7 +27,7 @@ namespace Vocaluxe.Base { private int _MouseMoveDiffMin = CSettings.MouseMoveDiffMinActive; private CFading _Fading; - private CTexture _Cursor; + private CTextureRef _Cursor; private Point _LastDiffPos; private readonly Stopwatch _Movetimer = new Stopwatch(); diff --git a/Vocaluxe/Base/CDataBase.cs b/Vocaluxe/Base/CDataBase.cs index 6297433e..a3e6397d 100644 --- a/Vocaluxe/Base/CDataBase.cs +++ b/Vocaluxe/Base/CDataBase.cs @@ -93,7 +93,7 @@ namespace Vocaluxe.Base _HighscoreDB.IncreaseSongCounter(dataBaseSongID); } - public static bool GetCover(string fileName, ref CTexture tex, int maxSize) + public static bool GetCover(string fileName, ref CTextureRef tex, int maxSize) { return _CoverDB.GetCover(fileName, ref tex, maxSize); } @@ -103,7 +103,7 @@ namespace Vocaluxe.Base _CoverDB.CommitCovers(); } - public static bool GetCreditsRessource(string fileName, ref CTexture tex) + public static bool GetCreditsRessource(string fileName, ref CTextureRef tex) { return _ResourceDB.GetCreditsRessource(fileName, ref tex); } diff --git a/Vocaluxe/Base/CDraw.cs b/Vocaluxe/Base/CDraw.cs index f109645b..0fbc6049 100644 --- a/Vocaluxe/Base/CDraw.cs +++ b/Vocaluxe/Base/CDraw.cs @@ -130,12 +130,12 @@ namespace Vocaluxe.Base _Draw.ClearScreen(); } - public static CTexture CopyScreen() + public static CTextureRef CopyScreen() { return _Draw.CopyScreen(); } - public static void CopyScreen(ref CTexture texture) + public static void CopyScreen(ref CTextureRef texture) { _Draw.CopyScreen(ref texture); } @@ -145,67 +145,67 @@ namespace Vocaluxe.Base _Draw.MakeScreenShot(); } - public static CTexture AddTexture(Bitmap bitmap) + public static CTextureRef AddTexture(Bitmap bitmap) { return _Draw.AddTexture(bitmap); } - public static CTexture AddTexture(string texturePath) + public static CTextureRef AddTexture(string texturePath) { return _Draw.AddTexture(texturePath); } - public static CTexture AddTexture(int w, int h, byte[] data) + public static CTextureRef AddTexture(int w, int h, byte[] data) { return _Draw.AddTexture(w, h, data); } - public static CTexture EnqueueTexture(int w, int h, byte[] data) + public static CTextureRef EnqueueTexture(int w, int h, byte[] data) { return _Draw.EnqueueTexture(w, h, data); } - public static bool UpdateTexture(CTexture texture, int w, int h, byte[] data) + public static bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data) { return _Draw.UpdateTexture(texture, w, h, data); } - public static bool UpdateOrAddTexture(ref CTexture texture, int w, int h, byte[] data) + public static bool UpdateOrAddTexture(ref CTextureRef texture, int w, int h, byte[] data) { return _Draw.UpdateOrAddTexture(ref texture, w, h, data); } - public static void RemoveTexture(ref CTexture texture) + public static void RemoveTexture(ref CTextureRef texture) { _Draw.RemoveTexture(ref texture); } - public static void DrawTexture(CTexture texture) + public static void DrawTexture(CTextureRef texture) { _Draw.DrawTexture(texture); } - public static void DrawTexture(CTexture texture, SRectF rect) + public static void DrawTexture(CTextureRef texture, SRectF rect) { _Draw.DrawTexture(texture, rect); } - public static void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false) + public static void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false) { _Draw.DrawTexture(texture, rect, color, mirrored); } - public static void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) + public static void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { _Draw.DrawTexture(texture, rect, color, bounds, mirrored); } - public static void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end) + public static void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end) { _Draw.DrawTexture(texture, rect, color, begin, end); } - public static void DrawTexture(CStatic staticBounds, CTexture texture, EAspect aspect) + public static void DrawTexture(CStatic staticBounds, CTextureRef texture, EAspect aspect) { if (texture == null) return; @@ -218,7 +218,7 @@ namespace Vocaluxe.Base texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f)); } - public static void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) + public static void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) { _Draw.DrawTextureReflection(texture, rect, color, bounds, space, height); } diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index cf99c472..96ed43d0 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -267,12 +267,12 @@ namespace Vocaluxe.Base return CTheme.GetSkinIndex(partyModeID); } - public CTexture GetSkinTexture(string textureName, int partyModeID) + public CTextureRef GetSkinTexture(string textureName, int partyModeID) { return CTheme.GetSkinTexture(textureName, partyModeID); } - public CTexture GetSkinVideoTexture(string videoName, int partyModeID) + public CTextureRef GetSkinVideoTexture(string videoName, int partyModeID) { return CTheme.GetSkinVideoTexture(videoName, partyModeID); } @@ -400,7 +400,7 @@ namespace Vocaluxe.Base CBackgroundMusic.StopPreview(); } - public CTexture GetVideoTexture() + public CTextureRef GetVideoTexture() { return CBackgroundMusic.GetVideoTexture(); } @@ -408,32 +408,32 @@ namespace Vocaluxe.Base class CBdraw : IDrawing { - public void DrawTexture(CTexture texture, SRectF rect) + public void DrawTexture(CTextureRef texture, SRectF rect) { CDraw.DrawTexture(texture, rect); } - public void DrawTexture(CTexture texture, SRectF rect, SColorF color) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color) { CDraw.DrawTexture(texture, rect, color); } - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { CDraw.DrawTexture(texture, rect, color, bounds, mirrored); } - public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight) + public void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight) { CDraw.DrawTextureReflection(texture, rect, color, bounds, reflectionSpace, reflectionHeight); } - public CTexture AddTexture(string fileName) + public CTextureRef AddTexture(string fileName) { return CDraw.AddTexture(fileName); } - public void RemoveTexture(ref CTexture texture) + public void RemoveTexture(ref CTextureRef texture) { CDraw.RemoveTexture(ref texture); } @@ -651,7 +651,7 @@ namespace Vocaluxe.Base return CProfiles.GetPlayerName(profileID, playerNum); } - public CTexture GetAvatar(int profileID) + public CTextureRef GetAvatar(int profileID) { return CProfiles.GetAvatarTextureFromProfile(profileID); } @@ -810,7 +810,7 @@ namespace Vocaluxe.Base return CVideo.Skip(videoStream, startPosition, videoGap); } - public bool GetFrame(int videoStream, ref CTexture videoTexture, float time, out float videoTime) + public bool GetFrame(int videoStream, ref CTextureRef videoTexture, float time, out float videoTime) { return CVideo.GetFrame(videoStream, ref videoTexture, time, out videoTime); } @@ -891,7 +891,7 @@ namespace Vocaluxe.Base class CBcover : ICover { - public CTexture GetNoCover() + public CTextureRef GetNoCover() { return CCover.NoCover; } @@ -899,7 +899,7 @@ namespace Vocaluxe.Base class CBdataBase : IDataBase { - public bool GetCover(string fileName, ref CTexture texture, int coverSize) + public bool GetCover(string fileName, ref CTextureRef texture, int coverSize) { return CDataBase.GetCover(fileName, ref texture, coverSize); } diff --git a/Vocaluxe/Base/CPlaylistElement.cs b/Vocaluxe/Base/CPlaylistElement.cs index 3b6588de..eec209c1 100644 --- a/Vocaluxe/Base/CPlaylistElement.cs +++ b/Vocaluxe/Base/CPlaylistElement.cs @@ -61,7 +61,7 @@ namespace Vocaluxe.Base get { return _Song != null ? _Song.Finish : 0f; } } - public CTexture Cover + public CTextureRef Cover { get { return _Song != null ? _Song.CoverTextureSmall : CCover.NoCover; } } diff --git a/Vocaluxe/Base/CProfiles.cs b/Vocaluxe/Base/CProfiles.cs index 5c05719f..8cc7d8b5 100644 --- a/Vocaluxe/Base/CProfiles.cs +++ b/Vocaluxe/Base/CProfiles.cs @@ -504,7 +504,7 @@ namespace Vocaluxe.Base #endregion profile properties #region avatar texture - public static CTexture GetAvatarTexture(int avatarID) + public static CTextureRef GetAvatarTexture(int avatarID) { if (!IsAvatarIDValid(avatarID)) return null; @@ -512,7 +512,7 @@ namespace Vocaluxe.Base return _Avatars[avatarID].Texture; } - public static CTexture GetAvatarTextureFromProfile(int profileID) + public static CTextureRef GetAvatarTextureFromProfile(int profileID) { if (!IsProfileIDValid(profileID) || _Profiles[profileID].Avatar == null) return null; diff --git a/Vocaluxe/Base/CTheme.cs b/Vocaluxe/Base/CTheme.cs index 520353a4..efbf6b67 100644 --- a/Vocaluxe/Base/CTheme.cs +++ b/Vocaluxe/Base/CTheme.cs @@ -44,7 +44,7 @@ namespace Vocaluxe.Base class CSkinElement { public string Value; - public CTexture Texture; + public CTextureRef Texture; } class CVideoSkinElement : CSkinElement @@ -554,7 +554,7 @@ namespace Vocaluxe.Base return path; } - public static CTexture GetSkinTexture(string textureName, int partyModeID) + public static CTextureRef GetSkinTexture(string textureName, int partyModeID) { int skinIndex = GetSkinIndex(partyModeID); CSkinElement sk; @@ -597,7 +597,7 @@ namespace Vocaluxe.Base return null; } - public static CTexture GetSkinVideoTexture(string videoName, int partyModeID) + public static CTextureRef GetSkinVideoTexture(string videoName, int partyModeID) { CVideoSkinElement sk = GetSkinVideo(videoName, partyModeID); if (sk == null) diff --git a/Vocaluxe/Base/CVideo.cs b/Vocaluxe/Base/CVideo.cs index 3d57cbd3..9b127eae 100644 --- a/Vocaluxe/Base/CVideo.cs +++ b/Vocaluxe/Base/CVideo.cs @@ -75,7 +75,7 @@ namespace Vocaluxe.Base return _VideoDecoder.GetLength(streamID); } - public static bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime) + public static bool GetFrame(int streamID, ref CTextureRef frame, float time, out float videoTime) { return _VideoDecoder.GetFrame(streamID, ref frame, time, out videoTime); } diff --git a/Vocaluxe/Base/CVideoPlayer.cs b/Vocaluxe/Base/CVideoPlayer.cs index 8dd47d4b..24667b3f 100644 --- a/Vocaluxe/Base/CVideoPlayer.cs +++ b/Vocaluxe/Base/CVideoPlayer.cs @@ -7,7 +7,7 @@ namespace Vocaluxe.Base { class CVideoPlayer { - private CTexture _VideoTexture; + private CTextureRef _VideoTexture; private int _VideoStream; private readonly Stopwatch _VideoTimer = new Stopwatch(); private bool _Finished; diff --git a/Vocaluxe/Base/CWebcam.cs b/Vocaluxe/Base/CWebcam.cs index af66025a..980c6f58 100644 --- a/Vocaluxe/Base/CWebcam.cs +++ b/Vocaluxe/Base/CWebcam.cs @@ -57,7 +57,7 @@ namespace Vocaluxe.Base _Webcam = null; } - public static bool GetFrame(ref CTexture tex) + public static bool GetFrame(ref CTextureRef tex) { return _Webcam != null && _Webcam.GetFrame(ref tex); } diff --git a/Vocaluxe/Base/Fonts/CFont.cs b/Vocaluxe/Base/Fonts/CFont.cs index e1408b72..a9c31e7a 100644 --- a/Vocaluxe/Base/Fonts/CFont.cs +++ b/Vocaluxe/Base/Fonts/CFont.cs @@ -85,7 +85,7 @@ namespace Vocaluxe.Base.Fonts public void DrawGlyph(char chr, float x, float y, float z, SColorF color) { - CTexture texture; + CTextureRef texture; SRectF rect; GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect); CDraw.DrawTexture(texture, rect, color); @@ -93,7 +93,7 @@ namespace Vocaluxe.Base.Fonts public void DrawGlyph(char chr, float x, float y, float z, SColorF color, float begin, float end) { - CTexture texture; + CTextureRef texture; SRectF rect; GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect); CDraw.DrawTexture(texture, rect, color, begin, end); @@ -101,7 +101,7 @@ namespace Vocaluxe.Base.Fonts public void DrawGlyphReflection(char chr, float x, float y, float z, SColorF color, float rspace, float rheight) { - CTexture texture; + CTextureRef texture; SRectF rect; GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect); CDraw.DrawTextureReflection(texture, rect, color, rect, rspace, rheight); diff --git a/Vocaluxe/Base/Fonts/CGlyph.cs b/Vocaluxe/Base/Fonts/CGlyph.cs index c694c84d..707f5aa7 100644 --- a/Vocaluxe/Base/Fonts/CGlyph.cs +++ b/Vocaluxe/Base/Fonts/CGlyph.cs @@ -31,7 +31,7 @@ namespace Vocaluxe.Base.Fonts { class CGlyph { - private CTexture _Texture; + private CTextureRef _Texture; private readonly SizeF _BoundingBox; private readonly RectangleF _DrawBounding; public readonly float MaxHeight; @@ -147,7 +147,7 @@ namespace Vocaluxe.Base.Fonts return CFonts.Height / _BoundingBox.Height; } - public void GetTextureAndRect(float x, float y, float z, out CTexture texture, out SRectF rect) + public void GetTextureAndRect(float x, float y, float z, out CTextureRef texture, out SRectF rect) { texture = _Texture; float factor = _GetFactor(); diff --git a/Vocaluxe/Lib/Database/CCoverDB.cs b/Vocaluxe/Lib/Database/CCoverDB.cs index 7723e2d4..8faf0460 100644 --- a/Vocaluxe/Lib/Database/CCoverDB.cs +++ b/Vocaluxe/Lib/Database/CCoverDB.cs @@ -63,7 +63,7 @@ namespace Vocaluxe.Lib.Database } } - public bool GetCover(string coverPath, ref CTexture tex, int maxSize) + public bool GetCover(string coverPath, ref CTextureRef tex, int maxSize) { if (_Connection == null) return false; diff --git a/Vocaluxe/Lib/Database/CResourceDB.cs b/Vocaluxe/Lib/Database/CResourceDB.cs index 4891a19e..77d9c455 100644 --- a/Vocaluxe/Lib/Database/CResourceDB.cs +++ b/Vocaluxe/Lib/Database/CResourceDB.cs @@ -66,7 +66,7 @@ namespace Vocaluxe.Lib.Database return true; } - public bool GetCreditsRessource(string fileName, ref CTexture tex) + public bool GetCreditsRessource(string fileName, ref CTextureRef tex) { if (_Connection == null) return false; diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 46cc3492..6484e36c 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -52,7 +52,7 @@ namespace Vocaluxe.Lib.Draw private VertexBuffer _VertexBuffer; private IndexBuffer _IndexBuffer; - private CTexture _BlankTexture; + private CTextureRef _BlankTexture; private readonly Queue _Vertices = new Queue(); private readonly Queue _VerticesTextures = new Queue(); @@ -466,9 +466,9 @@ namespace Vocaluxe.Lib.Draw /// Copies the current frame into a texture /// A texture holding the current frame /// - public CTexture CopyScreen() + public CTextureRef CopyScreen() { - CTexture texture = _GetNewTextureRef(_W, _H); + CTextureRef texture = _GetNewTextureRef(_W, _H); Surface backbufferSurface = _Device.GetBackBuffer(0, 0); var tex = new Texture(_Device, texture.W2, texture.H2, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed); @@ -487,7 +487,7 @@ namespace Vocaluxe.Lib.Draw /// Copies the current frame into a texture /// /// The texture in which the frame is copied to - public void CopyScreen(ref CTexture texture) + public void CopyScreen(ref CTextureRef texture) { if (!_TextureExists(texture) || texture.DataSize.Width != GetScreenWidth() || texture.DataSize.Height != GetScreenHeight()) { @@ -566,7 +566,7 @@ namespace Vocaluxe.Lib.Draw #endregion Basic Draw Methods #region Textures - protected override Texture _CreateTexture(CTexture texture, byte[] data) + protected override Texture _CreateTexture(CTextureRef texture, byte[] data) { //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 @@ -602,7 +602,7 @@ namespace Vocaluxe.Lib.Draw /// /// A byte array containing the new texture's data /// True if succeeded - public override bool UpdateTexture(CTexture texture, int w, int h, byte[] data) + public override bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data) { if (!_TextureExists(texture)) return false; @@ -626,7 +626,7 @@ namespace Vocaluxe.Lib.Draw /// Draws a texture /// /// The texture to be drawn - public void DrawTexture(CTexture texture) + public void DrawTexture(CTextureRef texture) { if (texture == null) return; @@ -638,7 +638,7 @@ namespace Vocaluxe.Lib.Draw /// /// The texture to be drawn /// A SRectF struct containing the destination coordinates - public void DrawTexture(CTexture texture, SRectF rect) + public void DrawTexture(CTextureRef texture, SRectF rect) { if (texture == null) return; @@ -652,7 +652,7 @@ namespace Vocaluxe.Lib.Draw /// A SRectF struct containing the destination coordinates /// A SColorF struct containing a color which the texture will be colored in /// True if the texture should be mirrored - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false) { if (rect.W < 1 || rect.H < 1) return; @@ -698,7 +698,7 @@ namespace Vocaluxe.Lib.Draw /// A SColorF struct containing a color which the texture will be colored in /// A SRectF struct containing which part of the texture should be drawn /// True if the texture should be mirrored - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { if (Math.Abs(rect.W) < 1 || Math.Abs(rect.H) < 1 || Math.Abs(bounds.H) < 1 || Math.Abs(bounds.W) < 1 || Math.Abs(color.A) < 0.01) @@ -775,7 +775,7 @@ namespace Vocaluxe.Lib.Draw /// A SColorF struct containing a color which the texture will be colored in /// A Value ranging from 0 to 1 containing the beginning of the texture /// A Value ranging from 0 to 1 containing the ending of the texture - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end) { if (!_TextureExists(texture)) return; @@ -819,7 +819,7 @@ namespace Vocaluxe.Lib.Draw /// A SRectF struct containing which part of the texture should be drawn /// The space between the texture and the reflection /// The height of the reflection - public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) + public void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) { if (!_TextureExists(texture)) return; diff --git a/Vocaluxe/Lib/Draw/CDrawBase.cs b/Vocaluxe/Lib/Draw/CDrawBase.cs index a068eb4c..b6b121b6 100644 --- a/Vocaluxe/Lib/Draw/CDrawBase.cs +++ b/Vocaluxe/Lib/Draw/CDrawBase.cs @@ -15,10 +15,10 @@ namespace Vocaluxe.Lib.Draw { struct STextureQueue { - public readonly CTexture Texture; + public readonly CTextureRef Texture; public readonly byte[] Data; - public STextureQueue(CTexture texture, byte[] data) + public STextureQueue(CTextureRef texture, byte[] data) { Texture = texture; Data = data; @@ -141,7 +141,7 @@ namespace Vocaluxe.Lib.Draw /// /// /// - protected abstract TTextureType _CreateTexture(CTexture texture, byte[] data); + protected abstract TTextureType _CreateTexture(CTextureRef texture, byte[] data); /// /// Creates the texture specified by the reference and fills it with the given data
@@ -150,14 +150,14 @@ namespace Vocaluxe.Lib.Draw /// /// /// - protected virtual TTextureType _CreateTexture(CTexture texture, IntPtr data) + protected virtual TTextureType _CreateTexture(CTextureRef texture, IntPtr data) { byte[] dataArray = new byte[4 * texture.DataSize.Width * texture.DataSize.Height]; Marshal.Copy(data, dataArray, 0, dataArray.Length); return _CreateTexture(texture, dataArray); } - protected CTexture _GetNewTextureRef(int origWidth, int origHeight, int dataWidth = 0, int dataHeight = 0) + protected CTextureRef _GetNewTextureRef(int origWidth, int origHeight, int dataWidth = 0, int dataHeight = 0) { Debug.Assert(origWidth > 0 && origHeight > 0); Debug.Assert(dataWidth > 0 || dataHeight <= 0); @@ -168,7 +168,7 @@ namespace Vocaluxe.Lib.Draw } Size origSize = new Size(origWidth, origHeight); Size dataSize = (dataHeight > 0) ? new Size(dataWidth, dataHeight) : origSize; - return new CTexture(id, origSize, dataSize, _CheckForNextPowerOf2(dataSize.Width), _CheckForNextPowerOf2(dataSize.Height)); + return new CTextureRef(id, origSize, dataSize, _CheckForNextPowerOf2(dataSize.Width), _CheckForNextPowerOf2(dataSize.Height)); } /// @@ -176,7 +176,7 @@ namespace Vocaluxe.Lib.Draw /// /// The texture's filepath /// A STexture object containing the added texture - public CTexture AddTexture(string texturePath) + public CTextureRef AddTexture(string texturePath) { if (!File.Exists(texturePath)) { @@ -193,7 +193,7 @@ namespace Vocaluxe.Lib.Draw CLog.LogError("Error loading Texture: " + texturePath); return null; } - CTexture s; + CTextureRef s; try { s = AddTexture(bmp, texturePath); @@ -205,7 +205,7 @@ namespace Vocaluxe.Lib.Draw return s; } - public CTexture AddTexture(Bitmap bmp) + public CTextureRef AddTexture(Bitmap bmp) { return AddTexture(bmp, ""); } @@ -216,7 +216,7 @@ namespace Vocaluxe.Lib.Draw /// The Bitmap of which the texure will be created from /// /// A STexture object containing the added texture - public CTexture AddTexture(Bitmap bmp, string texturePath) + public CTextureRef AddTexture(Bitmap bmp, string texturePath) { if (bmp.Height == 0 || bmp.Width == 0) return null; @@ -247,7 +247,7 @@ namespace Vocaluxe.Lib.Draw int w = Math.Min(bmp.Width, maxSize); int h = Math.Min(bmp.Height, maxSize); - CTexture texture = _GetNewTextureRef(bmp.Width, bmp.Height, w, h); + CTextureRef texture = _GetNewTextureRef(bmp.Width, bmp.Height, w, h); texture.TexturePath = texturePath; Bitmap bmp2 = null; @@ -285,14 +285,14 @@ namespace Vocaluxe.Lib.Draw return texture; } - public CTexture AddTexture(int w, int h, byte[] data) + public CTextureRef AddTexture(int w, int h, byte[] data) { - CTexture texture = _GetNewTextureRef(w, h); + CTextureRef texture = _GetNewTextureRef(w, h); _AddTexture(texture, data); return texture; } - private void _AddTexture(CTexture texture, byte[] data) + private void _AddTexture(CTextureRef texture, byte[] data) { TTextureType t = _CreateTexture(texture, data); lock (_Textures) @@ -301,7 +301,7 @@ namespace Vocaluxe.Lib.Draw } } - private void _AddTexture(CTexture texture, IntPtr data) + private void _AddTexture(CTextureRef texture, IntPtr data) { TTextureType t = _CreateTexture(texture, data); lock (_Textures) @@ -310,9 +310,9 @@ namespace Vocaluxe.Lib.Draw } } - public CTexture EnqueueTexture(int w, int h, byte[] data) + public CTextureRef EnqueueTexture(int w, int h, byte[] data) { - CTexture texture = _GetNewTextureRef(w, h); + CTextureRef texture = _GetNewTextureRef(w, h); lock (_Textures) { @@ -330,9 +330,9 @@ namespace Vocaluxe.Lib.Draw /// /// A byte array containing the new texture's data /// True if succeeded - public abstract bool UpdateTexture(CTexture texture, int w, int h, byte[] data); + public abstract bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data); - public bool UpdateOrAddTexture(ref CTexture texture, int w, int h, byte[] data) + public bool UpdateOrAddTexture(ref CTextureRef texture, int w, int h, byte[] data) { if (!UpdateTexture(texture, w, h, data)) { @@ -347,7 +347,7 @@ namespace Vocaluxe.Lib.Draw ///
/// The texture to check /// True if the texture exists - protected bool _TextureExists(CTexture texture) + protected bool _TextureExists(CTextureRef texture) { lock (_Textures) { @@ -356,7 +356,7 @@ namespace Vocaluxe.Lib.Draw } } - protected TTextureType _GetTexture(CTexture textureRef) + protected TTextureType _GetTexture(CTextureRef textureRef) { if (textureRef == null) return null; @@ -369,7 +369,7 @@ namespace Vocaluxe.Lib.Draw /// Removes a texture from the Vram /// /// The texture to be removed - public void RemoveTexture(ref CTexture texture) + public void RemoveTexture(ref CTextureRef texture) { if (texture == null) return; diff --git a/Vocaluxe/Lib/Draw/CDrawWinForm.cs b/Vocaluxe/Lib/Draw/CDrawWinForm.cs index 13f3ad4e..14e40292 100644 --- a/Vocaluxe/Lib/Draw/CDrawWinForm.cs +++ b/Vocaluxe/Lib/Draw/CDrawWinForm.cs @@ -44,7 +44,7 @@ namespace Vocaluxe.Lib.Draw private bool _TopMost; private Rectangle _Bounds; - private readonly Dictionary _Textures = new Dictionary(); + private readonly Dictionary _Textures = new Dictionary(); private readonly List _Bitmaps = new List(); private readonly Color _ClearColor = Color.DarkBlue; @@ -279,11 +279,11 @@ namespace Vocaluxe.Lib.Draw _G.Clear(_ClearColor); } - public CTexture CopyScreen() + public CTextureRef CopyScreen() { var bmp = new Bitmap(_Backbuffer); _Bitmaps.Add(bmp); - CTexture texture = _GetNewTexture(bmp.Width, bmp.Height); + CTextureRef texture = _GetNewTexture(bmp.Width, bmp.Height); // Add to Texture List _Textures[texture.ID] = texture; @@ -291,7 +291,7 @@ namespace Vocaluxe.Lib.Draw return texture; } - public void CopyScreen(ref CTexture texture) + public void CopyScreen(ref CTextureRef texture) { if (!_TextureExists(texture) || texture.W2 != GetScreenWidth() || texture.H2 != GetScreenHeight()) { @@ -318,11 +318,11 @@ namespace Vocaluxe.Lib.Draw public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) {} - public CTexture AddTexture(Bitmap bmp) + public CTextureRef AddTexture(Bitmap bmp) { var bmp2 = new Bitmap(bmp); _Bitmaps.Add(bmp2); - CTexture texture = _GetNewTexture(bmp.Width, bmp.Height); + CTextureRef texture = _GetNewTexture(bmp.Width, bmp.Height); // Add to Texture List _Textures[texture.ID] = texture; @@ -330,23 +330,23 @@ namespace Vocaluxe.Lib.Draw return texture; } - private CTexture _GetNewTexture(int w, int h) + private CTextureRef _GetNewTexture(int w, int h) { - return new CTexture(_Bitmaps.Count - 1, new Size(w, h), new Size(w, h)); + return new CTextureRef(_Bitmaps.Count - 1, new Size(w, h), new Size(w, h)); } - public CTexture AddTexture(string texturePath) + public CTextureRef AddTexture(string texturePath) { if (File.Exists(texturePath)) { - foreach (CTexture tex in _Textures.Values) + foreach (CTextureRef tex in _Textures.Values) { if (tex.TexturePath == texturePath) return tex; } using (var bmp = new Bitmap(texturePath)) { - CTexture texture = AddTexture(bmp); + CTextureRef texture = AddTexture(bmp); texture.TexturePath = texturePath; } } @@ -354,12 +354,12 @@ namespace Vocaluxe.Lib.Draw return null; } - private bool _TextureExists(CTexture texture) + private bool _TextureExists(CTextureRef texture) { return texture != null && _Textures.ContainsKey(texture.ID); } - public void RemoveTexture(ref CTexture texture) + public void RemoveTexture(ref CTextureRef texture) { if (_TextureExists(texture)) { @@ -369,12 +369,12 @@ namespace Vocaluxe.Lib.Draw texture = null; } - public CTexture EnqueueTexture(int w, int h, byte[] data) + public CTextureRef EnqueueTexture(int w, int h, byte[] data) { return AddTexture(w, h, data); } - public CTexture AddTexture(int w, int h, byte[] data) + public CTextureRef AddTexture(int w, int h, byte[] data) { using (var bmp = new Bitmap(w, h)) { @@ -385,7 +385,7 @@ namespace Vocaluxe.Lib.Draw } } - public bool UpdateTexture(CTexture texture, int w, int h, byte[] data) + public bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data) { if (_TextureExists(texture)) { @@ -398,7 +398,7 @@ namespace Vocaluxe.Lib.Draw return false; } - public bool UpdateOrAddTexture(ref CTexture texture, int w, int h, byte[] data) + public bool UpdateOrAddTexture(ref CTextureRef texture, int w, int h, byte[] data) { if (!UpdateTexture(texture, w, h, data)) { @@ -408,25 +408,25 @@ namespace Vocaluxe.Lib.Draw return true; } - public void DrawTexture(CTexture texture) + public void DrawTexture(CTextureRef texture) { if (texture != null) DrawTexture(texture, texture.Rect, texture.Color); } - public void DrawTexture(CTexture texture, SRectF rect) + public void DrawTexture(CTextureRef texture, SRectF rect) { if (texture != null) DrawTexture(texture, rect, texture.Color); } - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false) { if (texture != null) DrawTexture(texture, rect, color, rect, mirrored); } - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { if (!_TextureExists(texture)) return; @@ -435,9 +435,9 @@ namespace Vocaluxe.Lib.Draw coloredBitmap.Dispose(); } - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end) {} + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end) {} - public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) {} + public void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) {} public int GetTextureCount() { diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index 06449aa9..fa854c0b 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -275,9 +275,9 @@ namespace Vocaluxe.Lib.Draw GL.Ortho(-CConfig.BorderLeft, CConfig.BorderRight + CSettings.RenderW, CConfig.BorderBottom + CSettings.RenderH, -CConfig.BorderTop, CSettings.ZNear, CSettings.ZFar); } - public CTexture CopyScreen() + public CTextureRef CopyScreen() { - CTexture texture = _GetNewTextureRef(_W, _H); + CTextureRef texture = _GetNewTextureRef(_W, _H); CGLTexture t = new CGLTexture(GL.GenTexture()); GL.BindTexture(TextureTarget.Texture2D, t.Name); @@ -299,7 +299,7 @@ namespace Vocaluxe.Lib.Draw return texture; } - public void CopyScreen(ref CTexture texture) + public void CopyScreen(ref CTextureRef texture) { //Check for actual texture sizes as it may be downsized compared to OrigSize if (!_TextureExists(texture) || texture.DataSize.Width != GetScreenWidth() || texture.DataSize.Height != GetScreenHeight()) @@ -419,7 +419,7 @@ namespace Vocaluxe.Lib.Draw #region Textures #region adding - protected override CGLTexture _CreateTexture(CTexture texture, IntPtr data) + protected override CGLTexture _CreateTexture(CTextureRef texture, IntPtr data) { CGLTexture t = new CGLTexture(GL.GenTexture()); @@ -439,7 +439,7 @@ namespace Vocaluxe.Lib.Draw return t; } - protected override CGLTexture _CreateTexture(CTexture texture, byte[] data) + protected override CGLTexture _CreateTexture(CTextureRef texture, byte[] data) { CGLTexture t = new CGLTexture(GL.GenTexture()); @@ -476,7 +476,7 @@ namespace Vocaluxe.Lib.Draw #endregion adding #region updating - public override bool UpdateTexture(CTexture texture, int w, int h, byte[] data) + public override bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data) { CGLTexture t = _GetTexture(texture); if (t == null) @@ -524,21 +524,21 @@ namespace Vocaluxe.Lib.Draw #endregion updating #region drawing - public void DrawTexture(CTexture texture) + public void DrawTexture(CTextureRef texture) { if (texture == null) return; DrawTexture(texture, texture.Rect, texture.Color); } - public void DrawTexture(CTexture texture, SRectF rect) + public void DrawTexture(CTextureRef texture, SRectF rect) { if (texture == null) return; DrawTexture(texture, rect, texture.Color); } - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false) { CGLTexture t = _GetTexture(texture); if (t == null) @@ -601,7 +601,7 @@ namespace Vocaluxe.Lib.Draw GL.BindTexture(TextureTarget.Texture2D, 0); } - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { CGLTexture t = _GetTexture(texture); if (t == null) @@ -696,7 +696,7 @@ namespace Vocaluxe.Lib.Draw GL.BindTexture(TextureTarget.Texture2D, 0); } - public void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end) + public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end) { CGLTexture t = _GetTexture(texture); if (t == null) @@ -729,7 +729,7 @@ namespace Vocaluxe.Lib.Draw GL.BindTexture(TextureTarget.Texture2D, 0); } - public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) + public void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) { CGLTexture t = _GetTexture(texture); if (t == null) diff --git a/Vocaluxe/Lib/Draw/IDraw.cs b/Vocaluxe/Lib/Draw/IDraw.cs index f5e3fad3..44653e41 100644 --- a/Vocaluxe/Lib/Draw/IDraw.cs +++ b/Vocaluxe/Lib/Draw/IDraw.cs @@ -33,29 +33,29 @@ namespace Vocaluxe.Lib.Draw int GetTextureCount(); void ClearScreen(); - CTexture CopyScreen(); - void CopyScreen(ref CTexture texture); + CTextureRef CopyScreen(); + void CopyScreen(ref CTextureRef texture); void MakeScreenShot(); - CTexture AddTexture(string texturePath); - CTexture AddTexture(Bitmap bitmap); - CTexture AddTexture(int w, int h, byte[] data); - CTexture EnqueueTexture(int w, int h, byte[] data); - bool UpdateTexture(CTexture texture, int w, int h, byte[] data); - bool UpdateOrAddTexture(ref CTexture texture, int w, int h, byte[] data); - void RemoveTexture(ref CTexture texture); + CTextureRef AddTexture(string texturePath); + CTextureRef AddTexture(Bitmap bitmap); + CTextureRef AddTexture(int w, int h, byte[] data); + CTextureRef EnqueueTexture(int w, int h, byte[] data); + bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data); + bool UpdateOrAddTexture(ref CTextureRef texture, int w, int h, byte[] data); + void RemoveTexture(ref CTextureRef texture); // Basic Draw Methods 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 DrawColorReflection(SColorF color, SRectF rect, float space, float height); - void DrawTexture(CTexture texture); - void DrawTexture(CTexture texture, SRectF rect); - void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false); - void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false); - void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end); + void DrawTexture(CTextureRef texture); + void DrawTexture(CTextureRef texture, SRectF rect); + void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false); + void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false); + void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end); - void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height); + void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height); } } \ No newline at end of file diff --git a/Vocaluxe/Lib/Video/Acinerella/CDecoder.cs b/Vocaluxe/Lib/Video/Acinerella/CDecoder.cs index 9203b118..823c5290 100644 --- a/Vocaluxe/Lib/Video/Acinerella/CDecoder.cs +++ b/Vocaluxe/Lib/Video/Acinerella/CDecoder.cs @@ -102,7 +102,7 @@ namespace Vocaluxe.Lib.Video.Acinerella Finished = true; } - public bool GetFrame(ref CTexture frame, float time, out float videoTime) + public bool GetFrame(ref CTextureRef frame, float time, out float videoTime) { if (Finished) { diff --git a/Vocaluxe/Lib/Video/Acinerella/CDecoderThread.cs b/Vocaluxe/Lib/Video/Acinerella/CDecoderThread.cs index 0ff06799..ead40da9 100644 --- a/Vocaluxe/Lib/Video/Acinerella/CDecoderThread.cs +++ b/Vocaluxe/Lib/Video/Acinerella/CDecoderThread.cs @@ -193,7 +193,7 @@ namespace Vocaluxe.Lib.Video.Acinerella /// Maximum start time for frame /// Set to whether there are no more frames (stream finished, no loop, future calls will always return false) /// True if a new frame was gotten - public bool GetFrame(ref CTexture frame, ref float time, out bool finished) + public bool GetFrame(ref CTextureRef frame, ref float time, out bool finished) { bool result; if (Math.Abs(_LastShownTime - time) < _FrameDuration && frame != null) //Check 1 frame difference diff --git a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs index 27f2baeb..045a6344 100644 --- a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs +++ b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs @@ -69,7 +69,7 @@ namespace Vocaluxe.Lib.Video return _Decoder.Count; } - public bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime) + public bool GetFrame(int streamID, ref CTextureRef frame, float time, out float videoTime) { CDecoder decoder; if (_Decoder.TryGetValue(streamID, out decoder)) diff --git a/Vocaluxe/Lib/Video/IVideoDecoder.cs b/Vocaluxe/Lib/Video/IVideoDecoder.cs index b1da1feb..ebf5e575 100644 --- a/Vocaluxe/Lib/Video/IVideoDecoder.cs +++ b/Vocaluxe/Lib/Video/IVideoDecoder.cs @@ -73,7 +73,7 @@ namespace Vocaluxe.Lib.Video /// /// The actual position in s of the returned frame. Should be ~ time+VideoGap /// True if frame is valid, false: frame and videoTime might be unchanged or invalid - bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime); + bool GetFrame(int streamID, ref CTextureRef frame, float time, out float videoTime); /// /// Seeks to given position diff --git a/Vocaluxe/Lib/Webcam/CAForgeNet.cs b/Vocaluxe/Lib/Webcam/CAForgeNet.cs index 13bc4d20..723eddc0 100644 --- a/Vocaluxe/Lib/Webcam/CAForgeNet.cs +++ b/Vocaluxe/Lib/Webcam/CAForgeNet.cs @@ -201,7 +201,7 @@ namespace Vocaluxe.Lib.Webcam } } - public bool GetFrame(ref CTexture frame) + public bool GetFrame(ref CTextureRef frame) { lock (_MutexData) { diff --git a/Vocaluxe/Lib/Webcam/IWebcam.cs b/Vocaluxe/Lib/Webcam/IWebcam.cs index 98ae1804..9960b979 100644 --- a/Vocaluxe/Lib/Webcam/IWebcam.cs +++ b/Vocaluxe/Lib/Webcam/IWebcam.cs @@ -58,7 +58,7 @@ namespace Vocaluxe.Lib.Webcam /// /// /// - bool GetFrame(ref CTexture frame); + bool GetFrame(ref CTextureRef frame); /// /// Gets the last captured frame as a bitma diff --git a/Vocaluxe/Screens/CPopupScreenServerQR.cs b/Vocaluxe/Screens/CPopupScreenServerQR.cs index febb08a2..e6d4beeb 100644 --- a/Vocaluxe/Screens/CPopupScreenServerQR.cs +++ b/Vocaluxe/Screens/CPopupScreenServerQR.cs @@ -33,11 +33,11 @@ namespace Vocaluxe.Screens get { return 1; } } - private CTexture _QRServerAddress; - private CTexture _QRAndroidLink; - private CTexture _QRSymbianLink; - private CTexture _QRWebOSLink; - private CTexture _QRWindowsPhoneLink; + private CTextureRef _QRServerAddress; + private CTextureRef _QRAndroidLink; + private CTextureRef _QRSymbianLink; + private CTextureRef _QRWebOSLink; + private CTextureRef _QRWindowsPhoneLink; private const string _StaticQRServer = "StaticQRServer"; private const string _StaticQRAndroid = "StaticQRAndroid"; diff --git a/Vocaluxe/Screens/CScreenCredits.cs b/Vocaluxe/Screens/CScreenCredits.cs index 7c340a7a..0674d9d2 100644 --- a/Vocaluxe/Screens/CScreenCredits.cs +++ b/Vocaluxe/Screens/CScreenCredits.cs @@ -126,21 +126,21 @@ namespace Vocaluxe.Screens private List _Paragraphs; private List _ParagraphTexts; - private CTexture _TexLogo; - private CTexture _TexPerfectNoteStar; + private CTextureRef _TexLogo; + private CTextureRef _TexPerfectNoteStar; - private CTexture _TexRedDot; - private CTexture _TexBlueDot; + private CTextureRef _TexRedDot; + private CTextureRef _TexBlueDot; - private CTexture _TexNameBrunzel; - private CTexture _TexNameDarkice; - private CTexture _TexNameFlokuep; - private CTexture _TexNameFlamefire; - private CTexture _TexNameMesand; - private CTexture _TexNameBohning; - private CTexture _TexNameBabene03; - private CTexture _TexNamePantero; - private CTexture _TexNamePinky007; + private CTextureRef _TexNameBrunzel; + private CTextureRef _TexNameDarkice; + private CTextureRef _TexNameFlokuep; + private CTextureRef _TexNameFlamefire; + private CTextureRef _TexNameMesand; + private CTextureRef _TexNameBohning; + private CTextureRef _TexNameBabene03; + private CTextureRef _TexNamePantero; + private CTextureRef _TexNamePinky007; public override void Init() { @@ -286,12 +286,12 @@ namespace Vocaluxe.Screens return GetNewParticleEffect(numStars, partColor, rect, _TexPerfectNoteStar, partSize, EParticleType.Star); } - private void _AddNewCreditName(CTexture texture, int particleOffsetX, int particleOffsetY, bool bigParticles) + private void _AddNewCreditName(CTextureRef texture, int particleOffsetX, int particleOffsetY, bool bigParticles) { bool isRight = _CreditNames.Count % 2 == 0; int partRectSize = bigParticles ? 25 : 20; int partCount = bigParticles ? 8 : 6; - CTexture texDot = isRight ? _TexRedDot : _TexBlueDot; + CTextureRef texDot = isRight ? _TexRedDot : _TexBlueDot; CStatic image = GetNewStatic(texture, new SColorF(1, 1, 1, 1), new SRectF(-1, -1, 400, 120, -4)); diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 945e6731..31d6da1e 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -55,7 +55,7 @@ namespace Vocaluxe.Screens {"EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6"}; private readonly string[] _SelectSlideDuetPlayer = new string[] {"SelectSlideDuetPlayer1", "SelectSlideDuetPlayer2", "SelectSlideDuetPlayer3", "SelectSlideDuetPlayer4", "SelectSlideDuetPlayer5", "SelectSlideDuetPlayer6"}; - private readonly CTexture[] _OriginalPlayerAvatarTextures = new CTexture[CSettings.MaxNumPlayer]; + private readonly CTextureRef[] _OriginalPlayerAvatarTextures = new CTextureRef[CSettings.MaxNumPlayer]; private bool _SelectingKeyboardActive; private bool _SelectingFast; diff --git a/Vocaluxe/Screens/CScreenOptionsVideo.cs b/Vocaluxe/Screens/CScreenOptionsVideo.cs index a2bf330d..6e08cc85 100644 --- a/Vocaluxe/Screens/CScreenOptionsVideo.cs +++ b/Vocaluxe/Screens/CScreenOptionsVideo.cs @@ -49,7 +49,7 @@ namespace Vocaluxe.Screens private const string _TextWebcamResolution = "TextWebcamResolution"; private SWebcamConfig _Config; - private CTexture _WebcamTexture; + private CTextureRef _WebcamTexture; private int _DeviceNr; private int _CapabilityNr; diff --git a/Vocaluxe/Screens/CScreenProfiles.cs b/Vocaluxe/Screens/CScreenProfiles.cs index c8fdacfb..4a8c509d 100644 --- a/Vocaluxe/Screens/CScreenProfiles.cs +++ b/Vocaluxe/Screens/CScreenProfiles.cs @@ -64,7 +64,7 @@ namespace Vocaluxe.Screens private EEditMode _EditMode; - private CTexture _WebcamTexture; + private CTextureRef _WebcamTexture; private Bitmap _Snapshot; public override void Init() diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index ff4416f8..5918df48 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -99,9 +99,9 @@ namespace Vocaluxe.Screens private const float _Volume = 100f; private int _CurrentVideo = -1; private EAspect _VideoAspect = EAspect.Crop; - private CTexture _CurrentVideoTexture; - private CTexture _CurrentWebcamFrameTexture; - private CTexture _Background; + private CTextureRef _CurrentVideoTexture; + private CTextureRef _CurrentWebcamFrameTexture; + private CTextureRef _Background; private float _CurrentTime; private float _FinishTime; @@ -450,7 +450,7 @@ namespace Vocaluxe.Screens { if (_Active) { - CTexture background; + CTextureRef background; var aspect = EAspect.Crop; if (_CurrentVideo != -1 && CConfig.VideosInSongs == EOffOn.TR_CONFIG_ON && !_Webcam) { diff --git a/VocaluxeLib/Draw/CTexture.cs b/VocaluxeLib/Draw/CTextureRef.cs similarity index 96% rename from VocaluxeLib/Draw/CTexture.cs rename to VocaluxeLib/Draw/CTextureRef.cs index 2db8df42..4083890d 100644 --- a/VocaluxeLib/Draw/CTexture.cs +++ b/VocaluxeLib/Draw/CTextureRef.cs @@ -22,7 +22,7 @@ namespace VocaluxeLib.Draw /// /// Reference to a texture in the drawing driver /// - public class CTexture + public class CTextureRef { public readonly int ID; @@ -102,7 +102,7 @@ namespace VocaluxeLib.Draw /// Size of the data used /// Width in video memory /// Height in video memory - public CTexture(int id, Size origSize, Size dataSize, int texWidth = 0, int texHeight = 0) + public CTextureRef(int id, Size origSize, Size dataSize, int texWidth = 0, int texHeight = 0) { ID = id; _DataSize = dataSize; diff --git a/VocaluxeLib/IBasic.cs b/VocaluxeLib/IBasic.cs index ade82b4c..58537174 100644 --- a/VocaluxeLib/IBasic.cs +++ b/VocaluxeLib/IBasic.cs @@ -99,8 +99,8 @@ namespace VocaluxeLib { string GetThemeScreensPath(int partyModeID); int GetSkinIndex(int partyModeID); - CTexture GetSkinTexture(string textureName, int partyModeID); - CTexture GetSkinVideoTexture(string videoName, int partyModeID); + CTextureRef GetSkinTexture(string textureName, int partyModeID); + CTextureRef GetSkinVideoTexture(string videoName, int partyModeID); void SkinVideoResume(string videoName, int partyModeID); void SkinVideoPause(string videoName, int partyModeID); @@ -131,7 +131,7 @@ namespace VocaluxeLib void Play(); void Stop(); - CTexture GetVideoTexture(); + CTextureRef GetVideoTexture(); void LoadPreview(CSong song, float start = 0f); void PlayPreview(float start = -1f); @@ -140,13 +140,13 @@ namespace VocaluxeLib public interface IDrawing { - void DrawTexture(CTexture texture, SRectF rect); - void DrawTexture(CTexture texture, SRectF rect, SColorF color); - void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false); - void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight); + void DrawTexture(CTextureRef texture, SRectF rect); + void DrawTexture(CTextureRef texture, SRectF rect, SColorF color); + void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false); + void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight); - CTexture AddTexture(string fileName); - void RemoveTexture(ref CTexture texture); + CTextureRef AddTexture(string fileName); + void RemoveTexture(ref CTextureRef texture); void DrawColor(SColorF color, SRectF rect); void DrawColorReflection(SColorF color, SRectF rect, float space, float height); @@ -223,7 +223,7 @@ namespace VocaluxeLib CProfile[] GetProfiles(); EGameDifficulty GetDifficulty(int profileID); string GetPlayerName(int profileID, int playerNum = 0); - CTexture GetAvatar(int profileID); + CTextureRef GetAvatar(int profileID); CAvatar GetAvatarByFilename(string fileName); bool IsProfileIDValid(int profileID); bool IsGuest(int profileID); @@ -264,7 +264,7 @@ namespace VocaluxeLib { int Load(string videoFileName); bool Skip(int streamID, float startPosition, float videoGap); - bool GetFrame(int streamID, ref CTexture videoTexture, float time, out float videoTime); + bool GetFrame(int streamID, ref CTextureRef videoTexture, float time, out float videoTime); bool IsFinished(int streamID); bool Close(int streamID); void SetLoop(int streamID, bool loop = true); @@ -289,12 +289,12 @@ namespace VocaluxeLib public interface ICover { - CTexture GetNoCover(); + CTextureRef GetNoCover(); } public interface IDataBase { - bool GetCover(string fileName, ref CTexture texture, int coverSize); + bool GetCover(string fileName, ref CTextureRef texture, int coverSize); bool GetDataBaseSongInfos(string artist, string title, out int numPlayed, out DateTime dateAdded, out int highscoreID); } @@ -333,8 +333,8 @@ namespace VocaluxeLib void Load(CSong song, float start = 0f); void Stop(); void TogglePause(); - CTexture GetCover(); - CTexture GetVideoTexture(); + CTextureRef GetCover(); + CTextureRef GetVideoTexture(); bool IsPlaying(); float GetLength(); } diff --git a/VocaluxeLib/Menu/CBackground.cs b/VocaluxeLib/Menu/CBackground.cs index 67ba0755..c6647651 100644 --- a/VocaluxeLib/Menu/CBackground.cs +++ b/VocaluxeLib/Menu/CBackground.cs @@ -55,7 +55,7 @@ namespace VocaluxeLib.Menu private int _SlideShowCurrent; private readonly Stopwatch _SlideShowTimer = new Stopwatch(); - private readonly List _SlideShowTextures = new List(); + private readonly List _SlideShowTextures = new List(); public SColorF Color; @@ -223,7 +223,7 @@ namespace VocaluxeLib.Menu _Theme.Type = EBackgroundTypes.SlideShow; if (!String.IsNullOrEmpty(image)) { - CTexture texture = CBase.Drawing.AddTexture(image); + CTextureRef texture = CBase.Drawing.AddTexture(image); if (texture != null) _SlideShowTextures.Add(texture); } @@ -231,9 +231,9 @@ namespace VocaluxeLib.Menu public void RemoveSlideShowTextures() { - foreach (CTexture tex in _SlideShowTextures) + foreach (CTextureRef tex in _SlideShowTextures) { - CTexture texture = tex; + CTextureRef texture = tex; CBase.Drawing.RemoveTexture(ref texture); } _SlideShowTextures.Clear(); @@ -256,7 +256,7 @@ namespace VocaluxeLib.Menu private bool _DrawTexture() { - CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); + CTextureRef texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); if (texture != null) { var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH()); @@ -288,7 +288,7 @@ namespace VocaluxeLib.Menu _SlideShowCurrent = 0; } - CTexture texture = _SlideShowTextures[_SlideShowCurrent]; + CTextureRef texture = _SlideShowTextures[_SlideShowCurrent]; if (texture == null) return false; @@ -323,7 +323,7 @@ namespace VocaluxeLib.Menu private bool _DrawVideo() { - CTexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID); + CTextureRef videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID); if (videoTexture != null) { var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH()); @@ -338,7 +338,7 @@ namespace VocaluxeLib.Menu private bool _DrawBackgroundMusicVideo() { - CTexture videoTexture = CBase.BackgroundMusic.GetVideoTexture(); + CTextureRef videoTexture = CBase.BackgroundMusic.GetVideoTexture(); if (videoTexture != null) { var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH()); diff --git a/VocaluxeLib/Menu/CButton.cs b/VocaluxeLib/Menu/CButton.cs index 09ebdf86..52c8b7e2 100644 --- a/VocaluxeLib/Menu/CButton.cs +++ b/VocaluxeLib/Menu/CButton.cs @@ -38,8 +38,8 @@ namespace VocaluxeLib.Menu private bool _ThemeLoaded; private readonly int _PartyModeID; - public CTexture Texture; - public CTexture SelTexture; + public CTextureRef Texture; + public CTextureRef SelTexture; public SRectF Rect; public SColorF Color; public SColorF SelColor; @@ -290,7 +290,7 @@ namespace VocaluxeLib.Menu if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme && !forceDraw) return; - CTexture texture; + CTextureRef texture; if (!Selected && !Pressed || !_Enabled) { diff --git a/VocaluxeLib/Menu/CMenu.cs b/VocaluxeLib/Menu/CMenu.cs index 01fcb9ab..7cc10e7f 100644 --- a/VocaluxeLib/Menu/CMenu.cs +++ b/VocaluxeLib/Menu/CMenu.cs @@ -476,7 +476,7 @@ namespace VocaluxeLib.Menu return new CStatic(oldStatic); } - public CStatic GetNewStatic(CTexture texture, SColorF color, SRectF rect) + public CStatic GetNewStatic(CTextureRef texture, SColorF color, SRectF rect) { return new CStatic(_PartyModeID, texture, color, rect); } @@ -521,7 +521,7 @@ namespace VocaluxeLib.Menu return new CPlaylist(_PartyModeID); } - public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, CTexture texture, float size, EParticleType type) + public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, CTextureRef texture, float size, EParticleType type) { return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type); } diff --git a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs index 76015829..f5a39dee 100644 --- a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs +++ b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs @@ -683,7 +683,7 @@ namespace VocaluxeLib.Menu for (int i = 0; i < _TeamList[_CurrentTeam].Count; i++) { string name = CBase.Profiles.GetPlayerName(_TeamList[_CurrentTeam][i]); - CTexture avatar = CBase.Profiles.GetAvatar(_TeamList[_CurrentTeam][i]); + CTextureRef avatar = CBase.Profiles.GetAvatar(_TeamList[_CurrentTeam][i]); _SelectSlides[_SelectSlidePlayer].AddValue(name, avatar); } for (int i = _TeamList[_CurrentTeam].Count; i < _NumPlayerTeams[_CurrentTeam]; i++) diff --git a/VocaluxeLib/Menu/CNameSelection.cs b/VocaluxeLib/Menu/CNameSelection.cs index 3fd10b95..bb51ac13 100644 --- a/VocaluxeLib/Menu/CNameSelection.cs +++ b/VocaluxeLib/Menu/CNameSelection.cs @@ -69,9 +69,9 @@ namespace VocaluxeLib.Menu public SRectF Rect; private readonly List _Tiles; - private CTexture _TextureEmptyTile; - private CTexture _TextureTileSelected; - public CTexture TextureEmptyTile + private CTextureRef _TextureEmptyTile; + private CTextureRef _TextureTileSelected; + public CTextureRef TextureEmptyTile { get { return _TextureEmptyTile; } } diff --git a/VocaluxeLib/Menu/CParticle.cs b/VocaluxeLib/Menu/CParticle.cs index 6ab8a9c1..70dc7477 100644 --- a/VocaluxeLib/Menu/CParticle.cs +++ b/VocaluxeLib/Menu/CParticle.cs @@ -44,7 +44,7 @@ namespace VocaluxeLib.Menu #region private vars private readonly int _PartyModeID; private readonly string _TextureName; - private readonly CTexture _Texture; + private readonly CTextureRef _Texture; private SRectF _Rect; private float _Size; private SColorF _Color; @@ -127,7 +127,7 @@ namespace VocaluxeLib.Menu _Rotation = (float)(CBase.Game.GetRandomDouble() * 360.0); } - 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, + public CParticle(int partyModeID, CTextureRef texture, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize, EParticleType type) { _PartyModeID = partyModeID; @@ -300,7 +300,7 @@ namespace VocaluxeLib.Menu private SThemeParticleEffect _Theme; private bool _ThemeLoaded; - public CTexture Texture; + public CTextureRef Texture; public SColorF Color; public SRectF Rect; @@ -352,7 +352,7 @@ namespace VocaluxeLib.Menu Visible = true; } - public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, CTexture texture, float size, EParticleType type) + public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, CTextureRef texture, float size, EParticleType type) { _PartyModeID = partyModeID; _Theme = new SThemeParticleEffect(); diff --git a/VocaluxeLib/Menu/CScreenSetting.cs b/VocaluxeLib/Menu/CScreenSetting.cs index 9d377504..de1b44ee 100644 --- a/VocaluxeLib/Menu/CScreenSetting.cs +++ b/VocaluxeLib/Menu/CScreenSetting.cs @@ -126,7 +126,7 @@ namespace VocaluxeLib.Menu } } - private CTexture _GetTextureValue(string value) + private CTextureRef _GetTextureValue(string value) { return CBase.Theme.GetSkinTexture(value, _PartyModeID); } diff --git a/VocaluxeLib/Menu/CSelectSlide.cs b/VocaluxeLib/Menu/CSelectSlide.cs index 039533f4..8e508cc6 100644 --- a/VocaluxeLib/Menu/CSelectSlide.cs +++ b/VocaluxeLib/Menu/CSelectSlide.cs @@ -111,7 +111,7 @@ namespace VocaluxeLib.Menu private readonly List _ValueNames; private readonly List _ValuePartyModeIDs; - private readonly List _Textures; + private readonly List _Textures; private readonly List _ValueIndexes; private readonly List _ValueBounds = new List(); @@ -179,7 +179,7 @@ namespace VocaluxeLib.Menu MaxW = 0f; _Selected = false; - _Textures = new List(); + _Textures = new List(); _ValueIndexes = new List(); _ValueNames = new List(); _ValuePartyModeIDs = new List(); @@ -227,7 +227,7 @@ namespace VocaluxeLib.Menu MaxW = slide.MaxW; _Selected = slide._Selected; - _Textures = new List(slide._Textures); + _Textures = new List(slide._Textures); _ValueIndexes = new List(slide._ValueIndexes); _ValueNames = new List(slide._ValueNames); _ValueBounds = new List(slide._ValueBounds); @@ -534,17 +534,17 @@ namespace VocaluxeLib.Menu AddValue(value, null, _ValueIndexes.Count, partyModeID); } - public void AddValue(string value, CTexture texture) + public void AddValue(string value, CTextureRef texture) { AddValue(value, texture, _ValueIndexes.Count, _PartyModeID); } - private void _AddValue(string value, CTexture texture, int valueIndex) + private void _AddValue(string value, CTextureRef texture, int valueIndex) { AddValue(value, texture, valueIndex, _PartyModeID); } - public void AddValue(string value, CTexture texture, int valueIndex, int partyModeID) + public void AddValue(string value, CTextureRef texture, int valueIndex, int partyModeID) { _ValueNames.Add(value); _Textures.Add(texture); @@ -565,7 +565,7 @@ namespace VocaluxeLib.Menu _ValueBounds.Clear(); } - public void AddValues(string[] values, CTexture[] textures) + public void AddValues(string[] values, CTextureRef[] textures) { if (values.Length != textures.Length) return; @@ -589,7 +589,7 @@ namespace VocaluxeLib.Menu RenameValue(Selection, newName); } - public void RenameValue(int selection, string newName, CTexture newTexture = null) + public void RenameValue(int selection, string newName, CTextureRef newTexture = null) { if (selection < 0 && selection >= _ValueNames.Count) return; @@ -713,15 +713,15 @@ namespace VocaluxeLib.Menu if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme) return; - CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); - CTexture textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID); - CTexture textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID); + CTextureRef texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); + CTextureRef textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID); + CTextureRef textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID); - CTexture selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID); - CTexture selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID); - CTexture selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID); + CTextureRef selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID); + CTextureRef selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID); + CTextureRef selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID); - CTexture highlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID); + CTextureRef highlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID); if (Selected) { diff --git a/VocaluxeLib/Menu/CStatic.cs b/VocaluxeLib/Menu/CStatic.cs index 4285a25d..222ffc76 100644 --- a/VocaluxeLib/Menu/CStatic.cs +++ b/VocaluxeLib/Menu/CStatic.cs @@ -40,8 +40,8 @@ namespace VocaluxeLib.Menu return _Theme.Name; } - private CTexture _Texture; - public CTexture Texture + private CTextureRef _Texture; + public CTextureRef Texture { get { return _Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); } @@ -83,7 +83,7 @@ namespace VocaluxeLib.Menu Visible = s.Visible; } - public CStatic(int partyModeID, CTexture texture, SColorF color, SRectF rect) + public CStatic(int partyModeID, CTextureRef texture, SColorF color, SRectF rect) { _PartyModeID = partyModeID; @@ -192,7 +192,7 @@ namespace VocaluxeLib.Menu public void Draw(EAspect aspect, float scale = 1f, float zModify = 0f, bool forceDraw = false) { - CTexture texture = Texture; + CTextureRef texture = Texture; SRectF bounds = Rect.Scale(scale); SRectF rect; if (aspect != EAspect.Stretch && texture != null) diff --git a/VocaluxeLib/Menu/SingNotes/CSingNotes.cs b/VocaluxeLib/Menu/SingNotes/CSingNotes.cs index 89b915d9..a91a53dd 100644 --- a/VocaluxeLib/Menu/SingNotes/CSingNotes.cs +++ b/VocaluxeLib/Menu/SingNotes/CSingNotes.cs @@ -472,9 +472,9 @@ namespace VocaluxeLib.Menu.SingNotes var noteRect = new SRectF(rect.X + dw, rect.Y + dh, rect.W - 2 * dw, rect.H - 2 * dh, rect.Z); - CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID); - CTexture noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID); - CTexture noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID); + CTextureRef noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID); + CTextureRef noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID); + CTextureRef noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID); //Width of each of the ends (round parts) //Need 2 of them so use minimum @@ -519,9 +519,9 @@ namespace VocaluxeLib.Menu.SingNotes rect.Z ); - CTexture noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID); - CTexture noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID); - CTexture noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID); + CTextureRef noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID); + CTextureRef noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID); + CTextureRef noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID); float dx = r.H * noteBackgroundBegin.OrigAspect; if (2 * dx > r.W) @@ -614,7 +614,7 @@ namespace VocaluxeLib.Menu.SingNotes rect.Z ); - CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID); + CTextureRef noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID); float dx = r.H * noteBegin.OrigAspect; if (2 * dx > r.W) dx = r.W / 2; @@ -671,7 +671,7 @@ namespace VocaluxeLib.Menu.SingNotes _PlayerNotes[n].Color.B, _PlayerNotes[n].Color.A * _PlayerNotes[n].Alpha); - CTexture toneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID); + CTextureRef toneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID); CBase.Drawing.DrawTexture(toneHelper, drawRect, color); diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs index b33a1d16..a0efaa6f 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs @@ -37,8 +37,8 @@ namespace VocaluxeLib.Menu.SongMenu private CStatic _MedleyCalcIcon; private CStatic _MedleyTagIcon; - private CTexture _CoverBigBGTexture; - private CTexture _CoverBGTexture; + private CTextureRef _CoverBigBGTexture; + private CTextureRef _CoverBGTexture; private CText _Artist; private CText _Title; @@ -467,7 +467,7 @@ namespace VocaluxeLib.Menu.SongMenu _TextBG.Draw(); - CTexture vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null; + CTextureRef vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null; if (vidtex != null) { diff --git a/VocaluxeLib/Profile/CAvatar.cs b/VocaluxeLib/Profile/CAvatar.cs index 1daba02e..dc0325e9 100644 --- a/VocaluxeLib/Profile/CAvatar.cs +++ b/VocaluxeLib/Profile/CAvatar.cs @@ -25,10 +25,10 @@ namespace VocaluxeLib.Profile { public int ID; private readonly string _FileName = ""; - private CTexture _Texture; + private CTextureRef _Texture; private const int _MaxNameLen = 12; - public CTexture Texture + public CTextureRef Texture { get { return _Texture; } } @@ -39,11 +39,11 @@ namespace VocaluxeLib.Profile public static CAvatar GetAvatar(string fileName) { - CTexture texture = CBase.Drawing.AddTexture(fileName); + CTextureRef texture = CBase.Drawing.AddTexture(fileName); return texture == null ? null : new CAvatar(texture, fileName); } - private CAvatar(CTexture texture, string fileName, int id = -1) + private CAvatar(CTextureRef texture, string fileName, int id = -1) { _Texture = texture; _FileName = fileName; diff --git a/VocaluxeLib/Songs/CCategory.cs b/VocaluxeLib/Songs/CCategory.cs index 79f5087c..1fec7346 100644 --- a/VocaluxeLib/Songs/CCategory.cs +++ b/VocaluxeLib/Songs/CCategory.cs @@ -24,8 +24,8 @@ namespace VocaluxeLib.Songs public class CCategory { public readonly string Name; - private CTexture _CoverTextureSmall; - private CTexture _CoverTextureBig; + private CTextureRef _CoverTextureSmall; + private CTextureRef _CoverTextureBig; public readonly List Songs = new List(); public CCategory(string name) @@ -33,14 +33,14 @@ namespace VocaluxeLib.Songs Name = name; } - public CTexture CoverTextureSmall + public CTextureRef CoverTextureSmall { get { return _CoverTextureSmall; } set { _CoverTextureSmall = value; } } - public CTexture CoverTextureBig + public CTextureRef CoverTextureBig { get { return _CoverTextureBig ?? _CoverTextureSmall; } set diff --git a/VocaluxeLib/Songs/CSong.cs b/VocaluxeLib/Songs/CSong.cs index 665beac4..54024319 100644 --- a/VocaluxeLib/Songs/CSong.cs +++ b/VocaluxeLib/Songs/CSong.cs @@ -78,8 +78,8 @@ namespace VocaluxeLib.Songs public partial class CSong { - private CTexture _CoverTextureSmall; - private CTexture _CoverTextureBig; + private CTextureRef _CoverTextureSmall; + private CTextureRef _CoverTextureBig; public SMedley Medley; @@ -104,7 +104,7 @@ namespace VocaluxeLib.Songs public bool NotesLoaded { get; private set; } - public CTexture CoverTextureSmall + public CTextureRef CoverTextureSmall { get { @@ -116,7 +116,7 @@ namespace VocaluxeLib.Songs set { _CoverTextureSmall = value; } } - public CTexture CoverTextureBig + public CTextureRef CoverTextureBig { get { return _CoverTextureBig ?? _CoverTextureSmall; } set { _CoverTextureBig = value; } diff --git a/VocaluxeLib/Utils/Player/CSongPlayer.cs b/VocaluxeLib/Utils/Player/CSongPlayer.cs index 078be067..d90eb1b6 100644 --- a/VocaluxeLib/Utils/Player/CSongPlayer.cs +++ b/VocaluxeLib/Utils/Player/CSongPlayer.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; - using VocaluxeLib.Draw; using VocaluxeLib.Songs; @@ -14,7 +13,7 @@ namespace VocaluxeLib.Utils.Player private CSong _Song; private bool _VideoEnabled; private int _Video = -1; - private CTexture _CurrentVideoTexture; + private CTextureRef _CurrentVideoTexture; private CFading _VideoFading; public bool VideoEnabled @@ -41,7 +40,7 @@ namespace VocaluxeLib.Utils.Player } public bool SongHasVideo { - get { return _Song != null && File.Exists(Path.Combine(_Song.Folder,_Song.VideoFileName)); } + get { return _Song != null && File.Exists(Path.Combine(_Song.Folder, _Song.VideoFileName)); } } public string ArtistAndTitle @@ -56,7 +55,7 @@ namespace VocaluxeLib.Utils.Player } } - public CTexture Cover + public CTextureRef Cover { get { return _Song == null ? CBase.Cover.GetNoCover() : _Song.CoverTextureBig; } } @@ -66,11 +65,10 @@ namespace VocaluxeLib.Utils.Player get { return _StreamID != -1; } } - - public CSongPlayer(bool loop = false) : base(loop) { } + public CSongPlayer(bool loop = false) : base(loop) {} public CSongPlayer(CSong song, bool loop = false, float position = 0f, bool autoplay = false) - : base(Path.Combine(song.Folder,song.MP3FileName), loop, position, autoplay) + : base(Path.Combine(song.Folder, song.MP3FileName), loop, position, autoplay) { _Song = song; _LoadVideo(); @@ -82,7 +80,7 @@ namespace VocaluxeLib.Utils.Player _Song = null; } - public CTexture GetVideoTexture() + public CTextureRef GetVideoTexture() { if (_Video == -1 || _Song == null) return null; @@ -101,7 +99,7 @@ namespace VocaluxeLib.Utils.Player return null; } - public void Load(CSong song, float position = 0f, bool autoplay = false) + public void Load(CSong song, float position = 0f, bool autoplay = false) { if (song == null) return; @@ -109,7 +107,7 @@ namespace VocaluxeLib.Utils.Player Stop(); _Song = song; - + base.Load(Path.Combine(song.Folder, song.MP3FileName), position, false); _LoadVideo(); @@ -155,13 +153,10 @@ namespace VocaluxeLib.Utils.Player CBase.Video.Pause(_Video); CBase.Video.Skip(_Video, CBase.Sound.GetPosition(_StreamID) + _FadeTime, _Song.VideoGap); } - else if(_Video != -1) - { + else if (_Video != -1) CBase.Video.Resume(_Video); - } base.TogglePause(); } - private void _LoadVideo() { @@ -182,4 +177,4 @@ namespace VocaluxeLib.Utils.Player } } } -} +} \ No newline at end of file diff --git a/VocaluxeLib/VocaluxeLib.csproj b/VocaluxeLib/VocaluxeLib.csproj index a367e8e1..2ac08aae 100644 --- a/VocaluxeLib/VocaluxeLib.csproj +++ b/VocaluxeLib/VocaluxeLib.csproj @@ -100,7 +100,7 @@ - +