diff --git a/Output/ClientServerLib.dll b/Output/ClientServerLib.dll index 78c652b3..57a5fe2e 100644 Binary files a/Output/ClientServerLib.dll and b/Output/ClientServerLib.dll differ diff --git a/Output/Fonts/FreeSans/FreeSans.ttf b/Output/Fonts/FreeSans/FreeSans.ttf index 6de62ebf..9db95853 100644 Binary files a/Output/Fonts/FreeSans/FreeSans.ttf and b/Output/Fonts/FreeSans/FreeSans.ttf differ diff --git a/Output/Fonts/FreeSans/FreeSansBold.ttf b/Output/Fonts/FreeSans/FreeSansBold.ttf index e75685be..63644e74 100644 Binary files a/Output/Fonts/FreeSans/FreeSansBold.ttf and b/Output/Fonts/FreeSans/FreeSansBold.ttf differ diff --git a/Output/Fonts/FreeSans/FreeSansBoldOblique.ttf b/Output/Fonts/FreeSans/FreeSansBoldOblique.ttf index ec3bc02c..dde7f32f 100644 Binary files a/Output/Fonts/FreeSans/FreeSansBoldOblique.ttf and b/Output/Fonts/FreeSans/FreeSansBoldOblique.ttf differ diff --git a/Output/Fonts/FreeSans/FreeSansOblique.ttf b/Output/Fonts/FreeSans/FreeSansOblique.ttf index 733f8829..74528857 100644 Binary files a/Output/Fonts/FreeSans/FreeSansOblique.ttf and b/Output/Fonts/FreeSans/FreeSansOblique.ttf differ diff --git a/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml b/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml index 104a5e25..10c5c9e9 100644 --- a/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml +++ b/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml @@ -41,7 +41,7 @@ 0,00 - 32 + 27 769 @@ -52,8 +52,8 @@ TextSColor Left - - Center + + Center @@ -97,8 +97,8 @@ ButtonTextSColor Center - - Center + + Center @@ -146,8 +146,8 @@ ButtonTextSColor Center - - Center + + Center @@ -195,8 +195,8 @@ ButtonTextSColor Center - - Center + + Center @@ -244,8 +244,8 @@ ButtonTextSColor Center - - Center + + Center @@ -293,8 +293,8 @@ ButtonTextSColor Center - - Center + + Center @@ -342,8 +342,8 @@ ButtonTextSColor Center - - Center + + Center @@ -391,8 +391,8 @@ ButtonTextSColor Center - - Center + + Center @@ -440,8 +440,8 @@ ButtonTextSColor Center - - Center + + Center @@ -457,4 +457,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/PopupScreenVolumeControl.xml b/Output/Themes/Ambient/Screens/PopupScreenVolumeControl.xml index df32989f..324d6cc7 100644 --- a/Output/Themes/Ambient/Screens/PopupScreenVolumeControl.xml +++ b/Output/Themes/Ambient/Screens/PopupScreenVolumeControl.xml @@ -25,7 +25,7 @@ -2,00 - 32 + 27 80 @@ -36,8 +36,8 @@ TextSColor Left - - Center + + Center @@ -103,7 +103,7 @@ TextSColor - 32,00 + 27,00 -15,00 @@ -118,4 +118,4 @@ 1 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenHighscore.xml b/Output/Themes/Ambient/Screens/ScreenHighscore.xml index 356d2b0f..94bb3d88 100644 --- a/Output/Themes/Ambient/Screens/ScreenHighscore.xml +++ b/Output/Themes/Ambient/Screens/ScreenHighscore.xml @@ -52,7 +52,7 @@ 0,00 - 32 + 27 @@ -62,8 +62,8 @@ TextSColor Left - - Center + + Center @@ -81,7 +81,7 @@ 0,00 - 32 + 27 @@ -91,8 +91,8 @@ TextSColor Center - - Center + + Center @@ -110,7 +110,7 @@ 0,00 - 32 + 27 @@ -120,8 +120,8 @@ TextSColor Right - - Center + + Center @@ -139,7 +139,7 @@ 0,00 - 42 + 35 @@ -149,8 +149,8 @@ TextSColor Right - - Center + + Center @@ -178,8 +178,8 @@ TextSColor Right - - Center + + Center @@ -197,7 +197,7 @@ 0,00 - 42 + 35 @@ -207,8 +207,8 @@ TextSColor Right - - Center + + Center @@ -226,7 +226,7 @@ 0,00 - 42 + 35 @@ -236,8 +236,8 @@ TextSColor Right - - Center + + Center @@ -255,7 +255,7 @@ 0,00 - 42 + 35 @@ -265,8 +265,8 @@ TextSColor Right - - Center + + Center @@ -284,7 +284,7 @@ 0,00 - 42 + 35 @@ -294,8 +294,8 @@ TextSColor Right - - Center + + Center @@ -313,7 +313,7 @@ 0,00 - 42 + 35 @@ -323,8 +323,8 @@ TextSColor Right - - Center + + Center @@ -342,7 +342,7 @@ 0,00 - 42 + 35 @@ -352,8 +352,8 @@ TextSColor Right - - Center + + Center @@ -371,7 +371,7 @@ 0,00 - 42 + 35 @@ -381,8 +381,8 @@ TextSColor Right - - Center + + Center @@ -400,7 +400,7 @@ 0,00 - 42 + 35 @@ -410,8 +410,8 @@ TextSColor Right - - Center + + Center @@ -429,7 +429,7 @@ 0,00 - 42 + 35 @@ -439,8 +439,8 @@ TextSColor Left - - Center + + Center @@ -458,7 +458,7 @@ 0,00 - 42 + 35 @@ -468,8 +468,8 @@ TextSColor Left - - Center + + Center @@ -487,7 +487,7 @@ 0,00 - 42 + 35 @@ -497,8 +497,8 @@ TextSColor Left - - Center + + Center @@ -516,7 +516,7 @@ 0,00 - 42 + 35 @@ -526,8 +526,8 @@ TextSColor Left - - Center + + Center @@ -545,7 +545,7 @@ 0,00 - 42 + 35 @@ -555,8 +555,8 @@ TextSColor Left - - Center + + Center @@ -574,7 +574,7 @@ 0,00 - 42 + 35 @@ -584,8 +584,8 @@ TextSColor Left - - Center + + Center @@ -603,7 +603,7 @@ 0,00 - 42 + 35 @@ -613,8 +613,8 @@ TextSColor Left - - Center + + Center @@ -632,7 +632,7 @@ 0,00 - 42 + 35 @@ -642,8 +642,8 @@ TextSColor Left - - Center + + Center @@ -661,7 +661,7 @@ 0,00 - 42 + 35 @@ -671,8 +671,8 @@ TextSColor Left - - Center + + Center @@ -690,7 +690,7 @@ 0,00 - 42 + 35 @@ -700,8 +700,8 @@ TextSColor Left - - Center + + Center @@ -719,7 +719,7 @@ 0,00 - 42 + 35 @@ -729,8 +729,8 @@ TextSColor Left - - Center + + Center @@ -748,7 +748,7 @@ 0,00 - 42 + 35 @@ -758,8 +758,8 @@ TextSColor Left - - Center + + Center @@ -777,7 +777,7 @@ 0,00 - 42 + 35 @@ -787,8 +787,8 @@ TextSColor Left - - Center + + Center @@ -806,7 +806,7 @@ 0,00 - 42 + 35 @@ -816,8 +816,8 @@ TextSColor Left - - Center + + Center @@ -835,7 +835,7 @@ 0,00 - 42 + 35 @@ -845,8 +845,8 @@ TextSColor Left - - Center + + Center @@ -864,7 +864,7 @@ 0,00 - 42 + 35 @@ -874,8 +874,8 @@ TextSColor Left - - Center + + Center @@ -893,7 +893,7 @@ 0,00 - 42 + 35 @@ -903,8 +903,8 @@ TextSColor Left - - Center + + Center @@ -922,7 +922,7 @@ 0,00 - 42 + 35 @@ -932,8 +932,8 @@ TextSColor Left - - Center + + Center @@ -951,7 +951,7 @@ 0,00 - 42 + 35 @@ -961,8 +961,8 @@ TextSColor Left - - Center + + Center @@ -980,7 +980,7 @@ 0,00 - 42 + 35 @@ -990,8 +990,8 @@ TextSColor Left - - Center + + Center @@ -1009,7 +1009,7 @@ 0,00 - 42 + 35 @@ -1019,8 +1019,8 @@ TextSColor Left - - Center + + Center @@ -1038,7 +1038,7 @@ 0,00 - 42 + 35 @@ -1048,8 +1048,8 @@ TextSColor Left - - Center + + Center @@ -1067,7 +1067,7 @@ 0,00 - 42 + 35 @@ -1077,8 +1077,8 @@ TextSColor Left - - Center + + Center @@ -1096,7 +1096,7 @@ 0,00 - 42 + 35 @@ -1106,8 +1106,8 @@ TextSColor Left - - Center + + Center @@ -1125,7 +1125,7 @@ 0,00 - 42 + 35 @@ -1135,8 +1135,8 @@ TextSColor Left - - Center + + Center @@ -1154,7 +1154,7 @@ 0,00 - 42 + 35 @@ -1164,8 +1164,8 @@ TextSColor Left - - Center + + Center @@ -1183,7 +1183,7 @@ 0,00 - 42 + 35 @@ -1193,8 +1193,8 @@ TextSColor Left - - Center + + Center @@ -1212,7 +1212,7 @@ 0,00 - 42 + 35 @@ -1222,8 +1222,8 @@ TextSColor Left - - Center + + Center @@ -1241,7 +1241,7 @@ 0,00 - 42 + 35 @@ -1251,8 +1251,8 @@ TextSColor Left - - Center + + Center @@ -1270,7 +1270,7 @@ 0,00 - 42 + 35 @@ -1280,8 +1280,8 @@ TextSColor Left - - Center + + Center @@ -1300,7 +1300,7 @@ 100 1,00 1080 - 42 + 35 StaticColor @@ -1319,7 +1319,7 @@ 160 1,00 1080 - 42 + 35 StaticColor @@ -1338,7 +1338,7 @@ 220 1,00 1080 - 42 + 35 StaticColor @@ -1357,7 +1357,7 @@ 280 1,00 1080 - 42 + 35 StaticColor @@ -1376,7 +1376,7 @@ 340 1,00 1080 - 42 + 35 StaticColor @@ -1395,7 +1395,7 @@ 400 1,00 1080 - 42 + 35 StaticColor @@ -1414,7 +1414,7 @@ 460 1,00 1080 - 42 + 35 StaticColor @@ -1433,7 +1433,7 @@ 520 1,00 1080 - 42 + 35 StaticColor @@ -1452,7 +1452,7 @@ 580 1,00 1080 - 42 + 35 StaticColor @@ -1471,7 +1471,7 @@ 640 1,00 1080 - 42 + 35 StaticColor @@ -1483,4 +1483,4 @@ 250 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenLoad.xml b/Output/Themes/Ambient/Screens/ScreenLoad.xml index 6f78787d..36041ea4 100644 --- a/Output/Themes/Ambient/Screens/ScreenLoad.xml +++ b/Output/Themes/Ambient/Screens/ScreenLoad.xml @@ -1,7 +1,7 @@  - 1 + 2 Texture @@ -30,42 +30,13 @@ - - 640 - 300 - - 0,00 - - 120 - - - - Invisible - - - TextSColor - - Center - - Center - - - - Outline - - TR_PROGRAM_NAME - - - - - 60 - 653 + 655 0,00 - 32 + 27 @@ -75,8 +46,8 @@ TextSColor Left - - Center + + Center @@ -86,15 +57,44 @@ - - + + - 240 - 653 + 640 + 305 0,00 - 32 + 101 + + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + TR_PROGRAM_NAME + + + + + + + 240 + 655 + + 0,00 + + 27 @@ -104,8 +104,8 @@ TextSColor Left - - Center + + Center @@ -117,4 +117,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenMain.xml b/Output/Themes/Ambient/Screens/ScreenMain.xml index a54a9d5a..0d256cd2 100644 --- a/Output/Themes/Ambient/Screens/ScreenMain.xml +++ b/Output/Themes/Ambient/Screens/ScreenMain.xml @@ -49,9 +49,9 @@ 75 - 10 + 12 - 32 + 27 142 @@ -62,8 +62,8 @@ ButtonTextSColor Center - - Center + + Center @@ -106,9 +106,9 @@ 75 - 10 + 12 - 32 + 27 142 @@ -119,8 +119,8 @@ ButtonTextSColor Center - - Center + + Center @@ -163,9 +163,9 @@ 75 - 10 + 12 - 32 + 27 142 @@ -176,8 +176,8 @@ ButtonTextSColor Center - - Center + + Center @@ -220,9 +220,9 @@ 75 - 10 + 12 - 32 + 27 142 @@ -233,8 +233,8 @@ ButtonTextSColor Center - - Center + + Center @@ -277,9 +277,9 @@ 75 - 10 + 12 - 32 + 27 142 @@ -290,8 +290,8 @@ ButtonTextSColor Center - - Center + + Center @@ -315,4 +315,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index af45b2f7..4f81074c 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -260,7 +260,7 @@ 0,00 - 32 + 27 @@ -270,8 +270,8 @@ TextSColor Center - - Center + + Center @@ -289,7 +289,7 @@ 0,00 - 32 + 27 970 @@ -300,8 +300,8 @@ TextWarningColor Center - - Center + + Center @@ -319,7 +319,7 @@ 0,00 - 32 + 27 970 @@ -330,8 +330,8 @@ TextWarningColor Center - - Center + + Center @@ -359,8 +359,8 @@ TextSColor Center - - Center + + Center @@ -388,8 +388,8 @@ TextSColor Center - - Center + + Center @@ -417,8 +417,8 @@ TextSColor Center - - Center + + Center @@ -446,8 +446,8 @@ TextSColor Center - - Center + + Center @@ -475,8 +475,8 @@ TextSColor Center - - Center + + Center @@ -504,8 +504,8 @@ TextSColor Center - - Center + + Center @@ -538,7 +538,7 @@ 75 10 - 32 + 27 142 @@ -549,8 +549,8 @@ ButtonTextSColor Center - - Center + + Center @@ -595,7 +595,7 @@ 75 10 - 32 + 27 142 @@ -606,8 +606,8 @@ ButtonTextSColor Center - - Center + + Center @@ -685,7 +685,7 @@ TextSColor - 32,00 + 27,00 @@ -1138,7 +1138,7 @@ - 20 + 17 @@ -1305,4 +1305,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptions.xml b/Output/Themes/Ambient/Screens/ScreenOptions.xml index 9b991dc8..c31b5c68 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptions.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptions.xml @@ -36,7 +36,7 @@ 0,00 - 32 + 27 @@ -46,8 +46,8 @@ Invisible Left - - Center + + Center @@ -80,7 +80,7 @@ 75 10 - 32 + 27 142 @@ -91,8 +91,8 @@ ButtonTextSColor Center - - Center + + Center @@ -137,7 +137,7 @@ 75 10 - 32 + 27 142 @@ -148,8 +148,8 @@ ButtonTextSColor Center - - Center + + Center @@ -194,7 +194,7 @@ 75 10 - 32 + 27 142 @@ -205,8 +205,8 @@ ButtonTextSColor Center - - Center + + Center @@ -251,7 +251,7 @@ 75 10 - 32 + 27 142 @@ -262,8 +262,8 @@ ButtonTextSColor Center - - Center + + Center @@ -308,7 +308,7 @@ 75 10 - 32 + 27 142 @@ -319,8 +319,8 @@ ButtonTextSColor Center - - Center + + Center @@ -365,7 +365,7 @@ 75 10 - 32 + 27 142 @@ -376,8 +376,8 @@ ButtonTextSColor Center - - Center + + Center @@ -401,4 +401,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml b/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml index a2a8d7d6..a8cf9fee 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml @@ -132,7 +132,7 @@ 0,00 - 32 + 27 @@ -142,8 +142,8 @@ TextSColor Center - - Center + + Center @@ -161,7 +161,7 @@ 0,00 - 32 + 27 @@ -171,8 +171,8 @@ TextSColor Left - - Center + + Center @@ -190,7 +190,7 @@ 0,00 - 32 + 27 @@ -200,8 +200,8 @@ TextSColor Left - - Center + + Center @@ -219,7 +219,7 @@ 0,00 - 32 + 27 @@ -229,8 +229,8 @@ TextSColor Left - - Center + + Center @@ -248,7 +248,7 @@ 0,00 - 32 + 27 @@ -258,8 +258,8 @@ TextSColor Left - - Center + + Center @@ -277,7 +277,7 @@ 0,00 - 32 + 27 @@ -287,8 +287,8 @@ TextSColor Left - - Center + + Center @@ -306,7 +306,7 @@ 0,00 - 32 + 27 @@ -316,8 +316,8 @@ TextSColor Left - - Center + + Center @@ -350,7 +350,7 @@ 75 10 - 32 + 27 142 @@ -361,8 +361,8 @@ ButtonTextSColor Center - - Center + + Center @@ -440,7 +440,7 @@ TextSColor - 32,00 + 27,00 @@ -507,7 +507,7 @@ TextSColor - 32,00 + 27,00 @@ -574,7 +574,7 @@ TextSColor - 32,00 + 27,00 @@ -641,7 +641,7 @@ TextSColor - 32,00 + 27,00 @@ -708,7 +708,7 @@ TextSColor - 32,00 + 27,00 @@ -775,7 +775,7 @@ TextSColor - 32,00 + 27,00 @@ -788,4 +788,4 @@ 3 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml b/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml index 0276de59..b78b9b2f 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml @@ -36,7 +36,7 @@ 0,00 - 32 + 27 @@ -46,8 +46,8 @@ TextSColor Center - - Center + + Center @@ -65,7 +65,7 @@ 0,00 - 32 + 27 @@ -75,8 +75,8 @@ TextSColor Left - - Center + + Center @@ -94,7 +94,7 @@ 0,00 - 32 + 27 @@ -104,8 +104,8 @@ TextSColor Left - - Center + + Center @@ -138,7 +138,7 @@ 75 10 - 32 + 27 142 @@ -149,8 +149,8 @@ ButtonTextSColor Center - - Center + + Center @@ -228,7 +228,7 @@ TextSColor - 32,00 + 27,00 @@ -295,7 +295,7 @@ TextSColor - 32,00 + 27,00 diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml index 9362f766..14ce5e7b 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml @@ -160,11 +160,11 @@ 640 - 48 + 53 0,00 - 32 + 27 @@ -174,8 +174,8 @@ TextSColor Center - - Center + + Center @@ -189,11 +189,11 @@ 75 - 105 + 104 0,00 - 32 + 27 @@ -203,8 +203,8 @@ TextSColor Left - - Center + + Center @@ -222,7 +222,7 @@ 0,00 - 32 + 27 @@ -232,8 +232,8 @@ TextSColor Left - - Center + + Center @@ -251,7 +251,7 @@ 0,00 - 32 + 27 @@ -261,8 +261,8 @@ TextSColor Left - - Center + + Center @@ -280,7 +280,7 @@ 0,00 - 32 + 27 @@ -290,8 +290,8 @@ TextSColor Left - - Center + + Center @@ -309,7 +309,7 @@ 0,00 - 32 + 27 970 @@ -320,8 +320,8 @@ TextWarningColor Center - - Center + + Center @@ -339,7 +339,7 @@ -1,00 - 32 + 27 @@ -349,8 +349,8 @@ TextSColor Right - - Center + + Center @@ -368,7 +368,7 @@ -1,00 - 32 + 27 @@ -378,8 +378,8 @@ TextSColor Right - - Center + + Center @@ -410,9 +410,9 @@ 75 - 10 + 14 - 32 + 27 142 @@ -423,8 +423,8 @@ ButtonTextSColor Center - - Center + + Center @@ -467,9 +467,9 @@ 75 - 10 + 14 - 32 + 27 142 @@ -480,8 +480,8 @@ ButtonTextSColor Center - - Center + + Center @@ -559,7 +559,7 @@ TextSColor - 32,00 + 27 @@ -626,7 +626,7 @@ TextSColor - 32,00 + 27 @@ -693,7 +693,7 @@ TextSColor - 32,00 + 27 @@ -760,7 +760,7 @@ TextSColor - 32,00 + 27 @@ -835,4 +835,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml b/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml index 0f6bc2f8..dd87144c 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml @@ -36,7 +36,7 @@ 0,00 - 32 + 27 @@ -46,8 +46,8 @@ TextSColor Center - - Center + + Center @@ -65,7 +65,7 @@ 0,00 - 32 + 27 @@ -75,8 +75,8 @@ TextSColor Left - - Center + + Center @@ -94,7 +94,7 @@ 0,00 - 32 + 27 @@ -104,8 +104,8 @@ TextSColor Left - - Center + + Center @@ -123,7 +123,7 @@ 0,00 - 32 + 27 @@ -133,8 +133,8 @@ TextSColor Left - - Center + + Center @@ -152,7 +152,7 @@ 0,00 - 32 + 27 @@ -162,8 +162,8 @@ TextSColor Left - - Center + + Center @@ -181,7 +181,7 @@ 0,00 - 32 + 27 @@ -191,8 +191,8 @@ TextSColor Left - - Center + + Center @@ -225,7 +225,7 @@ 75 10 - 32 + 27 142 @@ -236,8 +236,8 @@ ButtonTextSColor Center - - Center + + Center @@ -315,7 +315,7 @@ TextSColor - 32,00 + 27,00 @@ -382,7 +382,7 @@ TextSColor - 32,00 + 27,00 @@ -449,7 +449,7 @@ TextSColor - 32,00 + 27,00 @@ -516,7 +516,7 @@ TextSColor - 32,00 + 27,00 @@ -583,7 +583,7 @@ TextSColor - 32,00 + 27,00 @@ -596,4 +596,4 @@ 3 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml b/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml index 8e031a75..372c93e8 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml @@ -164,7 +164,7 @@ 0,00 - 32 + 27 @@ -174,8 +174,8 @@ TextSColor Center - - Center + + Center @@ -193,7 +193,7 @@ 0,00 - 32 + 27 @@ -203,8 +203,8 @@ TextSColor Left - - Center + + Center @@ -222,7 +222,7 @@ 0,00 - 32 + 27 @@ -232,8 +232,8 @@ TextSColor Left - - Center + + Center @@ -251,7 +251,7 @@ 0,00 - 32 + 27 @@ -261,8 +261,8 @@ TextSColor Left - - Center + + Center @@ -280,7 +280,7 @@ 0,00 - 32 + 27 @@ -290,8 +290,8 @@ TextSColor Left - - Center + + Center @@ -309,7 +309,7 @@ 0,00 - 32 + 27 @@ -319,8 +319,8 @@ TextSColor Left - - Center + + Center @@ -338,7 +338,7 @@ 0,00 - 32 + 27 @@ -348,8 +348,8 @@ TextSColor Left - - Center + + Center @@ -367,7 +367,7 @@ 0,00 - 32 + 27 @@ -377,8 +377,8 @@ TextSColor Left - - Center + + Center @@ -396,7 +396,7 @@ 0,00 - 32 + 27 @@ -406,8 +406,8 @@ TextSColor Left - - Center + + Center @@ -440,7 +440,7 @@ 75 10 - 32 + 27 142 @@ -451,8 +451,8 @@ ButtonTextSColor Center - - Center + + Center @@ -530,7 +530,7 @@ TextSColor - 32,00 + 27,00 @@ -597,7 +597,7 @@ TextSColor - 32,00 + 27,00 @@ -664,7 +664,7 @@ TextSColor - 32,00 + 27,00 @@ -731,7 +731,7 @@ TextSColor - 32,00 + 27,00 @@ -798,7 +798,7 @@ TextSColor - 32,00 + 27,00 @@ -865,7 +865,7 @@ TextSColor - 32,00 + 27,00 @@ -932,7 +932,7 @@ TextSColor - 32,00 + 27,00 @@ -999,7 +999,7 @@ TextSColor - 32,00 + 27,00 @@ -1012,4 +1012,4 @@ 1 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml index b9374f8d..b6d039cc 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml @@ -100,7 +100,7 @@ 0,00 - 32 + 27 @@ -110,8 +110,8 @@ TextSColor Center - - Center + + Center @@ -129,7 +129,7 @@ 0,00 - 32 + 27 @@ -139,8 +139,8 @@ TextSColor Left - - Center + + Center @@ -158,7 +158,7 @@ 0,00 - 32 + 27 @@ -168,8 +168,8 @@ TextSColor Left - - Center + + Center @@ -187,7 +187,7 @@ 0,00 - 32 + 27 @@ -197,8 +197,8 @@ TextSColor Left - - Center + + Center @@ -216,7 +216,7 @@ 0,00 - 32 + 27 @@ -226,8 +226,8 @@ TextSColor Left - - Center + + Center @@ -245,7 +245,7 @@ 0,00 - 32 + 27 @@ -255,8 +255,8 @@ TextSColor Left - - Center + + Center @@ -274,7 +274,7 @@ 0,00 - 32 + 27 @@ -284,8 +284,8 @@ TextSColor Left - - Center + + Center @@ -318,7 +318,7 @@ 75 10 - 32 + 27 142 @@ -329,8 +329,8 @@ ButtonTextSColor Center - - Center + + Center @@ -408,7 +408,7 @@ TextSColor - 32,00 + 27,00 @@ -475,7 +475,7 @@ TextSColor - 32,00 + 27,00 @@ -542,7 +542,7 @@ TextSColor - 32,00 + 27,00 @@ -609,7 +609,7 @@ TextSColor - 32,00 + 27,00 @@ -676,7 +676,7 @@ TextSColor - 32,00 + 27,00 @@ -743,7 +743,7 @@ TextSColor - 32,00 + 27,00 @@ -756,4 +756,4 @@ 3 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenParty.xml b/Output/Themes/Ambient/Screens/ScreenParty.xml index 86df74ac..d6d81cbd 100644 --- a/Output/Themes/Ambient/Screens/ScreenParty.xml +++ b/Output/Themes/Ambient/Screens/ScreenParty.xml @@ -36,7 +36,7 @@ 0,00 - 32 + 27 @@ -46,8 +46,8 @@ TextSColor Center - - Center + + Center @@ -65,7 +65,7 @@ 0,00 - 32 + 27 @@ -75,8 +75,8 @@ TextSColor Left - - Center + + Center @@ -94,7 +94,7 @@ 0,00 - 32 + 27 @@ -104,8 +104,8 @@ TextSColor Left - - Center + + Center @@ -123,7 +123,7 @@ 0,00 - 32 + 27 @@ -133,8 +133,8 @@ TextSColor Left - - Center + + Center @@ -152,7 +152,7 @@ 0,00 - 32 + 27 @@ -162,8 +162,8 @@ TextSColor Left - - Center + + Center @@ -181,7 +181,7 @@ 0,00 - 32 + 27 @@ -191,8 +191,8 @@ TextSColor Left - - Center + + Center @@ -210,7 +210,7 @@ 0,00 - 32 + 27 @@ -220,8 +220,8 @@ TextSColor Left - - Center + + Center @@ -239,7 +239,7 @@ 0,00 - 32 + 27 @@ -249,8 +249,8 @@ TextSColor Left - - Center + + Center @@ -268,7 +268,7 @@ 0,00 - 32 + 27 600 @@ -279,8 +279,8 @@ TextSColor Center - - Center + + Center @@ -298,7 +298,7 @@ 0,00 - 32 + 27 600 @@ -309,8 +309,8 @@ TextSColor Center - - Center + + Center @@ -328,7 +328,7 @@ 0,00 - 32 + 27 600 @@ -339,8 +339,8 @@ TextSColor Center - - Center + + Center @@ -358,7 +358,7 @@ 0,00 - 32 + 27 600 @@ -369,8 +369,8 @@ TextSColor Center - - Center + + Center @@ -388,7 +388,7 @@ 0,00 - 32 + 27 600 @@ -399,8 +399,8 @@ TextSColor Center - - Center + + Center @@ -418,7 +418,7 @@ 0,00 - 32 + 27 600 @@ -429,8 +429,8 @@ TextSColor Center - - Center + + Center @@ -448,7 +448,7 @@ 0,00 - 32 + 27 600 @@ -459,8 +459,8 @@ TextSColor Center - - Center + + Center @@ -493,7 +493,7 @@ 75 10 - 32 + 27 142 @@ -504,8 +504,8 @@ ButtonTextSColor Center - - Center + + Center @@ -550,7 +550,7 @@ 75 10 - 32 + 27 142 @@ -561,8 +561,8 @@ ButtonTextSColor Center - - Center + + Center @@ -640,7 +640,7 @@ TextSColor - 32,00 + 27,00 @@ -653,4 +653,4 @@ 1 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenProfiles.xml b/Output/Themes/Ambient/Screens/ScreenProfiles.xml index 8977f56f..b996f2aa 100644 --- a/Output/Themes/Ambient/Screens/ScreenProfiles.xml +++ b/Output/Themes/Ambient/Screens/ScreenProfiles.xml @@ -132,7 +132,7 @@ 0,00 - 32 + 27 @@ -142,8 +142,8 @@ TextSColor Center - - Center + + Center @@ -161,7 +161,7 @@ 0,00 - 32 + 27 @@ -171,8 +171,8 @@ TextSColor Left - - Center + + Center @@ -190,7 +190,7 @@ 0,00 - 32 + 27 @@ -200,8 +200,8 @@ TextSColor Left - - Center + + Center @@ -219,7 +219,7 @@ 0,00 - 32 + 27 @@ -229,8 +229,8 @@ TextSColor Left - - Center + + Center @@ -248,7 +248,7 @@ 0,00 - 32 + 27 @@ -258,8 +258,8 @@ TextSColor Left - - Center + + Center @@ -277,7 +277,7 @@ 0,00 - 32 + 27 @@ -287,8 +287,8 @@ TextSColor Left - - Center + + Center @@ -321,7 +321,7 @@ 355 8 - 32 + 27 702 @@ -332,8 +332,8 @@ ButtonTextSColor Center - - Center + + Center @@ -370,7 +370,7 @@ 75 10 - 32 + 27 142 @@ -381,8 +381,8 @@ ButtonTextSColor Center - - Center + + Center @@ -427,7 +427,7 @@ 75 10 - 32 + 27 142 @@ -438,8 +438,8 @@ ButtonTextSColor Center - - Center + + Center @@ -484,7 +484,7 @@ 75 10 - 32 + 27 142 @@ -495,8 +495,8 @@ ButtonTextSColor Center - - Center + + Center @@ -541,7 +541,7 @@ 75 10 - 32 + 27 142 @@ -552,8 +552,8 @@ ButtonTextSColor Center - - Center + + Center @@ -598,7 +598,7 @@ 75 10 - 32 + 27 142 @@ -609,8 +609,8 @@ ButtonTextSColor Center - - Center + + Center @@ -655,7 +655,7 @@ 75 10 - 32 + 27 142 @@ -666,8 +666,8 @@ ButtonTextSColor Center - - Center + + Center @@ -704,7 +704,7 @@ 75 10 - 32 + 27 142 @@ -715,8 +715,8 @@ ButtonTextSColor Center - - Center + + Center @@ -753,7 +753,7 @@ 75 10 - 32 + 27 142 @@ -764,8 +764,8 @@ ButtonTextSColor Center - - Center + + Center @@ -843,7 +843,7 @@ TextSColor - 32,00 + 27,00 @@ -910,7 +910,7 @@ TextSColor - 32,00 + 27,00 @@ -977,7 +977,7 @@ TextSColor - 32,00 + 27,00 @@ -1044,7 +1044,7 @@ TextSColor - 32,00 + 27,00 @@ -1111,7 +1111,7 @@ TextSColor - 32,00 + 27,00 @@ -1124,4 +1124,4 @@ 2 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenScore.xml b/Output/Themes/Ambient/Screens/ScreenScore.xml index 34e5e35f..96b8f80d 100644 --- a/Output/Themes/Ambient/Screens/ScreenScore.xml +++ b/Output/Themes/Ambient/Screens/ScreenScore.xml @@ -1210,7 +1210,7 @@ 0,00 - 32 + 27 @@ -1220,8 +1220,8 @@ TextSColor Left - - Center + + Center @@ -1239,7 +1239,7 @@ 0,00 - 32 + 27 @@ -1249,8 +1249,8 @@ TextSColor Center - - Center + + Center @@ -1278,8 +1278,8 @@ TextSColor Center - - Center + + Center @@ -1297,7 +1297,7 @@ 0,00 - 32 + 27 @@ -1307,8 +1307,8 @@ TextSColor Center - - Center + + Center @@ -1326,7 +1326,7 @@ 0,00 - 32 + 27 @@ -1336,8 +1336,8 @@ TextSColor Center - - Center + + Center @@ -1365,8 +1365,8 @@ TextSColor Center - - Center + + Center @@ -1394,8 +1394,8 @@ TextSColor Center - - Center + + Center @@ -1413,7 +1413,7 @@ 0,00 - 32 + 27 @@ -1423,8 +1423,8 @@ TextSColor Center - - Center + + Center @@ -1442,7 +1442,7 @@ 0,00 - 32 + 27 @@ -1452,8 +1452,8 @@ TextSColor Center - - Center + + Center @@ -1481,8 +1481,8 @@ TextSColor Center - - Center + + Center @@ -1510,8 +1510,8 @@ TextSColor Center - - Center + + Center @@ -1529,7 +1529,7 @@ 0,00 - 32 + 27 @@ -1539,8 +1539,8 @@ TextSColor Center - - Center + + Center @@ -1558,7 +1558,7 @@ 0,00 - 32 + 27 @@ -1568,8 +1568,8 @@ TextSColor Center - - Center + + Center @@ -1597,8 +1597,8 @@ TextSColor Center - - Center + + Center @@ -1626,8 +1626,8 @@ TextSColor Center - - Center + + Center @@ -1645,7 +1645,7 @@ 0,00 - 32 + 27 @@ -1655,8 +1655,8 @@ TextSColor Center - - Center + + Center @@ -1674,7 +1674,7 @@ 0,00 - 32 + 27 @@ -1684,8 +1684,8 @@ TextSColor Center - - Center + + Center @@ -1713,8 +1713,8 @@ TextSColor Center - - Center + + Center @@ -1742,8 +1742,8 @@ TextSColor Center - - Center + + Center @@ -1761,7 +1761,7 @@ 0,00 - 32 + 27 @@ -1771,8 +1771,8 @@ TextSColor Center - - Center + + Center @@ -1790,7 +1790,7 @@ 0,00 - 32 + 27 @@ -1800,8 +1800,8 @@ TextSColor Center - - Center + + Center @@ -1829,8 +1829,8 @@ TextSColor Center - - Center + + Center @@ -1858,8 +1858,8 @@ TextSColor Center - - Center + + Center @@ -1877,7 +1877,7 @@ 0,00 - 32 + 27 @@ -1887,8 +1887,8 @@ TextSColor Center - - Center + + Center @@ -1906,7 +1906,7 @@ 0,00 - 32 + 27 @@ -1916,8 +1916,8 @@ TextSColor Center - - Center + + Center @@ -1945,8 +1945,8 @@ TextSColor Center - - Center + + Center @@ -1974,8 +1974,8 @@ TextSColor Center - - Center + + Center @@ -1993,7 +1993,7 @@ 0,00 - 32 + 27 @@ -2003,8 +2003,8 @@ TextSColor Center - - Center + + Center @@ -2022,7 +2022,7 @@ 0,00 - 32 + 27 160 @@ -2033,8 +2033,8 @@ TextSColor Center - - Center + + Center @@ -2062,8 +2062,8 @@ TextSColor Center - - Center + + Center @@ -2091,8 +2091,8 @@ TextSColor Center - - Center + + Center @@ -2110,7 +2110,7 @@ 0,00 - 32 + 27 @@ -2120,8 +2120,8 @@ TextSColor Center - - Center + + Center @@ -2139,7 +2139,7 @@ 0,00 - 32 + 27 160 @@ -2150,8 +2150,8 @@ TextSColor Center - - Center + + Center @@ -2179,8 +2179,8 @@ TextSColor Center - - Center + + Center @@ -2208,8 +2208,8 @@ TextSColor Center - - Center + + Center @@ -2227,7 +2227,7 @@ 0,00 - 32 + 27 @@ -2237,8 +2237,8 @@ TextSColor Center - - Center + + Center @@ -2256,7 +2256,7 @@ 0,00 - 32 + 27 160 @@ -2267,8 +2267,8 @@ TextSColor Center - - Center + + Center @@ -2296,8 +2296,8 @@ TextSColor Center - - Center + + Center @@ -2325,8 +2325,8 @@ TextSColor Center - - Center + + Center @@ -2344,7 +2344,7 @@ 0,00 - 32 + 27 @@ -2354,8 +2354,8 @@ TextSColor Center - - Center + + Center @@ -2373,7 +2373,7 @@ 0,00 - 32 + 27 160 @@ -2384,8 +2384,8 @@ TextSColor Center - - Center + + Center @@ -2413,8 +2413,8 @@ TextSColor Center - - Center + + Center @@ -2443,8 +2443,8 @@ TextSColor Center - - Center + + Center @@ -2462,7 +2462,7 @@ 0,00 - 32 + 27 160 @@ -2473,8 +2473,8 @@ TextSColor Center - - Center + + Center @@ -2492,7 +2492,7 @@ 0,00 - 32 + 27 160 @@ -2503,8 +2503,8 @@ TextSColor Center - - Center + + Center @@ -2533,8 +2533,8 @@ TextSColor Center - - Center + + Center @@ -2563,8 +2563,8 @@ TextSColor Center - - Center + + Center @@ -2582,7 +2582,7 @@ 0,00 - 32 + 27 160 @@ -2593,8 +2593,8 @@ TextSColor Center - - Center + + Center @@ -2612,7 +2612,7 @@ 0,00 - 32 + 27 160 @@ -2623,8 +2623,8 @@ TextSColor Center - - Center + + Center @@ -2653,8 +2653,8 @@ TextSColor Center - - Center + + Center @@ -2683,8 +2683,8 @@ TextSColor Center - - Center + + Center @@ -2702,7 +2702,7 @@ 0,00 - 32 + 27 160 @@ -2713,8 +2713,8 @@ TextSColor Center - - Center + + Center @@ -2732,7 +2732,7 @@ 0,00 - 32 + 27 160 @@ -2743,8 +2743,8 @@ TextSColor Center - - Center + + Center @@ -2773,8 +2773,8 @@ TextSColor Center - - Center + + Center @@ -2803,8 +2803,8 @@ TextSColor Center - - Center + + Center @@ -2822,7 +2822,7 @@ 0,00 - 32 + 27 160 @@ -2833,8 +2833,8 @@ TextSColor Center - - Center + + Center @@ -2852,7 +2852,7 @@ 0,00 - 32 + 27 160 @@ -2863,8 +2863,8 @@ TextSColor Center - - Center + + Center @@ -2893,8 +2893,8 @@ TextSColor Center - - Center + + Center @@ -2923,8 +2923,8 @@ TextSColor Center - - Center + + Center @@ -2942,7 +2942,7 @@ 0,00 - 32 + 27 160 @@ -2953,8 +2953,8 @@ TextSColor Center - - Center + + Center @@ -2972,7 +2972,7 @@ 0,00 - 32 + 27 160 @@ -2983,8 +2983,8 @@ TextSColor Center - - Center + + Center @@ -3013,8 +3013,8 @@ TextSColor Center - - Center + + Center @@ -3043,8 +3043,8 @@ TextSColor Center - - Center + + Center @@ -3062,7 +3062,7 @@ 0,00 - 32 + 27 160 @@ -3073,8 +3073,8 @@ TextSColor Center - - Center + + Center @@ -3092,7 +3092,7 @@ 0,00 - 32 + 27 160 @@ -3103,8 +3103,8 @@ TextSColor Center - - Center + + Center @@ -3133,8 +3133,8 @@ TextSColor Center - - Center + + Center @@ -3163,8 +3163,8 @@ TextSColor Center - - Center + + Center @@ -3182,7 +3182,7 @@ 0,00 - 32 + 27 160 @@ -3193,8 +3193,8 @@ TextSColor Center - - Center + + Center @@ -3212,7 +3212,7 @@ 0,00 - 32 + 27 160 @@ -3223,8 +3223,8 @@ TextSColor Center - - Center + + Center @@ -3253,8 +3253,8 @@ TextSColor Center - - Center + + Center @@ -3283,8 +3283,8 @@ TextSColor Center - - Center + + Center @@ -3302,7 +3302,7 @@ 0,00 - 32 + 27 160 @@ -3313,8 +3313,8 @@ TextSColor Center - - Center + + Center @@ -3332,7 +3332,7 @@ 0,00 - 32 + 27 160 @@ -3343,8 +3343,8 @@ TextSColor Center - - Center + + Center @@ -3373,8 +3373,8 @@ TextSColor Center - - Center + + Center @@ -3403,8 +3403,8 @@ TextSColor Center - - Center + + Center @@ -3422,7 +3422,7 @@ 0,00 - 32 + 27 160 @@ -3433,8 +3433,8 @@ TextSColor Center - - Center + + Center @@ -3452,7 +3452,7 @@ 0,00 - 32 + 27 160 @@ -3463,8 +3463,8 @@ TextSColor Center - - Center + + Center @@ -3493,8 +3493,8 @@ TextSColor Center - - Center + + Center @@ -3523,8 +3523,8 @@ TextSColor Center - - Center + + Center @@ -3542,7 +3542,7 @@ 0,00 - 32 + 27 160 @@ -3553,8 +3553,8 @@ TextSColor Center - - Center + + Center @@ -3572,7 +3572,7 @@ 0,00 - 32 + 27 160 @@ -3583,8 +3583,8 @@ TextSColor Center - - Center + + Center @@ -3613,8 +3613,8 @@ TextSColor Center - - Center + + Center @@ -3643,8 +3643,8 @@ TextSColor Center - - Center + + Center @@ -3662,7 +3662,7 @@ 0,00 - 32 + 27 160 @@ -3673,8 +3673,8 @@ TextSColor Center - - Center + + Center @@ -3692,7 +3692,7 @@ 0,00 - 32 + 27 160 @@ -3703,8 +3703,8 @@ TextSColor Center - - Center + + Center @@ -3733,8 +3733,8 @@ TextSColor Center - - Center + + Center @@ -3770,4 +3770,4 @@ Horizontal - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenSing.xml b/Output/Themes/Ambient/Screens/ScreenSing.xml index f42d5a99..abd2fae4 100644 --- a/Output/Themes/Ambient/Screens/ScreenSing.xml +++ b/Output/Themes/Ambient/Screens/ScreenSing.xml @@ -965,7 +965,7 @@ -1,00 - 32 + 27 880 @@ -976,8 +976,8 @@ TextBlack Center - - Center + + Center @@ -995,7 +995,7 @@ -1,00 - 32 + 27 @@ -1006,8 +1006,8 @@ TextSColor Left - - Center + + Center @@ -1035,8 +1035,8 @@ TextWhite Right - - Center + + Center @@ -1054,7 +1054,7 @@ -2,11 - 100 + 90 @@ -1064,8 +1064,8 @@ TextSColor Center - - Center + + Center @@ -1083,7 +1083,7 @@ -1,00 - 35 + 30 @@ -1093,8 +1093,8 @@ TextSColor Left - - Center + + Center @@ -1112,7 +1112,7 @@ -1,00 - 35 + 30 @@ -1122,8 +1122,8 @@ TextSColor Left - - Center + + Center @@ -1151,8 +1151,8 @@ TextSColor Right - - Center + + Center @@ -1183,8 +1183,8 @@ TextSColor Center - - Center + + Center @@ -1212,8 +1212,8 @@ Player1 Right - - Center + + Center @@ -1244,8 +1244,8 @@ Player1 Center - - Center + + Center @@ -1273,8 +1273,8 @@ Player2 Right - - Center + + Center @@ -1305,8 +1305,8 @@ Player2 Center - - Center + + Center @@ -1334,8 +1334,8 @@ Player1 Right - - Center + + Center @@ -1366,8 +1366,8 @@ Player1 Center - - Center + + Center @@ -1395,8 +1395,8 @@ Player2 Right - - Center + + Center @@ -1427,8 +1427,8 @@ Player2 Center - - Center + + Center @@ -1456,8 +1456,8 @@ Player3 Right - - Center + + Center @@ -1488,8 +1488,8 @@ Player3 Center - - Center + + Center @@ -1517,8 +1517,8 @@ Player1 Center - - Center + + Center @@ -1549,8 +1549,8 @@ Player1 Center - - Center + + Center @@ -1578,8 +1578,8 @@ Player2 Center - - Center + + Center @@ -1610,8 +1610,8 @@ Player2 Center - - Center + + Center @@ -1639,8 +1639,8 @@ Player3 Center - - Center + + Center @@ -1671,8 +1671,8 @@ Player3 Center - - Center + + Center @@ -1700,8 +1700,8 @@ Player4 Center - - Center + + Center @@ -1732,8 +1732,8 @@ Player4 Center - - Center + + Center @@ -1761,8 +1761,8 @@ Player1 Center - - Center + + Center @@ -1793,8 +1793,8 @@ Player1 Center - - Center + + Center @@ -1822,8 +1822,8 @@ Player2 Center - - Center + + Center @@ -1854,8 +1854,8 @@ Player2 Center - - Center + + Center @@ -1883,8 +1883,8 @@ Player3 Center - - Center + + Center @@ -1915,8 +1915,8 @@ Player3 Center - - Center + + Center @@ -1944,8 +1944,8 @@ Player4 Center - - Center + + Center @@ -1976,8 +1976,8 @@ Player4 Center - - Center + + Center @@ -2005,8 +2005,8 @@ Player5 Center - - Center + + Center @@ -2037,8 +2037,8 @@ Player5 Center - - Center + + Center @@ -2066,8 +2066,8 @@ Player1 Center - - Center + + Center @@ -2098,8 +2098,8 @@ Player1 Center - - Center + + Center @@ -2127,8 +2127,8 @@ Player2 Center - - Center + + Center @@ -2159,8 +2159,8 @@ Player2 Center - - Center + + Center @@ -2188,8 +2188,8 @@ Player3 Center - - Center + + Center @@ -2220,8 +2220,8 @@ Player3 Center - - Center + + Center @@ -2249,8 +2249,8 @@ Player4 Center - - Center + + Center @@ -2281,8 +2281,8 @@ Player4 Center - - Center + + Center @@ -2310,8 +2310,8 @@ Player5 Center - - Center + + Center @@ -2342,8 +2342,8 @@ Player5 Center - - Center + + Center @@ -2371,8 +2371,8 @@ Player6 Center - - Center + + Center @@ -2403,8 +2403,8 @@ Player6 Center - - Center + + Center @@ -2437,7 +2437,7 @@ 75 10 - 32 + 27 142 @@ -2448,8 +2448,8 @@ ButtonTextSColor Center - - Center + + Center @@ -2494,7 +2494,7 @@ 75 10 - 32 + 27 142 @@ -2505,8 +2505,8 @@ ButtonTextSColor Center - - Center + + Center @@ -2551,7 +2551,7 @@ 75 10 - 32 + 27 142 @@ -2562,8 +2562,8 @@ ButtonTextSColor Center - - Center + + Center @@ -2592,7 +2592,7 @@ 600 -1,00 1200 - 50 + 42 LyricMainColor @@ -2606,7 +2606,7 @@ 642 -1,00 1200 - 45 + 38 LyricSubColor @@ -2620,7 +2620,7 @@ 12 -1,00 1200 - 50 + 42 LyricMainColor @@ -2634,7 +2634,7 @@ 54 -1,00 1200 - 45 + 38 LyricSubColor @@ -2648,7 +2648,7 @@ 12 -1,00 1200 - 50 + 42 LyricMainColor @@ -2662,7 +2662,7 @@ 54 -1,00 1200 - 45 + 38 LyricSubColor diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 29173a81..50a1fe30 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -79,7 +79,7 @@ -2,11 - 50 + 42 350 @@ -90,8 +90,8 @@ Player1 Left - - Center + + Center @@ -109,7 +109,7 @@ -2,11 - 50 + 42 350 @@ -120,8 +120,8 @@ Player2 Left - - Center + + Center @@ -139,7 +139,7 @@ -2,11 - 50 + 42 350 @@ -150,8 +150,8 @@ Player3 Left - - Center + + Center @@ -169,7 +169,7 @@ -2,11 - 50 + 42 350 @@ -180,8 +180,8 @@ Player4 Left - - Center + + Center @@ -199,7 +199,7 @@ -2,11 - 50 + 42 350 @@ -210,8 +210,8 @@ Player5 Left - - Center + + Center @@ -229,7 +229,7 @@ -2,11 - 50 + 42 350 @@ -240,8 +240,8 @@ Player6 Left - - Center + + Center @@ -259,7 +259,7 @@ 0,00 - 32 + 27 340 @@ -270,8 +270,8 @@ TextSColor Center - - Center + + Center @@ -293,7 +293,7 @@ 0,00 - 32 + 27 830 @@ -304,8 +304,8 @@ TextSColor Center - - Center + + Center @@ -327,7 +327,7 @@ 0,00 - 32 + 27 @@ -337,8 +337,8 @@ TextSColor Right - - Center + + Center @@ -356,7 +356,7 @@ 0,00 - 32 + 27 @@ -366,8 +366,8 @@ TextSColor Left - - Center + + Center @@ -385,7 +385,7 @@ -2,11 - 40 + 34 350 @@ -396,8 +396,8 @@ TextSColor Center - - Center + + Center @@ -430,7 +430,7 @@ 40 20 - 40 + 34 60 @@ -441,8 +441,8 @@ ButtonTextSColor Center - - Center + + Center @@ -479,7 +479,7 @@ 40 20 - 40 + 34 60 @@ -490,8 +490,8 @@ ButtonTextSColor Center - - Center + + Center @@ -528,7 +528,7 @@ 40 20 - 40 + 34 60 @@ -539,8 +539,8 @@ ButtonTextSColor Center - - Center + + Center @@ -577,7 +577,7 @@ 40 20 - 40 + 34 60 @@ -588,8 +588,8 @@ ButtonTextSColor Center - - Center + + Center @@ -626,7 +626,7 @@ 40 20 - 40 + 34 60 @@ -637,8 +637,8 @@ ButtonTextSColor Center - - Center + + Center @@ -675,7 +675,7 @@ 40 20 - 40 + 34 60 @@ -686,8 +686,8 @@ ButtonTextSColor Center - - Center + + Center @@ -724,7 +724,7 @@ 180 5 - 30 + 25 350 @@ -735,8 +735,8 @@ ButtonTextSColor Center - - Center + + Center @@ -773,7 +773,7 @@ 180 5 - 30 + 25 350 @@ -784,8 +784,8 @@ ButtonTextSColor Center - - Center + + Center @@ -822,7 +822,7 @@ 180 5 - 30 + 25 350 @@ -833,8 +833,8 @@ ButtonTextSColor Center - - Center + + Center @@ -871,7 +871,7 @@ 180 5 - 30 + 25 350 @@ -882,8 +882,8 @@ ButtonTextSColor Center - - Center + + Center @@ -920,7 +920,7 @@ 180 5 - 30 + 25 350 @@ -931,8 +931,8 @@ ButtonTextSColor Center - - Center + + Center @@ -969,7 +969,7 @@ 180 5 - 30 + 25 350 @@ -980,8 +980,8 @@ ButtonTextSColor Center - - Center + + Center @@ -1018,7 +1018,7 @@ 180 5 - 30 + 25 350 @@ -1029,8 +1029,8 @@ ButtonTextSColor Center - - Center + + Center @@ -1067,7 +1067,7 @@ 180 5 - 30 + 25 350 @@ -1078,8 +1078,8 @@ ButtonTextSColor Center - - Center + + Center @@ -1116,7 +1116,7 @@ 180 5 - 30 + 25 350 @@ -1127,8 +1127,8 @@ ButtonTextSColor Center - - Center + + Center @@ -1165,7 +1165,7 @@ 75 10 - 32 + 27 142 @@ -1176,8 +1176,8 @@ ButtonTextSColor Center - - Center + + Center @@ -1222,7 +1222,7 @@ 180 5 - 30 + 25 350 @@ -1233,8 +1233,8 @@ ButtonTextSColor Center - - Center + + Center @@ -1271,7 +1271,7 @@ 180 5 - 30 + 25 350 @@ -1282,8 +1282,8 @@ ButtonTextSColor Center - - Center + + Center @@ -1353,7 +1353,7 @@ TextSColor - 30,00 + 25,00 @@ -1420,7 +1420,7 @@ TextSColor - 30,00 + 25,00 @@ -1487,7 +1487,7 @@ TextSColor - 30,00 + 25,00 @@ -1554,7 +1554,7 @@ TextSColor - 30,00 + 25,00 @@ -1618,7 +1618,7 @@ -1,01 - 46 + 39 340 @@ -1629,8 +1629,8 @@ TextSColor Center - - Center + + Center @@ -1648,7 +1648,7 @@ -1,01 - 38 + 32 340 @@ -1659,8 +1659,8 @@ TextSColor Center - - Center + + Center @@ -1689,8 +1689,8 @@ TextSColor Center - - Center + + Center @@ -1826,7 +1826,7 @@ -1,01 - 24 + 22 235 @@ -1837,8 +1837,8 @@ TextSColor Left - - Top + + Top @@ -1952,7 +1952,7 @@ TextSColor - 24,00 + 22,00 25,00 @@ -1975,7 +1975,7 @@ 45 -1,01 220 - 30 + 25 ButtonColor @@ -1987,7 +1987,7 @@ 0 0 - 30 + 25 220 @@ -1998,8 +1998,8 @@ ButtonTextSColor Left - - Center + + Center @@ -2036,7 +2036,7 @@ 180 5 - 30 + 25 350 @@ -2047,8 +2047,8 @@ ButtonTextSColor Center - - Center + + Center @@ -2085,7 +2085,7 @@ 180 5 - 30 + 25 350 @@ -2096,8 +2096,8 @@ ButtonTextSColor Center - - Center + + Center @@ -2134,7 +2134,7 @@ 180 5 - 30 + 25 350 @@ -2145,8 +2145,8 @@ ButtonTextSColor Center - - Center + + Center @@ -2183,7 +2183,7 @@ 180 5 - 30 + 25 350 @@ -2194,8 +2194,8 @@ ButtonTextSColor Center - - Center + + Center @@ -2212,4 +2212,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Changelog/Changelog_ScreenLoading.txt b/Output/Themes/Changelog/Changelog_ScreenLoading.txt new file mode 100644 index 00000000..0bca1ed6 --- /dev/null +++ b/Output/Themes/Changelog/Changelog_ScreenLoading.txt @@ -0,0 +1,7 @@ +ScreenLoading + +++++++++++ +Version 2: + +Rename: -> +++++++++++ \ No newline at end of file diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index d52a6e97..c4f40329 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -22,7 +22,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -using Vocaluxe.Base; using VocaluxeLib; using VocaluxeLib.Songs; @@ -496,138 +495,138 @@ namespace Vocaluxe.Base } } } -} -class CPlaylistElement -{ - private readonly CSong _Song; - - private readonly int _SongID; - public int SongID + class CPlaylistElement { - get { return _SongID; } - } + private readonly CSong _Song; - private string _MusicFilePath = String.Empty; - - public string MusicFilePath - { - get + private readonly int _SongID; + public int SongID { - if (_Song != null) - return _Song.GetMP3(); - - return _MusicFilePath; + get { return _SongID; } } - set { _MusicFilePath = value; } - } + private string _MusicFilePath = String.Empty; - public string VideoFilePath - { - get + public string MusicFilePath { - if (_Song != null) - return _Song.GetVideo(); + get + { + if (_Song != null) + return _Song.GetMP3(); - return string.Empty; + return _MusicFilePath; + } + + set { _MusicFilePath = value; } } - } - public string Title - { - get + public string VideoFilePath { - if (_Song != null) - return _Song.Title; + get + { + if (_Song != null) + return _Song.GetVideo(); - return ""; + return string.Empty; + } } - } - public string Artist - { - get + public string Title { - if (_Song != null) - return _Song.Artist; + get + { + if (_Song != null) + return _Song.Title; - return ""; + return ""; + } } - } - public float Start - { - get + public string Artist { - if (_Song != null) - return _Song.Start; + get + { + if (_Song != null) + return _Song.Artist; - return 0f; + return ""; + } } - } - public float Finish - { - get + public float Start { - if (_Song != null) - return _Song.Finish; + get + { + if (_Song != null) + return _Song.Start; - return 0f; + return 0f; + } } - } - public STexture Cover - { - get + public float Finish { - if (_Song != null) - return _Song.CoverTextureSmall; + get + { + if (_Song != null) + return _Song.Finish; - return CCover.NoCover; + return 0f; + } } - } - public float VideoGap - { - get + public STexture Cover { - if (_Song != null) - return _Song.VideoGap; + get + { + if (_Song != null) + return _Song.CoverTextureSmall; - return 0; + return CCover.NoCover; + } } - } - public bool Duet - { - get + public float VideoGap { - if (_Song != null) - return _Song.IsDuet; + get + { + if (_Song != null) + return _Song.VideoGap; - return false; + return 0; + } } - } - public CPlaylistElement(CSong song) - { - MusicFilePath = string.Empty; - _SongID = song.ID; + public bool Duet + { + get + { + if (_Song != null) + return _Song.IsDuet; - _Song = song; - } + return false; + } + } - public CPlaylistElement(string filePath) - { - MusicFilePath = filePath; - _SongID = -1; - } + public CPlaylistElement(CSong song) + { + MusicFilePath = string.Empty; + _SongID = song.ID; - public CPlaylistElement() - { - MusicFilePath = string.Empty; - _SongID = -1; + _Song = song; + } + + public CPlaylistElement(string filePath) + { + MusicFilePath = filePath; + _SongID = -1; + } + + public CPlaylistElement() + { + MusicFilePath = string.Empty; + _SongID = -1; + } } } \ No newline at end of file diff --git a/Vocaluxe/Base/CDataBase.cs b/Vocaluxe/Base/CDataBase.cs index ce58f110..35deea77 100644 --- a/Vocaluxe/Base/CDataBase.cs +++ b/Vocaluxe/Base/CDataBase.cs @@ -950,7 +950,7 @@ namespace Vocaluxe.Base reader.Read(); byte[] data = _GetBytes(reader); reader.Dispose(); - tex = CDraw.EnqueueTexture(w, h, ref data); + tex = CDraw.EnqueueTexture(w, h, data); return true; } } @@ -1000,7 +1000,7 @@ namespace Vocaluxe.Base origin.Dispose(); } - tex = CDraw.EnqueueTexture(w, h, ref data); + tex = CDraw.EnqueueTexture(w, h, data); command.CommandText = "INSERT INTO Cover (Path, width, height) VALUES (@path, @w, @h)"; command.Parameters.Add("@w", DbType.Int32).Value = w; @@ -1180,7 +1180,7 @@ namespace Vocaluxe.Base result = true; reader.Read(); byte[] data = _GetBytes(reader); - tex = CDraw.AddTexture(w, h, ref data); + tex = CDraw.AddTexture(w, h, data); /*using (Bitmap bmp = new Bitmap(w, h)) { BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); diff --git a/Vocaluxe/Base/CDraw.cs b/Vocaluxe/Base/CDraw.cs index cdb77d55..f9166042 100644 --- a/Vocaluxe/Base/CDraw.cs +++ b/Vocaluxe/Base/CDraw.cs @@ -19,8 +19,6 @@ using System; using System.Drawing; -using System.IO; -using System.Windows.Forms; using Vocaluxe.Lib.Draw; using VocaluxeLib; using VocaluxeLib.Menu; @@ -46,11 +44,8 @@ namespace Vocaluxe.Base } catch (Exception e) { - MessageBox.Show(e.Message + " - Error in initializing of OpenGL. Please check whether" + - " your graphic card drivers are up to date."); CLog.LogError(e.Message + " - Error in initializing of OpenGL. Please check whether" + - " your graphic card drivers are up to date."); - Environment.Exit(Environment.ExitCode); + " your graphic card drivers are up to date.", true, true); } break; @@ -62,14 +57,9 @@ namespace Vocaluxe.Base } catch (Exception e) { - MessageBox.Show(e.Message + " - Error in initializing of Direct3D. Please check if " + - "your DirectX redistributables and graphic card drivers are up to date. You can " + - "download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109", - CSettings.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error); CLog.LogError(e.Message + " - Error in initializing of Direct3D. Please check if " + "your DirectX redistributables and graphic card drivers are up to date. You can " + - "download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109"); - Environment.Exit(Environment.ExitCode); + "download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109", true, true); } break; #endif @@ -78,7 +68,8 @@ namespace Vocaluxe.Base _Draw = new CDrawWinForm(); break; } - _Draw.Init(); + if (!_Draw.Init()) + CLog.LogError("Could not init drawing interface!", true, true); } public static void MainLoop() @@ -87,11 +78,10 @@ namespace Vocaluxe.Base _Draw.MainLoop(); } - public static bool Unload() + public static void Unload() { - bool result = _Draw.Unload(); + _Draw.Unload(); _Draw = null; - return result; } public static int GetScreenWidth() @@ -104,16 +94,6 @@ namespace Vocaluxe.Base return _Draw.GetScreenHeight(); } - public static RectangleF GetTextBounds(CText text) - { - return _Draw.GetTextBounds(text); - } - - public static RectangleF GetTextBounds(CText text, float height) - { - return _Draw.GetTextBounds(text, height); - } - public static void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) { _Draw.DrawLine(a, r, g, b, w, x1, y1, x2, y2); @@ -160,12 +140,6 @@ namespace Vocaluxe.Base _Draw.MakeScreenShot(); } - // Draw Basic Text (must be deleted later) - public static void DrawText(string text, int x, int y, int h) - { - _Draw.DrawText(text, x, y, h); - } - public static STexture AddTexture(Bitmap bitmap) { return _Draw.AddTexture(bitmap); @@ -176,53 +150,17 @@ namespace Vocaluxe.Base return _Draw.AddTexture(texturePath); } - public static STexture AddTexture(string texturePath, int maxSize) - { - if (maxSize == 0) - return _Draw.AddTexture(texturePath); - - if (!File.Exists(texturePath)) - return new STexture(-1); - - using (Bitmap origin = new Bitmap(texturePath)) - { - int w = maxSize; - int h = maxSize; - - if (origin.Width >= origin.Height && origin.Width > w) - h = (int)Math.Round((float)w / origin.Width * origin.Height); - else if (origin.Height > origin.Width && origin.Height > h) - w = (int)Math.Round((float)h / origin.Height * origin.Width); - - using (Bitmap bmp = new Bitmap(origin, w, h)) - { - STexture tex = _Draw.AddTexture(bmp); - return tex; - } - } - } - - public static STexture AddTexture(int w, int h, IntPtr data) + public static STexture AddTexture(int w, int h, byte[] data) { return _Draw.AddTexture(w, h, data); } - public static STexture AddTexture(int w, int h, ref byte[] data) + public static STexture EnqueueTexture(int w, int h, byte[] data) { - return _Draw.AddTexture(w, h, ref data); + return _Draw.EnqueueTexture(w, h, data); } - public static STexture EnqueueTexture(int w, int h, ref byte[] data) - { - return _Draw.EnqueueTexture(w, h, ref data); - } - - public static bool UpdateTexture(ref STexture texture, ref byte[] data) - { - return _Draw.UpdateTexture(ref texture, ref data); - } - - public static bool UpdateTexture(ref STexture texture, IntPtr data) + public static bool UpdateTexture(ref STexture texture, byte[] data) { return _Draw.UpdateTexture(ref texture, data); } @@ -242,22 +180,12 @@ namespace Vocaluxe.Base _Draw.DrawTexture(texture, rect); } - public static void DrawTexture(STexture texture, SRectF rect, SColorF color) - { - _Draw.DrawTexture(texture, rect, color); - } - - public static void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds) - { - _Draw.DrawTexture(texture, rect, color, bounds); - } - - public static void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored) + public static void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false) { _Draw.DrawTexture(texture, rect, color, mirrored); } - public static void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored) + public static void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { _Draw.DrawTexture(texture, rect, color, bounds, mirrored); } @@ -269,15 +197,15 @@ namespace Vocaluxe.Base public static void DrawTexture(CStatic staticBounds, STexture texture, EAspect aspect) { + if (texture.Height <= 0f) + return; + RectangleF bounds = new RectangleF(staticBounds.Rect.X, staticBounds.Rect.Y, staticBounds.Rect.W, staticBounds.Rect.H); RectangleF rect = new RectangleF(0f, 0f, texture.Width, texture.Height); - if (rect.Height <= 0f) - return; - CHelper.SetRect(bounds, out rect, rect.Width / rect.Height, aspect); DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, staticBounds.Rect.Z), - texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), false); + texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f)); } public static void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) @@ -287,7 +215,7 @@ namespace Vocaluxe.Base public static int TextureCount() { - return _Draw.TextureCount(); + return _Draw.GetTextureCount(); } } } \ No newline at end of file diff --git a/Vocaluxe/Base/CGraphics.cs b/Vocaluxe/Base/CGraphics.cs index 5e7001fb..df205d9d 100644 --- a/Vocaluxe/Base/CGraphics.cs +++ b/Vocaluxe/Base/CGraphics.cs @@ -22,7 +22,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; -using Vocaluxe.Base.Font; +using Vocaluxe.Base.Fonts; using Vocaluxe.Screens; using VocaluxeLib; using VocaluxeLib.Menu; @@ -772,7 +772,7 @@ namespace Vocaluxe.Base } CFonts.Style = EStyle.Normal; CFonts.SetFont("Normal"); - CFonts.Height = 30; + CFonts.Height = 25; SColorF gray = new SColorF(1f, 1f, 1f, 0.5f); float y = 0; foreach (string txt in debugOutput) diff --git a/Vocaluxe/Base/CLog.cs b/Vocaluxe/Base/CLog.cs index 7e9bc0c8..df186697 100644 --- a/Vocaluxe/Base/CLog.cs +++ b/Vocaluxe/Base/CLog.cs @@ -21,6 +21,7 @@ using System; using System.Diagnostics; using System.IO; using System.Text; +using System.Windows.Forms; namespace Vocaluxe.Base { @@ -111,12 +112,17 @@ namespace Vocaluxe.Base } #region LogError - public static void LogError(string errorText) + public static void LogError(string errorText, bool show = false, bool exit = false, Exception e = null) { _NumErrors++; - - _ErrorLog.Add(_NumErrors + ") " + errorText); + if (show) + MessageBox.Show(errorText, CSettings.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error); + if (e != null) + errorText += ": " + e; + _ErrorLog.Add(_NumErrors + ") " + errorText + "\r\n"); _ErrorLog.Add(String.Empty); + if (exit) + Environment.Exit(Environment.ExitCode); } #endregion LogError diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index 5a55a92e..852f731a 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -21,7 +21,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Drawing; -using Vocaluxe.Base.Font; +using Vocaluxe.Base.Fonts; using VocaluxeLib; using VocaluxeLib.Game; using VocaluxeLib.Menu; @@ -349,11 +349,6 @@ namespace Vocaluxe.Base class CBdraw : IDrawing { - public RectangleF GetTextBounds(CText text) - { - return CDraw.GetTextBounds(text); - } - public void DrawTexture(STexture texture, SRectF rect) { CDraw.DrawTexture(texture, rect); @@ -364,12 +359,7 @@ namespace Vocaluxe.Base CDraw.DrawTexture(texture, rect, color); } - public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds) - { - CDraw.DrawTexture(texture, rect, color, bounds); - } - - public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored) + public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { CDraw.DrawTexture(texture, rect, color, bounds, mirrored); } @@ -443,6 +433,11 @@ namespace Vocaluxe.Base CFonts.Style = fontStyle; } + public RectangleF GetTextBounds(CText text) + { + return CFonts.GetTextBounds(text); + } + public RectangleF GetTextBounds(CText text, float textHeight) { return CFonts.GetTextBounds(text, textHeight); diff --git a/Vocaluxe/Base/CTheme.cs b/Vocaluxe/Base/CTheme.cs index cb79c832..e032dcbc 100644 --- a/Vocaluxe/Base/CTheme.cs +++ b/Vocaluxe/Base/CTheme.cs @@ -23,7 +23,7 @@ using System.IO; using System.Text; using System.Windows.Forms; using System.Xml; -using Vocaluxe.Base.Font; +using Vocaluxe.Base.Fonts; using VocaluxeLib; using VocaluxeLib.Menu; diff --git a/Vocaluxe/Base/Font/CFont.cs b/Vocaluxe/Base/Fonts/CFont.cs similarity index 61% rename from Vocaluxe/Base/Font/CFont.cs rename to Vocaluxe/Base/Fonts/CFont.cs index 64023bd8..73216784 100644 --- a/Vocaluxe/Base/Font/CFont.cs +++ b/Vocaluxe/Base/Fonts/CFont.cs @@ -24,133 +24,119 @@ using System.Drawing.Text; using VocaluxeLib; using VocaluxeLib.Menu; -namespace Vocaluxe.Base.Font +namespace Vocaluxe.Base.Fonts { class CFont : IDisposable { private readonly Dictionary _Glyphs; private PrivateFontCollection _Fonts; private FontFamily _Family; - private readonly float _Sizeh; + private readonly float _MaxGlyphHeight; - public readonly string FilePath; + private readonly string _FilePath; + + private bool _Disposed; public CFont(string file) { - FilePath = file; + _FilePath = file; _Glyphs = new Dictionary(); switch (CConfig.TextureQuality) { case ETextureQuality.TR_CONFIG_TEXTURE_LOWEST: - _Sizeh = 25f; + _MaxGlyphHeight = 25f; break; case ETextureQuality.TR_CONFIG_TEXTURE_LOW: - _Sizeh = 50f; + _MaxGlyphHeight = 50f; break; case ETextureQuality.TR_CONFIG_TEXTURE_MEDIUM: - _Sizeh = 100f; + _MaxGlyphHeight = 100f; break; case ETextureQuality.TR_CONFIG_TEXTURE_HIGH: - _Sizeh = 200f; + _MaxGlyphHeight = 200f; break; case ETextureQuality.TR_CONFIG_TEXTURE_HIGHEST: - _Sizeh = 400f; + _MaxGlyphHeight = 400f; break; default: - _Sizeh = 100f; + _MaxGlyphHeight = 100f; break; } + _MaxGlyphHeight = 50; } - public System.Drawing.Font GetFont() + public Font GetFont() { if (_Fonts == null) { _Fonts = new PrivateFontCollection(); try { - _Fonts.AddFontFile(FilePath); + _Fonts.AddFontFile(_FilePath); _Family = _Fonts.Families[0]; } catch (Exception e) { - CLog.LogError("Error opening font file " + FilePath + ": " + e.Message); + CLog.LogError("Error opening font file " + _FilePath + ": " + e.Message); } } - - return new System.Drawing.Font(_Family, CFonts.Height, CFonts.GetFontStyle(), GraphicsUnit.Pixel); + return new Font(_Family, CFonts.Height, CFonts.GetFontStyle(), GraphicsUnit.Pixel); } - public void DrawGlyph(char chr, float x, float y, float h, float z, SColorF color) + public void DrawGlyph(char chr, float x, float y, float z, SColorF color) { STexture texture; SRectF rect; - _GetGlyphTextureAndRect(chr, x, y, z, h, out texture, out rect); + GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect); CDraw.DrawTexture(texture, rect, color); } - public void DrawGlyph(char chr, float x, float y, float h, float z, SColorF color, float begin, float end) + public void DrawGlyph(char chr, float x, float y, float z, SColorF color, float begin, float end) { STexture texture; SRectF rect; - _GetGlyphTextureAndRect(chr, x, y, z, h, out texture, out rect); + GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect); CDraw.DrawTexture(texture, rect, color, begin, end); } - public void DrawGlyphReflection(char chr, float x, float y, float h, float z, SColorF color, float rspace, float rheight) + public void DrawGlyphReflection(char chr, float x, float y, float z, SColorF color, float rspace, float rheight) { STexture texture; SRectF rect; - _GetGlyphTextureAndRect(chr, x, y, z, h, out texture, out rect); + GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect); CDraw.DrawTextureReflection(texture, rect, color, rect, rspace, rheight); } - private void _GetGlyphTextureAndRect(char chr, float x, float y, float z, float h, out STexture texture, out SRectF rect) - { - AddGlyph(chr); - - CFonts.Height = h; - CGlyph glyph = _Glyphs[chr]; - texture = glyph.Texture; - float factor = h / texture.Height; - float width = texture.Width * factor; - float d = glyph.Sizeh / 5f * factor; - rect = new SRectF(x - d, y, width, h, z); - } - public float GetWidth(char chr) { - AddGlyph(chr); - - CGlyph glyph = _Glyphs[chr]; - float factor = CFonts.Height / glyph.Texture.Height; - return glyph.Width * factor; + return GetOrAddGlyph(chr).Width; } public float GetHeight(char chr) { - return CFonts.Height; - /*WTF??? - AddGlyph(chr); - - CGlyph glyph = _Glyphs[chr]; - float factor = CFonts.Height / glyph.Texture.height; - return glyph.Texture.height * factor;*/ + return GetOrAddGlyph(chr).Height; } - public void AddGlyph(char chr) + public CGlyph GetOrAddGlyph(char chr) { - if (_Glyphs.ContainsKey(chr)) - return; - - float h = CFonts.Height; - _Glyphs.Add(chr, new CGlyph(chr, _Sizeh)); - CFonts.Height = h; + CGlyph glyph; + if (!_Glyphs.TryGetValue(chr, out glyph)) + { + glyph = new CGlyph(chr, _MaxGlyphHeight); + _Glyphs.Add(chr, glyph); + } + if (glyph.MaxHeight + 50 < CFonts.Height) + { + glyph.UnloadTexture(); + glyph = new CGlyph(chr, (float)Math.Round(CFonts.Height / 50) * 50); + _Glyphs[chr] = glyph; + } + return glyph; } - public void UnloadAllGlyphs() + public void UnloadGlyphs() { foreach (CGlyph glyph in _Glyphs.Values) glyph.UnloadTexture(); @@ -159,11 +145,12 @@ namespace Vocaluxe.Base.Font public void Dispose() { - if (_Fonts != null) + if (!_Disposed) { - _Fonts.Dispose(); - _Fonts = null; - UnloadAllGlyphs(); + if (_Fonts != null) + _Fonts.Dispose(); + UnloadGlyphs(); + _Disposed = true; } GC.SuppressFinalize(this); } diff --git a/Vocaluxe/Base/Font/CFonts.cs b/Vocaluxe/Base/Fonts/CFonts.cs similarity index 83% rename from Vocaluxe/Base/Font/CFonts.cs rename to Vocaluxe/Base/Fonts/CFonts.cs index df33720a..cee81df5 100644 --- a/Vocaluxe/Base/Font/CFonts.cs +++ b/Vocaluxe/Base/Fonts/CFonts.cs @@ -26,17 +26,19 @@ using System.Xml; using VocaluxeLib; using VocaluxeLib.Menu; -namespace Vocaluxe.Base.Font +namespace Vocaluxe.Base.Fonts { static class CFonts { private static readonly XmlWriterSettings _Settings = new XmlWriterSettings(); - private static List _Fonts; + private static readonly List _Fonts = new List(); private static int _CurrentFont; private static float _Height = 1f; + // ReSharper disable MemberCanBePrivate.Global public static int PartyModeID { get; set; } + // ReSharper restore MemberCanBePrivate.Global public static EStyle Style = EStyle.Normal; @@ -64,18 +66,25 @@ namespace Vocaluxe.Base.Font _CurrentFont = 0; PartyModeID = -1; - BuildFonts(); + _BuildFonts(); } - public static void BuildFonts() + private static void _BuildFonts() { - _Fonts = new List(); + foreach (var font in _Fonts) + { + font.Normal.Dispose(); + font.Bold.Dispose(); + font.Italic.Dispose(); + font.BoldItalic.Dispose(); + } + _Fonts.Clear(); _CurrentFont = 0; _LoadFontList(); } - public static System.Drawing.Font GetFont() + public static Font GetFont() { return _GetCurrentFont().GetFont(); } @@ -108,6 +117,15 @@ namespace Vocaluxe.Base.Font DrawText(text, Height, x, y, z, new SColorF(0f, 0f, 0f, 1f)); } + /// + /// Draws a text string + /// + /// The text to be drawn + /// The text's x-position + /// The text's y-position + /// The text's height + /// The text's z-position + /// The text color public static void DrawText(string text, float h, float x, float y, float z, SColorF color) { if (h <= 0f) @@ -122,7 +140,7 @@ namespace Vocaluxe.Base.Font float dx = x; foreach (char chr in text) { - font.DrawGlyph(chr, dx, y, Height, z, color); + font.DrawGlyph(chr, dx, y, z, color); dx += font.GetWidth(chr); } } @@ -141,7 +159,7 @@ namespace Vocaluxe.Base.Font float dx = x; foreach (char chr in text) { - font.DrawGlyphReflection(chr, dx, y, Height, z, color, rspace, rheight); + font.DrawGlyphReflection(chr, dx, y, z, color, rspace, rheight); dx += font.GetWidth(chr); } } @@ -180,7 +198,7 @@ namespace Vocaluxe.Base.Font { if (e > 1f) e = 1f; - font.DrawGlyph(chr, dx, y, Height, z, color, b, e); + font.DrawGlyph(chr, dx, y, z, color, b, e); } } dx += w2; @@ -216,16 +234,37 @@ namespace Vocaluxe.Base.Font _CurrentFont = index; } + /// + /// Calculates the bounds for a CText object + /// + /// The CText object of which the bounds should be calculated for + /// RectangleF object containing the bounds public static RectangleF GetTextBounds(CText text) { return GetTextBounds(text, text.Height); } + /// + /// Calculates the bounds for a CText object + /// + /// The CText object of which the bounds should be calculated for + /// The height of the CText object + /// RectangleF object containing the bounds public static RectangleF GetTextBounds(CText text, float height) { + float oldHeight = Height; + int oldFont = _CurrentFont; + EStyle oldStyle = Style; Height = height; - return new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text, text.TranslationID)), - GetTextHeight(CLanguage.Translate(text.Text, text.TranslationID))); + SetFont(text.Font); + Style = text.Style; + var result = new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text, text.TranslationID)), + GetTextHeight(CLanguage.Translate(text.Text, text.TranslationID))); + //restore old values + Height = oldHeight; + _CurrentFont = oldFont; + Style = oldStyle; + return result; } public static float GetTextWidth(string text) @@ -309,16 +348,13 @@ namespace Vocaluxe.Base.Font /// Load default fonts /// /// - private static bool _LoadFontList() + private static void _LoadFontList() { CXMLReader xmlReader = CXMLReader.OpenFile(Path.Combine(CSettings.FolderFonts, CSettings.FileFonts)); if (xmlReader == null) - return false; - - _Fonts.Clear(); + return; _LoadFontFiles(xmlReader, Path.Combine(Directory.GetCurrentDirectory(), CSettings.FolderFonts)); - return true; } /// @@ -390,18 +426,15 @@ namespace Vocaluxe.Base.Font 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[index].Normal.UnloadGlyphs(); + _Fonts[index].Italic.UnloadGlyphs(); + _Fonts[index].Bold.UnloadGlyphs(); + _Fonts[index].BoldItalic.UnloadGlyphs(); _Fonts.RemoveAt(index); } else @@ -450,7 +483,7 @@ namespace Vocaluxe.Base.Font private static void _BuildGlyphs() { - const string text = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPGRSTUVWGXZ1234567890"; + const string text = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; for (int i = 0; i < _Fonts.Count; i++) { @@ -459,13 +492,13 @@ namespace Vocaluxe.Base.Font foreach (char chr in text) { Style = EStyle.Normal; - _Fonts[_CurrentFont].Normal.AddGlyph(chr); + _Fonts[_CurrentFont].Normal.GetOrAddGlyph(chr); Style = EStyle.Bold; - _Fonts[_CurrentFont].Bold.AddGlyph(chr); + _Fonts[_CurrentFont].Bold.GetOrAddGlyph(chr); Style = EStyle.Italic; - _Fonts[_CurrentFont].Italic.AddGlyph(chr); + _Fonts[_CurrentFont].Italic.GetOrAddGlyph(chr); Style = EStyle.BoldItalic; - _Fonts[_CurrentFont].BoldItalic.AddGlyph(chr); + _Fonts[_CurrentFont].BoldItalic.GetOrAddGlyph(chr); } } Style = EStyle.Normal; diff --git a/Vocaluxe/Base/Fonts/CGlyph.cs b/Vocaluxe/Base/Fonts/CGlyph.cs new file mode 100644 index 00000000..f61f0c88 --- /dev/null +++ b/Vocaluxe/Base/Fonts/CGlyph.cs @@ -0,0 +1,226 @@ +#region license +// /* +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +// */ +#endregion + +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using System.Drawing.Text; +using System.Runtime.InteropServices; +using VocaluxeLib; + +namespace Vocaluxe.Base.Fonts +{ + class CGlyph + { + private STexture _Texture; + private readonly SizeF _BoundingBox; + private readonly RectangleF _DrawBounding; + public readonly float MaxHeight; + + public float Width + { + get { return _BoundingBox.Width * _GetFactor(); } + } + + public float Height + { + get { return _BoundingBox.Height * _GetFactor(); } + } + + public CGlyph(char chr, float maxHeight) + { + MaxHeight = maxHeight; + float oldHeight = CFonts.Height; + float outline = CFonts.Outline; + float outlineSize = outline * maxHeight; + string chrString = chr.ToString(); + + CFonts.Height = maxHeight; + Font fo = CFonts.GetFont(); + SizeF fullSize; + Size bmpSize; + using (Graphics g = Graphics.FromHwnd(IntPtr.Zero)) + { + fullSize = g.MeasureString(chrString, fo); + if (chr != ' ') + { + //Gets exact height and width for drawing more than 1 char. But width is to small to draw char on bitmap as e.g. italic chars will get cropped + _BoundingBox = g.MeasureString(chrString, fo, -1, new StringFormat(StringFormat.GenericTypographic)); + // ReSharper disable CompareOfFloatsByEqualityOperator + if (_BoundingBox.Height == 0) + // ReSharper restore CompareOfFloatsByEqualityOperator + _BoundingBox.Height = fullSize.Height; + _BoundingBox.Width += outlineSize / 2; + _BoundingBox.Height += outlineSize; + fullSize.Width += outlineSize; + bmpSize = new Size((int)fullSize.Width, (int)Math.Round(_BoundingBox.Height)); + } + else + { + _BoundingBox = fullSize; + _BoundingBox.Height += outlineSize; + bmpSize = new Size(1, 1); + } + } + using (Bitmap bmp = new Bitmap(bmpSize.Width, bmpSize.Height, PixelFormat.Format32bppArgb)) + using (Graphics g = Graphics.FromImage(bmp)) + { + g.Clear(Color.Transparent); + + if (chr == ' ') + { + _Texture = CDraw.AddTexture(bmp); + _DrawBounding = new RectangleF(0, 0, 0, 0); + } + else + { + g.SmoothingMode = SmoothingMode.AntiAlias; + g.InterpolationMode = InterpolationMode.HighQualityBicubic; + g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; + + PointF point = new PointF(outlineSize / 2, outlineSize / 4); + + using (GraphicsPath path = new GraphicsPath()) + { + //Have to use size in em not pixels! + float emSize = fo.Size * fo.FontFamily.GetCellAscent(fo.Style) / fo.FontFamily.GetEmHeight(fo.Style); + path.AddString(chrString, fo.FontFamily, (int)fo.Style, emSize, point, new StringFormat()); + + using (Pen pen = new Pen(CFonts.OutlineColor.AsColor(), outlineSize)) + { + pen.LineJoin = LineJoin.Round; + g.DrawPath(pen, path); + g.FillPath(Brushes.White, path); + } + } + _DrawBounding = _GetRealBounds(bmp); + using (Bitmap bmpCropped = bmp.Clone(_DrawBounding, PixelFormat.Format32bppArgb)) + { + float dx = (fullSize.Width - _BoundingBox.Width - 1) / 2; + _DrawBounding.X -= dx; + _Texture = CDraw.AddTexture(bmpCropped); + /*_DrawBounding.X *= _Texture.Width / _DrawBounding.Width; + _DrawBounding.Y *= _Texture.Width / _DrawBounding.Width; + _DrawBounding.Width = _Texture.Width; + _DrawBounding.Height = _Texture.Height;*/ +#pragma warning disable 162 + if (false && Char.IsLetterOrDigit(chr)) + { + if (outline > 0) + bmpCropped.Save("font_" + chr + "o" + CFonts.Style + "2.png", ImageFormat.Png); + else + bmpCropped.Save("font_" + chr + CFonts.Style + "2.png", ImageFormat.Png); + } +#pragma warning restore 162 + } + } + } + CFonts.Height = oldHeight; + } + + public void UnloadTexture() + { + CDraw.RemoveTexture(ref _Texture); + } + + private float _GetFactor() + { + return CFonts.Height / _BoundingBox.Height; + } + + public void GetTextureAndRect(float x, float y, float z, out STexture texture, out SRectF rect) + { + texture = _Texture; + float factor = _GetFactor(); + x += _DrawBounding.X * factor; + y += _DrawBounding.Y * factor; + float h = _DrawBounding.Height * factor; + float w = _DrawBounding.Width * factor; + rect = new SRectF(x, y, w, h, z); + } + + private static Rectangle _GetRealBounds(Bitmap bmp) + { + int minX = 0, maxX = bmp.Width - 1, minY = 0; + BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); + int values = bmpData.Width * bmp.Height; + Int32[] rgbValues = new Int32[values]; + Marshal.Copy(bmpData.Scan0, rgbValues, 0, values); + int index = 0; + bool found = false; + //find from top + for (int y = 0; y < bmp.Height && !found; y++) + { + for (int x = 0; x < bmp.Width; x++) + { + if (rgbValues[index] != 0) + { + minX = x; + maxX = x; + minY = y; + found = true; + break; + } + index++; + } + } + found = false; + //find left + for (int x = 0; x < minX && !found; x++) + { + index = x + minY * bmp.Width; + for (int y = minY; y < bmp.Height; y++) + { + if (rgbValues[index] != 0) + { + found = true; + minX = x; + break; + } + index += bmp.Width; + } + } + found = false; + //find right + for (int x = bmp.Width - 1; x > maxX && !found; x--) + { + index = x + minY * bmp.Width; + for (int y = minY; y < bmp.Height; y++) + { + if (rgbValues[index] != 0) + { + found = true; + maxX = x; + break; + } + index += bmp.Width; + } + } + + //Add some additional space. Textures need some extra pixel for resizing. + int d = 4; + minX = minX - d; if (minX < 0) minX = 0; + minY = minY - d; if (minY < 0) minY = 0; + maxX = maxX + d; if (maxX > bmp.Width) maxX = bmp.Width; + + return new Rectangle(minX, minY, maxX - minX, bmp.Height - minY); + } + } +} \ No newline at end of file diff --git a/Vocaluxe/Base/Server/CVocaluxeServer.cs b/Vocaluxe/Base/Server/CVocaluxeServer.cs index 78f7d189..1351d769 100644 --- a/Vocaluxe/Base/Server/CVocaluxeServer.cs +++ b/Vocaluxe/Base/Server/CVocaluxeServer.cs @@ -28,7 +28,7 @@ namespace Vocaluxe.Base.Server { _Clients = new Dictionary(); _Server = new CServer(RequestHandler, CConfig.ServerPort, CConfig.ServerEncryption == EOffOn.TR_CONFIG_ON); - _Discover = new CDiscover(CConfig.ServerPort, CCommands.ResponseKeyword); + _Discover = new CDiscover(CConfig.ServerPort, CCommands.BroadcastKeyword); Controller.Init(); } diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 7cd083e6..21a1a0c1 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -31,7 +31,6 @@ using System.Runtime.InteropServices; using System.Windows.Forms; using SlimDX.Windows; using Vocaluxe.Base; -using Vocaluxe.Base.Font; using VocaluxeLib; using VocaluxeLib.Menu; @@ -102,11 +101,7 @@ namespace Vocaluxe.Lib.Draw } catch (Direct3DX9NotFoundException e) { - MessageBox.Show("No DirectX runtimes were found, please download and install them " + - "from http://www.microsoft.com/download/en/details.aspx?id=8109", - CSettings.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error); - CLog.LogError(e.Message + " - No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109"); - Environment.Exit(Environment.ExitCode); + CLog.LogError("No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109", true, true, e); } Paint += _OnPaintEvent; @@ -199,12 +194,9 @@ namespace Vocaluxe.Lib.Draw { if (_Device == null || _Device.Disposed) { - MessageBox.Show("Something went wrong during device creating, please check if your DirectX redistributables " + - "and graphic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109", - CSettings.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error); CLog.LogError( - "Something went wrong during device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109"); - Environment.Exit(Environment.ExitCode); + "Something went wrong during device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109", + true, true); } } @@ -581,7 +573,7 @@ namespace Vocaluxe.Lib.Draw /// Unloads all Textures and other objects used by Direct3D for rendering /// /// - public bool Unload() + public void Unload() { try { @@ -589,10 +581,10 @@ namespace Vocaluxe.Lib.Draw } catch {} //Dispose all textures - foreach (KeyValuePair p in _D3DTextures) + foreach (Texture texture in _D3DTextures.Values) { - if (p.Value != null) - p.Value.Dispose(); + if (texture != null) + texture.Dispose(); } STexturedColoredVertex.GetDeclaration(_Device).Dispose(); @@ -600,7 +592,6 @@ namespace Vocaluxe.Lib.Draw _IndexBuffer.Dispose(); _Device.Dispose(); _D3D.Dispose(); - return true; } /// @@ -621,30 +612,6 @@ namespace Vocaluxe.Lib.Draw return _Device.Viewport.Height; } - /// - /// Calculates the bounds for a CText object - /// - /// The CText object of which the bounds should be calculated for - /// RectangleF object containing the bounds - public RectangleF GetTextBounds(CText text) - { - return GetTextBounds(text, text.Height); - } - - /// - /// Calculates the bounds for a CText object - /// - /// The CText object of which the bounds should be calculated for - /// The height of the CText object - /// RectangleF object containing the bounds - public RectangleF GetTextBounds(CText text, float height) - { - CFonts.Height = height; - CFonts.SetFont(text.Font); - CFonts.Style = text.Style; - return new RectangleF(text.X, text.Y, CFonts.GetTextWidth(CLanguage.Translate(text.Text)), CFonts.GetTextHeight(CLanguage.Translate(text.Text))); - } - /// /// Adds a quad a list which will be added and rendered to the vertexbuffer when calling RenderToVertexBuffer to reduce vertexbuffer calls each frame to a minimum /// @@ -792,21 +759,14 @@ namespace Vocaluxe.Lib.Draw /// The end y-value public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) { - SColorF color = new SColorF((float)a / 255, (float)g / 255, (float)b / 255, (float)a / 255); - DrawTexture(_BlankTexture, new SRectF(x1, y1, x2, y2, 1), color); - } - - /// - /// Draws a text string - /// - /// The text to be drawn - /// The text's x-position - /// The text's y-position - /// The text's height - /// The text's z-position - public void DrawText(string text, int x, int y, int h, int z = 0) - { - CFonts.DrawText(text, h, x, y, z, new SColorF(1f, 1f, 1f, 1f)); + var lineVector = new Vector2[] {new Vector2(x1, y1), new Vector2(x2, y2)}; + using (var line = new Line(_Device)) + { + line.Antialias = true; + line.Begin(); + line.Draw(lineVector, new Color4((float)a / 255, (float)r / 255, (float)g / 255, (float)b / 255)); + line.End(); + } } /// @@ -927,11 +887,15 @@ namespace Vocaluxe.Lib.Draw { w = newW; h = (int)Math.Round(w / ratio); + if (h == 0) + h = 1; } else { h = newH; w = (int)Math.Round(h * ratio); + if (w == 0) + w = 1; } //Create a new Bitmap with the new sizes bmp2 = new Bitmap(w, h); @@ -956,21 +920,14 @@ namespace Vocaluxe.Lib.Draw bmp2.Dispose(); } - return AddTexture(w, h, ref data); + return AddTexture(w, h, data); } - public STexture AddTexture(int w, int h, IntPtr data) - { - byte[] pointerData = new Byte[4 * w * h]; - Marshal.Copy(data, pointerData, 0, pointerData.Length); - return AddTexture(w, h, ref pointerData); - } - - public STexture AddTexture(int w, int h, ref byte[] data) + public STexture AddTexture(int w, int h, byte[] data) { STexture texture = new STexture(-1); - Texture t = _CreateTexture(w, h, ref data, ref texture); + Texture t = _CreateTexture(w, h, data, ref texture); lock (_MutexTexture) { @@ -981,7 +938,7 @@ namespace Vocaluxe.Lib.Draw return texture; } - private Texture _CreateTexture(int w, int h, ref byte[] data, ref STexture texture) + private Texture _CreateTexture(int w, int h, byte[] data, ref STexture texture) { texture.Width = w; texture.Height = h; @@ -1020,7 +977,7 @@ namespace Vocaluxe.Lib.Draw return t; } - public STexture EnqueueTexture(int w, int h, ref byte[] data) + public STexture EnqueueTexture(int w, int h, byte[] data) { STexture texture = new STexture(-1); STextureQueue queue = new STextureQueue {Data = data, Height = h, Width = w}; @@ -1041,27 +998,13 @@ namespace Vocaluxe.Lib.Draw #endregion adding #region updating - /// - /// Updates the data of a texture - /// - /// The texture to update - /// A Pointer containing the data of which the texture should be updated - /// True if succeeded - public bool UpdateTexture(ref STexture texture, IntPtr data) - { - byte[] pointerData = new Byte[4 * (int)texture.Width * (int)texture.Height]; - Marshal.Copy(data, pointerData, 0, pointerData.Length); - - return UpdateTexture(ref texture, ref pointerData); - } - /// /// Updates the data of a texture /// /// The texture to update /// A byte array containing the new texture's data /// True if succeeded - public bool UpdateTexture(ref STexture texture, ref byte[] data) + public bool UpdateTexture(ref STexture texture, byte[] data) { if ((texture.Index >= 0) && (_Textures.Count > 0) && _TextureExists(ref texture)) { @@ -1162,30 +1105,7 @@ namespace Vocaluxe.Lib.Draw /// A SRectF struct containing the destination coordinates public void DrawTexture(STexture texture, SRectF rect) { - DrawTexture(texture, rect, texture.Color, false); - } - - /// - /// Draws a texture - /// - /// The texture to be drawn - /// A SRectF struct containing the destination coordinates - /// A SColorF struct containing a color which the texture will be colored in - public void DrawTexture(STexture texture, SRectF rect, SColorF color) - { - DrawTexture(texture, rect, color, false); - } - - /// - /// Draws a texture - /// - /// The texture to be drawn - /// A SRectF struct containing the destination coordinates - /// 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 - public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds) - { - DrawTexture(texture, rect, color, bounds, false); + DrawTexture(texture, rect, texture.Color); } /// @@ -1195,7 +1115,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(STexture texture, SRectF rect, SColorF color, bool mirrored) + public void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false) { DrawTexture(texture, rect, color, new SRectF(0, 0, CSettings.RenderW, CSettings.RenderH, rect.Z), mirrored); } @@ -1208,7 +1128,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(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored) + public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { if (_TextureExists(ref texture)) { @@ -1257,6 +1177,8 @@ namespace Vocaluxe.Lib.Draw rx2 -= 0.5f; ry2 -= 0.5f; + color.A *= CGraphics.GlobalAlpha; + if (color.A > 1) color.A = 1; if (color.R > 1) @@ -1266,7 +1188,7 @@ namespace Vocaluxe.Lib.Draw if (color.B > 1) color.B = 1; - Color c = Color.FromArgb((int)(color.A * 255 * CGraphics.GlobalAlpha), (int)(color.R * 255), (int)(color.G * 255), (int)(color.B * 255)); + Color c = color.AsColor(); if (!mirrored) { @@ -1320,7 +1242,9 @@ namespace Vocaluxe.Lib.Draw rx2 -= 0.5f; ry2 -= 0.5f; - Color c = Color.FromArgb((int)(color.A * 255 * CGraphics.GlobalAlpha), (int)(color.R * 255), (int)(color.G * 255), (int)(color.B * 255)); + color.A *= CGraphics.GlobalAlpha; + + Color c = color.AsColor(); STexturedColoredVertex[] vert = new STexturedColoredVertex[4]; vert[0] = new STexturedColoredVertex(new Vector3(rx1, -ry1, rect.Z + CGraphics.ZOffset), new Vector2(x1, y1), c.ToArgb()); @@ -1402,8 +1326,10 @@ namespace Vocaluxe.Lib.Draw rx2 -= 0.5f; ry2 -= 0.5f; - Color c = Color.FromArgb((int)(color.A * 255 * CGraphics.GlobalAlpha), (int)(color.R * 255), (int)(color.G * 255), (int)(color.B * 255)); - Color transparent = Color.FromArgb(0, (int)(color.R * 255), (int)(color.G * 255), (int)(color.B * 255)); + color.A *= CGraphics.GlobalAlpha; + Color c = color.AsColor(); + color.A = 0; + Color transparent = color.AsColor(); STexturedColoredVertex[] vert = new STexturedColoredVertex[4]; vert[0] = new STexturedColoredVertex(new Vector3(rx1, -ry1, rect.Z + CGraphics.ZOffset), new Vector2(x1, y2), c.ToArgb()); @@ -1429,7 +1355,7 @@ namespace Vocaluxe.Lib.Draw else return; - Texture t = _CreateTexture(q.Width, q.Height, ref q.Data, ref texture); + Texture t = _CreateTexture(q.Width, q.Height, q.Data, ref texture); _D3DTextures[q.ID] = t; _Textures[texture.Index] = texture; @@ -1441,7 +1367,7 @@ namespace Vocaluxe.Lib.Draw /// Gets the count of current textures /// /// The amount of textures - public int TextureCount() + public int GetTextureCount() { return _Textures.Count; } diff --git a/Vocaluxe/Lib/Draw/CDrawWinForm.cs b/Vocaluxe/Lib/Draw/CDrawWinForm.cs index f76de4b4..5da213ee 100644 --- a/Vocaluxe/Lib/Draw/CDrawWinForm.cs +++ b/Vocaluxe/Lib/Draw/CDrawWinForm.cs @@ -27,7 +27,6 @@ using System.Runtime.InteropServices; using System.Threading; using System.Windows.Forms; using Vocaluxe.Base; -using Vocaluxe.Base.Font; using VocaluxeLib; using VocaluxeLib.Menu; @@ -266,7 +265,7 @@ namespace Vocaluxe.Lib.Draw Close(); } - public bool Unload() + public void Unload() { try { @@ -274,7 +273,6 @@ namespace Vocaluxe.Lib.Draw } catch {} Dispose(); - return true; } public int GetScreenWidth() @@ -287,19 +285,6 @@ namespace Vocaluxe.Lib.Draw return ClientSize.Height; } - public RectangleF GetTextBounds(CText text) - { - return GetTextBounds(text, text.Height); - } - - public RectangleF GetTextBounds(CText text, float height) - { - CFonts.Height = height; - CFonts.SetFont(text.Font); - CFonts.Style = text.Style; - return new RectangleF(text.X, text.Y, CFonts.GetTextWidth(CLanguage.Translate(text.Text)), CFonts.GetTextHeight(CLanguage.Translate(text.Text))); - } - public void ClearScreen() { _G.Clear(_ClearColor); @@ -352,12 +337,6 @@ namespace Vocaluxe.Lib.Draw _G.DrawLine(new Pen(Color.FromArgb(a, r, g, b), w), new Point(x1, y1), new Point(x2, y2)); } - // Draw Basic Text - public void DrawText(string text, int x, int y, int h, int z = 0) - { - CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1)); - } - public void DrawColor(SColorF color, SRectF rect) {} public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) {} @@ -420,17 +399,12 @@ namespace Vocaluxe.Lib.Draw } } - public STexture AddTexture(int w, int h, IntPtr data) + public STexture EnqueueTexture(int w, int h, byte[] data) { - return new STexture(-1); + return AddTexture(w, h, data); } - public STexture EnqueueTexture(int w, int h, ref byte[] data) - { - return AddTexture(w, h, ref data); - } - - public STexture AddTexture(int w, int h, ref byte[] data) + public STexture AddTexture(int w, int h, byte[] data) { using (Bitmap bmp = new Bitmap(w, h)) { @@ -441,12 +415,7 @@ namespace Vocaluxe.Lib.Draw } } - public bool UpdateTexture(ref STexture texture, IntPtr data) - { - return true; - } - - public bool UpdateTexture(ref STexture texture, ref byte[] data) + public bool UpdateTexture(ref STexture texture, byte[] data) { if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index)) { @@ -470,29 +439,17 @@ namespace Vocaluxe.Lib.Draw DrawTexture(texture, rect, texture.Color); } - public void DrawTexture(STexture texture, SRectF rect, SColorF color) - { - if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index)) - DrawTexture(texture, rect, color, rect, false); - } - - public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds) - { - if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index)) - DrawTexture(texture, rect, color, bounds, false); - } - - public void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored) + public void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false) { if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index)) DrawTexture(texture, rect, color, rect, mirrored); } - public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored) + public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index)) { - Bitmap coloredBitmap = ColorizeBitmap(_Bitmaps[texture.Index], color); + Bitmap coloredBitmap = _ColorizeBitmap(_Bitmaps[texture.Index], color); _G.DrawImage(coloredBitmap, new RectangleF(rect.X, rect.Y, rect.W, rect.H)); coloredBitmap.Dispose(); } @@ -502,12 +459,12 @@ namespace Vocaluxe.Lib.Draw public void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) {} - public int TextureCount() + public int GetTextureCount() { return _Textures.Count; } - public static Bitmap ColorizeBitmap(Bitmap original, SColorF color) + private static Bitmap _ColorizeBitmap(Bitmap original, SColorF color) { Bitmap newBitmap = new Bitmap(original.Width, original.Height); diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index 0deb0595..d4a123b2 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -30,7 +30,6 @@ using System.IO; using System.Runtime.InteropServices; using System.Windows.Forms; using Vocaluxe.Base; -using Vocaluxe.Base.Font; using VocaluxeLib; using VocaluxeLib.Menu; using BeginMode = OpenTK.Graphics.OpenGL.BeginMode; @@ -189,6 +188,7 @@ namespace Vocaluxe.Lib.Draw return samples / 2; } + /* private int _CheckColorDepth(int setValue) { int result = 16; @@ -214,6 +214,7 @@ namespace Vocaluxe.Lib.Draw return result - 8; } +*/ private void _ToggleFullScreen() { @@ -458,7 +459,7 @@ namespace Vocaluxe.Lib.Draw Close(); } - public bool Unload() + public void Unload() { try { @@ -469,8 +470,6 @@ namespace Vocaluxe.Lib.Draw _Textures.Values.CopyTo(textures, 0); for (int i = 0; i < _Textures.Count; i++) RemoveTexture(ref textures[i]); - - return true; } public int GetScreenWidth() @@ -482,19 +481,6 @@ namespace Vocaluxe.Lib.Draw { return _Control.Height; } - - public RectangleF GetTextBounds(CText text) - { - return GetTextBounds(text, text.Height); - } - - public RectangleF GetTextBounds(CText text, float height) - { - CFonts.Height = height; - CFonts.SetFont(text.Font); - CFonts.Style = text.Style; - return new RectangleF(text.X, text.Y, CFonts.GetTextWidth(CLanguage.Translate(text.Text)), CFonts.GetTextHeight(CLanguage.Translate(text.Text))); - } #endregion main stuff #region Basic Draw Methods @@ -582,12 +568,17 @@ namespace Vocaluxe.Lib.Draw } } - public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) {} - - // Draw Basic Text (must be deleted later) - public void DrawText(string text, int x, int y, int h, int z = 0) + public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) { - CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1)); + GL.Enable(EnableCap.Blend); + GL.Color4(r, g, b, a * CGraphics.GlobalAlpha); + + GL.Begin(BeginMode.Lines); + GL.Vertex3(x1, y1, CGraphics.ZOffset); + GL.Vertex3(x2, y2, CGraphics.ZOffset); + GL.End(); + + GL.Disable(EnableCap.Blend); } public void DrawColor(SColorF color, SRectF rect) @@ -723,12 +714,16 @@ namespace Vocaluxe.Lib.Draw if (w > maxSize) { h = (int)Math.Round((float)maxSize / bmp.Width * bmp.Height); + if (h == 0) + h = 1; w = maxSize; } if (h > maxSize) { w = (int)Math.Round((float)maxSize / bmp.Height * bmp.Width); + if (w == 0) + w = 1; h = maxSize; } @@ -792,67 +787,7 @@ namespace Vocaluxe.Lib.Draw return texture; } - public STexture AddTexture(int w, int h, IntPtr data) - { - STexture texture = new STexture(-1); - - if (_UsePBO) - { - try - { - GL.GenBuffers(1, out texture.PBO); - GL.BindBuffer(BufferTarget.PixelUnpackBuffer, texture.PBO); - GL.BufferData(BufferTarget.PixelUnpackBuffer, (IntPtr)(w * h * 4), IntPtr.Zero, BufferUsageHint.StreamDraw); - GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0); - } - catch (Exception) - { - _UsePBO = false; - } - } - - int id = GL.GenTexture(); - GL.BindTexture(TextureTarget.Texture2D, id); - texture.ID = id; - - texture.Width = w; - texture.Height = h; - texture.W2 = MathHelper.NextPowerOfTwo(texture.Width); - texture.H2 = MathHelper.NextPowerOfTwo(texture.Height); - - texture.WidthRatio = texture.Width / texture.W2; - texture.HeightRatio = texture.Height / texture.H2; - - GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, (int)texture.W2, (int)texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero); - - GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, w, h, PixelFormat.Bgra, PixelType.UnsignedByte, data); - - - //GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge); - //GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); - - //GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear); - //GL.GenerateMipmap(GenerateMipmapTarget.Texture2D); - //GL.Ext.GenerateMipmap(GenerateMipmapTarget.Texture2D); - GL.BindTexture(TextureTarget.Texture2D, 0); - - // Add to Texture List - texture.Color = new SColorF(1f, 1f, 1f, 1f); - texture.Rect = new SRectF(0f, 0f, texture.Width, texture.Height, 0f); - texture.TexturePath = String.Empty; - - lock (_MutexTexture) - { - texture.Index = _IDs.Dequeue(); - _Textures[texture.Index] = texture; - } - - return texture; - } - - public STexture AddTexture(int w, int h, ref byte[] data) + public STexture AddTexture(int w, int h, byte[] data) { STexture texture = new STexture(-1); @@ -913,7 +848,7 @@ namespace Vocaluxe.Lib.Draw return texture; } - public STexture EnqueueTexture(int w, int h, ref byte[] data) + public STexture EnqueueTexture(int w, int h, byte[] data) { STexture texture = new STexture(-1); STextureQueue queue = new STextureQueue {Data = data, Height = h, Width = w}; @@ -934,60 +869,7 @@ namespace Vocaluxe.Lib.Draw #endregion adding #region updating - public bool UpdateTexture(ref STexture texture, IntPtr data) - { - if (_TextureExists(ref texture)) - { - if (_UsePBO) - { - try - { - GL.BindBuffer(BufferTarget.PixelUnpackBuffer, texture.PBO); - - IntPtr buffer = GL.MapBuffer(BufferTarget.PixelUnpackBuffer, BufferAccess.WriteOnly); - byte[] d = new byte[(int)texture.Height * (int)texture.Width * 4]; - - Marshal.Copy(data, d, 0, (int)texture.Height * (int)texture.Width * 4); - Marshal.Copy(d, 0, buffer, (int)texture.Height * (int)texture.Width * 4); - - GL.UnmapBuffer(BufferTarget.PixelUnpackBuffer); - - GL.BindTexture(TextureTarget.Texture2D, texture.ID); - GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero); - - GL.BindTexture(TextureTarget.Texture2D, 0); - GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0); - - return true; - } - catch (Exception) - { - _UsePBO = false; - } - } - - GL.BindTexture(TextureTarget.Texture2D, texture.ID); - - GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, data); - - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge); - - //GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); - - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear); - //GL.GenerateMipmap(GenerateMipmapTarget.Texture2D); - GL.Ext.GenerateMipmap(GenerateMipmapTarget.Texture2D); - - GL.BindTexture(TextureTarget.Texture2D, 0); - - return true; - } - return false; - } - - public bool UpdateTexture(ref STexture texture, ref byte[] data) + public bool UpdateTexture(ref STexture texture, byte[] data) { if (_TextureExists(ref texture)) { @@ -1070,25 +952,15 @@ namespace Vocaluxe.Lib.Draw public void DrawTexture(STexture texture, SRectF rect) { - DrawTexture(texture, rect, texture.Color, false); + DrawTexture(texture, rect, texture.Color); } - public void DrawTexture(STexture texture, SRectF rect, SColorF color) - { - DrawTexture(texture, rect, color, false); - } - - public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds) - { - DrawTexture(texture, rect, color, bounds, false); - } - - public void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored) + public void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false) { DrawTexture(texture, rect, color, new SRectF(0, 0, CSettings.RenderW, CSettings.RenderH, rect.Z), mirrored); } - public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored) + public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) { if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon || Math.Abs(color.A) < float.Epsilon) @@ -1324,7 +1196,7 @@ namespace Vocaluxe.Lib.Draw } #endregion drawing - public int TextureCount() + public int GetTextureCount() { return _Textures.Count; } diff --git a/Vocaluxe/Lib/Draw/IDraw.cs b/Vocaluxe/Lib/Draw/IDraw.cs index 8821a00b..921b0f2d 100644 --- a/Vocaluxe/Lib/Draw/IDraw.cs +++ b/Vocaluxe/Lib/Draw/IDraw.cs @@ -28,47 +28,36 @@ namespace Vocaluxe.Lib.Draw { bool Init(); void MainLoop(); - bool Unload(); + void Unload(); int GetScreenWidth(); int GetScreenHeight(); - RectangleF GetTextBounds(CText text); - RectangleF GetTextBounds(CText text, float height); - - // 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); + int GetTextureCount(); void ClearScreen(); STexture CopyScreen(); void CopyScreen(ref STexture texture); void MakeScreenShot(); - // Draw Basic Text (must be deleted later) - void DrawText(string text, int x, int y, int h, int z = 0); - STexture AddTexture(string texturePath); STexture AddTexture(Bitmap bitmap); - STexture AddTexture(int w, int h, IntPtr data); - STexture AddTexture(int w, int h, ref byte[] data); - STexture EnqueueTexture(int w, int h, ref byte[] data); - bool UpdateTexture(ref STexture texture, ref byte[] data); - bool UpdateTexture(ref STexture texture, IntPtr data); - + STexture AddTexture(int w, int h, byte[] data); + STexture EnqueueTexture(int w, int h, byte[] data); + bool UpdateTexture(ref STexture texture, byte[] data); void RemoveTexture(ref STexture 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(STexture texture); void DrawTexture(STexture texture, SRectF rect); - void DrawTexture(STexture texture, SRectF rect, SColorF color); - void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds); - - void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored); - void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored); + void DrawTexture(STexture texture, SRectF rect, SColorF color, bool mirrored = false); + void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false); void DrawTexture(STexture texture, SRectF rect, SColorF color, float begin, float end); void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height); - - int TextureCount(); } } \ No newline at end of file diff --git a/Vocaluxe/Lib/Sound/COpenALPlay.cs b/Vocaluxe/Lib/Sound/COpenALPlay.cs index f1fe898b..36017220 100644 --- a/Vocaluxe/Lib/Sound/COpenALPlay.cs +++ b/Vocaluxe/Lib/Sound/COpenALPlay.cs @@ -790,7 +790,7 @@ namespace Vocaluxe.Lib.Sound { if (_Data.BytesNotRead >= buf.Length) { - _Data.Read(ref buf); + _Data.Read(buf); byte[] b = new byte[2]; diff --git a/Vocaluxe/Lib/Sound/CPortAudioPlay.cs b/Vocaluxe/Lib/Sound/CPortAudioPlay.cs index 54ab8263..9c195495 100644 --- a/Vocaluxe/Lib/Sound/CPortAudioPlay.cs +++ b/Vocaluxe/Lib/Sound/CPortAudioPlay.cs @@ -816,7 +816,7 @@ namespace Vocaluxe.Lib.Sound { if (_NoMoreData || _Data.BytesNotRead >= buf.Length) { - _Data.Read(ref buf); + _Data.Read(buf); byte[] b = new byte[2]; for (int i = 0; i < buf.Length; i += _ByteCount) diff --git a/Vocaluxe/Lib/Sound/IPlayback.cs b/Vocaluxe/Lib/Sound/IPlayback.cs index d6f6d563..e021692f 100644 --- a/Vocaluxe/Lib/Sound/IPlayback.cs +++ b/Vocaluxe/Lib/Sound/IPlayback.cs @@ -103,7 +103,7 @@ namespace Vocaluxe.Lib.Sound } } - public void Read(ref byte[] data) + public void Read(byte[] data) { long read = 0L; while (read < data.Length && _BytesNotRead > 0L) diff --git a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs index 72d38fe5..b9292683 100644 --- a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs +++ b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs @@ -664,10 +664,10 @@ namespace Vocaluxe.Lib.Video if (frame.Index == -1 || _Width != (int)frame.Width || _Height != (int)frame.Height) { CDraw.RemoveTexture(ref frame); - frame = CDraw.AddTexture(_Width, _Height, ref _FrameBuffer[num].Data); + frame = CDraw.AddTexture(_Width, _Height, _FrameBuffer[num].Data); } else - CDraw.UpdateTexture(ref frame, ref _FrameBuffer[num].Data); + CDraw.UpdateTexture(ref frame, _FrameBuffer[num].Data); lock (_MutexSyncSignals) { diff --git a/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs b/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs index 9e9d0b89..f8b1de7e 100644 --- a/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs +++ b/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs @@ -119,17 +119,16 @@ namespace Vocaluxe.Lib.Video private void _UploadNewFrame(ref STexture frame, ref byte[] data, int width, int height) { - if (data != null) + if (data == null) + return; + if (frame.Index == -1 || width != (int)frame.Width || height != (int)frame.Height || data.Length == 0) { - if (frame.Index == -1 || width != (int)frame.Width || height != (int)frame.Height || data.Length == 0) - { - CDraw.RemoveTexture(ref frame); - frame = CDraw.AddTexture(width, height, ref data); - } - else - CDraw.UpdateTexture(ref frame, ref data); - data = null; + CDraw.RemoveTexture(ref frame); + frame = CDraw.AddTexture(width, height, data); } + else + CDraw.UpdateTexture(ref frame, data); + data = null; } } } \ No newline at end of file diff --git a/Vocaluxe/Lib/Webcam/CAForgeNet.cs b/Vocaluxe/Lib/Webcam/CAForgeNet.cs index 78d54321..c5af6463 100644 --- a/Vocaluxe/Lib/Webcam/CAForgeNet.cs +++ b/Vocaluxe/Lib/Webcam/CAForgeNet.cs @@ -59,10 +59,10 @@ namespace Vocaluxe.Lib.Webcam if (frame.Index == -1 || _Width != (int)frame.Width || _Height != (int)frame.Height) { CDraw.RemoveTexture(ref frame); - frame = CDraw.AddTexture(_Width, _Height, ref _Data); + frame = CDraw.AddTexture(_Width, _Height, _Data); } else - CDraw.UpdateTexture(ref frame, ref _Data); + CDraw.UpdateTexture(ref frame, _Data); } } return false; diff --git a/Vocaluxe/Program.cs b/Vocaluxe/Program.cs index d00b8d67..e6c90aea 100644 --- a/Vocaluxe/Program.cs +++ b/Vocaluxe/Program.cs @@ -25,7 +25,7 @@ using System.Reflection; using System.Windows.Forms; using Vocaluxe.Base; using System.Runtime.ExceptionServices; -using Vocaluxe.Base.Font; +using Vocaluxe.Base.Fonts; using Vocaluxe.Base.Server; namespace Vocaluxe diff --git a/Vocaluxe/Screens/CScreenCredits.cs b/Vocaluxe/Screens/CScreenCredits.cs index 146744f0..4e1e0455 100644 --- a/Vocaluxe/Screens/CScreenCredits.cs +++ b/Vocaluxe/Screens/CScreenCredits.cs @@ -22,90 +22,91 @@ using System.Collections.Generic; using System.Diagnostics; using System.Windows.Forms; using Vocaluxe.Base; +using Vocaluxe.Base.Fonts; using VocaluxeLib; using VocaluxeLib.Menu; -enum EDirection -{ - Left, - Right, - Up -} - -class CCreditName -{ - private readonly CStatic _Image; - private readonly CStatic _ImgDot; - private readonly CParticleEffect _Particle; - private readonly int _ParticleOffsetX; - private readonly int _ParticleOffsetY; - public EDirection Direction; - public float StartTimeUp; - public bool Active; - - public CCreditName(CStatic image, CStatic imgDot, CParticleEffect particle, int particleOffsetX, int particleOffsetY) - { - _Image = image; - _ImgDot = imgDot; - _Particle = particle; - _ParticleOffsetX = (int)Math.Round(particleOffsetX * image.Rect.W / image.Texture.Width - particle.Rect.W / 2); - _ParticleOffsetY = (int)Math.Round(particleOffsetY * image.Rect.H / image.Texture.Height - particle.Rect.H / 2); - Active = true; - } - - public float X - { - get { return _Image.Rect.X; } - set - { - _Image.Rect.X = value; - _ImgDot.Rect.X = value + _ParticleOffsetX; - _Particle.Rect.X = value + _ParticleOffsetX; - } - } - public float Y - { - get { return _Image.Rect.Y; } - set - { - _Image.Rect.Y = value; - _ImgDot.Rect.Y = value + _ParticleOffsetY; - _Particle.Rect.Y = value + _ParticleOffsetY; - } - } - - public float W - { - get { return _Image.Rect.W; } - } - public float H - { - get { return _Image.Rect.H; } - } - - public float Alpha - { - get { return _Image.Alpha; } - set - { - _Image.Alpha = value; - _ImgDot.Alpha = value; - } - } - - public void Draw() - { - if (Active) - { - _Image.Draw(); - _ImgDot.Draw(); - _Particle.Draw(); - } - } -} - namespace Vocaluxe.Screens { + enum EDirection + { + Left, + Right, + Up + } + + class CCreditName + { + private readonly CStatic _Image; + private readonly CStatic _ImgDot; + private readonly CParticleEffect _Particle; + private readonly int _ParticleOffsetX; + private readonly int _ParticleOffsetY; + public EDirection Direction; + public float StartTimeUp; + public bool Active; + + public CCreditName(CStatic image, CStatic imgDot, CParticleEffect particle, int particleOffsetX, int particleOffsetY) + { + _Image = image; + _ImgDot = imgDot; + _Particle = particle; + _ParticleOffsetX = (int)Math.Round(particleOffsetX * image.Rect.W / image.Texture.Width - particle.Rect.W / 2); + _ParticleOffsetY = (int)Math.Round(particleOffsetY * image.Rect.H / image.Texture.Height - particle.Rect.H / 2); + Active = true; + } + + public float X + { + get { return _Image.Rect.X; } + set + { + _Image.Rect.X = value; + _ImgDot.Rect.X = value + _ParticleOffsetX; + _Particle.Rect.X = value + _ParticleOffsetX; + } + } + public float Y + { + get { return _Image.Rect.Y; } + set + { + _Image.Rect.Y = value; + _ImgDot.Rect.Y = value + _ParticleOffsetY; + _Particle.Rect.Y = value + _ParticleOffsetY; + } + } + + public float W + { + get { return _Image.Rect.W; } + } + public float H + { + get { return _Image.Rect.H; } + } + + public float Alpha + { + get { return _Image.Alpha; } + set + { + _Image.Alpha = value; + _ImgDot.Alpha = value; + } + } + + public void Draw() + { + if (Active) + { + _Image.Draw(); + _ImgDot.Draw(); + _Particle.Draw(); + } + } + } + class CScreenCredits : CMenu { // Version number for theme files. Increment it, if you've changed something on the theme files! @@ -212,8 +213,8 @@ namespace Vocaluxe.Screens if (paragraph[e] == null) continue; string newLine = " " + paragraph[e]; - CText text = GetNewText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line); - if (CDraw.GetTextBounds(text).Width < (CSettings.RenderW - 220)) + CText text = GetNewText(75, lastY, -2, 25, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line); + if (CFonts.GetTextBounds(text).Width < (CSettings.RenderW - 220)) { line += newLine; diff --git a/Vocaluxe/Screens/CScreenLoad.cs b/Vocaluxe/Screens/CScreenLoad.cs index 52d519fd..8185520d 100644 --- a/Vocaluxe/Screens/CScreenLoad.cs +++ b/Vocaluxe/Screens/CScreenLoad.cs @@ -31,10 +31,11 @@ namespace Vocaluxe.Screens // Version number for theme files. Increment it, if you've changed something on the theme files! protected override int _ScreenVersion { - get { return 1; } + get { return 2; } } private const string _TextStatus = "TextStatus"; + private const string _TextProgramName = "TextProgramName"; private readonly string[] _IntroVideo = new string[] {"IntroIn", "IntroMid", "IntroOut"}; @@ -45,13 +46,13 @@ namespace Vocaluxe.Screens private bool _IntroOutPlayed; private CVideoPlayer[] _Intros; - private bool _BGMusicStartet; + private bool _BGMusicStarted; public override void Init() { base.Init(); - _ThemeTexts = new string[] {_TextStatus}; + _ThemeTexts = new string[] {_TextStatus, _TextProgramName}; _Intros = new CVideoPlayer[_IntroVideo.Length]; for (int i = 0; i < _Intros.Length; i++) _Intros[i] = new CVideoPlayer(); @@ -117,9 +118,10 @@ namespace Vocaluxe.Screens { for (int i = 0; i < _Intros.Length; i++) _Intros[i].Load(_IntroVideo[i]); + _Texts[_TextProgramName].Visible = false; } - _BGMusicStartet = false; + _BGMusicStarted = false; } public override void OnShowFinish() @@ -138,14 +140,14 @@ namespace Vocaluxe.Screens _Timer.Start(); if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON && - CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStartet) + CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStarted) { CBackgroundMusic.AddOwnMusic(); if (!CBackgroundMusic.IsPlaying) CBackgroundMusic.Next(); - _BGMusicStartet = true; + _BGMusicStarted = true; } CBackgroundMusic.CanSing = false; @@ -174,14 +176,14 @@ namespace Vocaluxe.Screens CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")"; if (CSongs.SongsLoaded && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON && - CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStartet) + CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStarted) { CBackgroundMusic.AddOwnMusic(); if (!CBackgroundMusic.IsPlaying) CBackgroundMusic.Next(); - _BGMusicStartet = true; + _BGMusicStarted = true; } return true; diff --git a/Vocaluxe/Screens/CScreenMain.cs b/Vocaluxe/Screens/CScreenMain.cs index eddeda92..4d92afdc 100644 --- a/Vocaluxe/Screens/CScreenMain.cs +++ b/Vocaluxe/Screens/CScreenMain.cs @@ -19,7 +19,7 @@ using System.Windows.Forms; using Vocaluxe.Base; -using Vocaluxe.Base.Font; +using Vocaluxe.Base.Fonts; using VocaluxeLib; using VocaluxeLib.Menu; @@ -39,6 +39,8 @@ namespace Vocaluxe.Screens private const string _ButtonProfiles = "ButtonProfiles"; private const string _ButtonExit = "ButtonExit"; + private CText _ReleaseText; + //CParticleEffect Snowflakes; public override void Init() { @@ -48,6 +50,13 @@ namespace Vocaluxe.Screens _ThemeButtons = new string[] {_ButtonSing, _ButtonParty, _ButtonOptions, _ButtonProfiles, _ButtonExit}; } + public override void LoadTheme(string xmlPath) + { + base.LoadTheme(xmlPath); + + _ReleaseText = GetNewText(10, 690, -1, 15, -1, EAlignment.Left, EStyle.Normal, "Normal", new SColorF(1f, 1f, 1f, 1f), CSettings.GetFullVersionText()); + } + public override bool HandleInput(SKeyEvent keyEvent) { base.HandleInput(keyEvent); @@ -157,9 +166,7 @@ namespace Vocaluxe.Screens if (CSettings.VersionRevision != ERevision.Release) // ReSharper restore ConditionIsAlwaysTrueOrFalse { - CFonts.SetFont("Normal"); - CFonts.Style = EStyle.Normal; - CDraw.DrawText(CSettings.GetFullVersionText(), 10, 680, 40); + _ReleaseText.Draw(); } return true; diff --git a/Vocaluxe/Screens/CScreenOptionsTheme.cs b/Vocaluxe/Screens/CScreenOptionsTheme.cs index 27168bdf..be74c138 100644 --- a/Vocaluxe/Screens/CScreenOptionsTheme.cs +++ b/Vocaluxe/Screens/CScreenOptionsTheme.cs @@ -19,7 +19,7 @@ using System.Windows.Forms; using Vocaluxe.Base; -using Vocaluxe.Base.Font; +using Vocaluxe.Base.Fonts; using VocaluxeLib; using VocaluxeLib.Menu; diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 82a9d578..61df6e3c 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -25,7 +25,7 @@ using System.IO; using System.Linq; using System.Windows.Forms; using Vocaluxe.Base; -using Vocaluxe.Base.Font; +using Vocaluxe.Base.Fonts; using VocaluxeLib; using VocaluxeLib.Menu; using VocaluxeLib.Menu.SingNotes; diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index aaeb0e6e..b9d85084 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -1198,7 +1198,7 @@ namespace Vocaluxe.Screens private void _OpenPlaylist(int playlistID) { - if (CPlaylists.Playlists.Length > playlistID && playlistID >= 0 && _Playlists[_Playlist].ActivePlaylistID != playlistID) + if (CPlaylists.Playlists.Length > playlistID && playlistID >= 0) { _Playlists[_Playlist].LoadPlaylist(playlistID); _SongMenus[_SongMenu].SetSmallView(true); diff --git a/Vocaluxe/Screens/CScreenTest.cs b/Vocaluxe/Screens/CScreenTest.cs index e0d1aac0..358fcabe 100644 --- a/Vocaluxe/Screens/CScreenTest.cs +++ b/Vocaluxe/Screens/CScreenTest.cs @@ -37,6 +37,25 @@ namespace Vocaluxe.Screens private int _TestMusic = -1; */ + public override void Init() + { + base.Init(); + const string test = "Ö ÄÜabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPGRSTUVWGXZ1234567890"; + SColorF color = new SColorF(1, 0, 0, 1); + CText text = new CText(10, 50, 1, 32, 0, EAlignment.Left, EStyle.Normal, "Normal", color, "jÄNormal Text" + test, -1, 26, 0); + _AddText(text); + text = new CText(10, 90, 1, 32, 0, EAlignment.Left, EStyle.Bold, "Normal", color, "jÄBold Text" + test, -1, 26, 0); + _AddText(text); + text = new CText(10, 130, 1, 32, 0, EAlignment.Left, EStyle.Italic, "Normal", color, "jÄItalic Text" + test, -1, 26, 0); + _AddText(text); + text = new CText(10, 170, 1, 32, 0, EAlignment.Left, EStyle.Normal, "Outline", color, "jÄNormal Text" + test, -1, 50, 0); + _AddText(text); + text = new CText(10, 210, 1, 32, 0, EAlignment.Left, EStyle.Bold, "Outline", color, "jÄBold Text" + test, -1, 100, 0); + _AddText(text); + text = new CText(10, 250, 1, 32, 0, EAlignment.Left, EStyle.Italic, "Outline", color, "jÄItalic Text" + test, -1, 150, 0); + _AddText(text); + } + public override bool HandleInput(SKeyEvent keyEvent) { if (keyEvent.KeyPressed && !Char.IsControl(keyEvent.Unicode)) {} diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index e7bb3d74..f89a8e6c 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -180,7 +180,7 @@ - + @@ -199,8 +199,8 @@ - - + + diff --git a/VocaluxeLib/IBasic.cs b/VocaluxeLib/IBasic.cs index fe92c5b8..2d71e3ae 100644 --- a/VocaluxeLib/IBasic.cs +++ b/VocaluxeLib/IBasic.cs @@ -114,12 +114,9 @@ namespace VocaluxeLib public interface IDrawing { - RectangleF GetTextBounds(CText text); - void DrawTexture(STexture texture, SRectF rect); void DrawTexture(STexture texture, SRectF rect, SColorF color); - void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds); - void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored); + void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false); void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight); STexture AddTexture(string fileName); @@ -148,6 +145,7 @@ namespace VocaluxeLib void SetFont(string fontName); void SetStyle(EStyle fontStyle); + RectangleF GetTextBounds(CText text); RectangleF GetTextBounds(CText text, float textHeight); void DrawText(string text, float textHeight, float x, float y, float z, SColorF color); diff --git a/VocaluxeLib/Menu/CButton.cs b/VocaluxeLib/Menu/CButton.cs index b3a69d15..976da6b4 100644 --- a/VocaluxeLib/Menu/CButton.cs +++ b/VocaluxeLib/Menu/CButton.cs @@ -312,7 +312,7 @@ namespace VocaluxeLib.Menu if (_Reflection) { CBase.Drawing.DrawTextureReflection(texture, Rect, Color, Rect, _ReflectionSpace, _ReflectionHeight); - Text.DrawRelative(Rect.X, Rect.Y, _ReflectionSpace, _ReflectionHeight, Rect.H); + Text.DrawRelative(Rect.X, Rect.Y, _ReflectionHeight, _ReflectionSpace, Rect.H); } else Text.DrawRelative(Rect.X, Rect.Y); @@ -326,7 +326,7 @@ namespace VocaluxeLib.Menu if (_Reflection) { CBase.Drawing.DrawTextureReflection(texture, Rect, SelColor, Rect, _ReflectionSpace, _ReflectionHeight); - Text.DrawRelative(Rect.X, Rect.Y, _ReflectionSpace, _ReflectionHeight, Rect.H); + Text.DrawRelative(Rect.X, Rect.Y, _ReflectionHeight, _ReflectionSpace, Rect.H); } else Text.DrawRelative(Rect.X, Rect.Y); @@ -340,7 +340,7 @@ namespace VocaluxeLib.Menu if (_Reflection) { CBase.Drawing.DrawTextureReflection(texture, Rect, SelColor, Rect, _ReflectionSpace, _ReflectionHeight); - _SelText.DrawRelative(Rect.X, Rect.Y, _ReflectionSpace, _ReflectionHeight, Rect.H); + _SelText.DrawRelative(Rect.X, Rect.Y, _ReflectionHeight, _ReflectionSpace, Rect.H); } else _SelText.DrawRelative(Rect.X, Rect.Y); diff --git a/VocaluxeLib/Menu/CLyric.cs b/VocaluxeLib/Menu/CLyric.cs index 547124e5..a501afe3 100644 --- a/VocaluxeLib/Menu/CLyric.cs +++ b/VocaluxeLib/Menu/CLyric.cs @@ -216,7 +216,7 @@ namespace VocaluxeLib.Menu if (n.Type == ENoteType.Freestyle) _Text.Style = EStyle.BoldItalic; - RectangleF rect = CBase.Drawing.GetTextBounds(_Text); + RectangleF rect = CBase.Fonts.GetTextBounds(_Text); _Width += rect.Width; _Notes.Add(n); } @@ -267,7 +267,7 @@ namespace VocaluxeLib.Menu _Text.X = x; _Text.Style = EStyle.Bold; _Text.Text = note.Text; - RectangleF rect = CBase.Drawing.GetTextBounds(_Text); + RectangleF rect = CBase.Fonts.GetTextBounds(_Text); if (note.Type == ENoteType.Freestyle) _Text.Style = EStyle.BoldItalic; @@ -326,7 +326,7 @@ namespace VocaluxeLib.Menu _Text.X = x; _Text.Style = EStyle.Bold; _Text.Text = _Notes[note].Text; - RectangleF rect = CBase.Drawing.GetTextBounds(_Text); + RectangleF rect = CBase.Fonts.GetTextBounds(_Text); if (_Notes[note].Type == ENoteType.Freestyle) _Text.Style = EStyle.BoldItalic; @@ -374,7 +374,7 @@ namespace VocaluxeLib.Menu if (_Notes[zoomNote].Type == ENoteType.Freestyle) _Text.Style = EStyle.BoldItalic; - RectangleF rect = CBase.Drawing.GetTextBounds(_Text); + RectangleF rect = CBase.Fonts.GetTextBounds(_Text); float diff = endBeat - _Notes[zoomNote].StartBeat; if (diff <= 0f) @@ -392,7 +392,7 @@ namespace VocaluxeLib.Menu float tz = _Text.Z; _Text.Height += _Text.Height * p * 0.4f; - RectangleF rectz = CBase.Drawing.GetTextBounds(_Text); + RectangleF rectz = CBase.Fonts.GetTextBounds(_Text); _Text.X -= (rectz.Width - rect.Width) / 2f; _Text.Y -= (rectz.Height - rect.Height) / 2f; _Text.Z -= 0.1f; @@ -415,7 +415,7 @@ namespace VocaluxeLib.Menu _Text.X = x; _Text.Style = EStyle.Bold; _Text.Text = note.Text; - RectangleF rect = CBase.Drawing.GetTextBounds(_Text); + RectangleF rect = CBase.Fonts.GetTextBounds(_Text); if (note.Type == ENoteType.Freestyle) _Text.Style = EStyle.BoldItalic; @@ -456,7 +456,7 @@ namespace VocaluxeLib.Menu _Text.X = x; _Text.Style = EStyle.Bold; _Text.Text = _Notes[note].Text; - RectangleF rect = CBase.Drawing.GetTextBounds(_Text); + RectangleF rect = CBase.Fonts.GetTextBounds(_Text); if (_Notes[note].Type == ENoteType.Freestyle) _Text.Style = EStyle.BoldItalic; diff --git a/VocaluxeLib/Menu/CMenu.cs b/VocaluxeLib/Menu/CMenu.cs index e17e6aec..9a5d6da8 100644 --- a/VocaluxeLib/Menu/CMenu.cs +++ b/VocaluxeLib/Menu/CMenu.cs @@ -999,51 +999,13 @@ namespace VocaluxeLib.Menu private bool _IsMouseOver(int x, int y, CInteraction interact) { - switch (interact.Type) + bool result = CHelper.IsInBounds(_GetRect(interact), x, y); + if (result) + return true; + if (interact.Type == EType.SelectSlide) { - case EType.Button: - if (CHelper.IsInBounds(_Buttons[interact.Num].Rect, x, y)) - return true; - break; - case EType.SelectSlide: - if (CHelper.IsInBounds(_SelectSlides[interact.Num].Rect, x, y) || - CHelper.IsInBounds(_SelectSlides[interact.Num].RectArrowLeft, x, y) || - CHelper.IsInBounds(_SelectSlides[interact.Num].RectArrowRight, x, y)) - return true; - break; - case EType.Static: - if (CHelper.IsInBounds(_Statics[interact.Num].Rect, x, y)) - return true; - break; - case EType.Text: - RectangleF bounds = CBase.Drawing.GetTextBounds(_Texts[interact.Num]); - if (CHelper.IsInBounds(new SRectF(_Texts[interact.Num].X, _Texts[interact.Num].Y, bounds.Width, bounds.Height, _Texts[interact.Num].Z), x, y)) - return true; - break; - case EType.SongMenu: - if (CHelper.IsInBounds(_SongMenus[interact.Num].Rect, x, y)) - return true; - break; - case EType.Lyric: - if (CHelper.IsInBounds(_Lyrics[interact.Num].Rect, x, y)) - return true; - break; - case EType.NameSelection: - if (CHelper.IsInBounds(_NameSelections[interact.Num].Rect, x, y)) - return true; - break; - case EType.Equalizer: - if (CHelper.IsInBounds(_Equalizers[interact.Num].Rect, x, y)) - return true; - break; - case EType.Playlist: - if (CHelper.IsInBounds(_Playlists[interact.Num].Rect, x, y)) - return true; - break; - case EType.ParticleEffect: - if (CHelper.IsInBounds(_ParticleEffects[interact.Num].Rect, x, y)) - return true; - break; + return CHelper.IsInBounds(_SelectSlides[interact.Num].RectArrowLeft, x, y) || + CHelper.IsInBounds(_SelectSlides[interact.Num].RectArrowRight, x, y); } return false; } @@ -1619,45 +1581,50 @@ namespace VocaluxeLib.Menu return false; } - private SRectF _GetRect(int interaction) + private SRectF _GetRect(CInteraction interaction) { SRectF result = new SRectF(); - switch (_Interactions[interaction].Type) + switch (interaction.Type) { case EType.Button: - return _Buttons[_Interactions[interaction].Num].Rect; + return _Buttons[interaction.Num].Rect; case EType.SelectSlide: - return _SelectSlides[_Interactions[interaction].Num].Rect; + return _SelectSlides[interaction.Num].Rect; case EType.Static: - return _Statics[_Interactions[interaction].Num].Rect; + return _Statics[interaction.Num].Rect; case EType.Text: - return _Texts[_Interactions[interaction].Num].Bounds; + return _Texts[interaction.Num].Rect; case EType.SongMenu: - return _SongMenus[_Interactions[interaction].Num].Rect; + return _SongMenus[interaction.Num].Rect; case EType.Lyric: - return _Lyrics[_Interactions[interaction].Num].Rect; + return _Lyrics[interaction.Num].Rect; case EType.NameSelection: - return _NameSelections[_Interactions[interaction].Num].Rect; + return _NameSelections[interaction.Num].Rect; case EType.Equalizer: - return _Equalizers[_Interactions[interaction].Num].Rect; + return _Equalizers[interaction.Num].Rect; case EType.Playlist: - return _Playlists[_Interactions[interaction].Num].Rect; + return _Playlists[interaction.Num].Rect; case EType.ParticleEffect: - return _ParticleEffects[_Interactions[interaction].Num].Rect; + return _ParticleEffects[interaction.Num].Rect; } return result; } + private SRectF _GetRect(int interaction) + { + return _GetRect(_Interactions[interaction]); + } + private void _AddInteraction(int num, EType type) { _Interactions.Add(new CInteraction(num, type)); diff --git a/VocaluxeLib/Menu/CSelectSlide.cs b/VocaluxeLib/Menu/CSelectSlide.cs index 7216166c..488d2af6 100644 --- a/VocaluxeLib/Menu/CSelectSlide.cs +++ b/VocaluxeLib/Menu/CSelectSlide.cs @@ -764,7 +764,7 @@ namespace VocaluxeLib.Menu alpha = new SColorF(1f, 1f, 1f, 1f); } - RectangleF bounds = CBase.Drawing.GetTextBounds(text); + RectangleF bounds = CBase.Fonts.GetTextBounds(text); text.X = (x + dx / 2f + dx * i) + TextRelativeX; if (!WithTextures) diff --git a/VocaluxeLib/Menu/CText.cs b/VocaluxeLib/Menu/CText.cs index 6284e88b..ac8bd1c8 100644 --- a/VocaluxeLib/Menu/CText.cs +++ b/VocaluxeLib/Menu/CText.cs @@ -32,24 +32,6 @@ namespace VocaluxeLib.Menu public string SelColorName; //for Buttons } - struct STextPosition - { - public float X; - public float Y; - public float TextHeight; - public float Width; - public float Height; - - public STextPosition(float initVal) - { - X = initVal; - Y = initVal; - TextHeight = initVal; - Width = initVal; - Height = initVal; - } - } - public class CText : IMenuElement { private SThemeText _Theme; @@ -65,8 +47,6 @@ namespace VocaluxeLib.Menu private bool _ButtonText; private bool _PositionNeedsUpdate = true; - private STextPosition _DrawPosition = new STextPosition(0); - private float _X; public float X { @@ -127,28 +107,6 @@ namespace VocaluxeLib.Menu if (Math.Abs(_MaxWidth - value) > 0.01) { _MaxWidth = value; - // ReSharper disable ConvertIfStatementToConditionalTernaryExpression - if (_MaxWidth > 0) - // ReSharper restore ConvertIfStatementToConditionalTernaryExpression - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), _MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f); - else - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f); - - _PositionNeedsUpdate = true; - } - } - } - - private SRectF _Bounds; - public SRectF Bounds - { - get { return _Bounds; } - set - { - if (Math.Abs(_Bounds.X - value.X) > 0.01 || Math.Abs(_Bounds.Y - value.Y) > 0.01 || Math.Abs(_Bounds.W - value.W) > 0.01 || Math.Abs(_Bounds.H - value.H) > 0.01 || - Math.Abs(_Bounds.Z - value.Z) > 0.01) - { - _Bounds = value; _PositionNeedsUpdate = true; } } @@ -168,15 +126,15 @@ namespace VocaluxeLib.Menu } } - private EHAlignment _HAlign = EHAlignment.Center; - public EHAlignment HAlign + private EHAlignment _ResizeAlign = EHAlignment.Center; + public EHAlignment ResizeAlign { - get { return _HAlign; } + get { return _ResizeAlign; } set { - if (_HAlign != value) + if (_ResizeAlign != value) { - _HAlign = value; + _ResizeAlign = value; _PositionNeedsUpdate = true; } } @@ -210,10 +168,23 @@ namespace VocaluxeLib.Menu } } + /// + /// Do NOT read/write this anywhere but in _UpdateTextPosition! + /// + private SRectF _Rect; + public SRectF Rect + { + get + { + if (_PositionNeedsUpdate) + _UpdateTextPosition(); + return _Rect; + } + } + public SColorF Color; //normal Color public SColorF SelColor; //selected Color for Buttons - public bool Reflection; public float ReflectionSpace; public float ReflectionHeight; @@ -288,15 +259,13 @@ namespace VocaluxeLib.Menu _Z = text._Z; _Height = text._Height; _MaxWidth = text._MaxWidth; - _Bounds = new SRectF(text._Bounds); _Align = text._Align; - _HAlign = text._HAlign; + _ResizeAlign = text._ResizeAlign; _Style = text._Style; _Font = text._Font; Color = new SColorF(text.Color); SelColor = new SColorF(text.SelColor); - Reflection = text.Reflection; ReflectionSpace = text.ReflectionSpace; ReflectionHeight = text.ReflectionHeight; @@ -308,117 +277,8 @@ namespace VocaluxeLib.Menu _EditMode = text._EditMode; } - public CText(float x, float y, float z, EAlignment align, float h, float mw, float r, float g, float b, float a, EStyle style, string font, string text, float rspace, - float rheight) - { - _Theme = new SThemeText(); - _ThemeLoaded = false; - _ButtonText = false; - _PartyModeID = -1; - _TranslationID = -1; - - X = x; - Y = y; - Z = z; - Height = h; - MaxWidth = mw; - Align = align; - HAlign = EHAlignment.Center; - Style = style; - Font = font; - - Color = new SColorF(r, g, b, a); - SelColor = new SColorF(r, g, b, a); - - Text = text; - - Selected = false; - - // ReSharper disable ConvertIfStatementToConditionalTernaryExpression - if (MaxWidth > 0) - // ReSharper restore ConvertIfStatementToConditionalTernaryExpression - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f); - else - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f); - - Reflection = true; - ReflectionSpace = rspace; - ReflectionHeight = rheight; - } - - public CText(float x, float y, float z, EAlignment align, float h, float mw, float r, float g, float b, float a, EStyle style, string font, string text) - { - _Theme = new SThemeText(); - _ThemeLoaded = false; - _ButtonText = false; - _PartyModeID = -1; - _TranslationID = -1; - - X = x; - Y = y; - Z = z; - Height = h; - MaxWidth = mw; - Align = align; - HAlign = EHAlignment.Center; - Style = style; - Font = font; - - Color = new SColorF(r, g, b, a); - SelColor = new SColorF(r, g, b, a); - - Text = text; - - Selected = false; - - // ReSharper disable ConvertIfStatementToConditionalTernaryExpression - if (MaxWidth > 0) - // ReSharper restore ConvertIfStatementToConditionalTernaryExpression - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f); - else - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f); - - Reflection = false; - } - - public CText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text, float rspace, float rheight) - { - _Theme = new SThemeText(); - _ThemeLoaded = false; - _ButtonText = false; - _PartyModeID = -1; - _TranslationID = -1; - - X = x; - Y = y; - Z = z; - Height = h; - MaxWidth = mw; - Align = align; - HAlign = EHAlignment.Center; - Style = style; - Font = font; - - Color = col; - SelColor = new SColorF(col); - - Text = text; - - Selected = false; - - // ReSharper disable ConvertIfStatementToConditionalTernaryExpression - if (MaxWidth > 0) - // ReSharper restore ConvertIfStatementToConditionalTernaryExpression - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f); - else - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f); - - Reflection = true; - ReflectionSpace = rspace; - ReflectionHeight = rheight; - } - - public CText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text, int partyModeID = -1) + public CText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text, int partyModeID = -1, float rheight = 0, + float rspace = 0) { _Theme = new SThemeText(); _ThemeLoaded = false; @@ -432,7 +292,7 @@ namespace VocaluxeLib.Menu Height = h; MaxWidth = mw; Align = align; - HAlign = EHAlignment.Center; + ResizeAlign = EHAlignment.Center; Style = style; Font = font; @@ -443,14 +303,8 @@ namespace VocaluxeLib.Menu Selected = false; - // ReSharper disable ConvertIfStatementToConditionalTernaryExpression - if (MaxWidth > 0) - // ReSharper restore ConvertIfStatementToConditionalTernaryExpression - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f); - else - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f); - - Reflection = false; + ReflectionSpace = rspace; + ReflectionHeight = rheight; } public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex) @@ -495,7 +349,7 @@ namespace VocaluxeLib.Menu } _ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Align", ref _Align); - xmlReader.TryGetEnumValue(item + "/HAlign", ref _HAlign); + xmlReader.TryGetEnumValue(item + "/ResizeAlign", ref _ResizeAlign); _ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Style", ref _Style); _ThemeLoaded &= xmlReader.GetValue(item + "/Font", out _Font, "Normal"); @@ -503,12 +357,9 @@ namespace VocaluxeLib.Menu if (xmlReader.ItemExists(item + "/Reflection") && !buttonText) { - Reflection = true; _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Space", ref ReflectionSpace); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Height", ref ReflectionHeight); } - else - Reflection = false; // Set values _Theme.Name = elementName; @@ -516,16 +367,7 @@ namespace VocaluxeLib.Menu _PositionNeedsUpdate = true; if (_ThemeLoaded) - { LoadTextures(); - - // ReSharper disable ConvertIfStatementToConditionalTernaryExpression - if (MaxWidth > 0) - // ReSharper restore ConvertIfStatementToConditionalTernaryExpression - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f); - else - Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f); - } return _ThemeLoaded; } @@ -579,8 +421,8 @@ namespace VocaluxeLib.Menu writer.WriteComment(": Text align horizontal: " + CHelper.ListStrings(Enum.GetNames(typeof(EAlignment)))); writer.WriteElementString("Align", Enum.GetName(typeof(EAlignment), Align)); - writer.WriteComment(": Text align vertical (on downsizing): " + CHelper.ListStrings(Enum.GetNames(typeof(EHAlignment)))); - writer.WriteElementString("HAlign", Enum.GetName(typeof(EHAlignment), HAlign)); + writer.WriteComment(": Text align vertical (on downsizing): " + CHelper.ListStrings(Enum.GetNames(typeof(EHAlignment)))); + writer.WriteElementString("HAlign", Enum.GetName(typeof(EHAlignment), ResizeAlign)); writer.WriteComment("