Remove copy constructors for structs

This commit is contained in:
Flamefire committed 2014-10-16 21:38:22 +02:00
1 parent e04480171e
commit 87f3271046
13 files changed
+53 -95

No files matched your search

+2 -1
View File
@@ -298,7 +298,8 @@ namespace Vocaluxe.Screens
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));
var particleRect = new SRectF(-1, -1, partRectSize, partRectSize, -6); var particleRect = new SRectF(-1, -1, partRectSize, partRectSize, -6);
var imgDotRect = new SRectF(particleRect) {Z = -5}; SRectF imgDotRect = particleRect;
imgDotRect.Z = -5;
CStatic imgDot = GetNewStatic(texDot, new SColorF(1, 1, 1, 1), imgDotRect); CStatic imgDot = GetNewStatic(texDot, new SColorF(1, 1, 1, 1), imgDotRect);
CParticleEffect particle = _GetStarParticles(partCount, isRight, particleRect, bigParticles); CParticleEffect particle = _GetStarParticles(partCount, isRight, particleRect, bigParticles);
+1 -1
View File
@@ -112,7 +112,7 @@ namespace VocaluxeLib.Menu
_ThemeLoaded &= success; _ThemeLoaded &= success;
} }
_Theme.Color.Color = new SColorF(Color); _Theme.Color.Color = Color;
int i = 1; int i = 1;
+6 -6
View File
@@ -141,9 +141,9 @@ namespace VocaluxeLib.Menu
SkinSelected = button._Theme.SkinSelected SkinSelected = button._Theme.SkinSelected
}; };
Rect = new SRectF(button.Rect); Rect = button.Rect;
Color = new SColorF(button.Color); Color = button.Color;
SelColor = new SColorF(button.Color); SelColor = button.Color;
Texture = button.Texture; Texture = button.Texture;
SelTexture = button.SelTexture; SelTexture = button.SelTexture;
@@ -238,9 +238,9 @@ namespace VocaluxeLib.Menu
if (_ThemeLoaded) if (_ThemeLoaded)
{ {
_Theme.Name = elementName; _Theme.Name = elementName;
_Theme.Rect = new SRectF(Rect); _Theme.Rect = Rect;
_Theme.Color.Color = new SColorF(Color); _Theme.Color.Color = Color;
_Theme.SelColor.Color = new SColorF(SelColor); _Theme.SelColor.Color = SelColor;
_Theme.Text = Text.GetTheme(); _Theme.Text = Text.GetTheme();
_Theme.SText = _SelText.GetTheme(); _Theme.SText = _SelText.GetTheme();
+2 -2
View File
@@ -169,8 +169,8 @@ namespace VocaluxeLib.Menu
{ {
_Theme.Name = elementName; _Theme.Name = elementName;
_Theme.Space = Space; _Theme.Space = Space;
_Theme.Color.Color = new SColorF(Color); _Theme.Color.Color = Color;
_Theme.MaxColor.Color = new SColorF(MaxColor); _Theme.MaxColor.Color = MaxColor;
_Theme.Rect = Rect; _Theme.Rect = Rect;
LoadTextures(); LoadTextures();
+3 -3
View File
@@ -164,9 +164,9 @@ namespace VocaluxeLib.Menu
if (_ThemeLoaded) if (_ThemeLoaded)
{ {
_Theme.Name = elementName; _Theme.Name = elementName;
_Theme.Color.Color = new SColorF(_Color); _Theme.Color.Color = _Color;
_Theme.SColor.Color = new SColorF(_ColorProcessed); _Theme.SColor.Color = _ColorProcessed;
_Theme.Rect = new SRectF(Rect); _Theme.Rect = Rect;
LoadTextures(); LoadTextures();
_Text = new CText(_X, _Y, _Z, _H, _MaxW, EAlignment.Left, EStyle.Bold, "Normal", _Color, String.Empty); _Text = new CText(_X, _Y, _Z, _H, _MaxW, EAlignment.Left, EStyle.Bold, "Normal", _Color, String.Empty);
+2 -3
View File
@@ -18,7 +18,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml;
using System.Xml.Serialization; using System.Xml.Serialization;
using VocaluxeLib.Draw; using VocaluxeLib.Draw;
using VocaluxeLib.Profile; using VocaluxeLib.Profile;
@@ -206,8 +205,8 @@ namespace VocaluxeLib.Menu
{ {
_Theme.Name = elementName; _Theme.Name = elementName;
_Theme.Rect = new SRectF(Rect); _Theme.Rect = Rect;
_Theme.ColorEmptyTile.Color = new SColorF(_ColorEmptyTile); _Theme.ColorEmptyTile.Color = _ColorEmptyTile;
LoadTextures(); LoadTextures();
} }
+2 -2
View File
@@ -420,8 +420,8 @@ namespace VocaluxeLib.Menu
if (_ThemeLoaded) if (_ThemeLoaded)
{ {
_Theme.Name = elementName; _Theme.Name = elementName;
_Theme.Rect = new SRectF(Rect); _Theme.Rect = Rect;
_Theme.Color.Color = new SColorF(Color); _Theme.Color.Color = Color;
LoadTextures(); LoadTextures();
} }
return _ThemeLoaded; return _ThemeLoaded;
+19 -19
View File
@@ -228,18 +228,18 @@ namespace VocaluxeLib.Menu
_ThemeLoaded = false; _ThemeLoaded = false;
Rect = new SRectF(slide.Rect); Rect = slide.Rect;
RectArrowLeft = new SRectF(slide.RectArrowLeft); RectArrowLeft = slide.RectArrowLeft;
RectArrowRight = new SRectF(slide.RectArrowRight); RectArrowRight = slide.RectArrowRight;
Color = new SColorF(slide.Color); Color = slide.Color;
SelColor = new SColorF(slide.SelColor); SelColor = slide.SelColor;
ColorArrow = new SColorF(slide.ColorArrow); ColorArrow = slide.ColorArrow;
SelColorArrow = new SColorF(slide.SelColorArrow); SelColorArrow = slide.SelColorArrow;
TextColor = new SColorF(slide.TextColor); TextColor = slide.TextColor;
SelTextColor = new SColorF(slide.SelTextColor); SelTextColor = slide.SelTextColor;
TextH = slide.TextH; TextH = slide.TextH;
TextRelativeX = slide.TextRelativeX; TextRelativeX = slide.TextRelativeX;
TextRelativeY = slide.TextRelativeY; TextRelativeY = slide.TextRelativeY;
@@ -389,21 +389,21 @@ namespace VocaluxeLib.Menu
if (_ThemeLoaded) if (_ThemeLoaded)
{ {
_Theme.Name = elementName; _Theme.Name = elementName;
_Theme.ArrowColor.Color = new SColorF(ColorArrow); _Theme.ArrowColor.Color = ColorArrow;
_Theme.ArrowSColor.Color = new SColorF(SelColorArrow); _Theme.ArrowSColor.Color = SelColorArrow;
_Theme.Color.Color = new SColorF(Color); _Theme.Color.Color = Color;
_Theme.HColor.Color = new SColorF(HighlightColor); _Theme.HColor.Color = HighlightColor;
_Theme.NumVisible = _NumVisible; _Theme.NumVisible = _NumVisible;
_Theme.Rect = new SRectF(Rect); _Theme.Rect = Rect;
_Theme.RectArrowLeft = new SRectF(RectArrowLeft); _Theme.RectArrowLeft = RectArrowLeft;
_Theme.RectArrowRight = new SRectF(RectArrowRight); _Theme.RectArrowRight = RectArrowRight;
_Theme.SColor.Color = new SColorF(SelColor); _Theme.SColor.Color = SelColor;
_Theme.TextColor.Color = new SColorF(TextColor); _Theme.TextColor.Color = TextColor;
_Theme.TextH = TextH; _Theme.TextH = TextH;
_Theme.TextMaxW = MaxW; _Theme.TextMaxW = MaxW;
_Theme.TextRelativeX = TextRelativeX; _Theme.TextRelativeX = TextRelativeX;
_Theme.TextRelativeY = TextRelativeY; _Theme.TextRelativeY = TextRelativeY;
_Theme.TextSColor.Color = new SColorF(SelTextColor); _Theme.TextSColor.Color = SelTextColor;
LoadTextures(); LoadTextures();
} }
+5 -5
View File
@@ -81,8 +81,8 @@ namespace VocaluxeLib.Menu
_PartyModeID = s._PartyModeID; _PartyModeID = s._PartyModeID;
_Texture = s.Texture; _Texture = s.Texture;
Color = new SColorF(s.Color); Color = s.Color;
Rect = new SRectF(s.Rect); Rect = s.Rect;
Reflection = s.Reflection; Reflection = s.Reflection;
ReflectionSpace = s.ReflectionHeight; ReflectionSpace = s.ReflectionHeight;
ReflectionHeight = s.ReflectionSpace; ReflectionHeight = s.ReflectionSpace;
@@ -130,7 +130,7 @@ namespace VocaluxeLib.Menu
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/W", ref Rect.W); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/W", ref Rect.W);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref Rect.H); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref Rect.H);
_Theme.Rect = new SRectF(Rect); _Theme.Rect = Rect;
if (xmlReader.GetValue(item + "/Color", out _Theme.Color.Name, String.Empty)) if (xmlReader.GetValue(item + "/Color", out _Theme.Color.Name, String.Empty))
_ThemeLoaded &= _Theme.Color.Get(_PartyModeID, out Color); _ThemeLoaded &= _Theme.Color.Get(_PartyModeID, out Color);
@@ -142,7 +142,7 @@ namespace VocaluxeLib.Menu
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/A", ref Color.A); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/A", ref Color.A);
} }
_Theme.Color.Color = new SColorF(Color); _Theme.Color.Color = Color;
if (xmlReader.ItemExists(item + "/Reflection")) if (xmlReader.ItemExists(item + "/Reflection"))
{ {
@@ -199,7 +199,7 @@ namespace VocaluxeLib.Menu
{ {
_Theme.Color.Get(_PartyModeID, out Color); _Theme.Color.Get(_PartyModeID, out Color);
Rect = new SRectF(_Theme.Rect); Rect = _Theme.Rect;
Reflection = _Theme.Reflection.Enabled; Reflection = _Theme.Reflection.Enabled;
if (Reflection) if (Reflection)
{ {
+3 -3
View File
@@ -268,8 +268,8 @@ namespace VocaluxeLib.Menu
_ResizeAlign = text._ResizeAlign; _ResizeAlign = text._ResizeAlign;
Font = new CFont(text.Font); //Use setter to set observer Font = new CFont(text.Font); //Use setter to set observer
Color = new SColorF(text.Color); Color = text.Color;
SelColor = new SColorF(text.SelColor); SelColor = text.SelColor;
ReflectionSpace = text.ReflectionSpace; ReflectionSpace = text.ReflectionSpace;
ReflectionHeight = text.ReflectionHeight; ReflectionHeight = text.ReflectionHeight;
@@ -300,7 +300,7 @@ namespace VocaluxeLib.Menu
_Font.Height = h; _Font.Height = h;
Color = col; Color = col;
SelColor = new SColorF(col); SelColor = col;
Text = text; Text = text;
+5 -3
View File
@@ -150,7 +150,7 @@ namespace VocaluxeLib.Menu.SingNotes
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "W", ref BarPos[player, numplayer].W); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "W", ref BarPos[player, numplayer].W);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "H", ref BarPos[player, numplayer].H); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "H", ref BarPos[player, numplayer].H);
_Theme.BarPos[i].Name = "P" + (player + 1) + "N" + (numplayer + 1); _Theme.BarPos[i].Name = "P" + (player + 1) + "N" + (numplayer + 1);
_Theme.BarPos[i].Rect = new SRectF(BarPos[player, numplayer]); _Theme.BarPos[i].Rect = BarPos[player, numplayer];
i++; i++;
} }
} }
@@ -357,7 +357,8 @@ namespace VocaluxeLib.Menu.SingNotes
if (note.EndBeat >= CBase.Game.GetRecordedBeat() && note.Hit && note.HitNote.Type == ENoteType.Golden) if (note.EndBeat >= CBase.Game.GetRecordedBeat() && note.Hit && note.HitNote.Type == ENoteType.Golden)
{ {
var re = new SRectF(rect) {W = (CBase.Game.GetMidRecordedBeat() - note.StartBeat) / beats * w}; SRectF re = rect;
re.W = (CBase.Game.GetMidRecordedBeat() - note.StartBeat) / beats * w;
_AddFlare(re, n); _AddFlare(re, n);
} }
@@ -524,7 +525,8 @@ namespace VocaluxeLib.Menu.SingNotes
private static void _DrawNoteLines(SRectF rect, SColorF color) private static void _DrawNoteLines(SRectF rect, SColorF color)
{ {
SRectF lineRect = new SRectF(rect) {H = 1.5f}; SRectF lineRect = rect;
lineRect.H = 1.5f;
for (int i = 0; i < CBase.Settings.GetNumNoteLines(); i++) for (int i = 0; i < CBase.Settings.GetNumNoteLines(); i++)
{ {
lineRect.Y = rect.Y + rect.H / CBase.Settings.GetNumNoteLines() * (i + 1); lineRect.Y = rect.Y + rect.H / CBase.Settings.GetNumNoteLines() * (i + 1);
@@ -41,19 +41,6 @@ namespace VocaluxeLib.Menu.SongMenu
//public SThemeSongMenuDreidel songMenuDreidel; //public SThemeSongMenuDreidel songMenuDreidel;
//public SThemeSongMenuList songMenuList; //public SThemeSongMenuList songMenuList;
public SThemeSongMenuTileBoard SongMenuTileBoard; public SThemeSongMenuTileBoard SongMenuTileBoard;
public SThemeSongMenu(SThemeSongMenu theme)
{
Name = theme.Name;
CoverBackground = theme.CoverBackground;
CoverBigBackground = theme.CoverBigBackground;
DuetIcon = theme.DuetIcon;
VideoIcon = theme.VideoIcon;
MedleyCalcIcon = theme.MedleyCalcIcon;
MedleyTagIcon = theme.MedleyTagIcon;
Color = new SThemeColor(theme.Color);
SongMenuTileBoard = theme.SongMenuTileBoard;
}
} }
public struct SThemeSongMenuTileBoard public struct SThemeSongMenuTileBoard
@@ -179,7 +166,7 @@ namespace VocaluxeLib.Menu.SongMenu
{ {
Visible = true; Visible = true;
_PartyModeID = partyModeID; _PartyModeID = partyModeID;
_Theme = new SThemeSongMenu(theme); _Theme = theme;
LoadTextures(); LoadTextures();
} }
@@ -192,7 +179,7 @@ namespace VocaluxeLib.Menu.SongMenu
public SThemeSongMenu GetTheme() public SThemeSongMenu GetTheme()
{ {
return new SThemeSongMenu(_Theme); return _Theme;
} }
public virtual bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader) public virtual bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader)
@@ -216,7 +203,7 @@ namespace VocaluxeLib.Menu.SongMenu
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/B", ref _ColorInternal.B); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/B", ref _ColorInternal.B);
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/A", ref _ColorInternal.A); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/A", ref _ColorInternal.A);
} }
_Theme.Color.Color = new SColorF(_ColorInternal); _Theme.Color.Color = _ColorInternal;
#region SongMenuTileBoard #region SongMenuTileBoard
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumW", ref _Theme.SongMenuTileBoard.NumW); _ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumW", ref _Theme.SongMenuTileBoard.NumW);
-31
View File
@@ -91,14 +91,6 @@ namespace VocaluxeLib
A = a; A = a;
} }
public SColorF(SColorF color)
{
R = color.R;
G = color.G;
B = color.B;
A = color.A;
}
[Pure] [Pure]
public Color AsColor() public Color AsColor()
{ {
@@ -123,12 +115,6 @@ namespace VocaluxeLib
get { return !String.IsNullOrEmpty(Name); } get { return !String.IsNullOrEmpty(Name); }
} }
public SThemeColor(SThemeColor theme)
{
Color = new SColorF(theme.Color);
Name = theme.Name;
}
public bool Get(int partyModeId, out SColorF color) public bool Get(int partyModeId, out SColorF color)
{ {
if (String.IsNullOrEmpty(Name)) if (String.IsNullOrEmpty(Name))
@@ -176,16 +162,6 @@ namespace VocaluxeLib
Rotation = 0f; Rotation = 0f;
} }
public SRectF(SRectF rect)
{
X = rect.X;
Y = rect.Y;
W = rect.W;
H = rect.H;
Z = rect.Z;
Rotation = 0f;
}
public SRectF(Rectangle rect) public SRectF(Rectangle rect)
{ {
X = rect.X; X = rect.X;
@@ -220,13 +196,6 @@ namespace VocaluxeLib
Height = height; Height = height;
Space = space; Space = space;
} }
public SReflection(SReflection refl)
{
Enabled = refl.Enabled;
Height = refl.Height;
Space = refl.Space;
}
} }
public struct SPoint3F public struct SPoint3F