Merge branch 'develop' of github.com:Vocaluxe/Vocaluxe into develop

Conflicts:
	Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs
This commit is contained in:
Florian Kuepper committed 2012-12-09 13:01:40 +01:00
commit 1e2c58fd24
6 files changed
+69 -12

No files matched your search

+35
View File
@@ -123,6 +123,11 @@ namespace Vocaluxe.Base
fo.Dispose(); fo.Dispose();
} }
public void UnloadTexture()
{
CDraw.RemoveTexture(ref Texture);
}
private float GetFactor(char chr, TextFormatFlags flags) private float GetFactor(char chr, TextFormatFlags flags)
{ {
if (CFonts.Style == EStyle.Normal) if (CFonts.Style == EStyle.Normal)
@@ -277,6 +282,15 @@ namespace Vocaluxe.Base
_htGlyphs.Add(chr, _Glyphs.Count - 1); _htGlyphs.Add(chr, _Glyphs.Count - 1);
CFonts.Height = h; CFonts.Height = h;
} }
public void UnloadAllGlyphs()
{
foreach (CGlyph glyph in _Glyphs)
{
glyph.UnloadTexture();
}
_Glyphs.Clear();
}
} }
struct SFont struct SFont
@@ -854,6 +868,27 @@ namespace Vocaluxe.Base
writer.WriteEndElement(); writer.WriteEndElement();
} }
public static void UnloadThemeFonts(string ThemeName)
{
if (_Fonts.Count == 0)
return;
int Index = 0;
while (Index < _Fonts.Count)
{
if (_Fonts[Index].IsThemeFont && _Fonts[Index].ThemeName == ThemeName)
{
_Fonts[Index].Normal.UnloadAllGlyphs();
_Fonts[Index].Italic.UnloadAllGlyphs();
_Fonts[Index].Bold.UnloadAllGlyphs();
_Fonts[Index].BoldItalic.UnloadAllGlyphs();
_Fonts.RemoveAt(Index);
}
else
Index++;
}
}
private static int GetFontIndex(string ThemeName, string FontName) private static int GetFontIndex(string ThemeName, string FontName)
{ {
if (ThemeName == String.Empty || FontName == String.Empty) if (ThemeName == String.Empty || FontName == String.Empty)
+12
View File
@@ -928,6 +928,18 @@ namespace Vocaluxe.Menu
CConfig.BackgroundMusicVolume = 0; CConfig.BackgroundMusicVolume = 0;
CConfig.SaveConfig(); CConfig.SaveConfig();
} }
else if (KeyEvent.Key == Keys.MediaNextTrack)
CBackgroundMusic.Next();
else if (KeyEvent.Key == Keys.MediaPreviousTrack)
CBackgroundMusic.Previous();
else if (KeyEvent.Key == Keys.MediaPlayPause)
{
if (CBackgroundMusic.Playing)
CBackgroundMusic.Pause();
else
CBackgroundMusic.Play();
}
CBackgroundMusic.ApplyVolume(); CBackgroundMusic.ApplyVolume();
} }
+9 -7
View File
@@ -53,6 +53,8 @@ namespace Vocaluxe.Menu
public float Alpha; public float Alpha;
public EAspect Aspect = EAspect.Stretch;
public CStatic() public CStatic()
{ {
_Theme = new SThemeStatic(); _Theme = new SThemeStatic();
@@ -213,25 +215,25 @@ namespace Vocaluxe.Menu
public void Draw() public void Draw()
{ {
Draw(1f, Rect.Z, false, false); Draw(1f, Rect.Z, Aspect, false);
} }
public void Draw(bool aspect) public void Draw(EAspect aspect)
{ {
Draw(1f, Rect.Z, aspect, false); Draw(1f, Rect.Z, aspect, false);
} }
public void Draw(float scale, bool aspect) public void Draw(float scale, EAspect aspect)
{ {
Draw(scale, Rect.Z, aspect, false); Draw(scale, Rect.Z, aspect, false);
} }
public void ForceDraw() public void ForceDraw()
{ {
Draw(1f, Rect.Z, false, true); Draw(1f, Rect.Z, Aspect, true);
} }
public void Draw(float scale, float z, bool aspect, bool ForceDraw) public void Draw(float scale, float z, EAspect aspect, bool ForceDraw)
{ {
STexture texture; STexture texture;
if (_Texture.index != -1) if (_Texture.index != -1)
@@ -248,11 +250,11 @@ namespace Vocaluxe.Menu
SRectF rect = bounds; SRectF rect = bounds;
if (aspect) if (aspect != EAspect.Stretch)
{ {
RectangleF bounds2 = new RectangleF(bounds.X, bounds.Y, bounds.W, bounds.H); RectangleF bounds2 = new RectangleF(bounds.X, bounds.Y, bounds.W, bounds.H);
RectangleF rect2 = new RectangleF(0f, 0f, texture.width, texture.height); RectangleF rect2 = new RectangleF(0f, 0f, texture.width, texture.height);
CHelper.SetRect(bounds2, ref rect2, texture.width / texture.height, EAspect.Crop); CHelper.SetRect(bounds2, ref rect2, texture.width / texture.height, aspect);
rect.X = rect2.X; rect.X = rect2.X;
rect.Y = rect2.Y; rect.Y = rect2.Y;
+5 -5
View File
@@ -408,13 +408,13 @@ namespace Vocaluxe.Menu.SongMenu
foreach (CStatic tile in _Tiles) foreach (CStatic tile in _Tiles)
{ {
if (tile.Selected && _Active) if (tile.Selected && _Active)
tile.Draw(1.2f, tile.Rect.Z - 0.1f, true, false); tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop, false);
else else
{ {
if (tile.Texture.index != _CoverTexture.index) if (tile.Texture.index != _CoverTexture.index)
tile.Draw(1f, tile.Rect.Z, true, false); tile.Draw(1f, tile.Rect.Z, EAspect.Crop, false);
else else
tile.Draw(1f, tile.Rect.Z, false, false); tile.Draw(1f, tile.Rect.Z, EAspect.Stretch, false);
} }
} }
@@ -467,9 +467,9 @@ namespace Vocaluxe.Menu.SongMenu
_TextBG.Draw(); _TextBG.Draw();
_CoverBig.Draw(1f, true); _CoverBig.Draw(1f, EAspect.Crop);
if (_vidtex.color.A < 1) if (_vidtex.color.A < 1)
_CoverBig.Draw(1f, true); _CoverBig.Draw(1f, EAspect.Crop);
if (_vidtex.index != -1 && _Video != -1) if (_vidtex.index != -1 && _Video != -1)
{ {
+2
View File
@@ -183,6 +183,7 @@ namespace Vocaluxe.Screens
_OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection; _OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection;
CTheme.UnloadSkins(); CTheme.UnloadSkins();
CFonts.UnloadThemeFonts(CConfig.Theme);
CTheme.ListSkins(); CTheme.ListSkins();
CConfig.Skin = CTheme.SkinNames[0]; CConfig.Skin = CTheme.SkinNames[0];
_OldSkin = 0; _OldSkin = 0;
@@ -205,6 +206,7 @@ namespace Vocaluxe.Screens
_OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection; _OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection;
CTheme.UnloadSkins(); CTheme.UnloadSkins();
CFonts.UnloadThemeFonts(CConfig.Theme);
CTheme.ListSkins(); CTheme.ListSkins();
CConfig.Skin = CTheme.SkinNames[0]; CConfig.Skin = CTheme.SkinNames[0];
_OldSkin = 0; _OldSkin = 0;
+6
View File
@@ -151,6 +151,7 @@ namespace Vocaluxe.Screens
public override void LoadTheme() public override void LoadTheme()
{ {
base.LoadTheme(); base.LoadTheme();
Statics[htStatics(StaticTimeLine)].Visible = false; Statics[htStatics(StaticTimeLine)].Visible = false;
Statics[htStatics(StaticTimeLineExpandedNormal)].Visible = false; Statics[htStatics(StaticTimeLineExpandedNormal)].Visible = false;
Statics[htStatics(StaticTimeLineExpandedHighlighted)].Visible = false; Statics[htStatics(StaticTimeLineExpandedHighlighted)].Visible = false;
@@ -427,6 +428,11 @@ namespace Vocaluxe.Screens
{ {
Lyrics[i].LyricStyle = CConfig.LyricStyle; Lyrics[i].LyricStyle = CConfig.LyricStyle;
} }
for (int p = 0; p < CGame.NumPlayer; p++)
{
Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Aspect = EAspect.Crop;
}
SetVisuability(); SetVisuability();
UpdateAvatars(); UpdateAvatars();