From 5ed6620bad808381fce94f2cd67ee911b4d45bff Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 21 Mar 2007 19:19:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 1121 +++++++++++++++++++++++++++++++++++++ 1 file changed, 1121 insertions(+) create mode 100644 Game/Code/Screens/UScreenSing.pas (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas new file mode 100644 index 00000000..2a97482d --- /dev/null +++ b/Game/Code/Screens/UScreenSing.pas @@ -0,0 +1,1121 @@ +unit UScreenSing; + +interface + +uses UMenu, UMusic, SDL, SysUtils, UPliki, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics, + TextGL, OpenGL12, BASS, UThemes, ULCD; + +type + TScreenSing = class(TMenu) + protected + paused: boolean; //Pause Mod + PauseTime: Real; + NumEmptySentences: integer; + public + TextTime: integer; + + StaticP1: integer; + StaticP1ScoreBG: integer; + TextP1: integer; + TextP1Score: integer; + + StaticP2R: integer; + StaticP2RScoreBG: integer; + TextP2R: integer; + TextP2RScore: integer; + + StaticP2M: integer; + StaticP2MScoreBG: integer; + TextP2M: integer; + TextP2MScore: integer; + + StaticP3R: integer; + StaticP3RScoreBG: integer; + TextP3R: integer; + TextP3RScore: integer; + + Tex_Background: TTexture; + FadeOut: boolean; + LyricMain: TLyric; + LyricSub: TLyric; + + constructor Create; override; + procedure onShow; override; + procedure onShowFinish; override; + function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; + function Draw: boolean; override; + procedure Finish; virtual; + procedure UpdateLCD; + procedure Pause; //Pause Mod(Toggles Pause) + + //OnSentenceEnd for LineBonus + Singbar + procedure onSentenceEnd(S: Cardinal); + end; + +implementation +uses UGraphic, UDraw, UMain, Classes, URecord, ULanguage, math; + +// Method for input parsing. If False is returned, GetNextWindow +// should be checked to know the next window to load; +function TScreenSing.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; +begin + Result := true; + If (PressedDown) Then + begin // Key Down + case PressedKey of + SDLK_ESCAPE : + begin + //Record Sound Hack: + //Sound[0].BufferLong + + Finish; + Music.PlayBack; + FadeTo(@ScreenScore); + end; + + SDLK_Q: + begin + Finish; + Result := false; + end; + + SDLK_P://Pause Mod + begin + Pause; + end; + + SDLK_RETURN: + begin + end; + + // Up and Down could be done at the same time, + // but I don't want to declare variables inside + // functions like this one, called so many times + SDLK_DOWN : + begin + end; + SDLK_UP : + begin + end; + end; + end + else // Key Up + case PressedKey of + SDLK_RETURN : + begin + end; + end; +end; + +//Pause Mod +procedure TScreenSing.Pause; +begin + if not paused then //Pause einschalten + begin + PauseTime := Czas.Teraz; + Paused := true; + //stop Music + Music.Pause; + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video + PauseSmpeg; //Video + end + else //Pause ausschalten + begin + Czas.Teraz := PauseTime; //Position of Notes + Music.MoveTo (PauseTime);//Position of Music + Music.Play; //Play Music + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video + PlaySmpeg; + //SkipSmpeg(PauseTime); + Paused := false; + end; +end; +//Pause Mod End + +constructor TScreenSing.Create; +var + I: integer; + P: integer; +begin + inherited Create; + + AddBackground(Theme.Sing.Background.Tex); + + for I := 0 to High(Theme.Sing.Static) do + AddStatic(Theme.Sing.Static[I]); + + for I := 0 to High(Theme.Sing.Text) do + AddText(Theme.Sing.Text[I]); + + // time + TextTime := AddText(75, 14, 1, 8, 0.25, 0.25, 0.25, '00:00'); + + StaticP1 := AddStatic(Theme.Sing.StaticP1); + StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); + TextP1 := AddText(Theme.Sing.TextP1); + TextP1Score := AddText(Theme.Sing.TextP1Score); + + StaticP2R := AddStatic(Theme.Sing.StaticP2R); + StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); + TextP2R := AddText(Theme.Sing.TextP2R); + TextP2RScore := AddText(Theme.Sing.TextP2RScore); + + StaticP2M := AddStatic(Theme.Sing.StaticP2M); + StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); + TextP2M := AddText(Theme.Sing.TextP2M); + TextP2MScore := AddText(Theme.Sing.TextP2MScore); + + StaticP3R := AddStatic(Theme.Sing.StaticP3R); + StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); + TextP3R := AddText(Theme.Sing.TextP3R); + TextP3RScore := AddText(Theme.Sing.TextP3RScore); + + LyricMain := TLyric.Create; + LyricSub := TLyric.Create; +end; + +procedure TScreenSing.onShow; +var + P: integer; + V1: boolean; + V2R: boolean; + V2M: boolean; + V3R: boolean; + NR: TRecR; //Line Bonus Mod +begin + Log.LogStatus('Begin', 'onShow'); + FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented + + // prepare players + SetLength(Player, PlayersPlay); +// Player[0].ScoreTotalI := 0; + + + case PlayersPlay of + 1: begin + V1 := true; + V2R := false; + V2M := false; + V3R := false; + end; + 2: begin + V1 := true; + V2R := true; + V2M := false; + V3R := false; + end; + 3: begin + V1 := true; + V2R := false; + V2M := true; + V3R := true; + end; + 4: begin // double screen + V1 := true; + V2R := true; + V2M := false; + V3R := false; + end; + 6: begin // double screen + V1 := true; + V2R := false; + V2M := true; + V3R := true; + end; + + end; + + + + Static[StaticP2R].Visible := V2R; + Static[StaticP2RScoreBG].Visible := V2R; + Text[TextP2R].Visible := V2R; + Text[TextP2RScore].Visible := V2R; + + Static[StaticP2M].Visible := V2M; + Static[StaticP2MScoreBG].Visible := V2M; + Text[TextP2M].Visible := V2M; + Text[TextP2MScore].Visible := V2M; + + Static[StaticP3R].Visible := V3R; + Static[StaticP3RScoreBG].Visible := V3R; + Text[TextP3R].Visible := V3R; + Text[TextP3RScore].Visible := V3R; + + // load notes + CzyscNuty; +// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); + AktSong := CatSongs.Song[CatSongs.Selected]; + + WczytajCzesci(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName); + AktSong.Path := CatSongs.Song[CatSongs.Selected].Path; +// AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed + + // set movie + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin + OpenSmpeg(AktSong.Path + AktSong.Video); + SkipSmpeg(AktSong.VideoGAP + AktSong.Start); + AktSong.VideoLoaded := true; + end; + + // set background + if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then + Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background) + else + Tex_Background.TexNum := -1; + + + + // play music (I) + Music.CaptureStart; + Music.MoveTo(AktSong.Start); +// Music.Play; + + // prepare timer (I) +// CountSkipTimeSet; + Czas.Teraz := AktSong.Start; + Czas.Razem := Music.Length; + if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000; + Czas.OldBeat := -1; + for P := 0 to High(Player) do + ClearScores(P); + + // main text + LyricMain.Clear; + LyricMain.X := 400; + LyricMain.Y := Skin_LyricsT; + LyricMain.Scale := 1.4; //1.4 + LyricMain.Align := 1; + + // sub text + LyricSub.Clear; + LyricSub.X := 400; + LyricSub.Y := Skin_LyricsT + 42; //40 + LyricSub.Align := 1; + + // set custom options + case Ini.LyricsFont of + 0: + begin + LyricMain.FontStyle := 0; + LyricSub.FontStyle := 0; + LyricMain.Size := 14; // 13 + LyricSub.Size := 14; // 13 + LyricMain.ColR := Skin_FontR; + LyricMain.ColG := Skin_FontG; + LyricMain.ColB := Skin_FontB; //Change für Crazy Joker + {LyricMain.ColSR := Skin_FontHighlightR; + LyricMain.ColSG := Skin_FontHighlightG; + LyricMain.ColSB := Skin_FontHighlightB;1aa5dc} + LyricMain.ColSR := 26/255; + LyricMain.ColSG := 165/255; + LyricMain.ColSB := 220/255; + + LyricSub.ColR := 0.6; + LyricSub.ColG := 0.6; + LyricSub.ColB := 0.6; + end; + 1: + begin + LyricMain.FontStyle := 2; + LyricSub.FontStyle := 2; + LyricMain.Size := 14; + LyricSub.Size := 14; + LyricMain.ColR := 0.75; + LyricMain.ColG := 0.75; + LyricMain.ColB := 1; + LyricMain.ColSR := 0.5; + LyricMain.ColSG := 0.5; + LyricMain.ColSB := 1; + LyricSub.ColR := 0.8; + LyricSub.ColG := 0.8; + LyricSub.ColB := 0.8; + end; + 2: + begin + LyricMain.FontStyle := 3; + LyricSub.FontStyle := 3; + LyricMain.Size := 12; + LyricSub.Size := 12; + LyricMain.ColR := 0.75; + LyricMain.ColG := 0.75; + LyricMain.ColB := 1; + LyricMain.ColSR := 0.5; + LyricMain.ColSG := 0.5; + LyricMain.ColSB := 1; + LyricSub.ColR := 0.8; + LyricSub.ColG := 0.8; + LyricSub.ColB := 0.8; + end; + end; // case + + case Ini.LyricsEffect of + 0: LyricMain.Style := 1; // 0 - one selected, 1 - selected all to the current + 1: LyricMain.Style := 2; + 2: LyricMain.Style := 3; + 3: LyricMain.Style := 4; + end; // case + + // fill texts + LyricMain.AddCzesc(0); + LyricMain.Selected := -1; + LyricSub.AddCzesc(1); + LyricSub.Selected := -1; + + UpdateLCD; + + //Deactivate Pause + Paused := False; + + {Static[StaticP2R].Visible := V2R; + Static[StaticP2RScoreBG].Visible := V2R; + Text[TextP2R].Visible := V2R; + Text[TextP2RScore].Visible := V2R; + + Static[StaticP2M].Visible := V2M; + Static[StaticP2MScoreBG].Visible := V2M; + Text[TextP2M].Visible := V2M; + Text[TextP2MScore].Visible := V2M; + + Static[StaticP3R].Visible := V3R; + Static[StaticP3RScoreBG].Visible := V3R; + Text[TextP3R].Visible := V3R; + Text[TextP3RScore].Visible := V3R;} + + //Set Position of Line Bonus - PhrasenBonus + if (Ini.LineBonus = 1) then //Show Line Bonus at Scores + begin + Case PlayersPlay of + 1: begin + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + end; + + 2: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.X; + Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.X; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.X; + Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + end; + + 3: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + end; + + 4: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + + //P4 + Player[3].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; + Player[3].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[3].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; + Player[3].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + end; + + 6: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + + //P4 + Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[3].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[3].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; + Player[3].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + + //P5 + Player[4].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[4].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[4].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[4].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P6 + Player[5].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[5].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[5].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[5].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + end; + end; + end + else if (Ini.LineBonus = 2) then //Show Line Bonus at Notes + begin + //SingDrawNoteLines(Nr.Left + 10*ScreenX, 120, Nr.Right + 10*ScreenX, 12); + //SingDrawNoteLines(Nr.Left + 10*ScreenX, 245, Nr.Right + 10*ScreenX, 12); + //SingDrawNoteLines(Nr.Left + 10*ScreenX, 370, Nr.Right + 10*ScreenX, 12); + + // positions + if Ini.SingWindow = 0 then begin + NR.Left := 120; + end else begin + NR.Left := 20; + end; + NR.Right := 780; + + NR.Width := NR.Right - NR.Left; + NR.WMid := NR.Width / 2; + NR.Mid := NR.Left + NR.WMid; + + Case PlayersPlay of + 1: begin + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartY := Skin_P2_NotesB - 105; + end; + + 2: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + end; + + 3: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetY := 120 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartY := 120 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_TargetY := 245 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_StartY := 245 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_TargetY := 370 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_StartY := 370 + 28; + end; + + 4: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P4 + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[3].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + end; + + 6: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetY := 120 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartY := 120 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_TargetY := 245 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_StartY := 245 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_TargetY := 370 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_StartY := 370 + 28; + + //P4 + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[3].LineBonus_TargetY := 120 - 65 + 28; + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[3].LineBonus_StartY := 120 + 28; + + //P5 + Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[4].LineBonus_TargetY := 245 - 65 + 28; + Player[4].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[4].LineBonus_StartY := 245 + 28; + + //P6 + Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[5].LineBonus_TargetY := 370 - 65 + 28; + Player[5].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[5].LineBonus_StartY := 370 + 28; + end; + end; + end; + //Set Position of Line Bonus - PhrasenBonus End + //Set Num of Empty Sentences for Phrasen Bonus + NumEmptySentences := 0; + for P := low(Czesci[0].Czesc) to high(Czesci[0].Czesc) do + if Czesci[0].Czesc[P].TotalNotes = 0 then Inc(NumEmptySentences); + + Log.LogStatus('End', 'onShow'); +end; + +procedure TScreenSing.onShowFinish; +begin + // play movie (II) + if AktSong.VideoLoaded then PlaySmpeg; + + // play music (II) + Music.Play; + + // prepare timer (II) + CountSkipTimeSet; +end; + +function TScreenSing.Draw: boolean; +var + Min: integer; + Sec: integer; + Tekst: string; + Flash: real; + S: integer; + T: integer; +begin + + + + //ScoreBG Mod + // set player colors + if PlayersPlay = 4 then begin + if ScreenAct = 1 then begin + LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, + Static[StaticP1].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P2Dark'); + + + + LoadColor(Static[StaticP1ScoreBG].Texture.ColR, Static[StaticP1ScoreBG].Texture.ColG, + Static[StaticP1ScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); + + + + end; + if ScreenAct = 2 then begin + LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, + Static[StaticP1].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P4Dark'); + + + + LoadColor(Static[StaticP1ScoreBG].Texture.ColR, Static[StaticP1ScoreBG].Texture.ColG, + Static[StaticP1ScoreBG].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark'); + + + + end; + end; + + if PlayersPlay = 6 then begin + if ScreenAct = 1 then begin + LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, + Static[StaticP1].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P2Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P3Dark'); + + + + LoadColor(Static[StaticP1ScoreBG].Texture.ColR, Static[StaticP1ScoreBG].Texture.ColG, + Static[StaticP1ScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); + LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, + Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark'); + + + + end; + if ScreenAct = 2 then begin + LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, + Static[StaticP1].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P5Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P6Dark'); + + + + + LoadColor(Static[StaticP1ScoreBG].Texture.ColR, Static[StaticP1ScoreBG].Texture.ColG, + Static[StaticP1ScoreBG].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark'); + LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, + Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark'); + + + + + end; + end; + +//Original 0.5.0 +{ // set player colors + if PlayersPlay = 4 then begin + if ScreenAct = 1 then begin + //LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, + //Static[StaticP1].Texture.ColB, 'P1Dark'); +// LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + // Static[StaticP2R].Texture.ColB, 'P2Dark'); + end; + if ScreenAct = 2 then begin + LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, + Static[StaticP1].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P4Dark'); + end; + end; + + if PlayersPlay = 6 then begin + if ScreenAct = 1 then begin + LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, + Static[StaticP1].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P2Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P3Dark'); + end; + if ScreenAct = 2 then begin + LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, + Static[StaticP1].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P5Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P6Dark'); + end; + end; } + //end ScoreBG Mod + + + + // set player names (for 2 screens and only Singstar skin) + if ScreenAct = 1 then begin + Text[TextP1].Text := 'P1'; + Text[TextP2R].Text := 'P2'; + Text[TextP2M].Text := 'P2'; + Text[TextP3R].Text := 'P3'; + end; + + if ScreenAct = 2 then begin + case PlayersPlay of +{ 1: begin + Text[TextP1].Text := 'P2'; + end; + 2: begin + Text[TextP1].Text := 'P3'; + Text[TextP2R].Text := 'P4'; + end; + 3: begin + Text[TextP1].Text := 'P4'; + Text[TextP2M].Text := 'P5'; + Text[TextP3R].Text := 'P6'; + end;} + + 4: begin + Text[TextP1].Text := 'P3'; + Text[TextP2R].Text := 'P4'; + end; + 6: begin + Text[TextP1].Text := 'P4'; + Text[TextP2M].Text := 'P5'; + Text[TextP3R].Text := 'P6'; + end; + end; // case + end; // if + + // stereo + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; + + + + + Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; + + + + + + Text[TextP1].X := Text[TextP1].X + 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX; + + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; + + + + Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; + + + + + Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX; + + for S := 1 to 1 do + Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX; + + for T := 0 to 1 do + Text[T].X := Text[T].X + 10*ScreenX; + + // update static menu with time ... + Min := Round(Czas.Teraz) div 60; + Sec := Round(Czas.Teraz) mod 60; + Text[TextTime].Text := ''; + if Min < 10 then Text[TextTime].Text := '0'; + Text[TextTime].Text := Text[TextTime].Text + IntToStr(Min) + ':'; + if Sec < 10 then Text[TextTime].Text := Text[TextTime].Text + '0'; + Text[TextTime].Text := Text[TextTime].Text + IntToStr(Sec); + + // .. and scores + if PlayersPlay = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + end; + + if PlayersPlay = 2 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + + if PlayersPlay = 3 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + + if PlayersPlay = 4 then begin + if ScreenAct = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + if ScreenAct = 2 then begin + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + + Tekst := IntToStr(Player[3].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + end; + + if PlayersPlay = 6 then begin + if ScreenAct = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + if ScreenAct = 2 then begin + Tekst := IntToStr(Player[3].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + + Tekst := IntToStr(Player[4].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[5].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + end; + + + // beat flash +{ Flash := 1 - (Czas.MidBeat - Czas.AktBeat); + if (Czas.AktBeat + AktSong.NotesGAP) mod AktSong.Resolution = 0 then Flash := 1 + else Flash := 0; + if Czas.AktBeat < 0 then Flash := 0; + glClearColor(Flash, Flash, Flash, 1);} + + // beat sound +// if (Ini.BeatClick = 1) and (Flash = 1) and (Czas.AktBeat <> Czas.OldBeat) then Music.PlayClick; + + // draw static menu (BG) + DrawBG; + //Draw Background + SingDrawBackground; + // update and draw movie + if ShowFinish and AktSong.VideoLoaded then begin + UpdateSmpeg; // this only draws + end; + + // draw static menu (FG) + DrawFG; + + // check for music finish +// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish)); + if ShowFinish then begin + if (not Music.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin + //Pause Mod: + if not Paused then + Sing(Self); // analyze song + end else begin +// Log.LogError('End'); + if not FadeOut then begin +// Log.LogError('End2'); + Finish; + FadeOut := true; + FadeTo(@ScreenScore); + end; + end; + end; + + // draw custom items + SingDraw; // always draw + + + // back stereo + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; + + + Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; + + + + Text[TextP1].X := Text[TextP1].X - 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX; + + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; + + + + Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; + + + + Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX; + + for S := 1 to 1 do + Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX; + + for T := 0 to 1 do + Text[T].X := Text[T].X - 10*ScreenX; + +end; + +procedure TScreenSing.Finish; +begin + Music.CaptureStop; + Music.Stop; + + if Ini.SavePlayback = 1 then begin + Log.BenchmarkStart(0); + Log.LogVoice(0); + Log.LogVoice(1); + Log.LogVoice(2); + Log.BenchmarkEnd(0); + Log.LogBenchmark('Creating files', 0); + end; + + if AktSong.VideoLoaded then begin + CloseSmpeg; + AktSong.VideoLoaded := false; // to prevent drawing closed video + end; +end; + +procedure TScreenSing.UpdateLCD; +var + T: string; +begin + LCD.HideCursor; + LCD.Clear; + + T := LyricMain.Text; + if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; + LCD.AddTextBR(T); + + T := LyricSub.Text; + if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; + LCD.AddTextBR(T); +end; + +procedure TScreenSing.onSentenceEnd(S: Cardinal); +var +I: Integer; +A: Real; +B: integer; //Max Points for Notes +begin + +//Check for Empty Sentence +if (Czesci[0].Czesc[S].TotalNotes<=0) then + exit; + +//Set Max Note Points +if (Ini.LineBonus > 0) then + B := 9000 +else + B := 10000; + +for I := 0 to High(Player) do begin + A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; + + //SingBar Mod + If ({(Ini.Oscilloscope = 2) and }(Czesci[0].Czesc[S].TotalNotes>0)) then + begin + Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 40 - 26); + if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; + if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; + + //end Singbar Mod + end; + + //PhrasenBonus - Line Bonus Mod + + If (Ini.LineBonus > 0) then + begin + + //Generate Steps 0 to 8 + A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); + if A >= 8 then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_PERFECT') + else if (A = 6) or (A = 7) then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_BETTER') + else if A = 5 then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_GOOD') + else if (A = 3) or (A = 4) then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_NORMAL') + else if A = 2 then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_BAD') + else + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_WORST'); + + //PhrasenBonus give Points + Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); + Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; + //Update Total Score + Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; + + //Color + Player[I].LineBonus_Color.B := 0; + Player[I].LineBonus_Color.R := (8-A)/8; + Player[I].LineBonus_Color.G := A/10; + + Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; + Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; + Player[I].LineBonus_Alpha := 0.92; + Player[I].LineBonus_Visible := True; + + + + end; + +//Refresh LastScore +Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; + +end; +//PhrasenBonus - Line Bonus Mod End// } + +end; + +end. -- cgit v1.2.3 From a48be5b4dd13db5cbc2cce4932508e61ff354340 Mon Sep 17 00:00:00 2001 From: mogguh Date: Wed, 21 Mar 2007 21:35:49 +0000 Subject: Golden notes are implemented from now on. So "golden notes" twinkle, and perfect sung notes twinkle too. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@12 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 2a97482d..3dd1119a 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -3,7 +3,7 @@ unit UScreenSing; interface uses UMenu, UMusic, SDL, SysUtils, UPliki, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics, - TextGL, OpenGL12, BASS, UThemes, ULCD; + TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses; type TScreenSing = class(TMenu) @@ -973,6 +973,9 @@ begin // draw custom items SingDraw; // always draw +//GoldenNoteStarsTwinkle Mod + GoldenRec.SpawnRec; +//GoldenNoteStarsTwinkle Mod // back stereo Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; @@ -1116,6 +1119,9 @@ Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; end; //PhrasenBonus - Line Bonus Mod End// } +//GoldenStarsTwinkle Mod + GoldenRec.KillAll; +//GoldenStarsTwinkle Mod End end; end. -- cgit v1.2.3 From b7ae6bb3c682473abc6c642ce4f15a4ffa9d630d Mon Sep 17 00:00:00 2001 From: mogguh Date: Sat, 24 Mar 2007 20:20:47 +0000 Subject: Bugfix: UScreenSing.pas fixed a minor bug that would've caused redrawing of golden stars in a different song git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@30 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 3dd1119a..f6ec6224 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -636,6 +636,10 @@ begin // prepare timer (II) CountSkipTimeSet; + +//GoldenStarsTwinkle Mod + GoldenRec.KillAll; +//GoldenStarsTwinkle Mod End end; function TScreenSing.Draw: boolean; -- cgit v1.2.3 From 3ba33f8e920a9e9a3114f159e2b6fda4273a6efb Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 28 Mar 2007 13:08:41 +0000 Subject: Added Jumpto Ability to SongScreen (Press J) Fixed: Golden Notes are not shown in PartyMode git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@39 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index f6ec6224..7b96e273 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -636,10 +636,6 @@ begin // prepare timer (II) CountSkipTimeSet; - -//GoldenStarsTwinkle Mod - GoldenRec.KillAll; -//GoldenStarsTwinkle Mod End end; function TScreenSing.Draw: boolean; @@ -1016,6 +1012,11 @@ begin Music.CaptureStop; Music.Stop; + //Kill all Stars not Killed yet + //GoldenStarsTwinkle Mod + GoldenRec.KillAll; + //GoldenStarsTwinkle Mod End + if Ini.SavePlayback = 1 then begin Log.BenchmarkStart(0); Log.LogVoice(0); -- cgit v1.2.3 From 8d591b8344e0cb87e1a987961b3790fa26d323a6 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 29 Mar 2007 12:40:11 +0000 Subject: Fixed Some Bugs in JumpTo Screen: Now plays correct music Space Bug is gone Added onSentenceChange Procedure to ScreenSing git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@48 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 116 ++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 54 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 7b96e273..201b97fa 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -50,6 +50,8 @@ type //OnSentenceEnd for LineBonus + Singbar procedure onSentenceEnd(S: Cardinal); + //OnSentenceChange (for Golden Notes) + procedure onSentenceChange(S: Cardinal); end; implementation @@ -1055,73 +1057,73 @@ A: Real; B: integer; //Max Points for Notes begin -//Check for Empty Sentence -if (Czesci[0].Czesc[S].TotalNotes<=0) then - exit; + //Check for Empty Sentence + if (Czesci[0].Czesc[S].TotalNotes<=0) then + exit; -//Set Max Note Points -if (Ini.LineBonus > 0) then - B := 9000 -else - B := 10000; + //Set Max Note Points + if (Ini.LineBonus > 0) then + B := 9000 + else + B := 10000; -for I := 0 to High(Player) do begin - A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; + for I := 0 to High(Player) do begin + A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; - //SingBar Mod - If ({(Ini.Oscilloscope = 2) and }(Czesci[0].Czesc[S].TotalNotes>0)) then - begin - Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 40 - 26); - if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; - if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; + //SingBar Mod + If ({(Ini.Oscilloscope = 2) and }(Czesci[0].Czesc[S].TotalNotes>0)) then + begin + Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 40 - 26); + if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; + if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; //end Singbar Mod - end; + end; //PhrasenBonus - Line Bonus Mod - If (Ini.LineBonus > 0) then - begin - - //Generate Steps 0 to 8 - A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); - if A >= 8 then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_PERFECT') - else if (A = 6) or (A = 7) then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_BETTER') - else if A = 5 then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_GOOD') - else if (A = 3) or (A = 4) then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_NORMAL') - else if A = 2 then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_BAD') - else - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_WORST'); - - //PhrasenBonus give Points - Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); - Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; - //Update Total Score - Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; - - //Color - Player[I].LineBonus_Color.B := 0; - Player[I].LineBonus_Color.R := (8-A)/8; - Player[I].LineBonus_Color.G := A/10; - - Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; - Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; - Player[I].LineBonus_Alpha := 0.92; - Player[I].LineBonus_Visible := True; + If (Ini.LineBonus > 0) then + begin + + //Generate Steps 0 to 8 + A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); + if A >= 8 then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_PERFECT') + else if (A = 6) or (A = 7) then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_BETTER') + else if A = 5 then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_GOOD') + else if (A = 3) or (A = 4) then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_NORMAL') + else if A = 2 then + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_BAD') + else + Player[I].LineBonus_Text := Language.Translate('LINEBONUS_WORST'); + + //PhrasenBonus give Points + Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); + Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; + //Update Total Score + Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; + + //Color + Player[I].LineBonus_Color.B := 0; + Player[I].LineBonus_Color.R := (8-A)/8; + Player[I].LineBonus_Color.G := A/10; + + Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; + Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; + Player[I].LineBonus_Alpha := 0.92; + Player[I].LineBonus_Visible := True; - end; + end; -//Refresh LastScore -Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; + //Refresh LastScore + Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; -end; + end; //PhrasenBonus - Line Bonus Mod End// } //GoldenStarsTwinkle Mod @@ -1129,4 +1131,10 @@ end; //GoldenStarsTwinkle Mod End end; +//Called on Sentence Change S= New Current Sentence +procedure TScreenSing.onSentenceChange(S: Cardinal); +begin + //Dummy +end; + end. -- cgit v1.2.3 From e0e16a3b1d28cf51fecf669d42465cf2a65728f3 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 29 Mar 2007 16:54:52 +0000 Subject: Added SBGW to TSelectSlide: Defining the Width of the Selections BG Added W to TText + Pagebreaks. If Width is given the Text breaks at the given width. Breaks are not generated perfect yet, needs some tuning. Changed all affected Screens to fit the new TText Component git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@49 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 201b97fa..ee4bedc8 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -369,6 +369,11 @@ begin //Deactivate Pause Paused := False; + //Kill all Stars not Killed yet + //GoldenStarsTwinkle Mod + GoldenRec.KillAll; + //GoldenStarsTwinkle Mod End + {Static[StaticP2R].Visible := V2R; Static[StaticP2RScoreBG].Visible := V2R; Text[TextP2R].Visible := V2R; @@ -1014,11 +1019,6 @@ begin Music.CaptureStop; Music.Stop; - //Kill all Stars not Killed yet - //GoldenStarsTwinkle Mod - GoldenRec.KillAll; - //GoldenStarsTwinkle Mod End - if Ini.SavePlayback = 1 then begin Log.BenchmarkStart(0); Log.LogVoice(0); @@ -1032,6 +1032,8 @@ begin CloseSmpeg; AktSong.VideoLoaded := false; // to prevent drawing closed video end; + + SetFontItalic (False); end; procedure TScreenSing.UpdateLCD; -- cgit v1.2.3 From 9d01c8801db29d6ff3d64ef81b84321549d84688 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 5 Apr 2007 21:09:52 +0000 Subject: Added Advanced Screen and Options in TIni Options working now only for Effect Perfect and Effect Golden. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@65 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index ee4bedc8..d684dc3c 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1089,18 +1089,12 @@ begin //Generate Steps 0 to 8 A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); + + //Generate Text if A >= 8 then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_PERFECT') - else if (A = 6) or (A = 7) then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_BETTER') - else if A = 5 then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_GOOD') - else if (A = 3) or (A = 4) then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_NORMAL') - else if A = 2 then - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_BAD') + Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8] else - Player[I].LineBonus_Text := Language.Translate('LINEBONUS_WORST'); + Player[I].LineBonus_Text := Theme.Sing.LineBonusText[Floor(A)]; //PhrasenBonus give Points Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); -- cgit v1.2.3 From 4ce8b89fdaf829546449c0d1acab14df80c49d95 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sat, 7 Apr 2007 12:58:11 +0000 Subject: Fixed some Bugs in Effect Engine: Perfect Note Stars was drawn 2 Times Golden Note Extra twinkling stops and is redrawn until next Sentece or Note at the End of the Golden Note. Redrawing of Golden Note Twinkles at the next Sentence git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@71 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index d684dc3c..ae5b239c 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1121,16 +1121,14 @@ begin end; //PhrasenBonus - Line Bonus Mod End// } - -//GoldenStarsTwinkle Mod - GoldenRec.KillAll; -//GoldenStarsTwinkle Mod End end; //Called on Sentence Change S= New Current Sentence procedure TScreenSing.onSentenceChange(S: Cardinal); begin - //Dummy + //GoldenStarsTwinkle Mod + GoldenRec.KillAll; + //GoldenStarsTwinkle Mod End end; end. -- cgit v1.2.3 From 44956e119562be2defd82eba8b10e7069ead5b76 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 10 Apr 2007 15:12:07 +0000 Subject: Edited Mogs Text: Now hes a Graphics Guy ^^ git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@77 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index ae5b239c..c6191cec 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1119,6 +1119,8 @@ begin //Refresh LastScore Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; + + end; //PhrasenBonus - Line Bonus Mod End// } end; @@ -1129,6 +1131,7 @@ begin //GoldenStarsTwinkle Mod GoldenRec.KillAll; //GoldenStarsTwinkle Mod End + end; end. -- cgit v1.2.3 From 943d001a21095f936fdcfc58f11cdbd6d30578a5 Mon Sep 17 00:00:00 2001 From: b1indy Date: Wed, 11 Apr 2007 20:22:01 +0000 Subject: first implementation of perfect line twinkle effect - works correctly for up to 3 players, restructured parts of particle code git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@80 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index c6191cec..e3b7c7ad 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -371,7 +371,7 @@ begin //Kill all Stars not Killed yet //GoldenStarsTwinkle Mod - GoldenRec.KillAll; + GoldenRec.SentenceChange; //GoldenStarsTwinkle Mod End {Static[StaticP2R].Visible := V2R; @@ -1119,17 +1119,24 @@ begin //Refresh LastScore Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; - + //PerfectLineTwinkle Mod (effect) Pt.1 + if A >= 8 then Player[I].LastSentencePerfect := True + else Player[I].LastSentencePerfect := False; + //PerfectLineTwinkle Mod end end; //PhrasenBonus - Line Bonus Mod End// } + + //PerfectLineTwinkle Mod (effect) Pt.2 + GoldenRec.SpawnPerfectLineTwinkle; + //PerfectLineTwinkle Mod end end; //Called on Sentence Change S= New Current Sentence procedure TScreenSing.onSentenceChange(S: Cardinal); begin //GoldenStarsTwinkle Mod - GoldenRec.KillAll; + GoldenRec.SentenceChange; //GoldenStarsTwinkle Mod End end; -- cgit v1.2.3 From 12eb3f055c7c75dbfeb168d5c38f87a901a6ab89 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sat, 14 Apr 2007 10:03:18 +0000 Subject: Fixed a bug that causes Perfect Line twinkles to spawn at each Line when LineBonus is deactivated. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@87 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index e3b7c7ad..e4fd7add 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1084,12 +1084,12 @@ begin //PhrasenBonus - Line Bonus Mod + //Generate Steps 0 to 8 + A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); + If (Ini.LineBonus > 0) then begin - //Generate Steps 0 to 8 - A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); - //Generate Text if A >= 8 then Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8] @@ -1111,21 +1111,21 @@ begin Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; Player[I].LineBonus_Alpha := 0.92; Player[I].LineBonus_Visible := True; + end; + //PhrasenBonus - Line Bonus Mod End// } - - + //PerfectLineTwinkle Mod (effect) Pt.1 + If (Ini.EffectPerfect>=1) then + begin + if A >= 8 then Player[I].LastSentencePerfect := True + else Player[I].LastSentencePerfect := False; end; + //PerfectLineTwinkle Mod end //Refresh LastScore Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; - //PerfectLineTwinkle Mod (effect) Pt.1 - if A >= 8 then Player[I].LastSentencePerfect := True - else Player[I].LastSentencePerfect := False; - //PerfectLineTwinkle Mod end - end; -//PhrasenBonus - Line Bonus Mod End// } //PerfectLineTwinkle Mod (effect) Pt.2 GoldenRec.SpawnPerfectLineTwinkle; @@ -1138,7 +1138,6 @@ begin //GoldenStarsTwinkle Mod GoldenRec.SentenceChange; //GoldenStarsTwinkle Mod End - end; end. -- cgit v1.2.3 From e8f259a1a37ce5cf10a79dc53e184d6af4e7b7d6 Mon Sep 17 00:00:00 2001 From: b1indy Date: Tue, 17 Apr 2007 00:48:03 +0000 Subject: Changed aadvanced options to switch on/off sing-effects and screen-fading Changed Languages (english, german) and Theme (deluxe) to reflect these changes implemented checks for config values to make these things work as expected git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@101 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index e4fd7add..29ea5c8b 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1115,7 +1115,7 @@ begin //PhrasenBonus - Line Bonus Mod End// } //PerfectLineTwinkle Mod (effect) Pt.1 - If (Ini.EffectPerfect>=1) then + If (Ini.EffectSing=1) then begin if A >= 8 then Player[I].LastSentencePerfect := True else Player[I].LastSentencePerfect := False; @@ -1128,7 +1128,8 @@ begin end; //PerfectLineTwinkle Mod (effect) Pt.2 - GoldenRec.SpawnPerfectLineTwinkle; + if Ini.EffectSing=1 then + GoldenRec.SpawnPerfectLineTwinkle; //PerfectLineTwinkle Mod end end; -- cgit v1.2.3 From 7cbb58f6fe6cd8d81e21d6e0b1ebdc2fd872b773 Mon Sep 17 00:00:00 2001 From: mogguh Date: Tue, 17 Apr 2007 20:01:16 +0000 Subject: Feature: Added the possibility to skin the sing screen, it's now possible to set player 1 stuff related to player modi (1, 2 or 3 player mode) (affected UThemes.pas, UScreenSing.pas, UScreenSingModi.pas) Theme/Skin: Used the new sing screen possibility, looks way more ps3 now :P git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@109 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 238 ++++++++++++++++++++++---------------- 1 file changed, 140 insertions(+), 98 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 29ea5c8b..650cfdff 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -19,6 +19,19 @@ type TextP1: integer; TextP1Score: integer; + //Added for ps3 skin + //shown when game is in 2/4 player modus + StaticP1TwoP: integer; + StaticP1TwoPScoreBG: integer; + TextP1TwoP: integer; + TextP1TwoPScore: integer; + //shown when game is in 3/6 player modus + StaticP1ThreeP: integer; + StaticP1ThreePScoreBG: integer; + TextP1ThreeP: integer; + TextP1ThreePScore: integer; + //eoa + StaticP2R: integer; StaticP2RScoreBG: integer; TextP2R: integer; @@ -157,6 +170,20 @@ begin TextP1 := AddText(Theme.Sing.TextP1); TextP1Score := AddText(Theme.Sing.TextP1Score); + //Added for ps3 skin + //This one is shown in 2/4P mode + StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); + StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); + TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); + TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); + + //This one is shown in 3/6P mode + StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); + StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); + TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); + TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); + //eoa + StaticP2R := AddStatic(Theme.Sing.StaticP2R); StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); TextP2R := AddText(Theme.Sing.TextP2R); @@ -178,11 +205,13 @@ end; procedure TScreenSing.onShow; var - P: integer; - V1: boolean; - V2R: boolean; - V2M: boolean; - V3R: boolean; + P: integer; + V1: boolean; + V1TwoP: boolean; //added for ps3 skin + V1ThreeP: boolean; //added for ps3 skin + V2R: boolean; + V2M: boolean; + V3R: boolean; NR: TRecR; //Line Bonus Mod begin Log.LogStatus('Begin', 'onShow'); @@ -195,39 +224,65 @@ begin case PlayersPlay of 1: begin - V1 := true; - V2R := false; - V2M := false; - V3R := false; + V1 := true; + V1TwoP := false; //added for ps3 skin + V1ThreeP := false; //added for ps3 skin + V2R := false; + V2M := false; + V3R := false; end; 2: begin - V1 := true; - V2R := true; - V2M := false; - V3R := false; + V1 := false; + V1TwoP := true; //added for ps3 skin + V1ThreeP := false; //added for ps3 skin + V2R := true; + V2M := false; + V3R := false; end; 3: begin - V1 := true; - V2R := false; - V2M := true; - V3R := true; + V1 := false; + V1TwoP := false; //added for ps3 skin + V1ThreeP := true; //added for ps3 skin + V2R := false; + V2M := true; + V3R := true; end; 4: begin // double screen - V1 := true; - V2R := true; - V2M := false; - V3R := false; + V1 := false; + V1TwoP := true; //added for ps3 skin + V1ThreeP := false; //added for ps3 skin + V2R := true; + V2M := false; + V3R := false; end; 6: begin // double screen - V1 := true; - V2R := false; - V2M := true; - V3R := true; + V1 := false; + V1TwoP := false; //added for ps3 skin + V1ThreeP := true; //added for ps3 skin + V2R := false; + V2M := true; + V3R := true; end; end; - + //Added for ps3 skin + //This one is shown in 1P mode + Static[StaticP1].Visible := V1; + Static[StaticP1ScoreBG].Visible := V1; + Text[TextP1].Visible := V1; + Text[TextP1Score].Visible := V1; + //This one is shown in 2/4P mode + Static[StaticP1TwoP].Visible := V1TwoP; + Static[StaticP1TwoPScoreBG].Visible := V1TwoP; + Text[TextP1TwoP].Visible := V1TwoP; + Text[TextP1TwoPScore].Visible := V1TwoP; + //This one is shown in 3/6P mode + Static[StaticP1ThreeP].Visible := V1ThreeP; + Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; + Text[TextP1ThreeP].Visible := V1ThreeP; + Text[TextP1ThreePScore].Visible := V1ThreeP; + //eoa Static[StaticP2R].Visible := V2R; Static[StaticP2RScoreBG].Visible := V2R; @@ -402,10 +457,10 @@ begin 2: begin //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.X; - Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.X; + Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; //P2 Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.X; @@ -416,10 +471,10 @@ begin 3: begin //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; //P2 Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; @@ -436,10 +491,10 @@ begin 4: begin //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; //P2 Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; @@ -448,10 +503,10 @@ begin Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + Player[2].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; //P4 Player[3].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; @@ -462,10 +517,10 @@ begin 6: begin //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; //P2 Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; @@ -480,10 +535,10 @@ begin Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; //P4 - Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; - Player[3].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; - Player[3].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; - Player[3].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[3].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[3].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[3].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; //P5 Player[4].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; @@ -661,15 +716,15 @@ begin // set player colors if PlayersPlay = 4 then begin if ScreenAct = 1 then begin - LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, - Static[StaticP1].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, + Static[StaticP1TwoP].Texture.ColB, 'P1Dark'); LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, Static[StaticP2R].Texture.ColB, 'P2Dark'); - LoadColor(Static[StaticP1ScoreBG].Texture.ColR, Static[StaticP1ScoreBG].Texture.ColG, - Static[StaticP1ScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, + Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark'); LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); @@ -677,15 +732,15 @@ begin end; if ScreenAct = 2 then begin - LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, - Static[StaticP1].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, + Static[StaticP1TwoP].Texture.ColB, 'P3Dark'); LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, Static[StaticP2R].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP1ScoreBG].Texture.ColR, Static[StaticP1ScoreBG].Texture.ColG, - Static[StaticP1ScoreBG].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, + Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark'); LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark'); @@ -696,8 +751,8 @@ begin if PlayersPlay = 6 then begin if ScreenAct = 1 then begin - LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, - Static[StaticP1].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, + Static[StaticP1ThreeP].Texture.ColB, 'P1Dark'); LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, Static[StaticP2R].Texture.ColB, 'P2Dark'); LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, @@ -705,8 +760,8 @@ begin - LoadColor(Static[StaticP1ScoreBG].Texture.ColR, Static[StaticP1ScoreBG].Texture.ColG, - Static[StaticP1ScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, + Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark'); LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, @@ -716,8 +771,8 @@ begin end; if ScreenAct = 2 then begin - LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, - Static[StaticP1].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, + Static[StaticP1ThreeP].Texture.ColB, 'P4Dark'); LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, Static[StaticP2R].Texture.ColB, 'P5Dark'); LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, @@ -726,8 +781,8 @@ begin - LoadColor(Static[StaticP1ScoreBG].Texture.ColR, Static[StaticP1ScoreBG].Texture.ColG, - Static[StaticP1ScoreBG].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, + Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark'); LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark'); LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, @@ -781,6 +836,8 @@ begin // set player names (for 2 screens and only Singstar skin) if ScreenAct = 1 then begin Text[TextP1].Text := 'P1'; + Text[TextP1TwoP].Text := 'P1'; //added for ps3 skin + Text[TextP1ThreeP].Text := 'P1'; //added for ps3 skin Text[TextP2R].Text := 'P2'; Text[TextP2M].Text := 'P2'; Text[TextP3R].Text := 'P3'; @@ -802,11 +859,11 @@ begin end;} 4: begin - Text[TextP1].Text := 'P3'; + Text[TextP1TwoP].Text := 'P3'; Text[TextP2R].Text := 'P4'; end; 6: begin - Text[TextP1].Text := 'P4'; + Text[TextP1ThreeP].Text := 'P4'; Text[TextP2M].Text := 'P5'; Text[TextP3R].Text := 'P6'; end; @@ -814,31 +871,21 @@ begin end; // if // stereo - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; - - - +// weird stuff, maybe this is for "dual screen?", but where is player three then? + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; - - - - Text[TextP1].X := Text[TextP1].X + 10*ScreenX; Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX; - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; - - - - Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; - - + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; + Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX; +// end of weird stuff for S := 1 to 1 do Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX; @@ -865,7 +912,7 @@ begin if PlayersPlay = 2 then begin Tekst := IntToStr(Player[0].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1Score].Text := Tekst; + Text[TextP1TwoPScore].Text := Tekst; Tekst := IntToStr(Player[1].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; @@ -875,7 +922,7 @@ begin if PlayersPlay = 3 then begin Tekst := IntToStr(Player[0].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1Score].Text := Tekst; + Text[TextP1ThreePScore].Text := Tekst; Tekst := IntToStr(Player[1].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; @@ -890,7 +937,7 @@ begin if ScreenAct = 1 then begin Tekst := IntToStr(Player[0].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1Score].Text := Tekst; + Text[TextP1TwoPScore].Text := Tekst; Tekst := IntToStr(Player[1].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; @@ -899,7 +946,7 @@ begin if ScreenAct = 2 then begin Tekst := IntToStr(Player[2].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1Score].Text := Tekst; + Text[TextP1TwoPScore].Text := Tekst; Tekst := IntToStr(Player[3].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; @@ -911,7 +958,7 @@ begin if ScreenAct = 1 then begin Tekst := IntToStr(Player[0].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1Score].Text := Tekst; + Text[TextP1ThreePScore].Text := Tekst; Tekst := IntToStr(Player[1].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; @@ -924,7 +971,7 @@ begin if ScreenAct = 2 then begin Tekst := IntToStr(Player[3].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1Score].Text := Tekst; + Text[TextP1ThreePScore].Text := Tekst; Tekst := IntToStr(Player[4].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; @@ -985,26 +1032,21 @@ begin //GoldenNoteStarsTwinkle Mod // back stereo - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; - +// weird stuff, maybe this is for "dual screen?", but where is player three then? + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; - - Text[TextP1].X := Text[TextP1].X - 10*ScreenX; Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX; - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; - - + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; - - Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX; +//weird end for S := 1 to 1 do Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX; -- cgit v1.2.3 From e68a4499226b3b9a129e55c94cebee5910c0ff02 Mon Sep 17 00:00:00 2001 From: mota23 Date: Fri, 20 Apr 2007 17:19:05 +0000 Subject: Changed LinePopup Colors from Red->Green to Red->Yellow->Green git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@124 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 650cfdff..e7572ab9 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1145,9 +1145,36 @@ begin Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; //Color - Player[I].LineBonus_Color.B := 0; - Player[I].LineBonus_Color.R := (8-A)/8; - Player[I].LineBonus_Color.G := A/10; + Case Floor(A) of + 0: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := 0; + Player[I].LineBonus_Color.B := 0; + end; + 1..3: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := (A * 0.25); + Player[I].LineBonus_Color.B := 0; + end; + 4: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + 5..7: begin + Player[I].LineBonus_Color.R := 1-((a-4)*0.25); + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + 8: begin + Player[I].LineBonus_Color.R := 0; + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + End; //Case + //Player[I].LineBonus_Color.B := 0; + //Player[I].LineBonus_Color.R := (8-A)/8; + //Player[I].LineBonus_Color.G := A/10; Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; -- cgit v1.2.3 From 3c106109e17a62c0d6c3620fc290a90410cae84c Mon Sep 17 00:00:00 2001 From: mota23 Date: Fri, 20 Apr 2007 20:36:21 +0000 Subject: Made the Line-Popup pop up. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@125 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 1 + 1 file changed, 1 insertion(+) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index e7572ab9..6cd444a2 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1180,6 +1180,7 @@ begin Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; Player[I].LineBonus_Alpha := 0.92; Player[I].LineBonus_Visible := True; + Player[I].LineBonus_Age := 1; end; //PhrasenBonus - Line Bonus Mod End// } -- cgit v1.2.3 From b49192ef9d03915744a65009e25f06fafd72bd30 Mon Sep 17 00:00:00 2001 From: mogguh Date: Mon, 23 Apr 2007 21:38:08 +0000 Subject: Feature: SingBar is now moveable via theme/skin (affects UDraw.pas, UThemes.pas, UScreenSing.pas) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@128 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 6cd444a2..01195db2 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -19,6 +19,15 @@ type TextP1: integer; TextP1Score: integer; + //moveable singbar mod + StaticP1SingBar: integer; + StaticP1ThreePSingBar: integer; + StaticP1TwoPSingBar: integer; + StaticP2RSingBar: integer; + StaticP2MSingBar: integer; + StaticP3SingBar: integer; + //eoa moveable singbar + //Added for ps3 skin //shown when game is in 2/4 player modus StaticP1TwoP: integer; @@ -170,6 +179,15 @@ begin TextP1 := AddText(Theme.Sing.TextP1); TextP1Score := AddText(Theme.Sing.TextP1Score); + //moveable singbar mod + StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar); + StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar); + StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar); + StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar); + //eoa moveable singbar + //Added for ps3 skin //This one is shown in 2/4P mode StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); -- cgit v1.2.3 From 85dd8313961a9a7c519a3f4466c46f3027a67411 Mon Sep 17 00:00:00 2001 From: mota23 Date: Wed, 25 Apr 2007 19:36:07 +0000 Subject: Fixed positions for popups git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@139 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 64 +++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 01195db2..cca398a1 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -592,107 +592,107 @@ begin Case PlayersPlay of 1: begin - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_StartY := Skin_P2_NotesB - 105; end; 2: begin //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; end; 3: begin //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_TargetY := 120 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_StartY := 120 + 28; //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[1].LineBonus_TargetY := 245 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[1].LineBonus_StartY := 245 + 28; //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[2].LineBonus_TargetY := 370 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[2].LineBonus_StartY := 370 + 28; end; 4: begin //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[2].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; //P4 - Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[3].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; end; 6: begin //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_TargetY := 120 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[0].LineBonus_StartY := 120 + 28; //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[1].LineBonus_TargetY := 245 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[1].LineBonus_StartY := 245 + 28; //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[2].LineBonus_TargetY := 370 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[2].LineBonus_StartY := 370 + 28; //P4 - Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[3].LineBonus_TargetY := 120 - 65 + 28; - Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[3].LineBonus_StartY := 120 + 28; //P5 - Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[4].LineBonus_TargetY := 245 - 65 + 28; - Player[4].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[4].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[4].LineBonus_StartY := 245 + 28; //P6 - Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 87); + Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); Player[5].LineBonus_TargetY := 370 - 65 + 28; - Player[5].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 87); + Player[5].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); Player[5].LineBonus_StartY := 370 + 28; end; end; -- cgit v1.2.3 From bda4fa8e57ca63a1d591433f120b4226d6a5d327 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 29 Apr 2007 17:50:29 +0000 Subject: Added 2 new Buttons to ScreenMain: Multi and Stats Updated Language Fiels to Fit with new Buttons Some CodeClean Up in Menu Class and in Screens Some minor Bug fixes I forgot about Added ability to group Buttons within a Screen New Theme Object: ButtonCollection: Same Attributes as a Button Plus FirstChild: Defining the First Button in the Group. For Example: SingSolo is 1, SingMulti Button is 2, in ScreenMain Added Attribute to Theme Button: Parent: Number of the assigned Group, 0 for no Group Used new Abilitys in MainScreen git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@149 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index cca398a1..93c3ac48 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -163,13 +163,7 @@ var begin inherited Create; - AddBackground(Theme.Sing.Background.Tex); - - for I := 0 to High(Theme.Sing.Static) do - AddStatic(Theme.Sing.Static[I]); - - for I := 0 to High(Theme.Sing.Text) do - AddText(Theme.Sing.Text[I]); + LoadFromTheme(Theme.Sing); // time TextTime := AddText(75, 14, 1, 8, 0.25, 0.25, 0.25, '00:00'); -- cgit v1.2.3 From 0f327cf133373168d94538686b57c22ba364f2a8 Mon Sep 17 00:00:00 2001 From: mogguh Date: Thu, 3 May 2007 21:09:24 +0000 Subject: Feature: It's now possible to move/skin the time progress thing (no fix positions anymore) (affected: UDraw.pas, UGraphic.pas, UThemes.pas, UScreenSing.pas, UScreenSingModi.pas) Theme/Skin: Added the time stuff beneath the lyrics (as "the others" did too) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@164 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 93c3ac48..3e66b197 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -12,7 +12,12 @@ type PauseTime: Real; NumEmptySentences: integer; public - TextTime: integer; + //TextTime: integer; + + //TimeBar mod + StaticTimeProgress: integer; + TextTimeText: integer; + //eoa TimeBar mod StaticP1: integer; StaticP1ScoreBG: integer; @@ -166,7 +171,12 @@ begin LoadFromTheme(Theme.Sing); // time - TextTime := AddText(75, 14, 1, 8, 0.25, 0.25, 0.25, '00:00'); + //TextTime := AddText(75, 14, 1, 8, 0.25, 0.25, 0.25, '00:00'); + + //TimeBar mod + StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress); + TextTimeText := AddText(Theme.Sing.TextTimeText); + //eoa TimeBar mod StaticP1 := AddStatic(Theme.Sing.StaticP1); StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); @@ -908,11 +918,11 @@ begin // update static menu with time ... Min := Round(Czas.Teraz) div 60; Sec := Round(Czas.Teraz) mod 60; - Text[TextTime].Text := ''; - if Min < 10 then Text[TextTime].Text := '0'; - Text[TextTime].Text := Text[TextTime].Text + IntToStr(Min) + ':'; - if Sec < 10 then Text[TextTime].Text := Text[TextTime].Text + '0'; - Text[TextTime].Text := Text[TextTime].Text + IntToStr(Sec); + Text[TextTimeText].Text := ''; + if Min < 10 then Text[TextTimeText].Text := '0'; + Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':'; + if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0'; + Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec); // .. and scores if PlayersPlay = 1 then begin -- cgit v1.2.3 From b61e647b67ac0d449d764b89b117a3ac8b603403 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 8 May 2007 19:00:47 +0000 Subject: Readded Q Shortcut (Exit Application) on all Screens Clean up Popup Code a little bit git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@180 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 3e66b197..6985672f 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -92,6 +92,17 @@ begin If (PressedDown) Then begin // Key Down case PressedKey of + SDLK_Q: + begin + //When not ask before Exit then Finish now + if (Ini.AskbeforeDel <> 1) then + Finish + //else just Pause and let the Popup make the Work + else if not paused then + Pause; + + Result := false; + end; SDLK_ESCAPE : begin //Record Sound Hack: @@ -102,12 +113,6 @@ begin FadeTo(@ScreenScore); end; - SDLK_Q: - begin - Finish; - Result := false; - end; - SDLK_P://Pause Mod begin Pause; @@ -127,13 +132,7 @@ begin begin end; end; - end - else // Key Up - case PressedKey of - SDLK_RETURN : - begin - end; - end; + end; end; //Pause Mod -- cgit v1.2.3 From dcb6e5d386735b3ced44d7c6d6280343a16ca7db Mon Sep 17 00:00:00 2001 From: mota23 Date: Thu, 10 May 2007 00:57:17 +0000 Subject: Some Themework in Stats and SingScreen. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@187 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 6985672f..b49e0add 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -368,7 +368,7 @@ begin // sub text LyricSub.Clear; LyricSub.X := 400; - LyricSub.Y := Skin_LyricsT + 42; //40 + LyricSub.Y := Skin_LyricsT + 35; //42 //40 LyricSub.Align := 1; // set custom options @@ -385,13 +385,13 @@ begin {LyricMain.ColSR := Skin_FontHighlightR; LyricMain.ColSG := Skin_FontHighlightG; LyricMain.ColSB := Skin_FontHighlightB;1aa5dc} - LyricMain.ColSR := 26/255; - LyricMain.ColSG := 165/255; - LyricMain.ColSB := 220/255; + LyricMain.ColSR := 96/255; //26 + LyricMain.ColSG := 192/255; //165 + LyricMain.ColSB := 96/255; //220 - LyricSub.ColR := 0.6; - LyricSub.ColG := 0.6; - LyricSub.ColB := 0.6; + LyricSub.ColR := 0.4; //0.6 + LyricSub.ColG := 0.4; //0.6 + LyricSub.ColB := 0.4; //0.6 end; 1: begin -- cgit v1.2.3 From 4a731514163a14bd3a9222d99707880b56772663 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 16 May 2007 19:19:35 +0000 Subject: all SongFile Loading and Saving procedures moved to UFiles. Added Some Tolerance in Song File Loading and Song Header Loading. Fix: Programm doesn't Crash anymore when a coruppted Song is loaded for Singing or Editing. Now Jump back to SongScreen and show an Error Message. Also Party Mode is not Interupted, a new Song will be selected automatically. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@197 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index b49e0add..cdce5984 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -2,7 +2,7 @@ unit UScreenSing; interface -uses UMenu, UMusic, SDL, SysUtils, UPliki, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics, +uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics, TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses; type @@ -321,11 +321,29 @@ begin Text[TextP3RScore].Visible := V3R; // load notes - CzyscNuty; + ResetSingTemp; // Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); AktSong := CatSongs.Song[CatSongs.Selected]; - - WczytajCzesci(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName); + try + if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then + begin + //Error Loading Song -> Go back to Song Screen and Show some Error Message + FadeTo(@ScreenSong); + //Select New Song in Party Mode + if ScreenSong.Mode = 1 then + ScreenSong.SelectRandomSong; + ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + Exit; + end; + except + //Error Loading Song -> Go back to Song Screen and Show some Error Message + FadeTo(@ScreenSong); + //Select New Song in Party Mode + if ScreenSong.Mode = 1 then + ScreenSong.SelectRandomSong; + ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + Exit; + end; AktSong.Path := CatSongs.Song[CatSongs.Selected].Path; // AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed -- cgit v1.2.3 From 8d45ef9b08de96a0037ac9e245a84b7730228736 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 20 May 2007 09:40:48 +0000 Subject: An effort to make a workaround for the many Crashes when a Video File ist corrupted. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@225 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index cdce5984..3899a4ed 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -730,7 +730,23 @@ end; procedure TScreenSing.onShowFinish; begin // play movie (II) - if AktSong.VideoLoaded then PlaySmpeg; + + if AktSong.VideoLoaded then + begin + try + PlaySmpeg; + except + //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Corrupted File: ' + AktSong.Video); + try + CloseSmpeg; + except + + end; + end; + end; // play music (II) Music.Play; @@ -1039,7 +1055,19 @@ begin SingDrawBackground; // update and draw movie if ShowFinish and AktSong.VideoLoaded then begin - UpdateSmpeg; // this only draws + try + UpdateSmpeg; // this only draws + except + //If an Error occurs drawing: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Corrupted File: ' + AktSong.Video); + try + CloseSmpeg; + except + + end; + end; end; // draw static menu (FG) -- cgit v1.2.3 From c7e2eee2adb177669622a9ee99072ad2b746efe5 Mon Sep 17 00:00:00 2001 From: mota23 Date: Sat, 26 May 2007 15:48:55 +0000 Subject: Changed active lyrics color back to blue. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@230 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 3899a4ed..ed79bb2f 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -403,9 +403,9 @@ begin {LyricMain.ColSR := Skin_FontHighlightR; LyricMain.ColSG := Skin_FontHighlightG; LyricMain.ColSB := Skin_FontHighlightB;1aa5dc} - LyricMain.ColSR := 96/255; //26 - LyricMain.ColSG := 192/255; //165 - LyricMain.ColSB := 96/255; //220 + LyricMain.ColSR := 5/255; //26 + LyricMain.ColSG := 163/255; //165 + LyricMain.ColSB := 210/255; //220 LyricSub.ColR := 0.4; //0.6 LyricSub.ColG := 0.4; //0.6 -- cgit v1.2.3 From 79bed9be3f06a0ce6026755fbe49bd7437bdf12e Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 27 May 2007 09:26:00 +0000 Subject: Added workaround for corrupted background Images git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@231 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index ed79bb2f..2ba7522f 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -8,9 +8,9 @@ uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UT type TScreenSing = class(TMenu) protected - paused: boolean; //Pause Mod - PauseTime: Real; - NumEmptySentences: integer; + paused: boolean; //Pause Mod + PauseTime: Real; + NumEmptySentences: integer; public //TextTime: integer; @@ -356,7 +356,12 @@ begin // set background if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then - Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background) + try + Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background); + except + log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background); + Tex_Background.TexNum := -1; + end else Tex_Background.TexNum := -1; -- cgit v1.2.3 From b7f377e62a7e941d7898c187a63dd6ed99b0798f Mon Sep 17 00:00:00 2001 From: b1indy Date: Sat, 28 Jul 2007 13:29:32 +0000 Subject: experimental ffmpeg videodecoding support, frameskipping doesn't work quite right yet git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@332 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 2ba7522f..4bf405f6 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -3,7 +3,7 @@ unit UScreenSing; interface uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics, - TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses; + TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, Uffmpeg; type TScreenSing = class(TMenu) @@ -145,7 +145,7 @@ begin //stop Music Music.Pause; if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video - PauseSmpeg; //Video + FFmpegTogglePause;//PauseSmpeg; //Video end else //Pause ausschalten begin @@ -153,7 +153,7 @@ begin Music.MoveTo (PauseTime);//Position of Music Music.Play; //Play Music if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video - PlaySmpeg; + FFmpegTogglePause;//PlaySmpeg; //SkipSmpeg(PauseTime); Paused := false; end; @@ -222,6 +222,7 @@ begin LyricMain := TLyric.Create; LyricSub := TLyric.Create; + Uffmpeg.Init; end; procedure TScreenSing.onShow; @@ -349,8 +350,11 @@ begin // set movie if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin - OpenSmpeg(AktSong.Path + AktSong.Video); - SkipSmpeg(AktSong.VideoGAP + AktSong.Start); +{ OpenSmpeg(AktSong.Path + AktSong.Video); + SkipSmpeg(AktSong.VideoGAP + AktSong.Start);} + // todo: VideoGap and Start time verwursten + FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); + FFmpegSkip(AktSong.VideoGAP + AktSong.Start); AktSong.VideoLoaded := true; end; @@ -739,14 +743,17 @@ begin if AktSong.VideoLoaded then begin try - PlaySmpeg; + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL; +// PlaySmpeg; except //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video AktSong.VideoLoaded := False; Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); Log.LogError('Corrupted File: ' + AktSong.Video); try - CloseSmpeg; +// CloseSmpeg; + FFmpegClose; except end; @@ -1061,14 +1068,19 @@ begin // update and draw movie if ShowFinish and AktSong.VideoLoaded then begin try - UpdateSmpeg; // this only draws +// UpdateSmpeg; // this only draws + // todo: find a way to determine, when a new frame is needed + // toto: same for the need to skip frames + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL; except //If an Error occurs drawing: prevent Video from being Drawn again and Close Video AktSong.VideoLoaded := False; log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); Log.LogError('Corrupted File: ' + AktSong.Video); try - CloseSmpeg; +// CloseSmpeg; + FFmpegClose; except end; @@ -1095,7 +1107,7 @@ begin end; end; end; - + // draw custom items SingDraw; // always draw @@ -1143,7 +1155,8 @@ begin end; if AktSong.VideoLoaded then begin - CloseSmpeg; +// CloseSmpeg; + FFmpegClose; AktSong.VideoLoaded := false; // to prevent drawing closed video end; -- cgit v1.2.3 From af7100ef908a4ee1474a607ed255c707959222f1 Mon Sep 17 00:00:00 2001 From: b1indy Date: Sat, 1 Sep 2007 17:42:46 +0000 Subject: ffmpeg support now with dualscreen mode git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@359 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 4bf405f6..6ce19c17 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -744,7 +744,7 @@ begin begin try FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL; + FFmpegDrawGL(ScreenAct); // PlaySmpeg; except //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video @@ -1072,7 +1072,7 @@ begin // todo: find a way to determine, when a new frame is needed // toto: same for the need to skip frames FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL; + FFmpegDrawGL(ScreenAct); except //If an Error occurs drawing: prevent Video from being Drawn again and Close Video AktSong.VideoLoaded := False; -- cgit v1.2.3 From 3043d3db91c3a541881aa951bbd4f8ccb5e3ce40 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Wed, 5 Sep 2007 12:35:19 +0000 Subject: modified ParseInput so Backspace will perform same function as ESC in most screens ( Except where text input is required, and backspace is used for text input ) This has been done, so that when used with Windows Media Center IR Remotes ( needs SDL 1.2 dll at runtime ) users can navigate throug the game without sitting in front of the PC keyboard. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@370 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 6ce19c17..8291a430 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -103,7 +103,9 @@ begin Result := false; end; - SDLK_ESCAPE : + + SDLK_ESCAPE, + SDLK_BACKSPACE : begin //Record Sound Hack: //Sound[0].BufferLong -- cgit v1.2.3 From 247cbdca4eb8af228fa1753f1185e85077b5befa Mon Sep 17 00:00:00 2001 From: b1indy Date: Fri, 7 Sep 2007 21:09:02 +0000 Subject: UScreenSing.pas, UScreenSingModi.pas: removed Uffmpeg and USmpeg, added UVideo UGraphic.pas: prepared for possible loading animation UGraphicClasses.pas, ULCD.pas, ULight.pas, UMain.pas, USkins.pas, UDisplay.pas, UMenuButton.pas, UMenuSelect.pas, UMenuSelectSlide.pas, UMenuStatic.pas, UScreenCredits.pas, UScreenEditSub.pas, UScreenOpen.pas, UScreenPopup.pas: some fixes to get rid of some compiler infos/warnings git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@374 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 8291a430..7a585cef 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -3,7 +3,7 @@ unit UScreenSing; interface uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics, - TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, Uffmpeg; + TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, UVideo; type TScreenSing = class(TMenu) @@ -224,7 +224,7 @@ begin LyricMain := TLyric.Create; LyricSub := TLyric.Create; - Uffmpeg.Init; + UVideo.Init; end; procedure TScreenSing.onShow; -- cgit v1.2.3 From e0b594a06c1e70df28b873b49e538ded7b3124c5 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sat, 8 Sep 2007 09:46:16 +0000 Subject: Fixed USMPeg still in Uses from UScreenSing git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@377 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 7a585cef..deaff447 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -2,7 +2,7 @@ unit UScreenSing; interface -uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics, +uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics, TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, UVideo; type -- cgit v1.2.3 From 13666b8a713f7f46d1db186ba147aa91984ddb0f Mon Sep 17 00:00:00 2001 From: mogguh Date: Mon, 10 Sep 2007 13:06:56 +0000 Subject: Overall look: ScoreBGs and playerboxes (p1, p2,..) are now drawn as colorized pngs. Notes are drawn with 3 textures instead of 2: bg_glow, notebg (unsung) and note hit (sung) - these are colorized pngs - textures will come in the following commit. Known Bugs: - ScoreBGs are not yet drawn in playercolor (only affects player count > 3) - Phrasen bonus pop up, indexes are not yet filled with usable data, therefore textures are not yet loaded correctly - Linebonus not yet done git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@382 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 393 ++++++++++++++++---------------------- 1 file changed, 161 insertions(+), 232 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index deaff447..a5f6a317 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -141,24 +141,34 @@ end; procedure TScreenSing.Pause; begin if not paused then //Pause einschalten - begin - PauseTime := Czas.Teraz; - Paused := true; - //stop Music - Music.Pause; - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video - FFmpegTogglePause;//PauseSmpeg; //Video - end - else //Pause ausschalten - begin - Czas.Teraz := PauseTime; //Position of Notes - Music.MoveTo (PauseTime);//Position of Music - Music.Play; //Play Music - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video - FFmpegTogglePause;//PlaySmpeg; + begin + // pause Time + PauseTime := Czas.Teraz; + Paused := true; + + // pause Music + Music.Pause; + + // pause Video + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + FFmpegTogglePause; + end + else //Pause ausschalten + begin + Czas.Teraz := PauseTime; //Position of Notes + + // Position of Music + Music.MoveTo (PauseTime); + // Play Music + Music.Play; + + // Video + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + FFmpegTogglePause; //SkipSmpeg(PauseTime); - Paused := false; - end; + + Paused := false; + end; end; //Pause Mod End @@ -171,59 +181,60 @@ begin LoadFromTheme(Theme.Sing); - // time - //TextTime := AddText(75, 14, 1, 8, 0.25, 0.25, 0.25, '00:00'); - - //TimeBar mod - StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress); - TextTimeText := AddText(Theme.Sing.TextTimeText); - //eoa TimeBar mod - - StaticP1 := AddStatic(Theme.Sing.StaticP1); - StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); - TextP1 := AddText(Theme.Sing.TextP1); - TextP1Score := AddText(Theme.Sing.TextP1Score); - - //moveable singbar mod - StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar); - StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar); - StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); - StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); - StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar); - StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar); - //eoa moveable singbar - - //Added for ps3 skin - //This one is shown in 2/4P mode - StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); - StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); - TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); - TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); - - //This one is shown in 3/6P mode - StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); + //TimeBar + StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress); + TextTimeText := AddText(Theme.Sing.TextTimeText); + +// 1 player | P1 + StaticP1 := AddStatic(Theme.Sing.StaticP1); + StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); + TextP1 := AddText(Theme.Sing.TextP1); + TextP1Score := AddText(Theme.Sing.TextP1Score); + StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar); + +// 2 or 4 players | P1 + StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); + StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); + TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); + TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); + StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + + // | P2 + StaticP2R := AddStatic(Theme.Sing.StaticP2R); + StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); + TextP2R := AddText(Theme.Sing.TextP2R); + TextP2RScore := AddText(Theme.Sing.TextP2RScore); + StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + +// 3 or 6 players | P1 + StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); - TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); - TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); - //eoa - - StaticP2R := AddStatic(Theme.Sing.StaticP2R); - StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); - TextP2R := AddText(Theme.Sing.TextP2R); - TextP2RScore := AddText(Theme.Sing.TextP2RScore); - - StaticP2M := AddStatic(Theme.Sing.StaticP2M); - StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); - TextP2M := AddText(Theme.Sing.TextP2M); - TextP2MScore := AddText(Theme.Sing.TextP2MScore); - - StaticP3R := AddStatic(Theme.Sing.StaticP3R); - StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); - TextP3R := AddText(Theme.Sing.TextP3R); - TextP3RScore := AddText(Theme.Sing.TextP3RScore); - - LyricMain := TLyric.Create; - LyricSub := TLyric.Create; + TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); + TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); + StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar); + + // | P2 + StaticP2M := AddStatic(Theme.Sing.StaticP2M); + StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); + TextP2M := AddText(Theme.Sing.TextP2M); + TextP2MScore := AddText(Theme.Sing.TextP2MScore); + StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar); + + // | P3 + StaticP3R := AddStatic(Theme.Sing.StaticP3R); + StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); + TextP3R := AddText(Theme.Sing.TextP3R); + TextP3RScore := AddText(Theme.Sing.TextP3RScore); + StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar); + + if ScreenAct = 2 then begin + // katze und affe + + end; + + LyricMain := TLyric.Create; + LyricSub := TLyric.Create; + UVideo.Init; end; @@ -245,44 +256,43 @@ begin SetLength(Player, PlayersPlay); // Player[0].ScoreTotalI := 0; - case PlayersPlay of 1: begin V1 := true; - V1TwoP := false; //added for ps3 skin - V1ThreeP := false; //added for ps3 skin + V1TwoP := false; + V1ThreeP := false; V2R := false; V2M := false; V3R := false; end; 2: begin V1 := false; - V1TwoP := true; //added for ps3 skin - V1ThreeP := false; //added for ps3 skin + V1TwoP := true; + V1ThreeP := false; V2R := true; V2M := false; V3R := false; end; 3: begin V1 := false; - V1TwoP := false; //added for ps3 skin - V1ThreeP := true; //added for ps3 skin + V1TwoP := false; + V1ThreeP := true; V2R := false; V2M := true; V3R := true; end; 4: begin // double screen V1 := false; - V1TwoP := true; //added for ps3 skin - V1ThreeP := false; //added for ps3 skin + V1TwoP := true; + V1ThreeP := false; V2R := true; V2M := false; V3R := false; end; 6: begin // double screen V1 := false; - V1TwoP := false; //added for ps3 skin - V1ThreeP := true; //added for ps3 skin + V1TwoP := false; + V1ThreeP := true; V2R := false; V2M := true; V3R := true; @@ -290,38 +300,40 @@ begin end; - //Added for ps3 skin //This one is shown in 1P mode - Static[StaticP1].Visible := V1; - Static[StaticP1ScoreBG].Visible := V1; - Text[TextP1].Visible := V1; - Text[TextP1Score].Visible := V1; + Static[StaticP1].Visible := V1; + Static[StaticP1ScoreBG].Visible := V1; + Text[TextP1].Visible := V1; + Text[TextP1Score].Visible := V1; + + //This one is shown in 2/4P mode - Static[StaticP1TwoP].Visible := V1TwoP; - Static[StaticP1TwoPScoreBG].Visible := V1TwoP; - Text[TextP1TwoP].Visible := V1TwoP; - Text[TextP1TwoPScore].Visible := V1TwoP; + Static[StaticP1TwoP].Visible := V1TwoP; + Static[StaticP1TwoPScoreBG].Visible := V1TwoP; + Text[TextP1TwoP].Visible := V1TwoP; + Text[TextP1TwoPScore].Visible := V1TwoP; + + Static[StaticP2R].Visible := V2R; + Static[StaticP2RScoreBG].Visible := V2R; + Text[TextP2R].Visible := V2R; + Text[TextP2RScore].Visible := V2R; + + //This one is shown in 3/6P mode - Static[StaticP1ThreeP].Visible := V1ThreeP; + Static[StaticP1ThreeP].Visible := V1ThreeP; Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; - Text[TextP1ThreeP].Visible := V1ThreeP; - Text[TextP1ThreePScore].Visible := V1ThreeP; - //eoa + Text[TextP1ThreeP].Visible := V1ThreeP; + Text[TextP1ThreePScore].Visible := V1ThreeP; - Static[StaticP2R].Visible := V2R; - Static[StaticP2RScoreBG].Visible := V2R; - Text[TextP2R].Visible := V2R; - Text[TextP2RScore].Visible := V2R; + Static[StaticP2M].Visible := V2M; + Static[StaticP2MScoreBG].Visible := V2M; + Text[TextP2M].Visible := V2M; + Text[TextP2MScore].Visible := V2M; - Static[StaticP2M].Visible := V2M; - Static[StaticP2MScoreBG].Visible := V2M; - Text[TextP2M].Visible := V2M; - Text[TextP2MScore].Visible := V2M; - - Static[StaticP3R].Visible := V3R; - Static[StaticP3RScoreBG].Visible := V3R; - Text[TextP3R].Visible := V3R; - Text[TextP3RScore].Visible := V3R; + Static[StaticP3R].Visible := V3R; + Static[StaticP3RScoreBG].Visible := V3R; + Text[TextP3R].Visible := V3R; + Text[TextP3RScore].Visible := V3R; // load notes ResetSingTemp; @@ -479,21 +491,6 @@ begin GoldenRec.SentenceChange; //GoldenStarsTwinkle Mod End - {Static[StaticP2R].Visible := V2R; - Static[StaticP2RScoreBG].Visible := V2R; - Text[TextP2R].Visible := V2R; - Text[TextP2RScore].Visible := V2R; - - Static[StaticP2M].Visible := V2M; - Static[StaticP2MScoreBG].Visible := V2M; - Text[TextP2M].Visible := V2M; - Text[TextP2MScore].Visible := V2M; - - Static[StaticP3R].Visible := V3R; - Static[StaticP3RScoreBG].Visible := V3R; - Text[TextP3R].Visible := V3R; - Text[TextP3RScore].Visible := V3R;} - //Set Position of Line Bonus - PhrasenBonus if (Ini.LineBonus = 1) then //Show Line Bonus at Scores begin @@ -606,9 +603,6 @@ begin end else if (Ini.LineBonus = 2) then //Show Line Bonus at Notes begin - //SingDrawNoteLines(Nr.Left + 10*ScreenX, 120, Nr.Right + 10*ScreenX, 12); - //SingDrawNoteLines(Nr.Left + 10*ScreenX, 245, Nr.Right + 10*ScreenX, 12); - //SingDrawNoteLines(Nr.Left + 10*ScreenX, 370, Nr.Right + 10*ScreenX, 12); // positions if Ini.SingWindow = 0 then begin @@ -781,24 +775,19 @@ begin - //ScoreBG Mod - // set player colors - if PlayersPlay = 4 then begin + //ScoreBG Mod | den wirren Scheiss hier brauch mer nimmer, wir haben colorized png's - no need for wirrness also + // set player colors - macht nichts weiter als die farben des statics zu wechseln, was zu unschönen effekten bei colorized png führt +{ if PlayersPlay = 4 then begin if ScreenAct = 1 then begin LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, Static[StaticP1TwoP].Texture.ColB, 'P1Dark'); LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, Static[StaticP2R].Texture.ColB, 'P2Dark'); - - LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark'); LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); - - - end; if ScreenAct = 2 then begin LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, @@ -806,110 +795,57 @@ begin LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, Static[StaticP2R].Texture.ColB, 'P4Dark'); - - LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark'); LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark'); - - - end; end; if PlayersPlay = 6 then begin if ScreenAct = 1 then begin - LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, Static[StaticP1ThreeP].Texture.ColB, 'P1Dark'); LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, Static[StaticP2R].Texture.ColB, 'P2Dark'); LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, Static[StaticP3R].Texture.ColB, 'P3Dark'); - - LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark'); LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); + Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark'); - - - end; if ScreenAct = 2 then begin + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, Static[StaticP1ThreeP].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, Static[StaticP2R].Texture.ColB, 'P5Dark'); LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, Static[StaticP3R].Texture.ColB, 'P6Dark'); - - - LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, - Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, + LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, + Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark'); LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark'); - - - - - end; - end; - -//Original 0.5.0 -{ // set player colors - if PlayersPlay = 4 then begin - if ScreenAct = 1 then begin - //LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, - //Static[StaticP1].Texture.ColB, 'P1Dark'); -// LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, - // Static[StaticP2R].Texture.ColB, 'P2Dark'); - end; - if ScreenAct = 2 then begin - LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, - Static[StaticP1].Texture.ColB, 'P3Dark'); - LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P4Dark'); end; end; - - if PlayersPlay = 6 then begin - if ScreenAct = 1 then begin - LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, - Static[StaticP1].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P2Dark'); - LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, - Static[StaticP3R].Texture.ColB, 'P3Dark'); - end; - if ScreenAct = 2 then begin - LoadColor(Static[StaticP1].Texture.ColR, Static[StaticP1].Texture.ColG, - Static[StaticP1].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P5Dark'); - LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, - Static[StaticP3R].Texture.ColB, 'P6Dark'); - end; - end; } - //end ScoreBG Mod - - + } // set player names (for 2 screens and only Singstar skin) if ScreenAct = 1 then begin - Text[TextP1].Text := 'P1'; - Text[TextP1TwoP].Text := 'P1'; //added for ps3 skin - Text[TextP1ThreeP].Text := 'P1'; //added for ps3 skin - Text[TextP2R].Text := 'P2'; - Text[TextP2M].Text := 'P2'; - Text[TextP3R].Text := 'P3'; + Text[TextP1].Text := 'P1'; + Text[TextP1TwoP].Text := 'P1'; + Text[TextP1ThreeP].Text := 'P1'; + Text[TextP2R].Text := 'P2'; + Text[TextP2M].Text := 'P2'; + Text[TextP3R].Text := 'P3'; end; if ScreenAct = 2 then begin @@ -928,35 +864,37 @@ begin end;} 4: begin - Text[TextP1TwoP].Text := 'P3'; - Text[TextP2R].Text := 'P4'; + Text[TextP1TwoP].Text := 'P3'; + Text[TextP2R].Text := 'P4'; end; 6: begin Text[TextP1ThreeP].Text := 'P4'; - Text[TextP2M].Text := 'P5'; - Text[TextP3R].Text := 'P6'; + Text[TextP2M].Text := 'P5'; + Text[TextP3R].Text := 'P6'; end; end; // case end; // if // stereo -// weird stuff, maybe this is for "dual screen?", but where is player three then? - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; - Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; +// weird stuff, maybe this is for "dual screen?", but where is player three then? | okay, i commented the stuff out the other day - nothing was missing on screen w/ 6 players - so do we even need this stuff? +// okay this stuff appears again some lines beneath this one, I commented it out for testing what it does - seems like it's doing nothing +// but I might be wrong, so what is this stuff here doing? O.o + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; + Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; - Text[TextP1].X := Text[TextP1].X + 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX; + Text[TextP1].X := Text[TextP1].X + 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX; - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; - Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX; + Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX; // end of weird stuff - for S := 1 to 1 do + for S := 1 to 1 do //wtf? Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX; for T := 0 to 1 do @@ -1052,17 +990,6 @@ begin end; end; - - // beat flash -{ Flash := 1 - (Czas.MidBeat - Czas.AktBeat); - if (Czas.AktBeat + AktSong.NotesGAP) mod AktSong.Resolution = 0 then Flash := 1 - else Flash := 0; - if Czas.AktBeat < 0 then Flash := 0; - glClearColor(Flash, Flash, Flash, 1);} - - // beat sound -// if (Ini.BeatClick = 1) and (Flash = 1) and (Czas.AktBeat <> Czas.OldBeat) then Music.PlayClick; - // draw static menu (BG) DrawBG; //Draw Background @@ -1120,21 +1047,23 @@ begin // back stereo // weird stuff, maybe this is for "dual screen?", but where is player three then? - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; - Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; +// okay this stuff appears again some lines above this one, I commented it out for testing what it does - seems like it's doing nothing +// but I might be wrong, so what is this stuff here doing? O.o + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; + Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; - Text[TextP1].X := Text[TextP1].X - 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX; + Text[TextP1].X := Text[TextP1].X - 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX; - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; - Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX; + Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX; //weird end - for S := 1 to 1 do + for S := 1 to 1 do // wtf? Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX; for T := 0 to 1 do @@ -1205,7 +1134,7 @@ begin If ({(Ini.Oscilloscope = 2) and }(Czesci[0].Czesc[S].TotalNotes>0)) then begin Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 40 - 26); - if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; + if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; //end Singbar Mod -- cgit v1.2.3 From 62c82114318ed04ce42617fa9ce2e179834dbda4 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Wed, 19 Sep 2007 11:44:10 +0000 Subject: added UCommon ( in classes ) for lazarus... common functions needed for lazarus ( and others ) can be put in here. also this now compiles on lazarus.. ( dosnt link yet... but I dont get any critical compiler errors ) tested to compile in my delphi, and basic functionality is fine. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@395 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index a5f6a317..1dd31ae9 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -2,6 +2,11 @@ unit UScreenSing; interface +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + + uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics, TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, UVideo; @@ -364,8 +369,9 @@ begin // set movie if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin -{ OpenSmpeg(AktSong.Path + AktSong.Video); - SkipSmpeg(AktSong.VideoGAP + AktSong.Start);} +(* OpenSmpeg(AktSong.Path + AktSong.Video); + SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) + // todo: VideoGap and Start time verwursten FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); FFmpegSkip(AktSong.VideoGAP + AktSong.Start); -- cgit v1.2.3 From db82b7e30a1b58b56fdb4bfc6089b47200ca1da1 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 20 Sep 2007 06:36:58 +0000 Subject: Ultrastar-DX now compiles in linux (using lazarus) Bass etc is commented out.. but it compiles, and im working through the runtime errors. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@408 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 2492 +++++++++++++++++++------------------ 1 file changed, 1256 insertions(+), 1236 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 1dd31ae9..343a2e6d 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1,1236 +1,1256 @@ -unit UScreenSing; - -interface - -{$IFDEF FPC} - {$MODE DELPHI} -{$ENDIF} - - -uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics, - TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, UVideo; - -type - TScreenSing = class(TMenu) - protected - paused: boolean; //Pause Mod - PauseTime: Real; - NumEmptySentences: integer; - public - //TextTime: integer; - - //TimeBar mod - StaticTimeProgress: integer; - TextTimeText: integer; - //eoa TimeBar mod - - StaticP1: integer; - StaticP1ScoreBG: integer; - TextP1: integer; - TextP1Score: integer; - - //moveable singbar mod - StaticP1SingBar: integer; - StaticP1ThreePSingBar: integer; - StaticP1TwoPSingBar: integer; - StaticP2RSingBar: integer; - StaticP2MSingBar: integer; - StaticP3SingBar: integer; - //eoa moveable singbar - - //Added for ps3 skin - //shown when game is in 2/4 player modus - StaticP1TwoP: integer; - StaticP1TwoPScoreBG: integer; - TextP1TwoP: integer; - TextP1TwoPScore: integer; - //shown when game is in 3/6 player modus - StaticP1ThreeP: integer; - StaticP1ThreePScoreBG: integer; - TextP1ThreeP: integer; - TextP1ThreePScore: integer; - //eoa - - StaticP2R: integer; - StaticP2RScoreBG: integer; - TextP2R: integer; - TextP2RScore: integer; - - StaticP2M: integer; - StaticP2MScoreBG: integer; - TextP2M: integer; - TextP2MScore: integer; - - StaticP3R: integer; - StaticP3RScoreBG: integer; - TextP3R: integer; - TextP3RScore: integer; - - Tex_Background: TTexture; - FadeOut: boolean; - LyricMain: TLyric; - LyricSub: TLyric; - - constructor Create; override; - procedure onShow; override; - procedure onShowFinish; override; - function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; - function Draw: boolean; override; - procedure Finish; virtual; - procedure UpdateLCD; - procedure Pause; //Pause Mod(Toggles Pause) - - //OnSentenceEnd for LineBonus + Singbar - procedure onSentenceEnd(S: Cardinal); - //OnSentenceChange (for Golden Notes) - procedure onSentenceChange(S: Cardinal); - end; - -implementation -uses UGraphic, UDraw, UMain, Classes, URecord, ULanguage, math; - -// Method for input parsing. If False is returned, GetNextWindow -// should be checked to know the next window to load; -function TScreenSing.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; -begin - Result := true; - If (PressedDown) Then - begin // Key Down - case PressedKey of - SDLK_Q: - begin - //When not ask before Exit then Finish now - if (Ini.AskbeforeDel <> 1) then - Finish - //else just Pause and let the Popup make the Work - else if not paused then - Pause; - - Result := false; - end; - - SDLK_ESCAPE, - SDLK_BACKSPACE : - begin - //Record Sound Hack: - //Sound[0].BufferLong - - Finish; - Music.PlayBack; - FadeTo(@ScreenScore); - end; - - SDLK_P://Pause Mod - begin - Pause; - end; - - SDLK_RETURN: - begin - end; - - // Up and Down could be done at the same time, - // but I don't want to declare variables inside - // functions like this one, called so many times - SDLK_DOWN : - begin - end; - SDLK_UP : - begin - end; - end; - end; -end; - -//Pause Mod -procedure TScreenSing.Pause; -begin - if not paused then //Pause einschalten - begin - // pause Time - PauseTime := Czas.Teraz; - Paused := true; - - // pause Music - Music.Pause; - - // pause Video - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; - end - else //Pause ausschalten - begin - Czas.Teraz := PauseTime; //Position of Notes - - // Position of Music - Music.MoveTo (PauseTime); - // Play Music - Music.Play; - - // Video - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; - //SkipSmpeg(PauseTime); - - Paused := false; - end; -end; -//Pause Mod End - -constructor TScreenSing.Create; -var - I: integer; - P: integer; -begin - inherited Create; - - LoadFromTheme(Theme.Sing); - - //TimeBar - StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress); - TextTimeText := AddText(Theme.Sing.TextTimeText); - -// 1 player | P1 - StaticP1 := AddStatic(Theme.Sing.StaticP1); - StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); - TextP1 := AddText(Theme.Sing.TextP1); - TextP1Score := AddText(Theme.Sing.TextP1Score); - StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar); - -// 2 or 4 players | P1 - StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); - StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); - TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); - TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); - StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); - - // | P2 - StaticP2R := AddStatic(Theme.Sing.StaticP2R); - StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); - TextP2R := AddText(Theme.Sing.TextP2R); - TextP2RScore := AddText(Theme.Sing.TextP2RScore); - StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); - -// 3 or 6 players | P1 - StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); - StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); - TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); - TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); - StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar); - - // | P2 - StaticP2M := AddStatic(Theme.Sing.StaticP2M); - StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); - TextP2M := AddText(Theme.Sing.TextP2M); - TextP2MScore := AddText(Theme.Sing.TextP2MScore); - StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar); - - // | P3 - StaticP3R := AddStatic(Theme.Sing.StaticP3R); - StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); - TextP3R := AddText(Theme.Sing.TextP3R); - TextP3RScore := AddText(Theme.Sing.TextP3RScore); - StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar); - - if ScreenAct = 2 then begin - // katze und affe - - end; - - LyricMain := TLyric.Create; - LyricSub := TLyric.Create; - - UVideo.Init; -end; - -procedure TScreenSing.onShow; -var - P: integer; - V1: boolean; - V1TwoP: boolean; //added for ps3 skin - V1ThreeP: boolean; //added for ps3 skin - V2R: boolean; - V2M: boolean; - V3R: boolean; - NR: TRecR; //Line Bonus Mod -begin - Log.LogStatus('Begin', 'onShow'); - FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented - - // prepare players - SetLength(Player, PlayersPlay); -// Player[0].ScoreTotalI := 0; - - case PlayersPlay of - 1: begin - V1 := true; - V1TwoP := false; - V1ThreeP := false; - V2R := false; - V2M := false; - V3R := false; - end; - 2: begin - V1 := false; - V1TwoP := true; - V1ThreeP := false; - V2R := true; - V2M := false; - V3R := false; - end; - 3: begin - V1 := false; - V1TwoP := false; - V1ThreeP := true; - V2R := false; - V2M := true; - V3R := true; - end; - 4: begin // double screen - V1 := false; - V1TwoP := true; - V1ThreeP := false; - V2R := true; - V2M := false; - V3R := false; - end; - 6: begin // double screen - V1 := false; - V1TwoP := false; - V1ThreeP := true; - V2R := false; - V2M := true; - V3R := true; - end; - - end; - - //This one is shown in 1P mode - Static[StaticP1].Visible := V1; - Static[StaticP1ScoreBG].Visible := V1; - Text[TextP1].Visible := V1; - Text[TextP1Score].Visible := V1; - - - //This one is shown in 2/4P mode - Static[StaticP1TwoP].Visible := V1TwoP; - Static[StaticP1TwoPScoreBG].Visible := V1TwoP; - Text[TextP1TwoP].Visible := V1TwoP; - Text[TextP1TwoPScore].Visible := V1TwoP; - - Static[StaticP2R].Visible := V2R; - Static[StaticP2RScoreBG].Visible := V2R; - Text[TextP2R].Visible := V2R; - Text[TextP2RScore].Visible := V2R; - - - //This one is shown in 3/6P mode - Static[StaticP1ThreeP].Visible := V1ThreeP; - Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; - Text[TextP1ThreeP].Visible := V1ThreeP; - Text[TextP1ThreePScore].Visible := V1ThreeP; - - Static[StaticP2M].Visible := V2M; - Static[StaticP2MScoreBG].Visible := V2M; - Text[TextP2M].Visible := V2M; - Text[TextP2MScore].Visible := V2M; - - Static[StaticP3R].Visible := V3R; - Static[StaticP3RScoreBG].Visible := V3R; - Text[TextP3R].Visible := V3R; - Text[TextP3RScore].Visible := V3R; - - // load notes - ResetSingTemp; -// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); - AktSong := CatSongs.Song[CatSongs.Selected]; - try - if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then - begin - //Error Loading Song -> Go back to Song Screen and Show some Error Message - FadeTo(@ScreenSong); - //Select New Song in Party Mode - if ScreenSong.Mode = 1 then - ScreenSong.SelectRandomSong; - ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); - Exit; - end; - except - //Error Loading Song -> Go back to Song Screen and Show some Error Message - FadeTo(@ScreenSong); - //Select New Song in Party Mode - if ScreenSong.Mode = 1 then - ScreenSong.SelectRandomSong; - ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); - Exit; - end; - AktSong.Path := CatSongs.Song[CatSongs.Selected].Path; -// AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed - - // set movie - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin -(* OpenSmpeg(AktSong.Path + AktSong.Video); - SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) - - // todo: VideoGap and Start time verwursten - FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); - FFmpegSkip(AktSong.VideoGAP + AktSong.Start); - AktSong.VideoLoaded := true; - end; - - // set background - if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then - try - Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background); - except - log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background); - Tex_Background.TexNum := -1; - end - else - Tex_Background.TexNum := -1; - - - - // play music (I) - Music.CaptureStart; - Music.MoveTo(AktSong.Start); -// Music.Play; - - // prepare timer (I) -// CountSkipTimeSet; - Czas.Teraz := AktSong.Start; - Czas.Razem := Music.Length; - if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000; - Czas.OldBeat := -1; - for P := 0 to High(Player) do - ClearScores(P); - - // main text - LyricMain.Clear; - LyricMain.X := 400; - LyricMain.Y := Skin_LyricsT; - LyricMain.Scale := 1.4; //1.4 - LyricMain.Align := 1; - - // sub text - LyricSub.Clear; - LyricSub.X := 400; - LyricSub.Y := Skin_LyricsT + 35; //42 //40 - LyricSub.Align := 1; - - // set custom options - case Ini.LyricsFont of - 0: - begin - LyricMain.FontStyle := 0; - LyricSub.FontStyle := 0; - LyricMain.Size := 14; // 13 - LyricSub.Size := 14; // 13 - LyricMain.ColR := Skin_FontR; - LyricMain.ColG := Skin_FontG; - LyricMain.ColB := Skin_FontB; //Change für Crazy Joker - {LyricMain.ColSR := Skin_FontHighlightR; - LyricMain.ColSG := Skin_FontHighlightG; - LyricMain.ColSB := Skin_FontHighlightB;1aa5dc} - LyricMain.ColSR := 5/255; //26 - LyricMain.ColSG := 163/255; //165 - LyricMain.ColSB := 210/255; //220 - - LyricSub.ColR := 0.4; //0.6 - LyricSub.ColG := 0.4; //0.6 - LyricSub.ColB := 0.4; //0.6 - end; - 1: - begin - LyricMain.FontStyle := 2; - LyricSub.FontStyle := 2; - LyricMain.Size := 14; - LyricSub.Size := 14; - LyricMain.ColR := 0.75; - LyricMain.ColG := 0.75; - LyricMain.ColB := 1; - LyricMain.ColSR := 0.5; - LyricMain.ColSG := 0.5; - LyricMain.ColSB := 1; - LyricSub.ColR := 0.8; - LyricSub.ColG := 0.8; - LyricSub.ColB := 0.8; - end; - 2: - begin - LyricMain.FontStyle := 3; - LyricSub.FontStyle := 3; - LyricMain.Size := 12; - LyricSub.Size := 12; - LyricMain.ColR := 0.75; - LyricMain.ColG := 0.75; - LyricMain.ColB := 1; - LyricMain.ColSR := 0.5; - LyricMain.ColSG := 0.5; - LyricMain.ColSB := 1; - LyricSub.ColR := 0.8; - LyricSub.ColG := 0.8; - LyricSub.ColB := 0.8; - end; - end; // case - - case Ini.LyricsEffect of - 0: LyricMain.Style := 1; // 0 - one selected, 1 - selected all to the current - 1: LyricMain.Style := 2; - 2: LyricMain.Style := 3; - 3: LyricMain.Style := 4; - end; // case - - // fill texts - LyricMain.AddCzesc(0); - LyricMain.Selected := -1; - LyricSub.AddCzesc(1); - LyricSub.Selected := -1; - - UpdateLCD; - - //Deactivate Pause - Paused := False; - - //Kill all Stars not Killed yet - //GoldenStarsTwinkle Mod - GoldenRec.SentenceChange; - //GoldenStarsTwinkle Mod End - - //Set Position of Line Bonus - PhrasenBonus - if (Ini.LineBonus = 1) then //Show Line Bonus at Scores - begin - Case PlayersPlay of - 1: begin - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; - end; - - 2: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.X; - Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.X; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.X; - Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; - end; - - 3: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; - - //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; - end; - - 4: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; - Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; - - //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; - - //P4 - Player[3].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; - Player[3].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; - Player[3].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; - Player[3].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; - end; - - 6: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; - - //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; - - //P4 - Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[3].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; - Player[3].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[3].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; - - //P5 - Player[4].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; - Player[4].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; - Player[4].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; - Player[4].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; - - //P6 - Player[5].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; - Player[5].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; - Player[5].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; - Player[5].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; - end; - end; - end - else if (Ini.LineBonus = 2) then //Show Line Bonus at Notes - begin - - // positions - if Ini.SingWindow = 0 then begin - NR.Left := 120; - end else begin - NR.Left := 20; - end; - NR.Right := 780; - - NR.Width := NR.Right - NR.Left; - NR.WMid := NR.Width / 2; - NR.Mid := NR.Left + NR.WMid; - - Case PlayersPlay of - 1: begin - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := Skin_P2_NotesB - 105; - end; - - 2: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; - end; - - 3: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := 120 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := 120 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := 245 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := 245 + 28; - - //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_TargetY := 370 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_StartY := 370 + 28; - end; - - 4: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; - - //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; - - //P4 - Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; - end; - - 6: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := 120 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := 120 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := 245 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := 245 + 28; - - //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_TargetY := 370 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_StartY := 370 + 28; - - //P4 - Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_TargetY := 120 - 65 + 28; - Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_StartY := 120 + 28; - - //P5 - Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[4].LineBonus_TargetY := 245 - 65 + 28; - Player[4].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[4].LineBonus_StartY := 245 + 28; - - //P6 - Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[5].LineBonus_TargetY := 370 - 65 + 28; - Player[5].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[5].LineBonus_StartY := 370 + 28; - end; - end; - end; - //Set Position of Line Bonus - PhrasenBonus End - //Set Num of Empty Sentences for Phrasen Bonus - NumEmptySentences := 0; - for P := low(Czesci[0].Czesc) to high(Czesci[0].Czesc) do - if Czesci[0].Czesc[P].TotalNotes = 0 then Inc(NumEmptySentences); - - Log.LogStatus('End', 'onShow'); -end; - -procedure TScreenSing.onShowFinish; -begin - // play movie (II) - - if AktSong.VideoLoaded then - begin - try - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); -// PlaySmpeg; - except - //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video - AktSong.VideoLoaded := False; - Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); - Log.LogError('Corrupted File: ' + AktSong.Video); - try -// CloseSmpeg; - FFmpegClose; - except - - end; - end; - end; - - // play music (II) - Music.Play; - - // prepare timer (II) - CountSkipTimeSet; -end; - -function TScreenSing.Draw: boolean; -var - Min: integer; - Sec: integer; - Tekst: string; - Flash: real; - S: integer; - T: integer; -begin - - - - //ScoreBG Mod | den wirren Scheiss hier brauch mer nimmer, wir haben colorized png's - no need for wirrness also - // set player colors - macht nichts weiter als die farben des statics zu wechseln, was zu unschönen effekten bei colorized png führt -{ if PlayersPlay = 4 then begin - if ScreenAct = 1 then begin - LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, - Static[StaticP1TwoP].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P2Dark'); - - LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, - Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); - end; - if ScreenAct = 2 then begin - LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, - Static[StaticP1TwoP].Texture.ColB, 'P3Dark'); - LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P4Dark'); - - LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, - Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark'); - LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark'); - end; - end; - - if PlayersPlay = 6 then begin - if ScreenAct = 1 then begin - LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, - Static[StaticP1ThreeP].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P2Dark'); - LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, - Static[StaticP3R].Texture.ColB, 'P3Dark'); - - LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, - Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); - LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, - Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark'); - end; - if ScreenAct = 2 then begin - - LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, - Static[StaticP1ThreeP].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P5Dark'); - LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, - Static[StaticP3R].Texture.ColB, 'P6Dark'); - - - LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, - Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark'); - LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, - Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark'); - end; - end; - } - - // set player names (for 2 screens and only Singstar skin) - if ScreenAct = 1 then begin - Text[TextP1].Text := 'P1'; - Text[TextP1TwoP].Text := 'P1'; - Text[TextP1ThreeP].Text := 'P1'; - Text[TextP2R].Text := 'P2'; - Text[TextP2M].Text := 'P2'; - Text[TextP3R].Text := 'P3'; - end; - - if ScreenAct = 2 then begin - case PlayersPlay of -{ 1: begin - Text[TextP1].Text := 'P2'; - end; - 2: begin - Text[TextP1].Text := 'P3'; - Text[TextP2R].Text := 'P4'; - end; - 3: begin - Text[TextP1].Text := 'P4'; - Text[TextP2M].Text := 'P5'; - Text[TextP3R].Text := 'P6'; - end;} - - 4: begin - Text[TextP1TwoP].Text := 'P3'; - Text[TextP2R].Text := 'P4'; - end; - 6: begin - Text[TextP1ThreeP].Text := 'P4'; - Text[TextP2M].Text := 'P5'; - Text[TextP3R].Text := 'P6'; - end; - end; // case - end; // if - - // stereo - -// weird stuff, maybe this is for "dual screen?", but where is player three then? | okay, i commented the stuff out the other day - nothing was missing on screen w/ 6 players - so do we even need this stuff? -// okay this stuff appears again some lines beneath this one, I commented it out for testing what it does - seems like it's doing nothing -// but I might be wrong, so what is this stuff here doing? O.o - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; - Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; - - Text[TextP1].X := Text[TextP1].X + 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX; - - - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; - Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; - - Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX; -// end of weird stuff - - for S := 1 to 1 do //wtf? - Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX; - - for T := 0 to 1 do - Text[T].X := Text[T].X + 10*ScreenX; - - // update static menu with time ... - Min := Round(Czas.Teraz) div 60; - Sec := Round(Czas.Teraz) mod 60; - Text[TextTimeText].Text := ''; - if Min < 10 then Text[TextTimeText].Text := '0'; - Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':'; - if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0'; - Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec); - - // .. and scores - if PlayersPlay = 1 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1Score].Text := Tekst; - end; - - if PlayersPlay = 2 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1TwoPScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2RScore].Text := Tekst; - end; - - if PlayersPlay = 3 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1ThreePScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2MScore].Text := Tekst; - - Tekst := IntToStr(Player[2].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP3RScore].Text := Tekst; - end; - - if PlayersPlay = 4 then begin - if ScreenAct = 1 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1TwoPScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2RScore].Text := Tekst; - end; - if ScreenAct = 2 then begin - Tekst := IntToStr(Player[2].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1TwoPScore].Text := Tekst; - - Tekst := IntToStr(Player[3].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2RScore].Text := Tekst; - end; - end; - - if PlayersPlay = 6 then begin - if ScreenAct = 1 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1ThreePScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2MScore].Text := Tekst; - - Tekst := IntToStr(Player[2].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP3RScore].Text := Tekst; - end; - if ScreenAct = 2 then begin - Tekst := IntToStr(Player[3].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1ThreePScore].Text := Tekst; - - Tekst := IntToStr(Player[4].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2MScore].Text := Tekst; - - Tekst := IntToStr(Player[5].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP3RScore].Text := Tekst; - end; - end; - - // draw static menu (BG) - DrawBG; - //Draw Background - SingDrawBackground; - // update and draw movie - if ShowFinish and AktSong.VideoLoaded then begin - try -// UpdateSmpeg; // this only draws - // todo: find a way to determine, when a new frame is needed - // toto: same for the need to skip frames - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); - except - //If an Error occurs drawing: prevent Video from being Drawn again and Close Video - AktSong.VideoLoaded := False; - log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); - Log.LogError('Corrupted File: ' + AktSong.Video); - try -// CloseSmpeg; - FFmpegClose; - except - - end; - end; - end; - - // draw static menu (FG) - DrawFG; - - // check for music finish -// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish)); - if ShowFinish then begin - if (not Music.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin - //Pause Mod: - if not Paused then - Sing(Self); // analyze song - end else begin -// Log.LogError('End'); - if not FadeOut then begin -// Log.LogError('End2'); - Finish; - FadeOut := true; - FadeTo(@ScreenScore); - end; - end; - end; - - // draw custom items - SingDraw; // always draw - -//GoldenNoteStarsTwinkle Mod - GoldenRec.SpawnRec; -//GoldenNoteStarsTwinkle Mod - - // back stereo - -// weird stuff, maybe this is for "dual screen?", but where is player three then? -// okay this stuff appears again some lines above this one, I commented it out for testing what it does - seems like it's doing nothing -// but I might be wrong, so what is this stuff here doing? O.o - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; - Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; - - Text[TextP1].X := Text[TextP1].X - 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX; - - - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; - Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; - - Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX; -//weird end - - for S := 1 to 1 do // wtf? - Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX; - - for T := 0 to 1 do - Text[T].X := Text[T].X - 10*ScreenX; - -end; - -procedure TScreenSing.Finish; -begin - Music.CaptureStop; - Music.Stop; - - if Ini.SavePlayback = 1 then begin - Log.BenchmarkStart(0); - Log.LogVoice(0); - Log.LogVoice(1); - Log.LogVoice(2); - Log.BenchmarkEnd(0); - Log.LogBenchmark('Creating files', 0); - end; - - if AktSong.VideoLoaded then begin -// CloseSmpeg; - FFmpegClose; - AktSong.VideoLoaded := false; // to prevent drawing closed video - end; - - SetFontItalic (False); -end; - -procedure TScreenSing.UpdateLCD; -var - T: string; -begin - LCD.HideCursor; - LCD.Clear; - - T := LyricMain.Text; - if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; - LCD.AddTextBR(T); - - T := LyricSub.Text; - if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; - LCD.AddTextBR(T); -end; - -procedure TScreenSing.onSentenceEnd(S: Cardinal); -var -I: Integer; -A: Real; -B: integer; //Max Points for Notes -begin - - //Check for Empty Sentence - if (Czesci[0].Czesc[S].TotalNotes<=0) then - exit; - - //Set Max Note Points - if (Ini.LineBonus > 0) then - B := 9000 - else - B := 10000; - - for I := 0 to High(Player) do begin - A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; - - //SingBar Mod - If ({(Ini.Oscilloscope = 2) and }(Czesci[0].Czesc[S].TotalNotes>0)) then - begin - Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 40 - 26); - if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; - if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; - - //end Singbar Mod - end; - - //PhrasenBonus - Line Bonus Mod - - //Generate Steps 0 to 8 - A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); - - If (Ini.LineBonus > 0) then - begin - - //Generate Text - if A >= 8 then - Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8] - else - Player[I].LineBonus_Text := Theme.Sing.LineBonusText[Floor(A)]; - - //PhrasenBonus give Points - Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); - Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; - //Update Total Score - Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; - - //Color - Case Floor(A) of - 0: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := 0; - Player[I].LineBonus_Color.B := 0; - end; - 1..3: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := (A * 0.25); - Player[I].LineBonus_Color.B := 0; - end; - 4: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - 5..7: begin - Player[I].LineBonus_Color.R := 1-((a-4)*0.25); - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - 8: begin - Player[I].LineBonus_Color.R := 0; - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - End; //Case - //Player[I].LineBonus_Color.B := 0; - //Player[I].LineBonus_Color.R := (8-A)/8; - //Player[I].LineBonus_Color.G := A/10; - - Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; - Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; - Player[I].LineBonus_Alpha := 0.92; - Player[I].LineBonus_Visible := True; - Player[I].LineBonus_Age := 1; - end; - //PhrasenBonus - Line Bonus Mod End// } - - //PerfectLineTwinkle Mod (effect) Pt.1 - If (Ini.EffectSing=1) then - begin - if A >= 8 then Player[I].LastSentencePerfect := True - else Player[I].LastSentencePerfect := False; - end; - //PerfectLineTwinkle Mod end - - //Refresh LastScore - Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; - - end; - - //PerfectLineTwinkle Mod (effect) Pt.2 - if Ini.EffectSing=1 then - GoldenRec.SpawnPerfectLineTwinkle; - //PerfectLineTwinkle Mod end -end; - -//Called on Sentence Change S= New Current Sentence -procedure TScreenSing.onSentenceChange(S: Cardinal); -begin - //GoldenStarsTwinkle Mod - GoldenRec.SentenceChange; - //GoldenStarsTwinkle Mod End -end; - -end. +unit UScreenSing; + +interface + +{$I switches.inc} + +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + + +uses UMenu, + UMusic, + SDL, + SysUtils, + UFiles, + UTime, + USongs, + UIni, + ULog, + UTexture, + ULyrics, + TextGL, + OpenGL12, + {$IFDEF useBASS} + bass, + {$ENDIF} + UThemes, + ULCD, + UGraphicClasses, + UVideo; + +type + TScreenSing = class(TMenu) + protected + paused: boolean; //Pause Mod + PauseTime: Real; + NumEmptySentences: integer; + public + //TextTime: integer; + + //TimeBar mod + StaticTimeProgress: integer; + TextTimeText: integer; + //eoa TimeBar mod + + StaticP1: integer; + StaticP1ScoreBG: integer; + TextP1: integer; + TextP1Score: integer; + + //moveable singbar mod + StaticP1SingBar: integer; + StaticP1ThreePSingBar: integer; + StaticP1TwoPSingBar: integer; + StaticP2RSingBar: integer; + StaticP2MSingBar: integer; + StaticP3SingBar: integer; + //eoa moveable singbar + + //Added for ps3 skin + //shown when game is in 2/4 player modus + StaticP1TwoP: integer; + StaticP1TwoPScoreBG: integer; + TextP1TwoP: integer; + TextP1TwoPScore: integer; + //shown when game is in 3/6 player modus + StaticP1ThreeP: integer; + StaticP1ThreePScoreBG: integer; + TextP1ThreeP: integer; + TextP1ThreePScore: integer; + //eoa + + StaticP2R: integer; + StaticP2RScoreBG: integer; + TextP2R: integer; + TextP2RScore: integer; + + StaticP2M: integer; + StaticP2MScoreBG: integer; + TextP2M: integer; + TextP2MScore: integer; + + StaticP3R: integer; + StaticP3RScoreBG: integer; + TextP3R: integer; + TextP3RScore: integer; + + Tex_Background: TTexture; + FadeOut: boolean; + LyricMain: TLyric; + LyricSub: TLyric; + + constructor Create; override; + procedure onShow; override; + procedure onShowFinish; override; + function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; + function Draw: boolean; override; + procedure Finish; virtual; + procedure UpdateLCD; + procedure Pause; //Pause Mod(Toggles Pause) + + //OnSentenceEnd for LineBonus + Singbar + procedure onSentenceEnd(S: Cardinal); + //OnSentenceChange (for Golden Notes) + procedure onSentenceChange(S: Cardinal); + end; + +implementation +uses UGraphic, UDraw, UMain, Classes, URecord, ULanguage, math; + +// Method for input parsing. If False is returned, GetNextWindow +// should be checked to know the next window to load; +function TScreenSing.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; +begin + Result := true; + If (PressedDown) Then + begin // Key Down + case PressedKey of + SDLK_Q: + begin + //When not ask before Exit then Finish now + if (Ini.AskbeforeDel <> 1) then + Finish + //else just Pause and let the Popup make the Work + else if not paused then + Pause; + + Result := false; + end; + + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + //Record Sound Hack: + //Sound[0].BufferLong + + Finish; + Music.PlayBack; + FadeTo(@ScreenScore); + end; + + SDLK_P://Pause Mod + begin + Pause; + end; + + SDLK_RETURN: + begin + end; + + // Up and Down could be done at the same time, + // but I don't want to declare variables inside + // functions like this one, called so many times + SDLK_DOWN : + begin + end; + SDLK_UP : + begin + end; + end; + end; +end; + +//Pause Mod +procedure TScreenSing.Pause; +begin + if not paused then //Pause einschalten + begin + // pause Time + PauseTime := Czas.Teraz; + Paused := true; + + // pause Music + Music.Pause; + + // pause Video + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + FFmpegTogglePause; + end + else //Pause ausschalten + begin + Czas.Teraz := PauseTime; //Position of Notes + + // Position of Music + Music.MoveTo (PauseTime); + // Play Music + Music.Play; + + // Video + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + FFmpegTogglePause; + //SkipSmpeg(PauseTime); + + Paused := false; + end; +end; +//Pause Mod End + +constructor TScreenSing.Create; +var + I: integer; + P: integer; +begin + inherited Create; + + LoadFromTheme(Theme.Sing); + + //TimeBar + StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress); + TextTimeText := AddText(Theme.Sing.TextTimeText); + +// 1 player | P1 + StaticP1 := AddStatic(Theme.Sing.StaticP1); + StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); + TextP1 := AddText(Theme.Sing.TextP1); + TextP1Score := AddText(Theme.Sing.TextP1Score); + StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar); + +// 2 or 4 players | P1 + StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); + StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); + TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); + TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); + StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + + // | P2 + StaticP2R := AddStatic(Theme.Sing.StaticP2R); + StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); + TextP2R := AddText(Theme.Sing.TextP2R); + TextP2RScore := AddText(Theme.Sing.TextP2RScore); + StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + +// 3 or 6 players | P1 + StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); + StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); + TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); + TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); + StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar); + + // | P2 + StaticP2M := AddStatic(Theme.Sing.StaticP2M); + StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); + TextP2M := AddText(Theme.Sing.TextP2M); + TextP2MScore := AddText(Theme.Sing.TextP2MScore); + StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar); + + // | P3 + StaticP3R := AddStatic(Theme.Sing.StaticP3R); + StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); + TextP3R := AddText(Theme.Sing.TextP3R); + TextP3RScore := AddText(Theme.Sing.TextP3RScore); + StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar); + + if ScreenAct = 2 then begin + // katze und affe + + end; + + LyricMain := TLyric.Create; + LyricSub := TLyric.Create; + + UVideo.Init; +end; + +procedure TScreenSing.onShow; +var + P: integer; + V1: boolean; + V1TwoP: boolean; //added for ps3 skin + V1ThreeP: boolean; //added for ps3 skin + V2R: boolean; + V2M: boolean; + V3R: boolean; + NR: TRecR; //Line Bonus Mod +begin + Log.LogStatus('Begin', 'onShow'); + FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented + + // prepare players + SetLength(Player, PlayersPlay); +// Player[0].ScoreTotalI := 0; + + case PlayersPlay of + 1: begin + V1 := true; + V1TwoP := false; + V1ThreeP := false; + V2R := false; + V2M := false; + V3R := false; + end; + 2: begin + V1 := false; + V1TwoP := true; + V1ThreeP := false; + V2R := true; + V2M := false; + V3R := false; + end; + 3: begin + V1 := false; + V1TwoP := false; + V1ThreeP := true; + V2R := false; + V2M := true; + V3R := true; + end; + 4: begin // double screen + V1 := false; + V1TwoP := true; + V1ThreeP := false; + V2R := true; + V2M := false; + V3R := false; + end; + 6: begin // double screen + V1 := false; + V1TwoP := false; + V1ThreeP := true; + V2R := false; + V2M := true; + V3R := true; + end; + + end; + + //This one is shown in 1P mode + Static[StaticP1].Visible := V1; + Static[StaticP1ScoreBG].Visible := V1; + Text[TextP1].Visible := V1; + Text[TextP1Score].Visible := V1; + + + //This one is shown in 2/4P mode + Static[StaticP1TwoP].Visible := V1TwoP; + Static[StaticP1TwoPScoreBG].Visible := V1TwoP; + Text[TextP1TwoP].Visible := V1TwoP; + Text[TextP1TwoPScore].Visible := V1TwoP; + + Static[StaticP2R].Visible := V2R; + Static[StaticP2RScoreBG].Visible := V2R; + Text[TextP2R].Visible := V2R; + Text[TextP2RScore].Visible := V2R; + + + //This one is shown in 3/6P mode + Static[StaticP1ThreeP].Visible := V1ThreeP; + Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; + Text[TextP1ThreeP].Visible := V1ThreeP; + Text[TextP1ThreePScore].Visible := V1ThreeP; + + Static[StaticP2M].Visible := V2M; + Static[StaticP2MScoreBG].Visible := V2M; + Text[TextP2M].Visible := V2M; + Text[TextP2MScore].Visible := V2M; + + Static[StaticP3R].Visible := V3R; + Static[StaticP3RScoreBG].Visible := V3R; + Text[TextP3R].Visible := V3R; + Text[TextP3RScore].Visible := V3R; + + // load notes + ResetSingTemp; +// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); + AktSong := CatSongs.Song[CatSongs.Selected]; + try + if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then + begin + //Error Loading Song -> Go back to Song Screen and Show some Error Message + FadeTo(@ScreenSong); + //Select New Song in Party Mode + if ScreenSong.Mode = 1 then + ScreenSong.SelectRandomSong; + ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + Exit; + end; + except + //Error Loading Song -> Go back to Song Screen and Show some Error Message + FadeTo(@ScreenSong); + //Select New Song in Party Mode + if ScreenSong.Mode = 1 then + ScreenSong.SelectRandomSong; + ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + Exit; + end; + AktSong.Path := CatSongs.Song[CatSongs.Selected].Path; +// AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed + + // set movie + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin +(* OpenSmpeg(AktSong.Path + AktSong.Video); + SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) + + // todo: VideoGap and Start time verwursten + FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); + FFmpegSkip(AktSong.VideoGAP + AktSong.Start); + AktSong.VideoLoaded := true; + end; + + // set background + if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then + try + Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background); + except + log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background); + Tex_Background.TexNum := -1; + end + else + Tex_Background.TexNum := -1; + + + + // play music (I) + Music.CaptureStart; + Music.MoveTo(AktSong.Start); +// Music.Play; + + // prepare timer (I) +// CountSkipTimeSet; + Czas.Teraz := AktSong.Start; + Czas.Razem := Music.Length; + if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000; + Czas.OldBeat := -1; + for P := 0 to High(Player) do + ClearScores(P); + + // main text + LyricMain.Clear; + LyricMain.X := 400; + LyricMain.Y := Skin_LyricsT; + LyricMain.Scale := 1.4; //1.4 + LyricMain.Align := 1; + + // sub text + LyricSub.Clear; + LyricSub.X := 400; + LyricSub.Y := Skin_LyricsT + 35; //42 //40 + LyricSub.Align := 1; + + // set custom options + case Ini.LyricsFont of + 0: + begin + LyricMain.FontStyle := 0; + LyricSub.FontStyle := 0; + LyricMain.Size := 14; // 13 + LyricSub.Size := 14; // 13 + LyricMain.ColR := Skin_FontR; + LyricMain.ColG := Skin_FontG; + LyricMain.ColB := Skin_FontB; //Change für Crazy Joker + {LyricMain.ColSR := Skin_FontHighlightR; + LyricMain.ColSG := Skin_FontHighlightG; + LyricMain.ColSB := Skin_FontHighlightB;1aa5dc} + LyricMain.ColSR := 5/255; //26 + LyricMain.ColSG := 163/255; //165 + LyricMain.ColSB := 210/255; //220 + + LyricSub.ColR := 0.4; //0.6 + LyricSub.ColG := 0.4; //0.6 + LyricSub.ColB := 0.4; //0.6 + end; + 1: + begin + LyricMain.FontStyle := 2; + LyricSub.FontStyle := 2; + LyricMain.Size := 14; + LyricSub.Size := 14; + LyricMain.ColR := 0.75; + LyricMain.ColG := 0.75; + LyricMain.ColB := 1; + LyricMain.ColSR := 0.5; + LyricMain.ColSG := 0.5; + LyricMain.ColSB := 1; + LyricSub.ColR := 0.8; + LyricSub.ColG := 0.8; + LyricSub.ColB := 0.8; + end; + 2: + begin + LyricMain.FontStyle := 3; + LyricSub.FontStyle := 3; + LyricMain.Size := 12; + LyricSub.Size := 12; + LyricMain.ColR := 0.75; + LyricMain.ColG := 0.75; + LyricMain.ColB := 1; + LyricMain.ColSR := 0.5; + LyricMain.ColSG := 0.5; + LyricMain.ColSB := 1; + LyricSub.ColR := 0.8; + LyricSub.ColG := 0.8; + LyricSub.ColB := 0.8; + end; + end; // case + + case Ini.LyricsEffect of + 0: LyricMain.Style := 1; // 0 - one selected, 1 - selected all to the current + 1: LyricMain.Style := 2; + 2: LyricMain.Style := 3; + 3: LyricMain.Style := 4; + end; // case + + // fill texts + LyricMain.AddCzesc(0); + LyricMain.Selected := -1; + LyricSub.AddCzesc(1); + LyricSub.Selected := -1; + + UpdateLCD; + + //Deactivate Pause + Paused := False; + + //Kill all Stars not Killed yet + //GoldenStarsTwinkle Mod + GoldenRec.SentenceChange; + //GoldenStarsTwinkle Mod End + + //Set Position of Line Bonus - PhrasenBonus + if (Ini.LineBonus = 1) then //Show Line Bonus at Scores + begin + Case PlayersPlay of + 1: begin + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + end; + + 2: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.X; + Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.X; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.X; + Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + end; + + 3: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + end; + + 4: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; + + //P4 + Player[3].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; + Player[3].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[3].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; + Player[3].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + end; + + 6: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + + //P4 + Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[3].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[3].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[3].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; + + //P5 + Player[4].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[4].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[4].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[4].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P6 + Player[5].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[5].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[5].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[5].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + end; + end; + end + else if (Ini.LineBonus = 2) then //Show Line Bonus at Notes + begin + + // positions + if Ini.SingWindow = 0 then begin + NR.Left := 120; + end else begin + NR.Left := 20; + end; + NR.Right := 780; + + NR.Width := NR.Right - NR.Left; + NR.WMid := NR.Width / 2; + NR.Mid := NR.Left + NR.WMid; + + Case PlayersPlay of + 1: begin + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := Skin_P2_NotesB - 105; + end; + + 2: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + end; + + 3: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := 120 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := 120 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := 245 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := 245 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_TargetY := 370 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_StartY := 370 + 28; + end; + + 4: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P4 + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + end; + + 6: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := 120 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := 120 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := 245 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := 245 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_TargetY := 370 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_StartY := 370 + 28; + + //P4 + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_TargetY := 120 - 65 + 28; + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_StartY := 120 + 28; + + //P5 + Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[4].LineBonus_TargetY := 245 - 65 + 28; + Player[4].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[4].LineBonus_StartY := 245 + 28; + + //P6 + Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[5].LineBonus_TargetY := 370 - 65 + 28; + Player[5].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[5].LineBonus_StartY := 370 + 28; + end; + end; + end; + //Set Position of Line Bonus - PhrasenBonus End + //Set Num of Empty Sentences for Phrasen Bonus + NumEmptySentences := 0; + for P := low(Czesci[0].Czesc) to high(Czesci[0].Czesc) do + if Czesci[0].Czesc[P].TotalNotes = 0 then Inc(NumEmptySentences); + + Log.LogStatus('End', 'onShow'); +end; + +procedure TScreenSing.onShowFinish; +begin + // play movie (II) + + if AktSong.VideoLoaded then + begin + try + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL(ScreenAct); +// PlaySmpeg; + except + //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Corrupted File: ' + AktSong.Video); + try +// CloseSmpeg; + FFmpegClose; + except + + end; + end; + end; + + // play music (II) + Music.Play; + + // prepare timer (II) + CountSkipTimeSet; +end; + +function TScreenSing.Draw: boolean; +var + Min: integer; + Sec: integer; + Tekst: string; + Flash: real; + S: integer; + T: integer; +begin + + + + //ScoreBG Mod | den wirren Scheiss hier brauch mer nimmer, wir haben colorized png's - no need for wirrness also + // set player colors - macht nichts weiter als die farben des statics zu wechseln, was zu unschönen effekten bei colorized png führt +{ if PlayersPlay = 4 then begin + if ScreenAct = 1 then begin + LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, + Static[StaticP1TwoP].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P2Dark'); + + LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, + Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); + end; + if ScreenAct = 2 then begin + LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, + Static[StaticP1TwoP].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P4Dark'); + + LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, + Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark'); + end; + end; + + if PlayersPlay = 6 then begin + if ScreenAct = 1 then begin + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, + Static[StaticP1ThreeP].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P2Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P3Dark'); + + LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, + Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); + LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, + Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark'); + end; + if ScreenAct = 2 then begin + + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, + Static[StaticP1ThreeP].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P5Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P6Dark'); + + + LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, + Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark'); + LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, + Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark'); + end; + end; + } + + // set player names (for 2 screens and only Singstar skin) + if ScreenAct = 1 then begin + Text[TextP1].Text := 'P1'; + Text[TextP1TwoP].Text := 'P1'; + Text[TextP1ThreeP].Text := 'P1'; + Text[TextP2R].Text := 'P2'; + Text[TextP2M].Text := 'P2'; + Text[TextP3R].Text := 'P3'; + end; + + if ScreenAct = 2 then begin + case PlayersPlay of +{ 1: begin + Text[TextP1].Text := 'P2'; + end; + 2: begin + Text[TextP1].Text := 'P3'; + Text[TextP2R].Text := 'P4'; + end; + 3: begin + Text[TextP1].Text := 'P4'; + Text[TextP2M].Text := 'P5'; + Text[TextP3R].Text := 'P6'; + end;} + + 4: begin + Text[TextP1TwoP].Text := 'P3'; + Text[TextP2R].Text := 'P4'; + end; + 6: begin + Text[TextP1ThreeP].Text := 'P4'; + Text[TextP2M].Text := 'P5'; + Text[TextP3R].Text := 'P6'; + end; + end; // case + end; // if + + // stereo + +// weird stuff, maybe this is for "dual screen?", but where is player three then? | okay, i commented the stuff out the other day - nothing was missing on screen w/ 6 players - so do we even need this stuff? +// okay this stuff appears again some lines beneath this one, I commented it out for testing what it does - seems like it's doing nothing +// but I might be wrong, so what is this stuff here doing? O.o + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; + Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; + + Text[TextP1].X := Text[TextP1].X + 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX; + + + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; + Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; + + Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX; +// end of weird stuff + + for S := 1 to 1 do //wtf? + Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX; + + for T := 0 to 1 do + Text[T].X := Text[T].X + 10*ScreenX; + + // update static menu with time ... + Min := Round(Czas.Teraz) div 60; + Sec := Round(Czas.Teraz) mod 60; + Text[TextTimeText].Text := ''; + if Min < 10 then Text[TextTimeText].Text := '0'; + Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':'; + if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0'; + Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec); + + // .. and scores + if PlayersPlay = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + end; + + if PlayersPlay = 2 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1TwoPScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + + if PlayersPlay = 3 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1ThreePScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + + if PlayersPlay = 4 then begin + if ScreenAct = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1TwoPScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + if ScreenAct = 2 then begin + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1TwoPScore].Text := Tekst; + + Tekst := IntToStr(Player[3].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + end; + + if PlayersPlay = 6 then begin + if ScreenAct = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1ThreePScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + if ScreenAct = 2 then begin + Tekst := IntToStr(Player[3].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1ThreePScore].Text := Tekst; + + Tekst := IntToStr(Player[4].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[5].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + end; + + // draw static menu (BG) + DrawBG; + //Draw Background + SingDrawBackground; + // update and draw movie + if ShowFinish and AktSong.VideoLoaded then begin + try +// UpdateSmpeg; // this only draws + // todo: find a way to determine, when a new frame is needed + // toto: same for the need to skip frames + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL(ScreenAct); + except + //If an Error occurs drawing: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Corrupted File: ' + AktSong.Video); + try +// CloseSmpeg; + FFmpegClose; + except + + end; + end; + end; + + // draw static menu (FG) + DrawFG; + + // check for music finish +// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish)); + if ShowFinish then begin + if (not Music.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin + //Pause Mod: + if not Paused then + Sing(Self); // analyze song + end else begin +// Log.LogError('End'); + if not FadeOut then begin +// Log.LogError('End2'); + Finish; + FadeOut := true; + FadeTo(@ScreenScore); + end; + end; + end; + + // draw custom items + SingDraw; // always draw + +//GoldenNoteStarsTwinkle Mod + GoldenRec.SpawnRec; +//GoldenNoteStarsTwinkle Mod + + // back stereo + +// weird stuff, maybe this is for "dual screen?", but where is player three then? +// okay this stuff appears again some lines above this one, I commented it out for testing what it does - seems like it's doing nothing +// but I might be wrong, so what is this stuff here doing? O.o + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; + Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; + + Text[TextP1].X := Text[TextP1].X - 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX; + + + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; + Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; + + Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX; +//weird end + + for S := 1 to 1 do // wtf? + Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX; + + for T := 0 to 1 do + Text[T].X := Text[T].X - 10*ScreenX; + +end; + +procedure TScreenSing.Finish; +begin + Music.CaptureStop; + Music.Stop; + + if Ini.SavePlayback = 1 then begin + Log.BenchmarkStart(0); + Log.LogVoice(0); + Log.LogVoice(1); + Log.LogVoice(2); + Log.BenchmarkEnd(0); + Log.LogBenchmark('Creating files', 0); + end; + + if AktSong.VideoLoaded then begin +// CloseSmpeg; + FFmpegClose; + AktSong.VideoLoaded := false; // to prevent drawing closed video + end; + + SetFontItalic (False); +end; + +procedure TScreenSing.UpdateLCD; +var + T: string; +begin + LCD.HideCursor; + LCD.Clear; + + T := LyricMain.Text; + if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; + LCD.AddTextBR(T); + + T := LyricSub.Text; + if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; + LCD.AddTextBR(T); +end; + +procedure TScreenSing.onSentenceEnd(S: Cardinal); +var +I: Integer; +A: Real; +B: integer; //Max Points for Notes +begin + + //Check for Empty Sentence + if (Czesci[0].Czesc[S].TotalNotes<=0) then + exit; + + //Set Max Note Points + if (Ini.LineBonus > 0) then + B := 9000 + else + B := 10000; + + for I := 0 to High(Player) do begin + A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; + + //SingBar Mod + If ({(Ini.Oscilloscope = 2) and }(Czesci[0].Czesc[S].TotalNotes>0)) then + begin + Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 40 - 26); + if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; + if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; + + //end Singbar Mod + end; + + //PhrasenBonus - Line Bonus Mod + + //Generate Steps 0 to 8 + A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); + + If (Ini.LineBonus > 0) then + begin + + //Generate Text + if A >= 8 then + Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8] + else + Player[I].LineBonus_Text := Theme.Sing.LineBonusText[Floor(A)]; + + //PhrasenBonus give Points + Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); + Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; + //Update Total Score + Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; + + //Color + Case Floor(A) of + 0: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := 0; + Player[I].LineBonus_Color.B := 0; + end; + 1..3: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := (A * 0.25); + Player[I].LineBonus_Color.B := 0; + end; + 4: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + 5..7: begin + Player[I].LineBonus_Color.R := 1-((a-4)*0.25); + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + 8: begin + Player[I].LineBonus_Color.R := 0; + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + End; //Case + //Player[I].LineBonus_Color.B := 0; + //Player[I].LineBonus_Color.R := (8-A)/8; + //Player[I].LineBonus_Color.G := A/10; + + Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; + Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; + Player[I].LineBonus_Alpha := 0.92; + Player[I].LineBonus_Visible := True; + Player[I].LineBonus_Age := 1; + end; + //PhrasenBonus - Line Bonus Mod End// } + + //PerfectLineTwinkle Mod (effect) Pt.1 + If (Ini.EffectSing=1) then + begin + if A >= 8 then Player[I].LastSentencePerfect := True + else Player[I].LastSentencePerfect := False; + end; + //PerfectLineTwinkle Mod end + + //Refresh LastScore + Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; + + end; + + //PerfectLineTwinkle Mod (effect) Pt.2 + if Ini.EffectSing=1 then + GoldenRec.SpawnPerfectLineTwinkle; + //PerfectLineTwinkle Mod end +end; + +//Called on Sentence Change S= New Current Sentence +procedure TScreenSing.onSentenceChange(S: Cardinal); +begin + //GoldenStarsTwinkle Mod + GoldenRec.SentenceChange; + //GoldenStarsTwinkle Mod End +end; + +end. -- cgit v1.2.3 From 26d8c209beba866f111a9d047bf1a70fe245b75d Mon Sep 17 00:00:00 2001 From: b1indy Date: Thu, 20 Sep 2007 07:19:45 +0000 Subject: new lyrics stuff; it's broken (lyrics don't show) and in "debug" mode (weird stuff going on in the singscreen) but i'm tired of editing conflicts git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@412 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 2557 +++++++++++++++++++------------------ 1 file changed, 1301 insertions(+), 1256 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 343a2e6d..ff6bfe20 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1,1256 +1,1301 @@ -unit UScreenSing; - -interface - -{$I switches.inc} - -{$IFDEF FPC} - {$MODE DELPHI} -{$ENDIF} - - -uses UMenu, - UMusic, - SDL, - SysUtils, - UFiles, - UTime, - USongs, - UIni, - ULog, - UTexture, - ULyrics, - TextGL, - OpenGL12, - {$IFDEF useBASS} - bass, - {$ENDIF} - UThemes, - ULCD, - UGraphicClasses, - UVideo; - -type - TScreenSing = class(TMenu) - protected - paused: boolean; //Pause Mod - PauseTime: Real; - NumEmptySentences: integer; - public - //TextTime: integer; - - //TimeBar mod - StaticTimeProgress: integer; - TextTimeText: integer; - //eoa TimeBar mod - - StaticP1: integer; - StaticP1ScoreBG: integer; - TextP1: integer; - TextP1Score: integer; - - //moveable singbar mod - StaticP1SingBar: integer; - StaticP1ThreePSingBar: integer; - StaticP1TwoPSingBar: integer; - StaticP2RSingBar: integer; - StaticP2MSingBar: integer; - StaticP3SingBar: integer; - //eoa moveable singbar - - //Added for ps3 skin - //shown when game is in 2/4 player modus - StaticP1TwoP: integer; - StaticP1TwoPScoreBG: integer; - TextP1TwoP: integer; - TextP1TwoPScore: integer; - //shown when game is in 3/6 player modus - StaticP1ThreeP: integer; - StaticP1ThreePScoreBG: integer; - TextP1ThreeP: integer; - TextP1ThreePScore: integer; - //eoa - - StaticP2R: integer; - StaticP2RScoreBG: integer; - TextP2R: integer; - TextP2RScore: integer; - - StaticP2M: integer; - StaticP2MScoreBG: integer; - TextP2M: integer; - TextP2MScore: integer; - - StaticP3R: integer; - StaticP3RScoreBG: integer; - TextP3R: integer; - TextP3RScore: integer; - - Tex_Background: TTexture; - FadeOut: boolean; - LyricMain: TLyric; - LyricSub: TLyric; - - constructor Create; override; - procedure onShow; override; - procedure onShowFinish; override; - function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; - function Draw: boolean; override; - procedure Finish; virtual; - procedure UpdateLCD; - procedure Pause; //Pause Mod(Toggles Pause) - - //OnSentenceEnd for LineBonus + Singbar - procedure onSentenceEnd(S: Cardinal); - //OnSentenceChange (for Golden Notes) - procedure onSentenceChange(S: Cardinal); - end; - -implementation -uses UGraphic, UDraw, UMain, Classes, URecord, ULanguage, math; - -// Method for input parsing. If False is returned, GetNextWindow -// should be checked to know the next window to load; -function TScreenSing.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; -begin - Result := true; - If (PressedDown) Then - begin // Key Down - case PressedKey of - SDLK_Q: - begin - //When not ask before Exit then Finish now - if (Ini.AskbeforeDel <> 1) then - Finish - //else just Pause and let the Popup make the Work - else if not paused then - Pause; - - Result := false; - end; - - SDLK_ESCAPE, - SDLK_BACKSPACE : - begin - //Record Sound Hack: - //Sound[0].BufferLong - - Finish; - Music.PlayBack; - FadeTo(@ScreenScore); - end; - - SDLK_P://Pause Mod - begin - Pause; - end; - - SDLK_RETURN: - begin - end; - - // Up and Down could be done at the same time, - // but I don't want to declare variables inside - // functions like this one, called so many times - SDLK_DOWN : - begin - end; - SDLK_UP : - begin - end; - end; - end; -end; - -//Pause Mod -procedure TScreenSing.Pause; -begin - if not paused then //Pause einschalten - begin - // pause Time - PauseTime := Czas.Teraz; - Paused := true; - - // pause Music - Music.Pause; - - // pause Video - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; - end - else //Pause ausschalten - begin - Czas.Teraz := PauseTime; //Position of Notes - - // Position of Music - Music.MoveTo (PauseTime); - // Play Music - Music.Play; - - // Video - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; - //SkipSmpeg(PauseTime); - - Paused := false; - end; -end; -//Pause Mod End - -constructor TScreenSing.Create; -var - I: integer; - P: integer; -begin - inherited Create; - - LoadFromTheme(Theme.Sing); - - //TimeBar - StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress); - TextTimeText := AddText(Theme.Sing.TextTimeText); - -// 1 player | P1 - StaticP1 := AddStatic(Theme.Sing.StaticP1); - StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); - TextP1 := AddText(Theme.Sing.TextP1); - TextP1Score := AddText(Theme.Sing.TextP1Score); - StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar); - -// 2 or 4 players | P1 - StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); - StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); - TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); - TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); - StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); - - // | P2 - StaticP2R := AddStatic(Theme.Sing.StaticP2R); - StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); - TextP2R := AddText(Theme.Sing.TextP2R); - TextP2RScore := AddText(Theme.Sing.TextP2RScore); - StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); - -// 3 or 6 players | P1 - StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); - StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); - TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); - TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); - StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar); - - // | P2 - StaticP2M := AddStatic(Theme.Sing.StaticP2M); - StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); - TextP2M := AddText(Theme.Sing.TextP2M); - TextP2MScore := AddText(Theme.Sing.TextP2MScore); - StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar); - - // | P3 - StaticP3R := AddStatic(Theme.Sing.StaticP3R); - StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); - TextP3R := AddText(Theme.Sing.TextP3R); - TextP3RScore := AddText(Theme.Sing.TextP3RScore); - StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar); - - if ScreenAct = 2 then begin - // katze und affe - - end; - - LyricMain := TLyric.Create; - LyricSub := TLyric.Create; - - UVideo.Init; -end; - -procedure TScreenSing.onShow; -var - P: integer; - V1: boolean; - V1TwoP: boolean; //added for ps3 skin - V1ThreeP: boolean; //added for ps3 skin - V2R: boolean; - V2M: boolean; - V3R: boolean; - NR: TRecR; //Line Bonus Mod -begin - Log.LogStatus('Begin', 'onShow'); - FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented - - // prepare players - SetLength(Player, PlayersPlay); -// Player[0].ScoreTotalI := 0; - - case PlayersPlay of - 1: begin - V1 := true; - V1TwoP := false; - V1ThreeP := false; - V2R := false; - V2M := false; - V3R := false; - end; - 2: begin - V1 := false; - V1TwoP := true; - V1ThreeP := false; - V2R := true; - V2M := false; - V3R := false; - end; - 3: begin - V1 := false; - V1TwoP := false; - V1ThreeP := true; - V2R := false; - V2M := true; - V3R := true; - end; - 4: begin // double screen - V1 := false; - V1TwoP := true; - V1ThreeP := false; - V2R := true; - V2M := false; - V3R := false; - end; - 6: begin // double screen - V1 := false; - V1TwoP := false; - V1ThreeP := true; - V2R := false; - V2M := true; - V3R := true; - end; - - end; - - //This one is shown in 1P mode - Static[StaticP1].Visible := V1; - Static[StaticP1ScoreBG].Visible := V1; - Text[TextP1].Visible := V1; - Text[TextP1Score].Visible := V1; - - - //This one is shown in 2/4P mode - Static[StaticP1TwoP].Visible := V1TwoP; - Static[StaticP1TwoPScoreBG].Visible := V1TwoP; - Text[TextP1TwoP].Visible := V1TwoP; - Text[TextP1TwoPScore].Visible := V1TwoP; - - Static[StaticP2R].Visible := V2R; - Static[StaticP2RScoreBG].Visible := V2R; - Text[TextP2R].Visible := V2R; - Text[TextP2RScore].Visible := V2R; - - - //This one is shown in 3/6P mode - Static[StaticP1ThreeP].Visible := V1ThreeP; - Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; - Text[TextP1ThreeP].Visible := V1ThreeP; - Text[TextP1ThreePScore].Visible := V1ThreeP; - - Static[StaticP2M].Visible := V2M; - Static[StaticP2MScoreBG].Visible := V2M; - Text[TextP2M].Visible := V2M; - Text[TextP2MScore].Visible := V2M; - - Static[StaticP3R].Visible := V3R; - Static[StaticP3RScoreBG].Visible := V3R; - Text[TextP3R].Visible := V3R; - Text[TextP3RScore].Visible := V3R; - - // load notes - ResetSingTemp; -// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); - AktSong := CatSongs.Song[CatSongs.Selected]; - try - if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then - begin - //Error Loading Song -> Go back to Song Screen and Show some Error Message - FadeTo(@ScreenSong); - //Select New Song in Party Mode - if ScreenSong.Mode = 1 then - ScreenSong.SelectRandomSong; - ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); - Exit; - end; - except - //Error Loading Song -> Go back to Song Screen and Show some Error Message - FadeTo(@ScreenSong); - //Select New Song in Party Mode - if ScreenSong.Mode = 1 then - ScreenSong.SelectRandomSong; - ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); - Exit; - end; - AktSong.Path := CatSongs.Song[CatSongs.Selected].Path; -// AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed - - // set movie - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin -(* OpenSmpeg(AktSong.Path + AktSong.Video); - SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) - - // todo: VideoGap and Start time verwursten - FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); - FFmpegSkip(AktSong.VideoGAP + AktSong.Start); - AktSong.VideoLoaded := true; - end; - - // set background - if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then - try - Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background); - except - log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background); - Tex_Background.TexNum := -1; - end - else - Tex_Background.TexNum := -1; - - - - // play music (I) - Music.CaptureStart; - Music.MoveTo(AktSong.Start); -// Music.Play; - - // prepare timer (I) -// CountSkipTimeSet; - Czas.Teraz := AktSong.Start; - Czas.Razem := Music.Length; - if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000; - Czas.OldBeat := -1; - for P := 0 to High(Player) do - ClearScores(P); - - // main text - LyricMain.Clear; - LyricMain.X := 400; - LyricMain.Y := Skin_LyricsT; - LyricMain.Scale := 1.4; //1.4 - LyricMain.Align := 1; - - // sub text - LyricSub.Clear; - LyricSub.X := 400; - LyricSub.Y := Skin_LyricsT + 35; //42 //40 - LyricSub.Align := 1; - - // set custom options - case Ini.LyricsFont of - 0: - begin - LyricMain.FontStyle := 0; - LyricSub.FontStyle := 0; - LyricMain.Size := 14; // 13 - LyricSub.Size := 14; // 13 - LyricMain.ColR := Skin_FontR; - LyricMain.ColG := Skin_FontG; - LyricMain.ColB := Skin_FontB; //Change für Crazy Joker - {LyricMain.ColSR := Skin_FontHighlightR; - LyricMain.ColSG := Skin_FontHighlightG; - LyricMain.ColSB := Skin_FontHighlightB;1aa5dc} - LyricMain.ColSR := 5/255; //26 - LyricMain.ColSG := 163/255; //165 - LyricMain.ColSB := 210/255; //220 - - LyricSub.ColR := 0.4; //0.6 - LyricSub.ColG := 0.4; //0.6 - LyricSub.ColB := 0.4; //0.6 - end; - 1: - begin - LyricMain.FontStyle := 2; - LyricSub.FontStyle := 2; - LyricMain.Size := 14; - LyricSub.Size := 14; - LyricMain.ColR := 0.75; - LyricMain.ColG := 0.75; - LyricMain.ColB := 1; - LyricMain.ColSR := 0.5; - LyricMain.ColSG := 0.5; - LyricMain.ColSB := 1; - LyricSub.ColR := 0.8; - LyricSub.ColG := 0.8; - LyricSub.ColB := 0.8; - end; - 2: - begin - LyricMain.FontStyle := 3; - LyricSub.FontStyle := 3; - LyricMain.Size := 12; - LyricSub.Size := 12; - LyricMain.ColR := 0.75; - LyricMain.ColG := 0.75; - LyricMain.ColB := 1; - LyricMain.ColSR := 0.5; - LyricMain.ColSG := 0.5; - LyricMain.ColSB := 1; - LyricSub.ColR := 0.8; - LyricSub.ColG := 0.8; - LyricSub.ColB := 0.8; - end; - end; // case - - case Ini.LyricsEffect of - 0: LyricMain.Style := 1; // 0 - one selected, 1 - selected all to the current - 1: LyricMain.Style := 2; - 2: LyricMain.Style := 3; - 3: LyricMain.Style := 4; - end; // case - - // fill texts - LyricMain.AddCzesc(0); - LyricMain.Selected := -1; - LyricSub.AddCzesc(1); - LyricSub.Selected := -1; - - UpdateLCD; - - //Deactivate Pause - Paused := False; - - //Kill all Stars not Killed yet - //GoldenStarsTwinkle Mod - GoldenRec.SentenceChange; - //GoldenStarsTwinkle Mod End - - //Set Position of Line Bonus - PhrasenBonus - if (Ini.LineBonus = 1) then //Show Line Bonus at Scores - begin - Case PlayersPlay of - 1: begin - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; - end; - - 2: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.X; - Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.X; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.X; - Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; - end; - - 3: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; - - //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; - end; - - 4: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; - Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; - - //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; - - //P4 - Player[3].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; - Player[3].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; - Player[3].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; - Player[3].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; - end; - - 6: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; - - //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; - - //P4 - Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[3].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; - Player[3].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[3].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; - - //P5 - Player[4].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; - Player[4].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; - Player[4].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; - Player[4].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; - - //P6 - Player[5].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; - Player[5].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; - Player[5].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; - Player[5].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; - end; - end; - end - else if (Ini.LineBonus = 2) then //Show Line Bonus at Notes - begin - - // positions - if Ini.SingWindow = 0 then begin - NR.Left := 120; - end else begin - NR.Left := 20; - end; - NR.Right := 780; - - NR.Width := NR.Right - NR.Left; - NR.WMid := NR.Width / 2; - NR.Mid := NR.Left + NR.WMid; - - Case PlayersPlay of - 1: begin - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := Skin_P2_NotesB - 105; - end; - - 2: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; - end; - - 3: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := 120 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := 120 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := 245 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := 245 + 28; - - //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_TargetY := 370 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_StartY := 370 + 28; - end; - - 4: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; - - //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; - - //P4 - Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; - end; - - 6: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := 120 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := 120 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := 245 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := 245 + 28; - - //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_TargetY := 370 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_StartY := 370 + 28; - - //P4 - Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_TargetY := 120 - 65 + 28; - Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_StartY := 120 + 28; - - //P5 - Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[4].LineBonus_TargetY := 245 - 65 + 28; - Player[4].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[4].LineBonus_StartY := 245 + 28; - - //P6 - Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[5].LineBonus_TargetY := 370 - 65 + 28; - Player[5].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[5].LineBonus_StartY := 370 + 28; - end; - end; - end; - //Set Position of Line Bonus - PhrasenBonus End - //Set Num of Empty Sentences for Phrasen Bonus - NumEmptySentences := 0; - for P := low(Czesci[0].Czesc) to high(Czesci[0].Czesc) do - if Czesci[0].Czesc[P].TotalNotes = 0 then Inc(NumEmptySentences); - - Log.LogStatus('End', 'onShow'); -end; - -procedure TScreenSing.onShowFinish; -begin - // play movie (II) - - if AktSong.VideoLoaded then - begin - try - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); -// PlaySmpeg; - except - //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video - AktSong.VideoLoaded := False; - Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); - Log.LogError('Corrupted File: ' + AktSong.Video); - try -// CloseSmpeg; - FFmpegClose; - except - - end; - end; - end; - - // play music (II) - Music.Play; - - // prepare timer (II) - CountSkipTimeSet; -end; - -function TScreenSing.Draw: boolean; -var - Min: integer; - Sec: integer; - Tekst: string; - Flash: real; - S: integer; - T: integer; -begin - - - - //ScoreBG Mod | den wirren Scheiss hier brauch mer nimmer, wir haben colorized png's - no need for wirrness also - // set player colors - macht nichts weiter als die farben des statics zu wechseln, was zu unschönen effekten bei colorized png führt -{ if PlayersPlay = 4 then begin - if ScreenAct = 1 then begin - LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, - Static[StaticP1TwoP].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P2Dark'); - - LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, - Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); - end; - if ScreenAct = 2 then begin - LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, - Static[StaticP1TwoP].Texture.ColB, 'P3Dark'); - LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P4Dark'); - - LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, - Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark'); - LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark'); - end; - end; - - if PlayersPlay = 6 then begin - if ScreenAct = 1 then begin - LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, - Static[StaticP1ThreeP].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P2Dark'); - LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, - Static[StaticP3R].Texture.ColB, 'P3Dark'); - - LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, - Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); - LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, - Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark'); - end; - if ScreenAct = 2 then begin - - LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, - Static[StaticP1ThreeP].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P5Dark'); - LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, - Static[StaticP3R].Texture.ColB, 'P6Dark'); - - - LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, - Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark'); - LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, - Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark'); - end; - end; - } - - // set player names (for 2 screens and only Singstar skin) - if ScreenAct = 1 then begin - Text[TextP1].Text := 'P1'; - Text[TextP1TwoP].Text := 'P1'; - Text[TextP1ThreeP].Text := 'P1'; - Text[TextP2R].Text := 'P2'; - Text[TextP2M].Text := 'P2'; - Text[TextP3R].Text := 'P3'; - end; - - if ScreenAct = 2 then begin - case PlayersPlay of -{ 1: begin - Text[TextP1].Text := 'P2'; - end; - 2: begin - Text[TextP1].Text := 'P3'; - Text[TextP2R].Text := 'P4'; - end; - 3: begin - Text[TextP1].Text := 'P4'; - Text[TextP2M].Text := 'P5'; - Text[TextP3R].Text := 'P6'; - end;} - - 4: begin - Text[TextP1TwoP].Text := 'P3'; - Text[TextP2R].Text := 'P4'; - end; - 6: begin - Text[TextP1ThreeP].Text := 'P4'; - Text[TextP2M].Text := 'P5'; - Text[TextP3R].Text := 'P6'; - end; - end; // case - end; // if - - // stereo - -// weird stuff, maybe this is for "dual screen?", but where is player three then? | okay, i commented the stuff out the other day - nothing was missing on screen w/ 6 players - so do we even need this stuff? -// okay this stuff appears again some lines beneath this one, I commented it out for testing what it does - seems like it's doing nothing -// but I might be wrong, so what is this stuff here doing? O.o - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; - Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; - - Text[TextP1].X := Text[TextP1].X + 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX; - - - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; - Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; - - Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX; -// end of weird stuff - - for S := 1 to 1 do //wtf? - Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX; - - for T := 0 to 1 do - Text[T].X := Text[T].X + 10*ScreenX; - - // update static menu with time ... - Min := Round(Czas.Teraz) div 60; - Sec := Round(Czas.Teraz) mod 60; - Text[TextTimeText].Text := ''; - if Min < 10 then Text[TextTimeText].Text := '0'; - Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':'; - if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0'; - Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec); - - // .. and scores - if PlayersPlay = 1 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1Score].Text := Tekst; - end; - - if PlayersPlay = 2 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1TwoPScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2RScore].Text := Tekst; - end; - - if PlayersPlay = 3 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1ThreePScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2MScore].Text := Tekst; - - Tekst := IntToStr(Player[2].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP3RScore].Text := Tekst; - end; - - if PlayersPlay = 4 then begin - if ScreenAct = 1 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1TwoPScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2RScore].Text := Tekst; - end; - if ScreenAct = 2 then begin - Tekst := IntToStr(Player[2].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1TwoPScore].Text := Tekst; - - Tekst := IntToStr(Player[3].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2RScore].Text := Tekst; - end; - end; - - if PlayersPlay = 6 then begin - if ScreenAct = 1 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1ThreePScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2MScore].Text := Tekst; - - Tekst := IntToStr(Player[2].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP3RScore].Text := Tekst; - end; - if ScreenAct = 2 then begin - Tekst := IntToStr(Player[3].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1ThreePScore].Text := Tekst; - - Tekst := IntToStr(Player[4].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2MScore].Text := Tekst; - - Tekst := IntToStr(Player[5].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP3RScore].Text := Tekst; - end; - end; - - // draw static menu (BG) - DrawBG; - //Draw Background - SingDrawBackground; - // update and draw movie - if ShowFinish and AktSong.VideoLoaded then begin - try -// UpdateSmpeg; // this only draws - // todo: find a way to determine, when a new frame is needed - // toto: same for the need to skip frames - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); - except - //If an Error occurs drawing: prevent Video from being Drawn again and Close Video - AktSong.VideoLoaded := False; - log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); - Log.LogError('Corrupted File: ' + AktSong.Video); - try -// CloseSmpeg; - FFmpegClose; - except - - end; - end; - end; - - // draw static menu (FG) - DrawFG; - - // check for music finish -// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish)); - if ShowFinish then begin - if (not Music.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin - //Pause Mod: - if not Paused then - Sing(Self); // analyze song - end else begin -// Log.LogError('End'); - if not FadeOut then begin -// Log.LogError('End2'); - Finish; - FadeOut := true; - FadeTo(@ScreenScore); - end; - end; - end; - - // draw custom items - SingDraw; // always draw - -//GoldenNoteStarsTwinkle Mod - GoldenRec.SpawnRec; -//GoldenNoteStarsTwinkle Mod - - // back stereo - -// weird stuff, maybe this is for "dual screen?", but where is player three then? -// okay this stuff appears again some lines above this one, I commented it out for testing what it does - seems like it's doing nothing -// but I might be wrong, so what is this stuff here doing? O.o - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; - Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; - - Text[TextP1].X := Text[TextP1].X - 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX; - - - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; - Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; - - Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX; -//weird end - - for S := 1 to 1 do // wtf? - Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX; - - for T := 0 to 1 do - Text[T].X := Text[T].X - 10*ScreenX; - -end; - -procedure TScreenSing.Finish; -begin - Music.CaptureStop; - Music.Stop; - - if Ini.SavePlayback = 1 then begin - Log.BenchmarkStart(0); - Log.LogVoice(0); - Log.LogVoice(1); - Log.LogVoice(2); - Log.BenchmarkEnd(0); - Log.LogBenchmark('Creating files', 0); - end; - - if AktSong.VideoLoaded then begin -// CloseSmpeg; - FFmpegClose; - AktSong.VideoLoaded := false; // to prevent drawing closed video - end; - - SetFontItalic (False); -end; - -procedure TScreenSing.UpdateLCD; -var - T: string; -begin - LCD.HideCursor; - LCD.Clear; - - T := LyricMain.Text; - if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; - LCD.AddTextBR(T); - - T := LyricSub.Text; - if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; - LCD.AddTextBR(T); -end; - -procedure TScreenSing.onSentenceEnd(S: Cardinal); -var -I: Integer; -A: Real; -B: integer; //Max Points for Notes -begin - - //Check for Empty Sentence - if (Czesci[0].Czesc[S].TotalNotes<=0) then - exit; - - //Set Max Note Points - if (Ini.LineBonus > 0) then - B := 9000 - else - B := 10000; - - for I := 0 to High(Player) do begin - A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; - - //SingBar Mod - If ({(Ini.Oscilloscope = 2) and }(Czesci[0].Czesc[S].TotalNotes>0)) then - begin - Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 40 - 26); - if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; - if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; - - //end Singbar Mod - end; - - //PhrasenBonus - Line Bonus Mod - - //Generate Steps 0 to 8 - A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); - - If (Ini.LineBonus > 0) then - begin - - //Generate Text - if A >= 8 then - Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8] - else - Player[I].LineBonus_Text := Theme.Sing.LineBonusText[Floor(A)]; - - //PhrasenBonus give Points - Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); - Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; - //Update Total Score - Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; - - //Color - Case Floor(A) of - 0: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := 0; - Player[I].LineBonus_Color.B := 0; - end; - 1..3: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := (A * 0.25); - Player[I].LineBonus_Color.B := 0; - end; - 4: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - 5..7: begin - Player[I].LineBonus_Color.R := 1-((a-4)*0.25); - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - 8: begin - Player[I].LineBonus_Color.R := 0; - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - End; //Case - //Player[I].LineBonus_Color.B := 0; - //Player[I].LineBonus_Color.R := (8-A)/8; - //Player[I].LineBonus_Color.G := A/10; - - Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; - Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; - Player[I].LineBonus_Alpha := 0.92; - Player[I].LineBonus_Visible := True; - Player[I].LineBonus_Age := 1; - end; - //PhrasenBonus - Line Bonus Mod End// } - - //PerfectLineTwinkle Mod (effect) Pt.1 - If (Ini.EffectSing=1) then - begin - if A >= 8 then Player[I].LastSentencePerfect := True - else Player[I].LastSentencePerfect := False; - end; - //PerfectLineTwinkle Mod end - - //Refresh LastScore - Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; - - end; - - //PerfectLineTwinkle Mod (effect) Pt.2 - if Ini.EffectSing=1 then - GoldenRec.SpawnPerfectLineTwinkle; - //PerfectLineTwinkle Mod end -end; - -//Called on Sentence Change S= New Current Sentence -procedure TScreenSing.onSentenceChange(S: Cardinal); -begin - //GoldenStarsTwinkle Mod - GoldenRec.SentenceChange; - //GoldenStarsTwinkle Mod End -end; - -end. +unit UScreenSing; + +interface + +{$I switches.inc} + +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + + +uses UMenu, + UMusic, + SDL, + SysUtils, + UFiles, + UTime, + USongs, + UIni, + ULog, + UTexture, + ULyrics, + TextGL, + OpenGL12, + {$IFDEF useBASS} + bass, + {$ENDIF} + UThemes, + ULCD, + UGraphicClasses, + UVideo; + +type + TScreenSing = class(TMenu) + protected + paused: boolean; //Pause Mod + PauseTime: Real; + NumEmptySentences: integer; + public + //TextTime: integer; + + //TimeBar mod + StaticTimeProgress: integer; + TextTimeText: integer; + //eoa TimeBar mod + + StaticP1: integer; + StaticP1ScoreBG: integer; + TextP1: integer; + TextP1Score: integer; + + //moveable singbar mod + StaticP1SingBar: integer; + StaticP1ThreePSingBar: integer; + StaticP1TwoPSingBar: integer; + StaticP2RSingBar: integer; + StaticP2MSingBar: integer; + StaticP3SingBar: integer; + //eoa moveable singbar + + //Added for ps3 skin + //shown when game is in 2/4 player modus + StaticP1TwoP: integer; + StaticP1TwoPScoreBG: integer; + TextP1TwoP: integer; + TextP1TwoPScore: integer; + //shown when game is in 3/6 player modus + StaticP1ThreeP: integer; + StaticP1ThreePScoreBG: integer; + TextP1ThreeP: integer; + TextP1ThreePScore: integer; + //eoa + + StaticP2R: integer; + StaticP2RScoreBG: integer; + TextP2R: integer; + TextP2RScore: integer; + + StaticP2M: integer; + StaticP2MScoreBG: integer; + TextP2M: integer; + TextP2MScore: integer; + + StaticP3R: integer; + StaticP3RScoreBG: integer; + TextP3R: integer; + TextP3RScore: integer; + + Tex_Background: TTexture; + FadeOut: boolean; +// LyricMain: TLyric; +// LyricSub: TLyric; + Lyrics: TLyricEngine; + + constructor Create; override; + procedure onShow; override; + procedure onShowFinish; override; + function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; + function Draw: boolean; override; + procedure Finish; virtual; + procedure UpdateLCD; + procedure Pause; //Pause Mod(Toggles Pause) + + //OnSentenceEnd for LineBonus + Singbar + procedure onSentenceEnd(S: Cardinal); + //OnSentenceChange (for Golden Notes) + procedure onSentenceChange(S: Cardinal); + end; + +implementation +uses UGraphic, UDraw, UMain, Classes, URecord, ULanguage, math; + +// Method for input parsing. If False is returned, GetNextWindow +// should be checked to know the next window to load; +function TScreenSing.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; +begin + Result := true; + If (PressedDown) Then + begin // Key Down + case PressedKey of + SDLK_Q: + begin + //When not ask before Exit then Finish now + if (Ini.AskbeforeDel <> 1) then + Finish + //else just Pause and let the Popup make the Work + else if not paused then + Pause; + + Result := false; + end; + + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + //Record Sound Hack: + //Sound[0].BufferLong + + Finish; + Music.PlayBack; + FadeTo(@ScreenScore); + end; + + SDLK_P://Pause Mod + begin + Pause; + end; + + SDLK_RETURN: + begin + end; + + // Up and Down could be done at the same time, + // but I don't want to declare variables inside + // functions like this one, called so many times + SDLK_DOWN : + begin + end; + SDLK_UP : + begin + end; + end; + end; +end; + +//Pause Mod +procedure TScreenSing.Pause; +begin + if not paused then //Pause einschalten + begin + // pause Time + PauseTime := Czas.Teraz; + Paused := true; + + // pause Music + Music.Pause; + + // pause Video + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + FFmpegTogglePause; + end + else //Pause ausschalten + begin + Czas.Teraz := PauseTime; //Position of Notes + + // Position of Music + Music.MoveTo (PauseTime); + // Play Music + Music.Play; + + // Video + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + FFmpegTogglePause; + //SkipSmpeg(PauseTime); + + Paused := false; + end; +end; +//Pause Mod End + +constructor TScreenSing.Create; +var + I: integer; + P: integer; +begin + inherited Create; + + LoadFromTheme(Theme.Sing); + + //TimeBar + StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress); + TextTimeText := AddText(Theme.Sing.TextTimeText); + +// 1 player | P1 + StaticP1 := AddStatic(Theme.Sing.StaticP1); + StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); + TextP1 := AddText(Theme.Sing.TextP1); + TextP1Score := AddText(Theme.Sing.TextP1Score); + StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar); + +// 2 or 4 players | P1 + StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); + StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); + TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); + TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); + StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + + // | P2 + StaticP2R := AddStatic(Theme.Sing.StaticP2R); + StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); + TextP2R := AddText(Theme.Sing.TextP2R); + TextP2RScore := AddText(Theme.Sing.TextP2RScore); + StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + +// 3 or 6 players | P1 + StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); + StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); + TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); + TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); + StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar); + + // | P2 + StaticP2M := AddStatic(Theme.Sing.StaticP2M); + StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); + TextP2M := AddText(Theme.Sing.TextP2M); + TextP2MScore := AddText(Theme.Sing.TextP2MScore); + StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar); + + // | P3 + StaticP3R := AddStatic(Theme.Sing.StaticP3R); + StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); + TextP3R := AddText(Theme.Sing.TextP3R); + TextP3RScore := AddText(Theme.Sing.TextP3RScore); + StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar); + + if ScreenAct = 2 then begin + // katze und affe + + end; + + Lyrics := TLyricEngine.Create(80,Skin_LyricsT,640,12,80,Skin_LyricsT+36,640,12); + + UVideo.Init; +end; + +procedure TScreenSing.onShow; +var + P: integer; + V1: boolean; + V1TwoP: boolean; //added for ps3 skin + V1ThreeP: boolean; //added for ps3 skin + V2R: boolean; + V2M: boolean; + V3R: boolean; + NR: TRecR; //Line Bonus Mod +begin + Log.LogStatus('Begin', 'onShow'); + FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented + + // prepare players + SetLength(Player, PlayersPlay); +// Player[0].ScoreTotalI := 0; + + case PlayersPlay of + 1: begin + V1 := true; + V1TwoP := false; + V1ThreeP := false; + V2R := false; + V2M := false; + V3R := false; + end; + 2: begin + V1 := false; + V1TwoP := true; + V1ThreeP := false; + V2R := true; + V2M := false; + V3R := false; + end; + 3: begin + V1 := false; + V1TwoP := false; + V1ThreeP := true; + V2R := false; + V2M := true; + V3R := true; + end; + 4: begin // double screen + V1 := false; + V1TwoP := true; + V1ThreeP := false; + V2R := true; + V2M := false; + V3R := false; + end; + 6: begin // double screen + V1 := false; + V1TwoP := false; + V1ThreeP := true; + V2R := false; + V2M := true; + V3R := true; + end; + + end; + + //This one is shown in 1P mode + Static[StaticP1].Visible := V1; + Static[StaticP1ScoreBG].Visible := V1; + Text[TextP1].Visible := V1; + Text[TextP1Score].Visible := V1; + + + //This one is shown in 2/4P mode + Static[StaticP1TwoP].Visible := V1TwoP; + Static[StaticP1TwoPScoreBG].Visible := V1TwoP; + Text[TextP1TwoP].Visible := V1TwoP; + Text[TextP1TwoPScore].Visible := V1TwoP; + + Static[StaticP2R].Visible := V2R; + Static[StaticP2RScoreBG].Visible := V2R; + Text[TextP2R].Visible := V2R; + Text[TextP2RScore].Visible := V2R; + + + //This one is shown in 3/6P mode + Static[StaticP1ThreeP].Visible := V1ThreeP; + Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; + Text[TextP1ThreeP].Visible := V1ThreeP; + Text[TextP1ThreePScore].Visible := V1ThreeP; + + Static[StaticP2M].Visible := V2M; + Static[StaticP2MScoreBG].Visible := V2M; + Text[TextP2M].Visible := V2M; + Text[TextP2MScore].Visible := V2M; + + Static[StaticP3R].Visible := V3R; + Static[StaticP3RScoreBG].Visible := V3R; + Text[TextP3R].Visible := V3R; + Text[TextP3RScore].Visible := V3R; + + // load notes + ResetSingTemp; +// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); + AktSong := CatSongs.Song[CatSongs.Selected]; + try + if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then + begin + //Error Loading Song -> Go back to Song Screen and Show some Error Message + FadeTo(@ScreenSong); + //Select New Song in Party Mode + if ScreenSong.Mode = 1 then + ScreenSong.SelectRandomSong; + ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + Exit; + end; + except + //Error Loading Song -> Go back to Song Screen and Show some Error Message + FadeTo(@ScreenSong); + //Select New Song in Party Mode + if ScreenSong.Mode = 1 then + ScreenSong.SelectRandomSong; + ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + Exit; + end; + AktSong.Path := CatSongs.Song[CatSongs.Selected].Path; +// AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed + + // set movie + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin +(* OpenSmpeg(AktSong.Path + AktSong.Video); + SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) + + // todo: VideoGap and Start time verwursten + FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); + FFmpegSkip(AktSong.VideoGAP + AktSong.Start); + AktSong.VideoLoaded := true; + end; + + // set background + if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then + try + Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background); + except + log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background); + Tex_Background.TexNum := -1; + end + else + Tex_Background.TexNum := -1; + + + + // play music (I) + Music.CaptureStart; + Music.MoveTo(AktSong.Start); +// Music.Play; + + // prepare timer (I) +// CountSkipTimeSet; + Czas.Teraz := AktSong.Start; + Czas.Razem := Music.Length; + if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000; + Czas.OldBeat := -1; + for P := 0 to High(Player) do + ClearScores(P); + + // main text + Lyrics.Clear (AktSong.BPM[0].BPM, AktSong.Resolution); + + // set custom options + case Ini.LyricsFont of + 0: + begin + Lyrics.UpperLineSize := 14; + Lyrics.LowerLineSize := 14; + Lyrics.FontStyle := 0; + + Lyrics.LineColor_en.R := Skin_FontR; + Lyrics.LineColor_en.G := Skin_FontG; + Lyrics.LineColor_en.B := Skin_FontB; + Lyrics.LineColor_en.A := 1; + + Lyrics.LineColor_dis.R := 0.4; + Lyrics.LineColor_dis.G := 0.4; + Lyrics.LineColor_dis.B := 0.4; + Lyrics.LineColor_dis.A := 1; + + Lyrics.LineColor_akt.R := 5/256; + Lyrics.LineColor_akt.G := 163/256; + Lyrics.LineColor_akt.B := 210/256; + Lyrics.LineColor_akt.A := 1; + +{ LyricSub.FontStyle := 0; + LyricMain.Size := 14; // 13 + LyricSub.Size := 14; // 13 + LyricMain.ColR := Skin_FontR; + LyricMain.ColG := Skin_FontG; + LyricMain.ColB := Skin_FontB; //Change für Crazy Joker + {LyricMain.ColSR := Skin_FontHighlightR; + LyricMain.ColSG := Skin_FontHighlightG; + LyricMain.ColSB := Skin_FontHighlightB;1aa5dc}{ + LyricMain.ColSR := 5/255; //26 + LyricMain.ColSG := 163/255; //165 + LyricMain.ColSB := 210/255; //220 + + LyricSub.ColR := 0.4; //0.6 + LyricSub.ColG := 0.4; //0.6 + LyricSub.ColB := 0.4; //0.6 } + end; + 1: + begin + { LyricMain.FontStyle := 2; + LyricSub.FontStyle := 2; + LyricMain.Size := 14; + LyricSub.Size := 14; + LyricMain.ColR := 0.75; + LyricMain.ColG := 0.75; + LyricMain.ColB := 1; + LyricMain.ColSR := 0.5; + LyricMain.ColSG := 0.5; + LyricMain.ColSB := 1; + LyricSub.ColR := 0.8; + LyricSub.ColG := 0.8; + LyricSub.ColB := 0.8; } + + Lyrics.UpperLineSize := 14; + Lyrics.LowerLineSize := 14; + Lyrics.FontStyle := 2; + + Lyrics.LineColor_en.R := 0.75; + Lyrics.LineColor_en.G := 0.75; + Lyrics.LineColor_en.B := 1; + Lyrics.LineColor_en.A := 1; + + Lyrics.LineColor_dis.R := 0.8; + Lyrics.LineColor_dis.G := 0.8; + Lyrics.LineColor_dis.B := 0.8; + Lyrics.LineColor_dis.A := 1; + + Lyrics.LineColor_akt.R := 0.5; + Lyrics.LineColor_akt.G := 0.5; + Lyrics.LineColor_akt.B := 1; + Lyrics.LineColor_akt.A := 1; + end; + 2: + begin + Lyrics.UpperLineSize := 12; + Lyrics.LowerLineSize := 12; + Lyrics.FontStyle := 3; + + Lyrics.LineColor_en.R := 0.75; + Lyrics.LineColor_en.G := 0.75; + Lyrics.LineColor_en.B := 1; + Lyrics.LineColor_en.A := 1; + + Lyrics.LineColor_dis.R := 0.8; + Lyrics.LineColor_dis.G := 0.8; + Lyrics.LineColor_dis.B := 0.8; + Lyrics.LineColor_dis.A := 1; + + Lyrics.LineColor_akt.R := 0.5; + Lyrics.LineColor_akt.G := 0.5; + Lyrics.LineColor_akt.B := 1; + Lyrics.LineColor_akt.A := 1; +{ LyricSub.FontStyle := 3; + LyricMain.Size := 12; + LyricSub.Size := 12; + LyricMain.ColR := 0.75; + LyricMain.ColG := 0.75; + LyricMain.ColB := 1; + LyricMain.ColSR := 0.5; + LyricMain.ColSG := 0.5; + LyricMain.ColSB := 1; + LyricSub.ColR := 0.8; + LyricSub.ColG := 0.8; + LyricSub.ColB := 0.8;} + end; + end; // case + + case Ini.LyricsEffect of + 0: Lyrics.HoverEffekt := 1; // 0 - one selected, 1 - selected all to the current + 1: Lyrics.HoverEffekt := 2; + 2: Lyrics.HoverEffekt := 3; + 3: Lyrics.HoverEffekt := 4; + end; // case + + // Add Lines to Lyrics + While (not Lyrics.LineinQueue) AND (Lyrics.LineCounter <= High(Czesci[0].Czesc)) do + Lyrics.AddLine(@Czesci[0].Czesc[Lyrics.LineCounter]); + + UpdateLCD; + + //Deactivate Pause + Paused := False; + + //Kill all Stars not Killed yet + //GoldenStarsTwinkle Mod + GoldenRec.SentenceChange; + //GoldenStarsTwinkle Mod End + + //Set Position of Line Bonus - PhrasenBonus + if (Ini.LineBonus = 1) then //Show Line Bonus at Scores + begin + Case PlayersPlay of + 1: begin + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + end; + + 2: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.X; + Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.X; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.X; + Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + end; + + 3: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + end; + + 4: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; + + //P4 + Player[3].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; + Player[3].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[3].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; + Player[3].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + end; + + 6: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + + //P4 + Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[3].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[3].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[3].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; + + //P5 + Player[4].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[4].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[4].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[4].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P6 + Player[5].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[5].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[5].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[5].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + end; + end; + end + else if (Ini.LineBonus = 2) then //Show Line Bonus at Notes + begin + + // positions + if Ini.SingWindow = 0 then begin + NR.Left := 120; + end else begin + NR.Left := 20; + end; + NR.Right := 780; + + NR.Width := NR.Right - NR.Left; + NR.WMid := NR.Width / 2; + NR.Mid := NR.Left + NR.WMid; + + Case PlayersPlay of + 1: begin + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := Skin_P2_NotesB - 105; + end; + + 2: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + end; + + 3: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := 120 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := 120 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := 245 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := 245 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_TargetY := 370 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_StartY := 370 + 28; + end; + + 4: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P4 + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + end; + + 6: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := 120 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := 120 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := 245 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := 245 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_TargetY := 370 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_StartY := 370 + 28; + + //P4 + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_TargetY := 120 - 65 + 28; + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_StartY := 120 + 28; + + //P5 + Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[4].LineBonus_TargetY := 245 - 65 + 28; + Player[4].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[4].LineBonus_StartY := 245 + 28; + + //P6 + Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[5].LineBonus_TargetY := 370 - 65 + 28; + Player[5].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[5].LineBonus_StartY := 370 + 28; + end; + end; + end; + //Set Position of Line Bonus - PhrasenBonus End + //Set Num of Empty Sentences for Phrasen Bonus + NumEmptySentences := 0; + for P := low(Czesci[0].Czesc) to high(Czesci[0].Czesc) do + if Czesci[0].Czesc[P].TotalNotes = 0 then Inc(NumEmptySentences); + + Log.LogStatus('End', 'onShow'); +end; + +procedure TScreenSing.onShowFinish; +begin + // play movie (II) + + if AktSong.VideoLoaded then + begin + try + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL(ScreenAct); +// PlaySmpeg; + except + //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Corrupted File: ' + AktSong.Video); + try +// CloseSmpeg; + FFmpegClose; + except + + end; + end; + end; + + // play music (II) + Music.Play; + + // prepare timer (II) + CountSkipTimeSet; +end; + +function TScreenSing.Draw: boolean; +var + Min: integer; + Sec: integer; + Tekst: string; + Flash: real; + S: integer; + T: integer; +begin + + + + //ScoreBG Mod | den wirren Scheiss hier brauch mer nimmer, wir haben colorized png's - no need for wirrness also + // set player colors - macht nichts weiter als die farben des statics zu wechseln, was zu unschönen effekten bei colorized png führt +{ if PlayersPlay = 4 then begin + if ScreenAct = 1 then begin + LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, + Static[StaticP1TwoP].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P2Dark'); + + LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, + Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); + end; + if ScreenAct = 2 then begin + LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, + Static[StaticP1TwoP].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P4Dark'); + + LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, + Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark'); + end; + end; + + if PlayersPlay = 6 then begin + if ScreenAct = 1 then begin + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, + Static[StaticP1ThreeP].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P2Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P3Dark'); + + LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, + Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); + LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, + Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark'); + end; + if ScreenAct = 2 then begin + + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, + Static[StaticP1ThreeP].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P5Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P6Dark'); + + + LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, + Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark'); + LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, + Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark'); + end; + end; + } + + // set player names (for 2 screens and only Singstar skin) + if ScreenAct = 1 then begin + Text[TextP1].Text := 'P1'; + Text[TextP1TwoP].Text := 'P1'; + Text[TextP1ThreeP].Text := 'P1'; + Text[TextP2R].Text := 'P2'; + Text[TextP2M].Text := 'P2'; + Text[TextP3R].Text := 'P3'; + end; + + if ScreenAct = 2 then begin + case PlayersPlay of +{ 1: begin + Text[TextP1].Text := 'P2'; + end; + 2: begin + Text[TextP1].Text := 'P3'; + Text[TextP2R].Text := 'P4'; + end; + 3: begin + Text[TextP1].Text := 'P4'; + Text[TextP2M].Text := 'P5'; + Text[TextP3R].Text := 'P6'; + end;} + + 4: begin + Text[TextP1TwoP].Text := 'P3'; + Text[TextP2R].Text := 'P4'; + end; + 6: begin + Text[TextP1ThreeP].Text := 'P4'; + Text[TextP2M].Text := 'P5'; + Text[TextP3R].Text := 'P6'; + end; + end; // case + end; // if + + // stereo + +// weird stuff, maybe this is for "dual screen?", but where is player three then? | okay, i commented the stuff out the other day - nothing was missing on screen w/ 6 players - so do we even need this stuff? +// okay this stuff appears again some lines beneath this one, I commented it out for testing what it does - seems like it's doing nothing +// but I might be wrong, so what is this stuff here doing? O.o + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; + Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; + + Text[TextP1].X := Text[TextP1].X + 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX; + + + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; + Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; + + Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX; +// end of weird stuff + + for S := 1 to 1 do //wtf? + Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX; + + for T := 0 to 1 do + Text[T].X := Text[T].X + 10*ScreenX; + + // update static menu with time ... + Min := Round(Czas.Teraz) div 60; + Sec := Round(Czas.Teraz) mod 60; + Text[TextTimeText].Text := ''; + if Min < 10 then Text[TextTimeText].Text := '0'; + Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':'; + if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0'; + Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec); + + // .. and scores + if PlayersPlay = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + end; + + if PlayersPlay = 2 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1TwoPScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + + if PlayersPlay = 3 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1ThreePScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + + if PlayersPlay = 4 then begin + if ScreenAct = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1TwoPScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + if ScreenAct = 2 then begin + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1TwoPScore].Text := Tekst; + + Tekst := IntToStr(Player[3].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + end; + + if PlayersPlay = 6 then begin + if ScreenAct = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1ThreePScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + if ScreenAct = 2 then begin + Tekst := IntToStr(Player[3].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1ThreePScore].Text := Tekst; + + Tekst := IntToStr(Player[4].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[5].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + end; + + // draw static menu (BG) + DrawBG; + //Draw Background + SingDrawBackground; + // update and draw movie + if ShowFinish and AktSong.VideoLoaded then begin + try +// UpdateSmpeg; // this only draws + // todo: find a way to determine, when a new frame is needed + // toto: same for the need to skip frames + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL(ScreenAct); + except + //If an Error occurs drawing: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Corrupted File: ' + AktSong.Video); + try +// CloseSmpeg; + FFmpegClose; + except + + end; + end; + end; + + // draw static menu (FG) + DrawFG; + + // check for music finish +// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish)); + if ShowFinish then begin + if (not Music.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin + //Pause Mod: + if not Paused then + Sing(Self); // analyze song + end else begin +// Log.LogError('End'); + if not FadeOut then begin +// Log.LogError('End2'); + Finish; + FadeOut := true; + FadeTo(@ScreenScore); + end; + end; + end; + + // draw custom items + SingDraw; // always draw + +//GoldenNoteStarsTwinkle Mod + GoldenRec.SpawnRec; +//GoldenNoteStarsTwinkle Mod + + // back stereo + +// weird stuff, maybe this is for "dual screen?", but where is player three then? +// okay this stuff appears again some lines above this one, I commented it out for testing what it does - seems like it's doing nothing +// but I might be wrong, so what is this stuff here doing? O.o + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; + Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; + + Text[TextP1].X := Text[TextP1].X - 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX; + + + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; + Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; + + Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX; +//weird end + + for S := 1 to 1 do // wtf? + Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX; + + for T := 0 to 1 do + Text[T].X := Text[T].X - 10*ScreenX; + +end; + +procedure TScreenSing.Finish; +begin + Music.CaptureStop; + Music.Stop; + + if Ini.SavePlayback = 1 then begin + Log.BenchmarkStart(0); + Log.LogVoice(0); + Log.LogVoice(1); + Log.LogVoice(2); + Log.BenchmarkEnd(0); + Log.LogBenchmark('Creating files', 0); + end; + + if AktSong.VideoLoaded then begin +// CloseSmpeg; + FFmpegClose; + AktSong.VideoLoaded := false; // to prevent drawing closed video + end; + + SetFontItalic (False); +end; + +procedure TScreenSing.UpdateLCD; +var + T: string; +begin + //Todo: Lyrics +{ LCD.HideCursor; + LCD.Clear; + + T := LyricMain.Text; + if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; + LCD.AddTextBR(T); + + T := LyricSub.Text; + if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; + LCD.AddTextBR(T);} +end; + +procedure TScreenSing.onSentenceEnd(S: Cardinal); +var +I: Integer; +A: Real; +B: integer; //Max Points for Notes +begin + + //Check for Empty Sentence + if (Czesci[0].Czesc[S].TotalNotes<=0) then + exit; + + //Set Max Note Points + if (Ini.LineBonus > 0) then + B := 9000 + else + B := 10000; + + for I := 0 to High(Player) do begin + A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; + + //SingBar Mod + If ({(Ini.Oscilloscope = 2) and }(Czesci[0].Czesc[S].TotalNotes>0)) then + begin + Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 40 - 26); + if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; + if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; + + //end Singbar Mod + end; + + //PhrasenBonus - Line Bonus Mod + + //Generate Steps 0 to 8 + A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); + + If (Ini.LineBonus > 0) then + begin + + //Generate Text + if A >= 8 then + Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8] + else + Player[I].LineBonus_Text := Theme.Sing.LineBonusText[Floor(A)]; + + //PhrasenBonus give Points + Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); + Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; + //Update Total Score + Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; + + //Color + Case Floor(A) of + 0: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := 0; + Player[I].LineBonus_Color.B := 0; + end; + 1..3: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := (A * 0.25); + Player[I].LineBonus_Color.B := 0; + end; + 4: begin + Player[I].LineBonus_Color.R := 1; + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + 5..7: begin + Player[I].LineBonus_Color.R := 1-((a-4)*0.25); + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + 8: begin + Player[I].LineBonus_Color.R := 0; + Player[I].LineBonus_Color.G := 1; + Player[I].LineBonus_Color.B := 0; + end; + End; //Case + //Player[I].LineBonus_Color.B := 0; + //Player[I].LineBonus_Color.R := (8-A)/8; + //Player[I].LineBonus_Color.G := A/10; + + Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; + Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; + Player[I].LineBonus_Alpha := 0.92; + Player[I].LineBonus_Visible := True; + Player[I].LineBonus_Age := 1; + end; + //PhrasenBonus - Line Bonus Mod End// } + + //PerfectLineTwinkle Mod (effect) Pt.1 + If (Ini.EffectSing=1) then + begin + if A >= 8 then Player[I].LastSentencePerfect := True + else Player[I].LastSentencePerfect := False; + end; + //PerfectLineTwinkle Mod end + + //Refresh LastScore + Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; + + end; + + //PerfectLineTwinkle Mod (effect) Pt.2 + if Ini.EffectSing=1 then + GoldenRec.SpawnPerfectLineTwinkle; + //PerfectLineTwinkle Mod end +end; + +//Called on Sentence Change S= New Current Sentence +procedure TScreenSing.onSentenceChange(S: Cardinal); +begin + //GoldenStarsTwinkle Mod + GoldenRec.SentenceChange; + if (Lyrics.LineCounter <= High(Czesci[0].Czesc)) then + Lyrics.AddLine(@Czesci[0].Czesc[Lyrics.LineCounter]); + //GoldenStarsTwinkle Mod End +end; + +end. -- cgit v1.2.3 From 1f9fd791bbe68741b8273a64eb5c0abe928e431c Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 23 Sep 2007 14:00:46 +0000 Subject: New class for score management -Scores are raised when PopUp slides under the scorebg -1 to 6 Player support (even 5 Players(not supported by Core atm)) -Display 3 Players instead of 2 when 4 Players are set in the Options and Screens=2 Ratingbar is not drawn by class atm. Have to be done git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@430 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 163 +++++++++++++++++++++++++------------- 1 file changed, 108 insertions(+), 55 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index ff6bfe20..b953cc07 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -28,7 +28,8 @@ uses UMenu, UThemes, ULCD, UGraphicClasses, - UVideo; + UVideo, + USingScores; type TScreenSing = class(TMenu) @@ -45,46 +46,51 @@ type //eoa TimeBar mod StaticP1: integer; - StaticP1ScoreBG: integer; TextP1: integer; - TextP1Score: integer; + {StaticP1ScoreBG: integer; + TextP1Score: integer;} - //moveable singbar mod + {//moveable singbar mod StaticP1SingBar: integer; StaticP1ThreePSingBar: integer; StaticP1TwoPSingBar: integer; StaticP2RSingBar: integer; StaticP2MSingBar: integer; StaticP3SingBar: integer; - //eoa moveable singbar + //eoa moveable singbar } //Added for ps3 skin //shown when game is in 2/4 player modus StaticP1TwoP: integer; - StaticP1TwoPScoreBG: integer; TextP1TwoP: integer; - TextP1TwoPScore: integer; + + {StaticP1TwoPScoreBG: integer; + TextP1TwoPScore: integer;} //shown when game is in 3/6 player modus StaticP1ThreeP: integer; - StaticP1ThreePScoreBG: integer; TextP1ThreeP: integer; - TextP1ThreePScore: integer; + + {TextP1ThreePScore: integer; + StaticP1ThreePScoreBG: integer; } //eoa StaticP2R: integer; - StaticP2RScoreBG: integer; TextP2R: integer; - TextP2RScore: integer; + + {StaticP2RScoreBG: integer; + TextP2RScore: integer;} StaticP2M: integer; - StaticP2MScoreBG: integer; TextP2M: integer; - TextP2MScore: integer; + + {StaticP2MScoreBG: integer; + TextP2MScore: integer; } StaticP3R: integer; - StaticP3RScoreBG: integer; TextP3R: integer; - TextP3RScore: integer; + + {StaticP3RScoreBG: integer; + TextP3RScore: integer;} Tex_Background: TTexture; FadeOut: boolean; @@ -92,6 +98,9 @@ type // LyricSub: TLyric; Lyrics: TLyricEngine; + //Score Manager: + Scores: TSingScores; + constructor Create; override; procedure onShow; override; procedure onShowFinish; override; @@ -205,6 +214,10 @@ var begin inherited Create; + //Create Score Class + Scores := TSingScores.Create; + Scores.LoadfromTheme; + LoadFromTheme(Theme.Sing); //TimeBar @@ -213,45 +226,51 @@ begin // 1 player | P1 StaticP1 := AddStatic(Theme.Sing.StaticP1); - StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); TextP1 := AddText(Theme.Sing.TextP1); + + {StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); TextP1Score := AddText(Theme.Sing.TextP1Score); - StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar); + StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar);} // 2 or 4 players | P1 StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); - StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); + + {StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); - StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar);} // | P2 StaticP2R := AddStatic(Theme.Sing.StaticP2R); - StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); TextP2R := AddText(Theme.Sing.TextP2R); + + {StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); TextP2RScore := AddText(Theme.Sing.TextP2RScore); - StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); + StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); } // 3 or 6 players | P1 StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); - StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); + + {StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); - StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar); + StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar);} // | P2 StaticP2M := AddStatic(Theme.Sing.StaticP2M); - StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); TextP2M := AddText(Theme.Sing.TextP2M); + + {StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); TextP2MScore := AddText(Theme.Sing.TextP2MScore); - StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar); + StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar);} // | P3 StaticP3R := AddStatic(Theme.Sing.StaticP3R); - StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); TextP3R := AddText(Theme.Sing.TextP3R); + + {StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); TextP3RScore := AddText(Theme.Sing.TextP3RScore); - StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar); + StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar);} if ScreenAct = 2 then begin // katze und affe @@ -273,10 +292,24 @@ var V2M: boolean; V3R: boolean; NR: TRecR; //Line Bonus Mod + + Color: TRGB; begin Log.LogStatus('Begin', 'onShow'); FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented + //SetUp Score Manager + Scores.ClearPlayers; //Clear Old Player Values + Color.R := 0; Color.G := 0; Color.B := 0; //Dummy atm + For P := 0 to PlayersPlay -1 do //Add new Ones + begin + Scores.AddPlayer(Tex_ScoreBG[P], Color); + end; + + Scores.Init; //Get Positions for Players + + + // prepare players SetLength(Player, PlayersPlay); // Player[0].ScoreTotalI := 0; @@ -327,38 +360,44 @@ begin //This one is shown in 1P mode Static[StaticP1].Visible := V1; - Static[StaticP1ScoreBG].Visible := V1; Text[TextP1].Visible := V1; - Text[TextP1Score].Visible := V1; + + {Static[StaticP1ScoreBG].Visible := V1; + Text[TextP1Score].Visible := V1;} //This one is shown in 2/4P mode Static[StaticP1TwoP].Visible := V1TwoP; - Static[StaticP1TwoPScoreBG].Visible := V1TwoP; Text[TextP1TwoP].Visible := V1TwoP; - Text[TextP1TwoPScore].Visible := V1TwoP; + + {Static[StaticP1TwoPScoreBG].Visible := V1TwoP; + Text[TextP1TwoPScore].Visible := V1TwoP;} Static[StaticP2R].Visible := V2R; - Static[StaticP2RScoreBG].Visible := V2R; Text[TextP2R].Visible := V2R; - Text[TextP2RScore].Visible := V2R; + + {Static[StaticP2RScoreBG].Visible := V2R; + Text[TextP2RScore].Visible := V2R; } //This one is shown in 3/6P mode Static[StaticP1ThreeP].Visible := V1ThreeP; - Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; Text[TextP1ThreeP].Visible := V1ThreeP; - Text[TextP1ThreePScore].Visible := V1ThreeP; + + {Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; + Text[TextP1ThreePScore].Visible := V1ThreeP; } Static[StaticP2M].Visible := V2M; - Static[StaticP2MScoreBG].Visible := V2M; Text[TextP2M].Visible := V2M; - Text[TextP2MScore].Visible := V2M; + + {Static[StaticP2MScoreBG].Visible := V2M; + Text[TextP2MScore].Visible := V2M; } Static[StaticP3R].Visible := V3R; - Static[StaticP3RScoreBG].Visible := V3R; Text[TextP3R].Visible := V3R; - Text[TextP3RScore].Visible := V3R; + + {Static[StaticP3RScoreBG].Visible := V3R; + Text[TextP3RScore].Visible := V3R; } // load notes ResetSingTemp; @@ -559,7 +598,7 @@ begin GoldenRec.SentenceChange; //GoldenStarsTwinkle Mod End - //Set Position of Line Bonus - PhrasenBonus + {//Set Position of Line Bonus - PhrasenBonus if (Ini.LineBonus = 1) then //Show Line Bonus at Scores begin Case PlayersPlay of @@ -790,7 +829,8 @@ begin Player[5].LineBonus_StartY := 370 + 28; end; end; - end; + end; } + //Set Position of Line Bonus - PhrasenBonus End //Set Num of Empty Sentences for Phrasen Bonus NumEmptySentences := 0; @@ -949,17 +989,19 @@ begin // okay this stuff appears again some lines beneath this one, I commented it out for testing what it does - seems like it's doing nothing // but I might be wrong, so what is this stuff here doing? O.o Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; - Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; Text[TextP1].X := Text[TextP1].X + 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX; + + {Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX;} Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; - Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX; + + {Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX;} // end of weird stuff for S := 1 to 1 do //wtf? @@ -977,7 +1019,7 @@ begin if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0'; Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec); - // .. and scores + {// .. and scores if PlayersPlay = 1 then begin Tekst := IntToStr(Player[0].ScoreTotalI); while Length(Tekst) < 5 do Tekst := '0' + Tekst; @@ -1056,7 +1098,7 @@ begin while Length(Tekst) < 5 do Tekst := '0' + Tekst; Text[TextP3RScore].Text := Tekst; end; - end; + end; } // draw static menu (BG) DrawBG; @@ -1112,23 +1154,26 @@ begin GoldenRec.SpawnRec; //GoldenNoteStarsTwinkle Mod + //Draw Scores + Scores.Draw; + // back stereo // weird stuff, maybe this is for "dual screen?", but where is player three then? // okay this stuff appears again some lines above this one, I commented it out for testing what it does - seems like it's doing nothing // but I might be wrong, so what is this stuff here doing? O.o Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; - Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; - Text[TextP1].X := Text[TextP1].X - 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX; + {Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX;} - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; - Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX; + + {Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX;} //weird end for S := 1 to 1 do // wtf? @@ -1229,7 +1274,7 @@ begin //Update Total Score Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; - //Color + {//Color Case Floor(A) of 0: begin Player[I].LineBonus_Color.R := 1; @@ -1265,7 +1310,15 @@ begin Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; Player[I].LineBonus_Alpha := 0.92; Player[I].LineBonus_Visible := True; - Player[I].LineBonus_Age := 1; + Player[I].LineBonus_Age := 1;} + + //Spawn PopUp + If (A >= 8) then + A := 8 + else IF A < 0 then + A := 0; + //Round(Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8)); + Scores.SpawnPopUp(I, Floor(A), Player[I].ScoreTotalI); end; //PhrasenBonus - Line Bonus Mod End// } -- cgit v1.2.3 From 1acdd4a165647aa45d44f537326506d97c90c121 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 25 Sep 2007 18:59:00 +0000 Subject: Some Cleanup in UDraw, UMain and UScreenSing Removed some old, yet not used functions One class todo(Notes) then the dirty UDraw will be a thing of the past. Also Player and Notes Array needs some rewriting. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@434 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 49 +-------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index b953cc07..4e60a78b 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1244,15 +1244,6 @@ begin for I := 0 to High(Player) do begin A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; - //SingBar Mod - If ({(Ini.Oscilloscope = 2) and }(Czesci[0].Czesc[S].TotalNotes>0)) then - begin - Player[I].ScorePercentTarget := Player[I].ScorePercentTarget + floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 40 - 26); - if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0; - if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99; - - //end Singbar Mod - end; //PhrasenBonus - Line Bonus Mod @@ -1274,50 +1265,12 @@ begin //Update Total Score Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; - {//Color - Case Floor(A) of - 0: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := 0; - Player[I].LineBonus_Color.B := 0; - end; - 1..3: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := (A * 0.25); - Player[I].LineBonus_Color.B := 0; - end; - 4: begin - Player[I].LineBonus_Color.R := 1; - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - 5..7: begin - Player[I].LineBonus_Color.R := 1-((a-4)*0.25); - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - 8: begin - Player[I].LineBonus_Color.R := 0; - Player[I].LineBonus_Color.G := 1; - Player[I].LineBonus_Color.B := 0; - end; - End; //Case - //Player[I].LineBonus_Color.B := 0; - //Player[I].LineBonus_Color.R := (8-A)/8; - //Player[I].LineBonus_Color.G := A/10; - - Player[I].LineBonus_PosX := Player[I].LineBonus_StartX; - Player[I].LineBonus_PosY := Player[I].LineBonus_StartY; - Player[I].LineBonus_Alpha := 0.92; - Player[I].LineBonus_Visible := True; - Player[I].LineBonus_Age := 1;} - //Spawn PopUp If (A >= 8) then A := 8 else IF A < 0 then A := 0; - //Round(Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8)); + Scores.SpawnPopUp(I, Floor(A), Player[I].ScoreTotalI); end; //PhrasenBonus - Line Bonus Mod End// } -- cgit v1.2.3 From e5b70a52b5fc4a572136a3a07ee2f5e443c5e52b Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Fri, 28 Sep 2007 13:57:52 +0000 Subject: Reremoved old TPlayer attributes and removed some code fragments that still links to these attributes git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@444 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 7 ------- 1 file changed, 7 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 4e60a78b..391fdccf 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1252,13 +1252,6 @@ begin If (Ini.LineBonus > 0) then begin - - //Generate Text - if A >= 8 then - Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8] - else - Player[I].LineBonus_Text := Theme.Sing.LineBonusText[Floor(A)]; - //PhrasenBonus give Points Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; -- cgit v1.2.3 From d123263213fba448d5695df35660f7de4cbed433 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 11 Oct 2007 08:11:47 +0000 Subject: modified UTime to utilise SDL timer... this allows for reliable cross platform timers. Tested working on linux. Modified UVideo and screens to get Video playback working on linux currently only video stream... no audio.. but I Will be working towards this, for all audio playback ( at least for linux ) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@501 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 2615 +++++++++++++++++++------------------ 1 file changed, 1315 insertions(+), 1300 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 391fdccf..9e43f31f 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1,1300 +1,1315 @@ -unit UScreenSing; - -interface - -{$I switches.inc} - -{$IFDEF FPC} - {$MODE DELPHI} -{$ENDIF} - - -uses UMenu, - UMusic, - SDL, - SysUtils, - UFiles, - UTime, - USongs, - UIni, - ULog, - UTexture, - ULyrics, - TextGL, - OpenGL12, - {$IFDEF useBASS} - bass, - {$ENDIF} - UThemes, - ULCD, - UGraphicClasses, - UVideo, - USingScores; - -type - TScreenSing = class(TMenu) - protected - paused: boolean; //Pause Mod - PauseTime: Real; - NumEmptySentences: integer; - public - //TextTime: integer; - - //TimeBar mod - StaticTimeProgress: integer; - TextTimeText: integer; - //eoa TimeBar mod - - StaticP1: integer; - TextP1: integer; - {StaticP1ScoreBG: integer; - TextP1Score: integer;} - - {//moveable singbar mod - StaticP1SingBar: integer; - StaticP1ThreePSingBar: integer; - StaticP1TwoPSingBar: integer; - StaticP2RSingBar: integer; - StaticP2MSingBar: integer; - StaticP3SingBar: integer; - //eoa moveable singbar } - - //Added for ps3 skin - //shown when game is in 2/4 player modus - StaticP1TwoP: integer; - TextP1TwoP: integer; - - {StaticP1TwoPScoreBG: integer; - TextP1TwoPScore: integer;} - //shown when game is in 3/6 player modus - StaticP1ThreeP: integer; - TextP1ThreeP: integer; - - {TextP1ThreePScore: integer; - StaticP1ThreePScoreBG: integer; } - //eoa - - StaticP2R: integer; - TextP2R: integer; - - {StaticP2RScoreBG: integer; - TextP2RScore: integer;} - - StaticP2M: integer; - TextP2M: integer; - - {StaticP2MScoreBG: integer; - TextP2MScore: integer; } - - StaticP3R: integer; - TextP3R: integer; - - {StaticP3RScoreBG: integer; - TextP3RScore: integer;} - - Tex_Background: TTexture; - FadeOut: boolean; -// LyricMain: TLyric; -// LyricSub: TLyric; - Lyrics: TLyricEngine; - - //Score Manager: - Scores: TSingScores; - - constructor Create; override; - procedure onShow; override; - procedure onShowFinish; override; - function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; - function Draw: boolean; override; - procedure Finish; virtual; - procedure UpdateLCD; - procedure Pause; //Pause Mod(Toggles Pause) - - //OnSentenceEnd for LineBonus + Singbar - procedure onSentenceEnd(S: Cardinal); - //OnSentenceChange (for Golden Notes) - procedure onSentenceChange(S: Cardinal); - end; - -implementation -uses UGraphic, UDraw, UMain, Classes, URecord, ULanguage, math; - -// Method for input parsing. If False is returned, GetNextWindow -// should be checked to know the next window to load; -function TScreenSing.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; -begin - Result := true; - If (PressedDown) Then - begin // Key Down - case PressedKey of - SDLK_Q: - begin - //When not ask before Exit then Finish now - if (Ini.AskbeforeDel <> 1) then - Finish - //else just Pause and let the Popup make the Work - else if not paused then - Pause; - - Result := false; - end; - - SDLK_ESCAPE, - SDLK_BACKSPACE : - begin - //Record Sound Hack: - //Sound[0].BufferLong - - Finish; - Music.PlayBack; - FadeTo(@ScreenScore); - end; - - SDLK_P://Pause Mod - begin - Pause; - end; - - SDLK_RETURN: - begin - end; - - // Up and Down could be done at the same time, - // but I don't want to declare variables inside - // functions like this one, called so many times - SDLK_DOWN : - begin - end; - SDLK_UP : - begin - end; - end; - end; -end; - -//Pause Mod -procedure TScreenSing.Pause; -begin - if not paused then //Pause einschalten - begin - // pause Time - PauseTime := Czas.Teraz; - Paused := true; - - // pause Music - Music.Pause; - - // pause Video - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; - end - else //Pause ausschalten - begin - Czas.Teraz := PauseTime; //Position of Notes - - // Position of Music - Music.MoveTo (PauseTime); - // Play Music - Music.Play; - - // Video - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; - //SkipSmpeg(PauseTime); - - Paused := false; - end; -end; -//Pause Mod End - -constructor TScreenSing.Create; -var - I: integer; - P: integer; -begin - inherited Create; - - //Create Score Class - Scores := TSingScores.Create; - Scores.LoadfromTheme; - - LoadFromTheme(Theme.Sing); - - //TimeBar - StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress); - TextTimeText := AddText(Theme.Sing.TextTimeText); - -// 1 player | P1 - StaticP1 := AddStatic(Theme.Sing.StaticP1); - TextP1 := AddText(Theme.Sing.TextP1); - - {StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); - TextP1Score := AddText(Theme.Sing.TextP1Score); - StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar);} - -// 2 or 4 players | P1 - StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); - TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); - - {StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); - TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); - StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar);} - - // | P2 - StaticP2R := AddStatic(Theme.Sing.StaticP2R); - TextP2R := AddText(Theme.Sing.TextP2R); - - {StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); - TextP2RScore := AddText(Theme.Sing.TextP2RScore); - StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); } - -// 3 or 6 players | P1 - StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); - TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); - - {StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); - TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); - StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar);} - - // | P2 - StaticP2M := AddStatic(Theme.Sing.StaticP2M); - TextP2M := AddText(Theme.Sing.TextP2M); - - {StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); - TextP2MScore := AddText(Theme.Sing.TextP2MScore); - StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar);} - - // | P3 - StaticP3R := AddStatic(Theme.Sing.StaticP3R); - TextP3R := AddText(Theme.Sing.TextP3R); - - {StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); - TextP3RScore := AddText(Theme.Sing.TextP3RScore); - StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar);} - - if ScreenAct = 2 then begin - // katze und affe - - end; - - Lyrics := TLyricEngine.Create(80,Skin_LyricsT,640,12,80,Skin_LyricsT+36,640,12); - - UVideo.Init; -end; - -procedure TScreenSing.onShow; -var - P: integer; - V1: boolean; - V1TwoP: boolean; //added for ps3 skin - V1ThreeP: boolean; //added for ps3 skin - V2R: boolean; - V2M: boolean; - V3R: boolean; - NR: TRecR; //Line Bonus Mod - - Color: TRGB; -begin - Log.LogStatus('Begin', 'onShow'); - FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented - - //SetUp Score Manager - Scores.ClearPlayers; //Clear Old Player Values - Color.R := 0; Color.G := 0; Color.B := 0; //Dummy atm - For P := 0 to PlayersPlay -1 do //Add new Ones - begin - Scores.AddPlayer(Tex_ScoreBG[P], Color); - end; - - Scores.Init; //Get Positions for Players - - - - // prepare players - SetLength(Player, PlayersPlay); -// Player[0].ScoreTotalI := 0; - - case PlayersPlay of - 1: begin - V1 := true; - V1TwoP := false; - V1ThreeP := false; - V2R := false; - V2M := false; - V3R := false; - end; - 2: begin - V1 := false; - V1TwoP := true; - V1ThreeP := false; - V2R := true; - V2M := false; - V3R := false; - end; - 3: begin - V1 := false; - V1TwoP := false; - V1ThreeP := true; - V2R := false; - V2M := true; - V3R := true; - end; - 4: begin // double screen - V1 := false; - V1TwoP := true; - V1ThreeP := false; - V2R := true; - V2M := false; - V3R := false; - end; - 6: begin // double screen - V1 := false; - V1TwoP := false; - V1ThreeP := true; - V2R := false; - V2M := true; - V3R := true; - end; - - end; - - //This one is shown in 1P mode - Static[StaticP1].Visible := V1; - Text[TextP1].Visible := V1; - - {Static[StaticP1ScoreBG].Visible := V1; - Text[TextP1Score].Visible := V1;} - - - //This one is shown in 2/4P mode - Static[StaticP1TwoP].Visible := V1TwoP; - Text[TextP1TwoP].Visible := V1TwoP; - - {Static[StaticP1TwoPScoreBG].Visible := V1TwoP; - Text[TextP1TwoPScore].Visible := V1TwoP;} - - Static[StaticP2R].Visible := V2R; - Text[TextP2R].Visible := V2R; - - {Static[StaticP2RScoreBG].Visible := V2R; - Text[TextP2RScore].Visible := V2R; } - - - //This one is shown in 3/6P mode - Static[StaticP1ThreeP].Visible := V1ThreeP; - Text[TextP1ThreeP].Visible := V1ThreeP; - - {Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; - Text[TextP1ThreePScore].Visible := V1ThreeP; } - - Static[StaticP2M].Visible := V2M; - Text[TextP2M].Visible := V2M; - - {Static[StaticP2MScoreBG].Visible := V2M; - Text[TextP2MScore].Visible := V2M; } - - Static[StaticP3R].Visible := V3R; - Text[TextP3R].Visible := V3R; - - {Static[StaticP3RScoreBG].Visible := V3R; - Text[TextP3RScore].Visible := V3R; } - - // load notes - ResetSingTemp; -// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); - AktSong := CatSongs.Song[CatSongs.Selected]; - try - if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then - begin - //Error Loading Song -> Go back to Song Screen and Show some Error Message - FadeTo(@ScreenSong); - //Select New Song in Party Mode - if ScreenSong.Mode = 1 then - ScreenSong.SelectRandomSong; - ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); - Exit; - end; - except - //Error Loading Song -> Go back to Song Screen and Show some Error Message - FadeTo(@ScreenSong); - //Select New Song in Party Mode - if ScreenSong.Mode = 1 then - ScreenSong.SelectRandomSong; - ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); - Exit; - end; - AktSong.Path := CatSongs.Song[CatSongs.Selected].Path; -// AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed - - // set movie - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin -(* OpenSmpeg(AktSong.Path + AktSong.Video); - SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) - - // todo: VideoGap and Start time verwursten - FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); - FFmpegSkip(AktSong.VideoGAP + AktSong.Start); - AktSong.VideoLoaded := true; - end; - - // set background - if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then - try - Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background); - except - log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background); - Tex_Background.TexNum := -1; - end - else - Tex_Background.TexNum := -1; - - - - // play music (I) - Music.CaptureStart; - Music.MoveTo(AktSong.Start); -// Music.Play; - - // prepare timer (I) -// CountSkipTimeSet; - Czas.Teraz := AktSong.Start; - Czas.Razem := Music.Length; - if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000; - Czas.OldBeat := -1; - for P := 0 to High(Player) do - ClearScores(P); - - // main text - Lyrics.Clear (AktSong.BPM[0].BPM, AktSong.Resolution); - - // set custom options - case Ini.LyricsFont of - 0: - begin - Lyrics.UpperLineSize := 14; - Lyrics.LowerLineSize := 14; - Lyrics.FontStyle := 0; - - Lyrics.LineColor_en.R := Skin_FontR; - Lyrics.LineColor_en.G := Skin_FontG; - Lyrics.LineColor_en.B := Skin_FontB; - Lyrics.LineColor_en.A := 1; - - Lyrics.LineColor_dis.R := 0.4; - Lyrics.LineColor_dis.G := 0.4; - Lyrics.LineColor_dis.B := 0.4; - Lyrics.LineColor_dis.A := 1; - - Lyrics.LineColor_akt.R := 5/256; - Lyrics.LineColor_akt.G := 163/256; - Lyrics.LineColor_akt.B := 210/256; - Lyrics.LineColor_akt.A := 1; - -{ LyricSub.FontStyle := 0; - LyricMain.Size := 14; // 13 - LyricSub.Size := 14; // 13 - LyricMain.ColR := Skin_FontR; - LyricMain.ColG := Skin_FontG; - LyricMain.ColB := Skin_FontB; //Change für Crazy Joker - {LyricMain.ColSR := Skin_FontHighlightR; - LyricMain.ColSG := Skin_FontHighlightG; - LyricMain.ColSB := Skin_FontHighlightB;1aa5dc}{ - LyricMain.ColSR := 5/255; //26 - LyricMain.ColSG := 163/255; //165 - LyricMain.ColSB := 210/255; //220 - - LyricSub.ColR := 0.4; //0.6 - LyricSub.ColG := 0.4; //0.6 - LyricSub.ColB := 0.4; //0.6 } - end; - 1: - begin - { LyricMain.FontStyle := 2; - LyricSub.FontStyle := 2; - LyricMain.Size := 14; - LyricSub.Size := 14; - LyricMain.ColR := 0.75; - LyricMain.ColG := 0.75; - LyricMain.ColB := 1; - LyricMain.ColSR := 0.5; - LyricMain.ColSG := 0.5; - LyricMain.ColSB := 1; - LyricSub.ColR := 0.8; - LyricSub.ColG := 0.8; - LyricSub.ColB := 0.8; } - - Lyrics.UpperLineSize := 14; - Lyrics.LowerLineSize := 14; - Lyrics.FontStyle := 2; - - Lyrics.LineColor_en.R := 0.75; - Lyrics.LineColor_en.G := 0.75; - Lyrics.LineColor_en.B := 1; - Lyrics.LineColor_en.A := 1; - - Lyrics.LineColor_dis.R := 0.8; - Lyrics.LineColor_dis.G := 0.8; - Lyrics.LineColor_dis.B := 0.8; - Lyrics.LineColor_dis.A := 1; - - Lyrics.LineColor_akt.R := 0.5; - Lyrics.LineColor_akt.G := 0.5; - Lyrics.LineColor_akt.B := 1; - Lyrics.LineColor_akt.A := 1; - end; - 2: - begin - Lyrics.UpperLineSize := 12; - Lyrics.LowerLineSize := 12; - Lyrics.FontStyle := 3; - - Lyrics.LineColor_en.R := 0.75; - Lyrics.LineColor_en.G := 0.75; - Lyrics.LineColor_en.B := 1; - Lyrics.LineColor_en.A := 1; - - Lyrics.LineColor_dis.R := 0.8; - Lyrics.LineColor_dis.G := 0.8; - Lyrics.LineColor_dis.B := 0.8; - Lyrics.LineColor_dis.A := 1; - - Lyrics.LineColor_akt.R := 0.5; - Lyrics.LineColor_akt.G := 0.5; - Lyrics.LineColor_akt.B := 1; - Lyrics.LineColor_akt.A := 1; -{ LyricSub.FontStyle := 3; - LyricMain.Size := 12; - LyricSub.Size := 12; - LyricMain.ColR := 0.75; - LyricMain.ColG := 0.75; - LyricMain.ColB := 1; - LyricMain.ColSR := 0.5; - LyricMain.ColSG := 0.5; - LyricMain.ColSB := 1; - LyricSub.ColR := 0.8; - LyricSub.ColG := 0.8; - LyricSub.ColB := 0.8;} - end; - end; // case - - case Ini.LyricsEffect of - 0: Lyrics.HoverEffekt := 1; // 0 - one selected, 1 - selected all to the current - 1: Lyrics.HoverEffekt := 2; - 2: Lyrics.HoverEffekt := 3; - 3: Lyrics.HoverEffekt := 4; - end; // case - - // Add Lines to Lyrics - While (not Lyrics.LineinQueue) AND (Lyrics.LineCounter <= High(Czesci[0].Czesc)) do - Lyrics.AddLine(@Czesci[0].Czesc[Lyrics.LineCounter]); - - UpdateLCD; - - //Deactivate Pause - Paused := False; - - //Kill all Stars not Killed yet - //GoldenStarsTwinkle Mod - GoldenRec.SentenceChange; - //GoldenStarsTwinkle Mod End - - {//Set Position of Line Bonus - PhrasenBonus - if (Ini.LineBonus = 1) then //Show Line Bonus at Scores - begin - Case PlayersPlay of - 1: begin - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; - end; - - 2: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.X; - Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.X; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.X; - Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; - end; - - 3: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; - - //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; - end; - - 4: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; - Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; - - //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; - - //P4 - Player[3].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; - Player[3].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; - Player[3].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; - Player[3].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; - end; - - 6: begin - //P1 - Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; - Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; - - //P2 - Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; - Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; - Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; - - //P3 - Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; - Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; - Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; - - //P4 - Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[3].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; - Player[3].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; - Player[3].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; - - //P5 - Player[4].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; - Player[4].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; - Player[4].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; - Player[4].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; - - //P6 - Player[5].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; - Player[5].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; - Player[5].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; - Player[5].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; - end; - end; - end - else if (Ini.LineBonus = 2) then //Show Line Bonus at Notes - begin - - // positions - if Ini.SingWindow = 0 then begin - NR.Left := 120; - end else begin - NR.Left := 20; - end; - NR.Right := 780; - - NR.Width := NR.Right - NR.Left; - NR.WMid := NR.Width / 2; - NR.Mid := NR.Left + NR.WMid; - - Case PlayersPlay of - 1: begin - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := Skin_P2_NotesB - 105; - end; - - 2: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; - end; - - 3: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := 120 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := 120 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := 245 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := 245 + 28; - - //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_TargetY := 370 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_StartY := 370 + 28; - end; - - 4: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; - - //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; - - //P4 - Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; - Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; - end; - - 6: begin - //P1 - Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_TargetY := 120 - 65 + 28; - Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[0].LineBonus_StartY := 120 + 28; - - //P2 - Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_TargetY := 245 - 65 + 28; - Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[1].LineBonus_StartY := 245 + 28; - - //P3 - Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_TargetY := 370 - 65 + 28; - Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[2].LineBonus_StartY := 370 + 28; - - //P4 - Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_TargetY := 120 - 65 + 28; - Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[3].LineBonus_StartY := 120 + 28; - - //P5 - Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[4].LineBonus_TargetY := 245 - 65 + 28; - Player[4].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[4].LineBonus_StartY := 245 + 28; - - //P6 - Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); - Player[5].LineBonus_TargetY := 370 - 65 + 28; - Player[5].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); - Player[5].LineBonus_StartY := 370 + 28; - end; - end; - end; } - - //Set Position of Line Bonus - PhrasenBonus End - //Set Num of Empty Sentences for Phrasen Bonus - NumEmptySentences := 0; - for P := low(Czesci[0].Czesc) to high(Czesci[0].Czesc) do - if Czesci[0].Czesc[P].TotalNotes = 0 then Inc(NumEmptySentences); - - Log.LogStatus('End', 'onShow'); -end; - -procedure TScreenSing.onShowFinish; -begin - // play movie (II) - - if AktSong.VideoLoaded then - begin - try - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); -// PlaySmpeg; - except - //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video - AktSong.VideoLoaded := False; - Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); - Log.LogError('Corrupted File: ' + AktSong.Video); - try -// CloseSmpeg; - FFmpegClose; - except - - end; - end; - end; - - // play music (II) - Music.Play; - - // prepare timer (II) - CountSkipTimeSet; -end; - -function TScreenSing.Draw: boolean; -var - Min: integer; - Sec: integer; - Tekst: string; - Flash: real; - S: integer; - T: integer; -begin - - - - //ScoreBG Mod | den wirren Scheiss hier brauch mer nimmer, wir haben colorized png's - no need for wirrness also - // set player colors - macht nichts weiter als die farben des statics zu wechseln, was zu unschönen effekten bei colorized png führt -{ if PlayersPlay = 4 then begin - if ScreenAct = 1 then begin - LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, - Static[StaticP1TwoP].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P2Dark'); - - LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, - Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); - end; - if ScreenAct = 2 then begin - LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, - Static[StaticP1TwoP].Texture.ColB, 'P3Dark'); - LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P4Dark'); - - LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, - Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark'); - LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark'); - end; - end; - - if PlayersPlay = 6 then begin - if ScreenAct = 1 then begin - LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, - Static[StaticP1ThreeP].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P2Dark'); - LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, - Static[StaticP3R].Texture.ColB, 'P3Dark'); - - LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, - Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark'); - LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); - LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, - Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark'); - end; - if ScreenAct = 2 then begin - - LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, - Static[StaticP1ThreeP].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, - Static[StaticP2R].Texture.ColB, 'P5Dark'); - LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, - Static[StaticP3R].Texture.ColB, 'P6Dark'); - - - LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, - Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark'); - LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, - Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark'); - LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, - Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark'); - end; - end; - } - - // set player names (for 2 screens and only Singstar skin) - if ScreenAct = 1 then begin - Text[TextP1].Text := 'P1'; - Text[TextP1TwoP].Text := 'P1'; - Text[TextP1ThreeP].Text := 'P1'; - Text[TextP2R].Text := 'P2'; - Text[TextP2M].Text := 'P2'; - Text[TextP3R].Text := 'P3'; - end; - - if ScreenAct = 2 then begin - case PlayersPlay of -{ 1: begin - Text[TextP1].Text := 'P2'; - end; - 2: begin - Text[TextP1].Text := 'P3'; - Text[TextP2R].Text := 'P4'; - end; - 3: begin - Text[TextP1].Text := 'P4'; - Text[TextP2M].Text := 'P5'; - Text[TextP3R].Text := 'P6'; - end;} - - 4: begin - Text[TextP1TwoP].Text := 'P3'; - Text[TextP2R].Text := 'P4'; - end; - 6: begin - Text[TextP1ThreeP].Text := 'P4'; - Text[TextP2M].Text := 'P5'; - Text[TextP3R].Text := 'P6'; - end; - end; // case - end; // if - - // stereo - -// weird stuff, maybe this is for "dual screen?", but where is player three then? | okay, i commented the stuff out the other day - nothing was missing on screen w/ 6 players - so do we even need this stuff? -// okay this stuff appears again some lines beneath this one, I commented it out for testing what it does - seems like it's doing nothing -// but I might be wrong, so what is this stuff here doing? O.o - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; - - Text[TextP1].X := Text[TextP1].X + 10*ScreenX; - - {Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX;} - - - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; - - Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; - - {Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX;} -// end of weird stuff - - for S := 1 to 1 do //wtf? - Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX; - - for T := 0 to 1 do - Text[T].X := Text[T].X + 10*ScreenX; - - // update static menu with time ... - Min := Round(Czas.Teraz) div 60; - Sec := Round(Czas.Teraz) mod 60; - Text[TextTimeText].Text := ''; - if Min < 10 then Text[TextTimeText].Text := '0'; - Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':'; - if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0'; - Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec); - - {// .. and scores - if PlayersPlay = 1 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1Score].Text := Tekst; - end; - - if PlayersPlay = 2 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1TwoPScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2RScore].Text := Tekst; - end; - - if PlayersPlay = 3 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1ThreePScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2MScore].Text := Tekst; - - Tekst := IntToStr(Player[2].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP3RScore].Text := Tekst; - end; - - if PlayersPlay = 4 then begin - if ScreenAct = 1 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1TwoPScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2RScore].Text := Tekst; - end; - if ScreenAct = 2 then begin - Tekst := IntToStr(Player[2].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1TwoPScore].Text := Tekst; - - Tekst := IntToStr(Player[3].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2RScore].Text := Tekst; - end; - end; - - if PlayersPlay = 6 then begin - if ScreenAct = 1 then begin - Tekst := IntToStr(Player[0].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1ThreePScore].Text := Tekst; - - Tekst := IntToStr(Player[1].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2MScore].Text := Tekst; - - Tekst := IntToStr(Player[2].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP3RScore].Text := Tekst; - end; - if ScreenAct = 2 then begin - Tekst := IntToStr(Player[3].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP1ThreePScore].Text := Tekst; - - Tekst := IntToStr(Player[4].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP2MScore].Text := Tekst; - - Tekst := IntToStr(Player[5].ScoreTotalI); - while Length(Tekst) < 5 do Tekst := '0' + Tekst; - Text[TextP3RScore].Text := Tekst; - end; - end; } - - // draw static menu (BG) - DrawBG; - //Draw Background - SingDrawBackground; - // update and draw movie - if ShowFinish and AktSong.VideoLoaded then begin - try -// UpdateSmpeg; // this only draws - // todo: find a way to determine, when a new frame is needed - // toto: same for the need to skip frames - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); - except - //If an Error occurs drawing: prevent Video from being Drawn again and Close Video - AktSong.VideoLoaded := False; - log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); - Log.LogError('Corrupted File: ' + AktSong.Video); - try -// CloseSmpeg; - FFmpegClose; - except - - end; - end; - end; - - // draw static menu (FG) - DrawFG; - - // check for music finish -// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish)); - if ShowFinish then begin - if (not Music.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin - //Pause Mod: - if not Paused then - Sing(Self); // analyze song - end else begin -// Log.LogError('End'); - if not FadeOut then begin -// Log.LogError('End2'); - Finish; - FadeOut := true; - FadeTo(@ScreenScore); - end; - end; - end; - - // draw custom items - SingDraw; // always draw - -//GoldenNoteStarsTwinkle Mod - GoldenRec.SpawnRec; -//GoldenNoteStarsTwinkle Mod - - //Draw Scores - Scores.Draw; - - // back stereo - -// weird stuff, maybe this is for "dual screen?", but where is player three then? -// okay this stuff appears again some lines above this one, I commented it out for testing what it does - seems like it's doing nothing -// but I might be wrong, so what is this stuff here doing? O.o - Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; - Text[TextP1].X := Text[TextP1].X - 10*ScreenX; - - {Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; - Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX;} - - - Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; - Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; - - {Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; - Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX;} -//weird end - - for S := 1 to 1 do // wtf? - Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX; - - for T := 0 to 1 do - Text[T].X := Text[T].X - 10*ScreenX; - -end; - -procedure TScreenSing.Finish; -begin - Music.CaptureStop; - Music.Stop; - - if Ini.SavePlayback = 1 then begin - Log.BenchmarkStart(0); - Log.LogVoice(0); - Log.LogVoice(1); - Log.LogVoice(2); - Log.BenchmarkEnd(0); - Log.LogBenchmark('Creating files', 0); - end; - - if AktSong.VideoLoaded then begin -// CloseSmpeg; - FFmpegClose; - AktSong.VideoLoaded := false; // to prevent drawing closed video - end; - - SetFontItalic (False); -end; - -procedure TScreenSing.UpdateLCD; -var - T: string; -begin - //Todo: Lyrics -{ LCD.HideCursor; - LCD.Clear; - - T := LyricMain.Text; - if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; - LCD.AddTextBR(T); - - T := LyricSub.Text; - if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; - LCD.AddTextBR(T);} -end; - -procedure TScreenSing.onSentenceEnd(S: Cardinal); -var -I: Integer; -A: Real; -B: integer; //Max Points for Notes -begin - - //Check for Empty Sentence - if (Czesci[0].Czesc[S].TotalNotes<=0) then - exit; - - //Set Max Note Points - if (Ini.LineBonus > 0) then - B := 9000 - else - B := 10000; - - for I := 0 to High(Player) do begin - A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; - - - //PhrasenBonus - Line Bonus Mod - - //Generate Steps 0 to 8 - A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); - - If (Ini.LineBonus > 0) then - begin - //PhrasenBonus give Points - Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); - Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; - //Update Total Score - Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; - - //Spawn PopUp - If (A >= 8) then - A := 8 - else IF A < 0 then - A := 0; - - Scores.SpawnPopUp(I, Floor(A), Player[I].ScoreTotalI); - end; - //PhrasenBonus - Line Bonus Mod End// } - - //PerfectLineTwinkle Mod (effect) Pt.1 - If (Ini.EffectSing=1) then - begin - if A >= 8 then Player[I].LastSentencePerfect := True - else Player[I].LastSentencePerfect := False; - end; - //PerfectLineTwinkle Mod end - - //Refresh LastScore - Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; - - end; - - //PerfectLineTwinkle Mod (effect) Pt.2 - if Ini.EffectSing=1 then - GoldenRec.SpawnPerfectLineTwinkle; - //PerfectLineTwinkle Mod end -end; - -//Called on Sentence Change S= New Current Sentence -procedure TScreenSing.onSentenceChange(S: Cardinal); -begin - //GoldenStarsTwinkle Mod - GoldenRec.SentenceChange; - if (Lyrics.LineCounter <= High(Czesci[0].Czesc)) then - Lyrics.AddLine(@Czesci[0].Czesc[Lyrics.LineCounter]); - //GoldenStarsTwinkle Mod End -end; - -end. +unit UScreenSing; + +interface + +{$I switches.inc} + +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + + +uses UMenu, + UMusic, + SDL, + SysUtils, + UFiles, + UTime, + USongs, + UIni, + ULog, + UTexture, + ULyrics, + TextGL, + OpenGL12, + {$IFDEF useBASS} + bass, + {$ENDIF} + UThemes, + ULCD, + UGraphicClasses, + UVideo, + USingScores; + +type + TScreenSing = class(TMenu) + protected + paused: boolean; //Pause Mod + PauseTime: Real; + NumEmptySentences: integer; + public + //TextTime: integer; + + //TimeBar mod + StaticTimeProgress: integer; + TextTimeText: integer; + //eoa TimeBar mod + + StaticP1: integer; + TextP1: integer; + {StaticP1ScoreBG: integer; + TextP1Score: integer;} + + {//moveable singbar mod + StaticP1SingBar: integer; + StaticP1ThreePSingBar: integer; + StaticP1TwoPSingBar: integer; + StaticP2RSingBar: integer; + StaticP2MSingBar: integer; + StaticP3SingBar: integer; + //eoa moveable singbar } + + //Added for ps3 skin + //shown when game is in 2/4 player modus + StaticP1TwoP: integer; + TextP1TwoP: integer; + + {StaticP1TwoPScoreBG: integer; + TextP1TwoPScore: integer;} + //shown when game is in 3/6 player modus + StaticP1ThreeP: integer; + TextP1ThreeP: integer; + + {TextP1ThreePScore: integer; + StaticP1ThreePScoreBG: integer; } + //eoa + + StaticP2R: integer; + TextP2R: integer; + + {StaticP2RScoreBG: integer; + TextP2RScore: integer;} + + StaticP2M: integer; + TextP2M: integer; + + {StaticP2MScoreBG: integer; + TextP2MScore: integer; } + + StaticP3R: integer; + TextP3R: integer; + + {StaticP3RScoreBG: integer; + TextP3RScore: integer;} + + Tex_Background: TTexture; + FadeOut: boolean; +// LyricMain: TLyric; +// LyricSub: TLyric; + Lyrics: TLyricEngine; + + //Score Manager: + Scores: TSingScores; + + constructor Create; override; + procedure onShow; override; + procedure onShowFinish; override; + function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; + function Draw: boolean; override; + procedure Finish; virtual; + procedure UpdateLCD; + procedure Pause; //Pause Mod(Toggles Pause) + + //OnSentenceEnd for LineBonus + Singbar + procedure onSentenceEnd(S: Cardinal); + //OnSentenceChange (for Golden Notes) + procedure onSentenceChange(S: Cardinal); + end; + +implementation +uses UGraphic, UDraw, UMain, Classes, URecord, ULanguage, math; + +// Method for input parsing. If False is returned, GetNextWindow +// should be checked to know the next window to load; +function TScreenSing.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; +begin + Result := true; + If (PressedDown) Then + begin // Key Down + case PressedKey of + SDLK_Q: + begin + //When not ask before Exit then Finish now + if (Ini.AskbeforeDel <> 1) then + Finish + //else just Pause and let the Popup make the Work + else if not paused then + Pause; + + Result := false; + end; + + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + //Record Sound Hack: + //Sound[0].BufferLong + + Finish; + Music.PlayBack; + FadeTo(@ScreenScore); + end; + + SDLK_P://Pause Mod + begin + Pause; + end; + + SDLK_RETURN: + begin + end; + + // Up and Down could be done at the same time, + // but I don't want to declare variables inside + // functions like this one, called so many times + SDLK_DOWN : + begin + end; + SDLK_UP : + begin + end; + end; + end; +end; + +//Pause Mod +procedure TScreenSing.Pause; +begin + if not paused then //Pause einschalten + begin + // pause Time + PauseTime := Czas.Teraz; + Paused := true; + + // pause Music + Music.Pause; + + // pause Video + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + FFmpegTogglePause; + end + else //Pause ausschalten + begin + Czas.Teraz := PauseTime; //Position of Notes + + // Position of Music + Music.MoveTo (PauseTime); + // Play Music + Music.Play; + + // Video + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + FFmpegTogglePause; + //SkipSmpeg(PauseTime); + + Paused := false; + end; +end; +//Pause Mod End + +constructor TScreenSing.Create; +var + I: integer; + P: integer; +begin + inherited Create; + + //Create Score Class + Scores := TSingScores.Create; + Scores.LoadfromTheme; + + LoadFromTheme(Theme.Sing); + + //TimeBar + StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress); + TextTimeText := AddText(Theme.Sing.TextTimeText); + +// 1 player | P1 + StaticP1 := AddStatic(Theme.Sing.StaticP1); + TextP1 := AddText(Theme.Sing.TextP1); + + {StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG); + TextP1Score := AddText(Theme.Sing.TextP1Score); + StaticP1SingBar := AddStatic(Theme.Sing.StaticP1SingBar);} + +// 2 or 4 players | P1 + StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP); + TextP1TwoP := AddText(Theme.Sing.TextP1TwoP); + + {StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG); + TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore); + StaticP1TwoPSingBar := AddStatic(Theme.Sing.StaticP2RSingBar);} + + // | P2 + StaticP2R := AddStatic(Theme.Sing.StaticP2R); + TextP2R := AddText(Theme.Sing.TextP2R); + + {StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG); + TextP2RScore := AddText(Theme.Sing.TextP2RScore); + StaticP2RSingBar := AddStatic(Theme.Sing.StaticP2RSingBar); } + +// 3 or 6 players | P1 + StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP); + TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP); + + {StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG); + TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore); + StaticP1ThreePSingBar := AddStatic(Theme.Sing.StaticP1ThreePSingBar);} + + // | P2 + StaticP2M := AddStatic(Theme.Sing.StaticP2M); + TextP2M := AddText(Theme.Sing.TextP2M); + + {StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG); + TextP2MScore := AddText(Theme.Sing.TextP2MScore); + StaticP2MSingBar := AddStatic(Theme.Sing.StaticP2MSingBar);} + + // | P3 + StaticP3R := AddStatic(Theme.Sing.StaticP3R); + TextP3R := AddText(Theme.Sing.TextP3R); + + {StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG); + TextP3RScore := AddText(Theme.Sing.TextP3RScore); + StaticP3SingBar := AddStatic(Theme.Sing.StaticP3SingBar);} + + if ScreenAct = 2 then begin + // katze und affe + + end; + + Lyrics := TLyricEngine.Create(80,Skin_LyricsT,640,12,80,Skin_LyricsT+36,640,12); + + UVideo.Init; +end; + +procedure TScreenSing.onShow; +var + P: integer; + V1: boolean; + V1TwoP: boolean; //added for ps3 skin + V1ThreeP: boolean; //added for ps3 skin + V2R: boolean; + V2M: boolean; + V3R: boolean; + NR: TRecR; //Line Bonus Mod + + Color: TRGB; +begin + Log.LogStatus('Begin', 'onShow'); + FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented + + //SetUp Score Manager + Scores.ClearPlayers; //Clear Old Player Values + Color.R := 0; Color.G := 0; Color.B := 0; //Dummy atm + For P := 0 to PlayersPlay -1 do //Add new Ones + begin + Scores.AddPlayer(Tex_ScoreBG[P], Color); + end; + + Scores.Init; //Get Positions for Players + + + + // prepare players + SetLength(Player, PlayersPlay); +// Player[0].ScoreTotalI := 0; + + case PlayersPlay of + 1: begin + V1 := true; + V1TwoP := false; + V1ThreeP := false; + V2R := false; + V2M := false; + V3R := false; + end; + 2: begin + V1 := false; + V1TwoP := true; + V1ThreeP := false; + V2R := true; + V2M := false; + V3R := false; + end; + 3: begin + V1 := false; + V1TwoP := false; + V1ThreeP := true; + V2R := false; + V2M := true; + V3R := true; + end; + 4: begin // double screen + V1 := false; + V1TwoP := true; + V1ThreeP := false; + V2R := true; + V2M := false; + V3R := false; + end; + 6: begin // double screen + V1 := false; + V1TwoP := false; + V1ThreeP := true; + V2R := false; + V2M := true; + V3R := true; + end; + + end; + + //This one is shown in 1P mode + Static[StaticP1].Visible := V1; + Text[TextP1].Visible := V1; + + {Static[StaticP1ScoreBG].Visible := V1; + Text[TextP1Score].Visible := V1;} + + + //This one is shown in 2/4P mode + Static[StaticP1TwoP].Visible := V1TwoP; + Text[TextP1TwoP].Visible := V1TwoP; + + {Static[StaticP1TwoPScoreBG].Visible := V1TwoP; + Text[TextP1TwoPScore].Visible := V1TwoP;} + + Static[StaticP2R].Visible := V2R; + Text[TextP2R].Visible := V2R; + + {Static[StaticP2RScoreBG].Visible := V2R; + Text[TextP2RScore].Visible := V2R; } + + + //This one is shown in 3/6P mode + Static[StaticP1ThreeP].Visible := V1ThreeP; + Text[TextP1ThreeP].Visible := V1ThreeP; + + {Static[StaticP1ThreePScoreBG].Visible := V1ThreeP; + Text[TextP1ThreePScore].Visible := V1ThreeP; } + + Static[StaticP2M].Visible := V2M; + Text[TextP2M].Visible := V2M; + + {Static[StaticP2MScoreBG].Visible := V2M; + Text[TextP2MScore].Visible := V2M; } + + Static[StaticP3R].Visible := V3R; + Text[TextP3R].Visible := V3R; + + {Static[StaticP3RScoreBG].Visible := V3R; + Text[TextP3RScore].Visible := V3R; } + + // load notes + ResetSingTemp; +// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); + AktSong := CatSongs.Song[CatSongs.Selected]; + try + if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then + begin + //Error Loading Song -> Go back to Song Screen and Show some Error Message + FadeTo(@ScreenSong); + //Select New Song in Party Mode + if ScreenSong.Mode = 1 then + ScreenSong.SelectRandomSong; + ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + Exit; + end; + except + //Error Loading Song -> Go back to Song Screen and Show some Error Message + FadeTo(@ScreenSong); + //Select New Song in Party Mode + if ScreenSong.Mode = 1 then + ScreenSong.SelectRandomSong; + ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + Exit; + end; + AktSong.Path := CatSongs.Song[CatSongs.Selected].Path; +// AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed + + // set movie + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin +(* OpenSmpeg(AktSong.Path + AktSong.Video); + SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) + + // todo: VideoGap and Start time verwursten + FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); + FFmpegSkip(AktSong.VideoGAP + AktSong.Start); + AktSong.VideoLoaded := true; + end; + + // set background + if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then + try + Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background); + except + log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background); + Tex_Background.TexNum := -1; + end + else + Tex_Background.TexNum := -1; + + + + // play music (I) + Music.CaptureStart; + Music.MoveTo(AktSong.Start); +// Music.Play; + + // prepare timer (I) +// CountSkipTimeSet; + Czas.Teraz := AktSong.Start; + Czas.Razem := Music.Length; + if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000; + Czas.OldBeat := -1; + for P := 0 to High(Player) do + ClearScores(P); + + // main text + Lyrics.Clear (AktSong.BPM[0].BPM, AktSong.Resolution); + + // set custom options + case Ini.LyricsFont of + 0: + begin + Lyrics.UpperLineSize := 14; + Lyrics.LowerLineSize := 14; + Lyrics.FontStyle := 0; + + Lyrics.LineColor_en.R := Skin_FontR; + Lyrics.LineColor_en.G := Skin_FontG; + Lyrics.LineColor_en.B := Skin_FontB; + Lyrics.LineColor_en.A := 1; + + Lyrics.LineColor_dis.R := 0.4; + Lyrics.LineColor_dis.G := 0.4; + Lyrics.LineColor_dis.B := 0.4; + Lyrics.LineColor_dis.A := 1; + + Lyrics.LineColor_akt.R := 5/256; + Lyrics.LineColor_akt.G := 163/256; + Lyrics.LineColor_akt.B := 210/256; + Lyrics.LineColor_akt.A := 1; + +{ LyricSub.FontStyle := 0; + LyricMain.Size := 14; // 13 + LyricSub.Size := 14; // 13 + LyricMain.ColR := Skin_FontR; + LyricMain.ColG := Skin_FontG; + LyricMain.ColB := Skin_FontB; //Change für Crazy Joker + {LyricMain.ColSR := Skin_FontHighlightR; + LyricMain.ColSG := Skin_FontHighlightG; + LyricMain.ColSB := Skin_FontHighlightB;1aa5dc}{ + LyricMain.ColSR := 5/255; //26 + LyricMain.ColSG := 163/255; //165 + LyricMain.ColSB := 210/255; //220 + + LyricSub.ColR := 0.4; //0.6 + LyricSub.ColG := 0.4; //0.6 + LyricSub.ColB := 0.4; //0.6 } + end; + 1: + begin + { LyricMain.FontStyle := 2; + LyricSub.FontStyle := 2; + LyricMain.Size := 14; + LyricSub.Size := 14; + LyricMain.ColR := 0.75; + LyricMain.ColG := 0.75; + LyricMain.ColB := 1; + LyricMain.ColSR := 0.5; + LyricMain.ColSG := 0.5; + LyricMain.ColSB := 1; + LyricSub.ColR := 0.8; + LyricSub.ColG := 0.8; + LyricSub.ColB := 0.8; } + + Lyrics.UpperLineSize := 14; + Lyrics.LowerLineSize := 14; + Lyrics.FontStyle := 2; + + Lyrics.LineColor_en.R := 0.75; + Lyrics.LineColor_en.G := 0.75; + Lyrics.LineColor_en.B := 1; + Lyrics.LineColor_en.A := 1; + + Lyrics.LineColor_dis.R := 0.8; + Lyrics.LineColor_dis.G := 0.8; + Lyrics.LineColor_dis.B := 0.8; + Lyrics.LineColor_dis.A := 1; + + Lyrics.LineColor_akt.R := 0.5; + Lyrics.LineColor_akt.G := 0.5; + Lyrics.LineColor_akt.B := 1; + Lyrics.LineColor_akt.A := 1; + end; + 2: + begin + Lyrics.UpperLineSize := 12; + Lyrics.LowerLineSize := 12; + Lyrics.FontStyle := 3; + + Lyrics.LineColor_en.R := 0.75; + Lyrics.LineColor_en.G := 0.75; + Lyrics.LineColor_en.B := 1; + Lyrics.LineColor_en.A := 1; + + Lyrics.LineColor_dis.R := 0.8; + Lyrics.LineColor_dis.G := 0.8; + Lyrics.LineColor_dis.B := 0.8; + Lyrics.LineColor_dis.A := 1; + + Lyrics.LineColor_akt.R := 0.5; + Lyrics.LineColor_akt.G := 0.5; + Lyrics.LineColor_akt.B := 1; + Lyrics.LineColor_akt.A := 1; +{ LyricSub.FontStyle := 3; + LyricMain.Size := 12; + LyricSub.Size := 12; + LyricMain.ColR := 0.75; + LyricMain.ColG := 0.75; + LyricMain.ColB := 1; + LyricMain.ColSR := 0.5; + LyricMain.ColSG := 0.5; + LyricMain.ColSB := 1; + LyricSub.ColR := 0.8; + LyricSub.ColG := 0.8; + LyricSub.ColB := 0.8;} + end; + end; // case + + case Ini.LyricsEffect of + 0: Lyrics.HoverEffekt := 1; // 0 - one selected, 1 - selected all to the current + 1: Lyrics.HoverEffekt := 2; + 2: Lyrics.HoverEffekt := 3; + 3: Lyrics.HoverEffekt := 4; + end; // case + + // Add Lines to Lyrics + While (not Lyrics.LineinQueue) AND (Lyrics.LineCounter <= High(Czesci[0].Czesc)) do + Lyrics.AddLine(@Czesci[0].Czesc[Lyrics.LineCounter]); + + UpdateLCD; + + //Deactivate Pause + Paused := False; + + //Kill all Stars not Killed yet + //GoldenStarsTwinkle Mod + GoldenRec.SentenceChange; + //GoldenStarsTwinkle Mod End + + {//Set Position of Line Bonus - PhrasenBonus + if (Ini.LineBonus = 1) then //Show Line Bonus at Scores + begin + Case PlayersPlay of + 1: begin + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1Score.Y + 65; + end; + + 2: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.X; + Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.X; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.X; + Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + end; + + 3: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + end; + + 4: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP1TwoPScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP1TwoPScore.Y + 65; + + //P4 + Player[3].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x; + Player[3].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y; + Player[3].LineBonus_StartX := Theme.Sing.StaticP2RScoreBG.x; + Player[3].LineBonus_StartY := Theme.Sing.TextP2RScore.Y + 65; + end; + + 6: begin + //P1 + Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[0].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[0].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; + + //P2 + Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[1].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[1].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P3 + Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[2].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[2].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + + //P4 + Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[3].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y; + Player[3].LineBonus_StartX := Theme.Sing.StaticP1ThreePScoreBG.x; + Player[3].LineBonus_StartY := Theme.Sing.TextP1ThreePScore.Y + 65; + + //P5 + Player[4].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x; + Player[4].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y; + Player[4].LineBonus_StartX := Theme.Sing.StaticP2MScoreBG.x; + Player[4].LineBonus_StartY := Theme.Sing.TextP2MScore.Y + 65; + + //P6 + Player[5].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x; + Player[5].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y; + Player[5].LineBonus_StartX := Theme.Sing.StaticP3RScoreBG.x; + Player[5].LineBonus_StartY := Theme.Sing.TextP3RScore.Y + 65; + end; + end; + end + else if (Ini.LineBonus = 2) then //Show Line Bonus at Notes + begin + + // positions + if Ini.SingWindow = 0 then begin + NR.Left := 120; + end else begin + NR.Left := 20; + end; + NR.Right := 780; + + NR.Width := NR.Right - NR.Left; + NR.WMid := NR.Width / 2; + NR.Mid := NR.Left + NR.WMid; + + Case PlayersPlay of + 1: begin + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := Skin_P2_NotesB - 105; + end; + + 2: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + end; + + 3: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := 120 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := 120 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := 245 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := 245 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_TargetY := 370 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_StartY := 370 + 28; + end; + + 4: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_StartY := Skin_P1_NotesB - 105 + 28; + + //P4 + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28; + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_StartY := Skin_P2_NotesB - 105 + 28; + end; + + 6: begin + //P1 + Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_TargetY := 120 - 65 + 28; + Player[0].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[0].LineBonus_StartY := 120 + 28; + + //P2 + Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_TargetY := 245 - 65 + 28; + Player[1].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[1].LineBonus_StartY := 245 + 28; + + //P3 + Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_TargetY := 370 - 65 + 28; + Player[2].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[2].LineBonus_StartY := 370 + 28; + + //P4 + Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_TargetY := 120 - 65 + 28; + Player[3].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[3].LineBonus_StartY := 120 + 28; + + //P5 + Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[4].LineBonus_TargetY := 245 - 65 + 28; + Player[4].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[4].LineBonus_StartY := 245 + 28; + + //P6 + Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100); + Player[5].LineBonus_TargetY := 370 - 65 + 28; + Player[5].LineBonus_StartX := Round(Nr.Right + 10*ScreenX - 100); + Player[5].LineBonus_StartY := 370 + 28; + end; + end; + end; } + + //Set Position of Line Bonus - PhrasenBonus End + //Set Num of Empty Sentences for Phrasen Bonus + NumEmptySentences := 0; + for P := low(Czesci[0].Czesc) to high(Czesci[0].Czesc) do + if Czesci[0].Czesc[P].TotalNotes = 0 then Inc(NumEmptySentences); + + Log.LogStatus('End', 'onShow'); +end; + +procedure TScreenSing.onShowFinish; +begin + // play movie (II) + + if AktSong.VideoLoaded then + begin + try + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL(ScreenAct); +// PlaySmpeg; + except + + on E : Exception do + begin + //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Error Message : '+ E.message ); + Log.LogError(' In : '+ E.ClassName +' (TScreenSing.onShowFinish)' ); + Log.LogError('Corrupted File: ' + AktSong.Video); + try +// CloseSmpeg; + FFmpegClose; + except + + end; + end; + end; + end; + + // play music (II) + Music.Play; + + // prepare timer (II) + CountSkipTimeSet; +end; + +function TScreenSing.Draw: boolean; +var + Min: integer; + Sec: integer; + Tekst: string; + Flash: real; + S: integer; + T: integer; +begin + + + + //ScoreBG Mod | den wirren Scheiss hier brauch mer nimmer, wir haben colorized png's - no need for wirrness also + // set player colors - macht nichts weiter als die farben des statics zu wechseln, was zu unschönen effekten bei colorized png führt +{ if PlayersPlay = 4 then begin + if ScreenAct = 1 then begin + LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, + Static[StaticP1TwoP].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P2Dark'); + + LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, + Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); + end; + if ScreenAct = 2 then begin + LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG, + Static[StaticP1TwoP].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P4Dark'); + + LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG, + Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark'); + LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark'); + end; + end; + + if PlayersPlay = 6 then begin + if ScreenAct = 1 then begin + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, + Static[StaticP1ThreeP].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P2Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P3Dark'); + + LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, + Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark'); + LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark'); + LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, + Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark'); + end; + if ScreenAct = 2 then begin + + LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG, + Static[StaticP1ThreeP].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG, + Static[StaticP2R].Texture.ColB, 'P5Dark'); + LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG, + Static[StaticP3R].Texture.ColB, 'P6Dark'); + + + LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG, + Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark'); + LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG, + Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark'); + LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG, + Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark'); + end; + end; + } + + // set player names (for 2 screens and only Singstar skin) + if ScreenAct = 1 then begin + Text[TextP1].Text := 'P1'; + Text[TextP1TwoP].Text := 'P1'; + Text[TextP1ThreeP].Text := 'P1'; + Text[TextP2R].Text := 'P2'; + Text[TextP2M].Text := 'P2'; + Text[TextP3R].Text := 'P3'; + end; + + if ScreenAct = 2 then begin + case PlayersPlay of +{ 1: begin + Text[TextP1].Text := 'P2'; + end; + 2: begin + Text[TextP1].Text := 'P3'; + Text[TextP2R].Text := 'P4'; + end; + 3: begin + Text[TextP1].Text := 'P4'; + Text[TextP2M].Text := 'P5'; + Text[TextP3R].Text := 'P6'; + end;} + + 4: begin + Text[TextP1TwoP].Text := 'P3'; + Text[TextP2R].Text := 'P4'; + end; + 6: begin + Text[TextP1ThreeP].Text := 'P4'; + Text[TextP2M].Text := 'P5'; + Text[TextP3R].Text := 'P6'; + end; + end; // case + end; // if + + // stereo + +// weird stuff, maybe this is for "dual screen?", but where is player three then? | okay, i commented the stuff out the other day - nothing was missing on screen w/ 6 players - so do we even need this stuff? +// okay this stuff appears again some lines beneath this one, I commented it out for testing what it does - seems like it's doing nothing +// but I might be wrong, so what is this stuff here doing? O.o + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX; + + Text[TextP1].X := Text[TextP1].X + 10*ScreenX; + + {Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX;} + + + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX; + + Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX; + + {Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX;} +// end of weird stuff + + for S := 1 to 1 do //wtf? + Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX; + + for T := 0 to 1 do + Text[T].X := Text[T].X + 10*ScreenX; + + // update static menu with time ... + Min := Round(Czas.Teraz) div 60; + Sec := Round(Czas.Teraz) mod 60; + Text[TextTimeText].Text := ''; + if Min < 10 then Text[TextTimeText].Text := '0'; + Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':'; + if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0'; + Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec); + + {// .. and scores + if PlayersPlay = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1Score].Text := Tekst; + end; + + if PlayersPlay = 2 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1TwoPScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + + if PlayersPlay = 3 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1ThreePScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + + if PlayersPlay = 4 then begin + if ScreenAct = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1TwoPScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + if ScreenAct = 2 then begin + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1TwoPScore].Text := Tekst; + + Tekst := IntToStr(Player[3].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2RScore].Text := Tekst; + end; + end; + + if PlayersPlay = 6 then begin + if ScreenAct = 1 then begin + Tekst := IntToStr(Player[0].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1ThreePScore].Text := Tekst; + + Tekst := IntToStr(Player[1].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[2].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + if ScreenAct = 2 then begin + Tekst := IntToStr(Player[3].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP1ThreePScore].Text := Tekst; + + Tekst := IntToStr(Player[4].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP2MScore].Text := Tekst; + + Tekst := IntToStr(Player[5].ScoreTotalI); + while Length(Tekst) < 5 do Tekst := '0' + Tekst; + Text[TextP3RScore].Text := Tekst; + end; + end; } + + // draw static menu (BG) + DrawBG; + //Draw Background + SingDrawBackground; + // update and draw movie + + if ShowFinish and AktSong.VideoLoaded then begin + try +// UpdateSmpeg; // this only draws + // todo: find a way to determine, when a new frame is needed + // toto: same for the need to skip frames + + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL(ScreenAct); + except + on E : Exception do + begin + + //If an Error occurs drawing: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Error Message : '+ E.message ); + Log.LogError(' In : '+ E.ClassName +' (TScreenSing.Draw)' ); + + Log.LogError('Corrupted File: ' + AktSong.Video); + try +// CloseSmpeg; + FFmpegClose; + except + + end; + end; + end; + end; + + // draw static menu (FG) + DrawFG; + + // check for music finish +// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish)); + if ShowFinish then begin + if (not Music.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin + //Pause Mod: + if not Paused then + Sing(Self); // analyze song + end else begin +// Log.LogError('End'); + if not FadeOut then begin +// Log.LogError('End2'); + Finish; + FadeOut := true; + FadeTo(@ScreenScore); + end; + end; + end; + + // draw custom items + SingDraw; // always draw + +//GoldenNoteStarsTwinkle Mod + GoldenRec.SpawnRec; +//GoldenNoteStarsTwinkle Mod + + //Draw Scores + Scores.Draw; + + // back stereo + +// weird stuff, maybe this is for "dual screen?", but where is player three then? +// okay this stuff appears again some lines above this one, I commented it out for testing what it does - seems like it's doing nothing +// but I might be wrong, so what is this stuff here doing? O.o + Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX; + Text[TextP1].X := Text[TextP1].X - 10*ScreenX; + + {Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX; + Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX;} + + + Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX; + Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX; + + {Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX; + Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX;} +//weird end + + for S := 1 to 1 do // wtf? + Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX; + + for T := 0 to 1 do + Text[T].X := Text[T].X - 10*ScreenX; + +end; + +procedure TScreenSing.Finish; +begin + Music.CaptureStop; + Music.Stop; + + if Ini.SavePlayback = 1 then begin + Log.BenchmarkStart(0); + Log.LogVoice(0); + Log.LogVoice(1); + Log.LogVoice(2); + Log.BenchmarkEnd(0); + Log.LogBenchmark('Creating files', 0); + end; + + if AktSong.VideoLoaded then begin +// CloseSmpeg; + FFmpegClose; + AktSong.VideoLoaded := false; // to prevent drawing closed video + end; + + SetFontItalic (False); +end; + +procedure TScreenSing.UpdateLCD; +var + T: string; +begin + //Todo: Lyrics +{ LCD.HideCursor; + LCD.Clear; + + T := LyricMain.Text; + if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; + LCD.AddTextBR(T); + + T := LyricSub.Text; + if Copy(T, Length(T), 1) <> ' ' then T := T + ' '; + LCD.AddTextBR(T);} +end; + +procedure TScreenSing.onSentenceEnd(S: Cardinal); +var +I: Integer; +A: Real; +B: integer; //Max Points for Notes +begin + + //Check for Empty Sentence + if (Czesci[0].Czesc[S].TotalNotes<=0) then + exit; + + //Set Max Note Points + if (Ini.LineBonus > 0) then + B := 9000 + else + B := 10000; + + for I := 0 to High(Player) do begin + A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2; + + + //PhrasenBonus - Line Bonus Mod + + //Generate Steps 0 to 8 + A := Floor(A / (B * Czesci[0].Czesc[S].TotalNotes / Czesci[0].Wartosc) * 8); + + If (Ini.LineBonus > 0) then + begin + //PhrasenBonus give Points + Player[I].ScoreLine := Player[I].ScoreLine + (1000 / (Length(Czesci[0].Czesc) - NumEmptySentences) * A / 8); + Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10; + //Update Total Score + Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI; + + //Spawn PopUp + If (A >= 8) then + A := 8 + else IF A < 0 then + A := 0; + + Scores.SpawnPopUp(I, Floor(A), Player[I].ScoreTotalI); + end; + //PhrasenBonus - Line Bonus Mod End// } + + //PerfectLineTwinkle Mod (effect) Pt.1 + If (Ini.EffectSing=1) then + begin + if A >= 8 then Player[I].LastSentencePerfect := True + else Player[I].LastSentencePerfect := False; + end; + //PerfectLineTwinkle Mod end + + //Refresh LastScore + Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden; + + end; + + //PerfectLineTwinkle Mod (effect) Pt.2 + if Ini.EffectSing=1 then + GoldenRec.SpawnPerfectLineTwinkle; + //PerfectLineTwinkle Mod end +end; + +//Called on Sentence Change S= New Current Sentence +procedure TScreenSing.onSentenceChange(S: Cardinal); +begin + //GoldenStarsTwinkle Mod + GoldenRec.SentenceChange; + if (Lyrics.LineCounter <= High(Czesci[0].Czesc)) then + Lyrics.AddLine(@Czesci[0].Czesc[Lyrics.LineCounter]); + //GoldenStarsTwinkle Mod End +end; + +end. -- cgit v1.2.3 From 44554c7908f7e2405a249331f00a35703f5939c2 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 11 Oct 2007 12:02:20 +0000 Subject: Added IAudioPlayback Interface and implementation for BASS. Created "AudioPlayback" Global Singleton, which removed the need for the "Music" Global variable. This was done because global singleton objects are a recognized better "design pattern" achieving the same thing as global variables, but in a nicer way. I will be working to a) separate IAudioPlayback in to separate "Playback" and "Input" Interfaces b) build a FFMpeg class that implements IAudioPlayback git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@504 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 9e43f31f..e0c80297 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -146,7 +146,7 @@ begin //Sound[0].BufferLong Finish; - Music.PlayBack; + AudioPlayback.PlayBack; FadeTo(@ScreenScore); end; @@ -182,7 +182,7 @@ begin Paused := true; // pause Music - Music.Pause; + AudioPlayback.Pause; // pause Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then @@ -193,9 +193,9 @@ begin Czas.Teraz := PauseTime; //Position of Notes // Position of Music - Music.MoveTo (PauseTime); + AudioPlayback.MoveTo (PauseTime); // Play Music - Music.Play; + AudioPlayback.Play; // Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then @@ -451,14 +451,14 @@ begin // play music (I) - Music.CaptureStart; - Music.MoveTo(AktSong.Start); + AudioPlayback.CaptureStart; + AudioPlayback.MoveTo(AktSong.Start); // Music.Play; // prepare timer (I) // CountSkipTimeSet; Czas.Teraz := AktSong.Start; - Czas.Razem := Music.Length; + Czas.Razem := AudioPlayback.Length; if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000; Czas.OldBeat := -1; for P := 0 to High(Player) do @@ -871,7 +871,7 @@ begin end; // play music (II) - Music.Play; + AudioPlayback.Play; // prepare timer (II) CountSkipTimeSet; @@ -1147,7 +1147,7 @@ begin // check for music finish // Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish)); if ShowFinish then begin - if (not Music.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin + if (not AudioPlayback.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin //Pause Mod: if not Paused then Sing(Self); // analyze song @@ -1201,8 +1201,8 @@ end; procedure TScreenSing.Finish; begin - Music.CaptureStop; - Music.Stop; + AudioPlayback.CaptureStop; + AudioPlayback.Stop; if Ini.SavePlayback = 1 then begin Log.BenchmarkStart(0); -- cgit v1.2.3 From 6292440f6da3c11e85bb9fc3a741a26540e429be Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 11 Oct 2007 12:12:37 +0000 Subject: separated IAudioPlayback in to separate "Playback" and "Input" Interfaces ( both interfaces provided by same TMusic_Bass class... git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@505 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index e0c80297..abb2726e 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -451,7 +451,7 @@ begin // play music (I) - AudioPlayback.CaptureStart; + AudioInput.CaptureStart; AudioPlayback.MoveTo(AktSong.Start); // Music.Play; @@ -1201,7 +1201,7 @@ end; procedure TScreenSing.Finish; begin - AudioPlayback.CaptureStop; + AudioInput.CaptureStop; AudioPlayback.Stop; if Ini.SavePlayback = 1 then begin -- cgit v1.2.3 From 8c923b5b76bb17e00132a0b2b2b96de34265fc63 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Tue, 16 Oct 2007 11:27:23 +0000 Subject: modified ffmpeg usage, to use interface same as bass... still needs some tidy up, but its working. :) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@515 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 43 +++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index abb2726e..c32b29e0 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -22,13 +22,15 @@ uses UMenu, ULyrics, TextGL, OpenGL12, +(* {$IFDEF useBASS} bass, {$ENDIF} +*) UThemes, ULCD, UGraphicClasses, - UVideo, +// UVideo, USingScores; type @@ -186,7 +188,8 @@ begin // pause Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; + VideoPlayback.Pause; +// FFmpegTogglePause; end else //Pause ausschalten begin @@ -199,7 +202,8 @@ begin // Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; + VideoPlayback.Pause; +// FFmpegTogglePause; //SkipSmpeg(PauseTime); Paused := false; @@ -279,7 +283,7 @@ begin Lyrics := TLyricEngine.Create(80,Skin_LyricsT,640,12,80,Skin_LyricsT+36,640,12); - UVideo.Init; + VideoPlayback.Init(); end; procedure TScreenSing.onShow; @@ -432,8 +436,12 @@ begin SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) // todo: VideoGap and Start time verwursten - FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); - FFmpegSkip(AktSong.VideoGAP + AktSong.Start); +// FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); + VideoPlayback.Open( AktSong.Path + AktSong.Video ); + +// FFmpegSkip(AktSong.VideoGAP + AktSong.Start); + VideoPlayback.position := AktSong.VideoGAP + AktSong.Start; + AktSong.VideoLoaded := true; end; @@ -847,8 +855,11 @@ begin if AktSong.VideoLoaded then begin try - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); + writeln( 'VideoPlayback.FFmpegGetFrame' ); + VideoPlayback.FFmpegGetFrame(Czas.Teraz); + + writeln( 'VideoPlayback.FFmpegDrawGL' ); + VideoPlayback.FFmpegDrawGL(ScreenAct); // PlaySmpeg; except @@ -862,7 +873,7 @@ begin Log.LogError('Corrupted File: ' + AktSong.Video); try // CloseSmpeg; - FFmpegClose; + VideoPlayback.Close; except end; @@ -1112,14 +1123,15 @@ begin SingDrawBackground; // update and draw movie - if ShowFinish and AktSong.VideoLoaded then begin + if ShowFinish and AktSong.VideoLoaded then + begin try // UpdateSmpeg; // this only draws // todo: find a way to determine, when a new frame is needed // toto: same for the need to skip frames - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); + VideoPlayback.FFmpegGetFrame(Czas.Teraz); + VideoPlayback.FFmpegDrawGL(ScreenAct); except on E : Exception do begin @@ -1133,7 +1145,7 @@ begin Log.LogError('Corrupted File: ' + AktSong.Video); try // CloseSmpeg; - FFmpegClose; + VideoPlayback.Close; except end; @@ -1213,9 +1225,10 @@ begin Log.LogBenchmark('Creating files', 0); end; - if AktSong.VideoLoaded then begin + if AktSong.VideoLoaded then + begin // CloseSmpeg; - FFmpegClose; + VideoPlayback.Close; AktSong.VideoLoaded := false; // to prevent drawing closed video end; -- cgit v1.2.3 From 659f88b3328ab25380777d2f04124ff5e5c444ba Mon Sep 17 00:00:00 2001 From: jaybinks Date: Tue, 16 Oct 2007 11:36:18 +0000 Subject: tidy up un-needed uses clauses.. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@516 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 6 ------ 1 file changed, 6 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index c32b29e0..542326d2 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -22,15 +22,9 @@ uses UMenu, ULyrics, TextGL, OpenGL12, -(* - {$IFDEF useBASS} - bass, - {$ENDIF} -*) UThemes, ULCD, UGraphicClasses, -// UVideo, USingScores; type -- cgit v1.2.3 From 9a144f3cc3b9fbed5b07ffc3a05c5449d638d3ae Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 25 Oct 2007 06:59:28 +0000 Subject: minor changes and fixes for USDX on linux. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@526 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 542326d2..8cba8f36 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -425,7 +425,8 @@ begin // AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed // set movie - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin + if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + begin (* OpenSmpeg(AktSong.Path + AktSong.Video); SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) -- cgit v1.2.3 From 391d30716d48dc709f6444b19c008e82311623b9 Mon Sep 17 00:00:00 2001 From: eddie-0815 Date: Thu, 1 Nov 2007 19:34:40 +0000 Subject: Mac OS X version compiles and links. I hope I didn't break too many files on windows/linux. Added switches.inc to all files. Changed many IFDEFs. For Windows-only code please use MSWINDOWS instead of WIN32 now. WIN32 is also used by the Mac port. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@546 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 8cba8f36..60cab0a4 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -4,10 +4,6 @@ interface {$I switches.inc} -{$IFDEF FPC} - {$MODE DELPHI} -{$ENDIF} - uses UMenu, UMusic, -- cgit v1.2.3 From 99955c78f63d1cb0d8bec666bc33953590a74c8a Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 1 Nov 2007 23:22:01 +0000 Subject: fixed failed builds build:USDX-LAZLIN-75 build:USDX-LAZLIN-76 for some reason we can not use {$MODE Delphi} in an included file. ( Probably because of the way the compier scopes this switch to each pas file ) ive had to revert this part of eddies changes. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@548 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 60cab0a4..dd11ee07 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -2,6 +2,10 @@ unit UScreenSing; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + {$I switches.inc} -- cgit v1.2.3 From 486ad8796acc5883ef83f3a78cd615f6711d77f0 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 6 Dec 2007 09:39:49 +0000 Subject: conformed projectM to IVideoPlayback still needs a little work. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@678 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index dd11ee07..c3bb78d2 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -851,10 +851,10 @@ begin begin try writeln( 'VideoPlayback.FFmpegGetFrame' ); - VideoPlayback.FFmpegGetFrame(Czas.Teraz); + VideoPlayback.GetFrame(Czas.Teraz); writeln( 'VideoPlayback.FFmpegDrawGL' ); - VideoPlayback.FFmpegDrawGL(ScreenAct); + VideoPlayback.DrawGL(ScreenAct); // PlaySmpeg; except @@ -1125,8 +1125,8 @@ begin // todo: find a way to determine, when a new frame is needed // toto: same for the need to skip frames - VideoPlayback.FFmpegGetFrame(Czas.Teraz); - VideoPlayback.FFmpegDrawGL(ScreenAct); + VideoPlayback.GetFrame(Czas.Teraz); + VideoPlayback.DrawGL(ScreenAct); except on E : Exception do begin -- cgit v1.2.3 From 553ee1ad981964a3689e6510d5813dbff0f2119c Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 6 Dec 2007 10:46:53 +0000 Subject: added "V" key to sing screen to start Visualization... git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@681 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index c3bb78d2..b3b92446 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -150,6 +150,13 @@ begin begin Pause; end; + + SDLK_V: //Show Visualization + begin + AktSong.VideoLoaded := not AktSong.VideoLoaded; + VideoPlayback.play; + + end; SDLK_RETURN: begin @@ -183,7 +190,7 @@ begin // pause Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then VideoPlayback.Pause; -// FFmpegTogglePause; + end else //Pause ausschalten begin @@ -197,8 +204,6 @@ begin // Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then VideoPlayback.Pause; -// FFmpegTogglePause; - //SkipSmpeg(PauseTime); Paused := false; end; @@ -427,14 +432,9 @@ begin // set movie if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin -(* OpenSmpeg(AktSong.Path + AktSong.Video); - SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) - // todo: VideoGap and Start time verwursten -// FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); VideoPlayback.Open( AktSong.Path + AktSong.Video ); -// FFmpegSkip(AktSong.VideoGAP + AktSong.Start); VideoPlayback.position := AktSong.VideoGAP + AktSong.Start; AktSong.VideoLoaded := true; @@ -1119,6 +1119,7 @@ begin // update and draw movie if ShowFinish and AktSong.VideoLoaded then +// if ShowFinish then begin try // UpdateSmpeg; // this only draws -- cgit v1.2.3 From 886b7205df1355054eda3cb72b65c77ec8a40d73 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 6 Dec 2007 11:19:36 +0000 Subject: added [tab] to change visualization preset git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@682 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index b3b92446..e62b9339 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -157,6 +157,12 @@ begin VideoPlayback.play; end; + + SDLK_TAB: //Change Visualization Preset + begin + if AktSong.VideoLoaded then + VideoPlayback.MoveTo( now ); // move to a random position + end; SDLK_RETURN: begin -- cgit v1.2.3 From be68ff31e2d10d5f29894c6ec4ed877c70c142a3 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 6 Dec 2007 12:26:05 +0000 Subject: gave priority to videos over Visualization... so now video plays back... and "V" will switch between Video ( or jpg ) background and visualization. this needs to be pressed on every song, as the state should be forgotten. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@687 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 51 ++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 17 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index e62b9339..75246d09 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -97,6 +97,9 @@ type //Score Manager: Scores: TSingScores; + fShowVisualization : boolean; + fCurrentVideoPlaybackEngine : IVideoPlayback; + constructor Create; override; procedure onShow; override; procedure onShowFinish; override; @@ -153,15 +156,22 @@ begin SDLK_V: //Show Visualization begin - AktSong.VideoLoaded := not AktSong.VideoLoaded; - VideoPlayback.play; + fShowVisualization := not fShowVisualization; + + if fShowVisualization then + fCurrentVideoPlaybackEngine := Visualization + else + fCurrentVideoPlaybackEngine := VideoPlayback; + + if fShowVisualization then + fCurrentVideoPlaybackEngine.play; end; SDLK_TAB: //Change Visualization Preset begin - if AktSong.VideoLoaded then - VideoPlayback.MoveTo( now ); // move to a random position + if fShowVisualization then + fCurrentVideoPlaybackEngine.MoveTo( now ); // move to a random position end; SDLK_RETURN: @@ -195,7 +205,7 @@ begin // pause Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - VideoPlayback.Pause; + fCurrentVideoPlaybackEngine.Pause; end else //Pause ausschalten @@ -209,7 +219,7 @@ begin // Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - VideoPlayback.Pause; + fCurrentVideoPlaybackEngine.Pause; Paused := false; end; @@ -223,6 +233,10 @@ var begin inherited Create; + fShowVisualization := false; + fCurrentVideoPlaybackEngine := VideoPlayback; + + //Create Score Class Scores := TSingScores.Create; Scores.LoadfromTheme; @@ -288,7 +302,7 @@ begin Lyrics := TLyricEngine.Create(80,Skin_LyricsT,640,12,80,Skin_LyricsT+36,640,12); - VideoPlayback.Init(); + fCurrentVideoPlaybackEngine.Init(); end; procedure TScreenSing.onShow; @@ -307,6 +321,9 @@ begin Log.LogStatus('Begin', 'onShow'); FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented + // reset video playback engine, to play Video Clip... + fCurrentVideoPlaybackEngine := VideoPlayback; + //SetUp Score Manager Scores.ClearPlayers; //Clear Old Player Values Color.R := 0; Color.G := 0; Color.B := 0; //Dummy atm @@ -439,9 +456,9 @@ begin if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin // todo: VideoGap and Start time verwursten - VideoPlayback.Open( AktSong.Path + AktSong.Video ); + fCurrentVideoPlaybackEngine.Open( AktSong.Path + AktSong.Video ); - VideoPlayback.position := AktSong.VideoGAP + AktSong.Start; + fCurrentVideoPlaybackEngine.position := AktSong.VideoGAP + AktSong.Start; AktSong.VideoLoaded := true; end; @@ -857,10 +874,10 @@ begin begin try writeln( 'VideoPlayback.FFmpegGetFrame' ); - VideoPlayback.GetFrame(Czas.Teraz); + fCurrentVideoPlaybackEngine.GetFrame(Czas.Teraz); writeln( 'VideoPlayback.FFmpegDrawGL' ); - VideoPlayback.DrawGL(ScreenAct); + fCurrentVideoPlaybackEngine.DrawGL(ScreenAct); // PlaySmpeg; except @@ -874,7 +891,7 @@ begin Log.LogError('Corrupted File: ' + AktSong.Video); try // CloseSmpeg; - VideoPlayback.Close; + fCurrentVideoPlaybackEngine.Close; except end; @@ -1124,7 +1141,7 @@ begin SingDrawBackground; // update and draw movie - if ShowFinish and AktSong.VideoLoaded then + if ShowFinish and ( AktSong.VideoLoaded or fShowVisualization ) then // if ShowFinish then begin try @@ -1132,8 +1149,8 @@ begin // todo: find a way to determine, when a new frame is needed // toto: same for the need to skip frames - VideoPlayback.GetFrame(Czas.Teraz); - VideoPlayback.DrawGL(ScreenAct); + fCurrentVideoPlaybackEngine.GetFrame(Czas.Teraz); + fCurrentVideoPlaybackEngine.DrawGL(ScreenAct); except on E : Exception do begin @@ -1147,7 +1164,7 @@ begin Log.LogError('Corrupted File: ' + AktSong.Video); try // CloseSmpeg; - VideoPlayback.Close; + fCurrentVideoPlaybackEngine.Close; except end; @@ -1230,7 +1247,7 @@ begin if AktSong.VideoLoaded then begin // CloseSmpeg; - VideoPlayback.Close; + fCurrentVideoPlaybackEngine.Close; AktSong.VideoLoaded := false; // to prevent drawing closed video end; -- cgit v1.2.3 From 425ff834dbc3933475ee8f783eea6167e92ec174 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Fri, 7 Dec 2007 04:32:38 +0000 Subject: little bit of tidy up.. added command line switch, to see what media interfaces are being used. moved RandomPCM Data generation to Visualizer class. added Visualization preset change, on new line ( may be a little to much... maybe we should do ever 4 or 16 bars or something ?) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@697 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 75246d09..31e9f511 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -165,14 +165,14 @@ begin if fShowVisualization then fCurrentVideoPlaybackEngine.play; - + end; SDLK_TAB: //Change Visualization Preset begin - if fShowVisualization then - fCurrentVideoPlaybackEngine.MoveTo( now ); // move to a random position - end; + if fShowVisualization then + fCurrentVideoPlaybackEngine.MoveTo( now ); // move to a random position + end; SDLK_RETURN: begin @@ -1144,13 +1144,18 @@ begin if ShowFinish and ( AktSong.VideoLoaded or fShowVisualization ) then // if ShowFinish then begin - try +// try // UpdateSmpeg; // this only draws // todo: find a way to determine, when a new frame is needed // toto: same for the need to skip frames - fCurrentVideoPlaybackEngine.GetFrame(Czas.Teraz); - fCurrentVideoPlaybackEngine.DrawGL(ScreenAct); + if assigned( fCurrentVideoPlaybackEngine ) then + begin + fCurrentVideoPlaybackEngine.GetFrame(Czas.Teraz); + fCurrentVideoPlaybackEngine.DrawGL(ScreenAct); + end; + +(* except on E : Exception do begin @@ -1170,6 +1175,8 @@ begin end; end; end; +*) + end; // draw static menu (FG) @@ -1332,6 +1339,12 @@ begin if Ini.EffectSing=1 then GoldenRec.SpawnPerfectLineTwinkle; //PerfectLineTwinkle Mod end + + + // if we are shoing a visualization... change to a new preset after each sentence.. + // Maybe we should make this less often or something... just a + if fShowVisualization then + fCurrentVideoPlaybackEngine.MoveTo( now ); // move to a random position end; //Called on Sentence Change S= New Current Sentence -- cgit v1.2.3 From 5404b0734c15320423bc4848fbc0880ed092e5e7 Mon Sep 17 00:00:00 2001 From: b1indy Date: Sat, 15 Dec 2007 17:12:20 +0000 Subject: again some progress with the lyrics... git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@703 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 31e9f511..d3019ac6 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -511,10 +511,10 @@ begin Lyrics.LineColor_dis.B := 0.4; Lyrics.LineColor_dis.A := 1; - Lyrics.LineColor_akt.R := 5/256; - Lyrics.LineColor_akt.G := 163/256; - Lyrics.LineColor_akt.B := 210/256; - Lyrics.LineColor_akt.A := 1; + Lyrics.LineColor_act.R := 5/256; + Lyrics.LineColor_act.G := 163/256; + Lyrics.LineColor_act.B := 210/256; + Lyrics.LineColor_act.A := 1; { LyricSub.FontStyle := 0; LyricMain.Size := 14; // 13 @@ -563,10 +563,10 @@ begin Lyrics.LineColor_dis.B := 0.8; Lyrics.LineColor_dis.A := 1; - Lyrics.LineColor_akt.R := 0.5; - Lyrics.LineColor_akt.G := 0.5; - Lyrics.LineColor_akt.B := 1; - Lyrics.LineColor_akt.A := 1; + Lyrics.LineColor_act.R := 0.5; + Lyrics.LineColor_act.G := 0.5; + Lyrics.LineColor_act.B := 1; + Lyrics.LineColor_act.A := 1; end; 2: begin @@ -584,10 +584,10 @@ begin Lyrics.LineColor_dis.B := 0.8; Lyrics.LineColor_dis.A := 1; - Lyrics.LineColor_akt.R := 0.5; - Lyrics.LineColor_akt.G := 0.5; - Lyrics.LineColor_akt.B := 1; - Lyrics.LineColor_akt.A := 1; + Lyrics.LineColor_act.R := 0.5; + Lyrics.LineColor_act.G := 0.5; + Lyrics.LineColor_act.B := 1; + Lyrics.LineColor_act.A := 1; { LyricSub.FontStyle := 3; LyricMain.Size := 12; LyricSub.Size := 12; -- cgit v1.2.3 From 9f4eaeef7d2100486af9ecbdd1e94e3bd10df3f8 Mon Sep 17 00:00:00 2001 From: b1indy Date: Sun, 16 Dec 2007 11:10:20 +0000 Subject: elimitated sentence change flicker bug git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@704 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index d3019ac6..309af301 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1353,7 +1353,18 @@ begin //GoldenStarsTwinkle Mod GoldenRec.SentenceChange; if (Lyrics.LineCounter <= High(Czesci[0].Czesc)) then + begin Lyrics.AddLine(@Czesci[0].Czesc[Lyrics.LineCounter]); + // addline uses display memory + // calling draw makes sure, there's the singscreen in it, when the next + // swap between onscreen and offscreen buffers is done + // (this eliminates the onSentenceChange flickering) + // note: maybe it would be better to make sure, a display redraw is done + // right after the sentence change (before buffer swap) or make sure + // onsentencechange is only called right before calling Display.Draw + // (or whatever it was called) + Draw; + end; //GoldenStarsTwinkle Mod End end; -- cgit v1.2.3 From bc01e7c70cf07c9758e09b07af5f788a45297eee Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 11 Jan 2008 12:41:51 +0000 Subject: Cleanup: Use the property Position in favor of MoveTo() (MoveTo() will be SetPosition() soon) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@784 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 309af301..5a9ecae7 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -171,7 +171,7 @@ begin SDLK_TAB: //Change Visualization Preset begin if fShowVisualization then - fCurrentVideoPlaybackEngine.MoveTo( now ); // move to a random position + fCurrentVideoPlaybackEngine.Position := now; // move to a random position end; SDLK_RETURN: @@ -213,7 +213,7 @@ begin Czas.Teraz := PauseTime; //Position of Notes // Position of Music - AudioPlayback.MoveTo (PauseTime); + AudioPlayback.Position := PauseTime; // Play Music AudioPlayback.Play; @@ -478,7 +478,7 @@ begin // play music (I) AudioInput.CaptureStart; - AudioPlayback.MoveTo(AktSong.Start); + AudioPlayback.Position := AktSong.Start; // Music.Play; // prepare timer (I) @@ -1344,7 +1344,7 @@ begin // if we are shoing a visualization... change to a new preset after each sentence.. // Maybe we should make this less often or something... just a if fShowVisualization then - fCurrentVideoPlaybackEngine.MoveTo( now ); // move to a random position + fCurrentVideoPlaybackEngine.Position := now; // move to a random position end; //Called on Sentence Change S= New Current Sentence -- cgit v1.2.3 From e74bd57c12f470257111c1c0530fb38f0fd34414 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Sat, 12 Jan 2008 12:31:43 +0000 Subject: bunch of smaller changes... some changes to song loading... Record global changed to singleton object started implementing mic volume display in Settings-Record hope this dosnt break anything.. :P git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@789 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 91 +++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 41 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 5a9ecae7..adfc4d2c 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -101,22 +101,29 @@ type fCurrentVideoPlaybackEngine : IVideoPlayback; constructor Create; override; - procedure onShow; override; - procedure onShowFinish; override; - function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; - function Draw: boolean; override; - procedure Finish; virtual; - procedure UpdateLCD; - procedure Pause; //Pause Mod(Toggles Pause) - - //OnSentenceEnd for LineBonus + Singbar - procedure onSentenceEnd(S: Cardinal); - //OnSentenceChange (for Golden Notes) - procedure onSentenceChange(S: Cardinal); + procedure onShow; override; + procedure onShowFinish; override; + + function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; + function Draw: boolean; override; + + procedure Finish; virtual; + procedure UpdateLCD; + procedure Pause; //Pause Mod(Toggles Pause) + + procedure onSentenceEnd(S: Cardinal); //OnSentenceEnd for LineBonus + Singbar + procedure onSentenceChange(S: Cardinal); //OnSentenceChange (for Golden Notes) end; implementation -uses UGraphic, UDraw, UMain, Classes, URecord, ULanguage, math; + +uses UGraphic, + UDraw, + UMain, + Classes, + URecord, + ULanguage, + math; // Method for input parsing. If False is returned, GetNextWindow // should be checked to know the next window to load; @@ -204,7 +211,7 @@ begin AudioPlayback.Pause; // pause Video - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then fCurrentVideoPlaybackEngine.Pause; end @@ -218,7 +225,7 @@ begin AudioPlayback.Play; // Video - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then fCurrentVideoPlaybackEngine.Pause; Paused := false; @@ -425,12 +432,13 @@ begin {Static[StaticP3RScoreBG].Visible := V3R; Text[TextP3RScore].Visible := V3R; } - // load notes ResetSingTemp; // Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); - AktSong := CatSongs.Song[CatSongs.Selected]; + CurrentSong := CatSongs.Song[CatSongs.Selected]; + try - if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then + if not CurrentSong.LoadSong then +// if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then begin //Error Loading Song -> Go back to Song Screen and Show some Error Message FadeTo(@ScreenSong); @@ -449,26 +457,26 @@ begin ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); Exit; end; - AktSong.Path := CatSongs.Song[CatSongs.Selected].Path; -// AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed + CurrentSong.Path := CatSongs.Song[CatSongs.Selected].Path; +// CurrentSong.GAP := CurrentSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / CurrentSong.BPM[0].BPM / 2; // temporary until UMain will be fixed // set movie - if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then + if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then begin // todo: VideoGap and Start time verwursten - fCurrentVideoPlaybackEngine.Open( AktSong.Path + AktSong.Video ); + fCurrentVideoPlaybackEngine.Open( CurrentSong.Path + CurrentSong.Video ); - fCurrentVideoPlaybackEngine.position := AktSong.VideoGAP + AktSong.Start; + fCurrentVideoPlaybackEngine.position := CurrentSong.VideoGAP + CurrentSong.Start; - AktSong.VideoLoaded := true; + CurrentSong.VideoLoaded := true; end; // set background - if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then + if (CurrentSong.Background <> '') and (CurrentSong.VideoLoaded = false) then try - Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background); + Tex_Background := Texture.LoadTexture(CurrentSong.Path + CurrentSong.Background); except - log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background); + log.LogError('Background could not be loaded: ' + CurrentSong.Path + CurrentSong.Background); Tex_Background.TexNum := -1; end else @@ -478,20 +486,20 @@ begin // play music (I) AudioInput.CaptureStart; - AudioPlayback.Position := AktSong.Start; + AudioPlayback.Position := CurrentSong.Start; // Music.Play; // prepare timer (I) // CountSkipTimeSet; - Czas.Teraz := AktSong.Start; + Czas.Teraz := CurrentSong.Start; Czas.Razem := AudioPlayback.Length; - if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000; + if (CurrentSong.Finish > 0) then Czas.Razem := CurrentSong.Finish / 1000; Czas.OldBeat := -1; for P := 0 to High(Player) do ClearScores(P); // main text - Lyrics.Clear (AktSong.BPM[0].BPM, AktSong.Resolution); + Lyrics.Clear (CurrentSong.BPM[0].BPM, CurrentSong.Resolution); // set custom options case Ini.LyricsFont of @@ -870,7 +878,7 @@ procedure TScreenSing.onShowFinish; begin // play movie (II) - if AktSong.VideoLoaded then + if CurrentSong.VideoLoaded then begin try writeln( 'VideoPlayback.FFmpegGetFrame' ); @@ -884,11 +892,11 @@ begin on E : Exception do begin //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video - AktSong.VideoLoaded := False; + CurrentSong.VideoLoaded := False; Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); Log.LogError('Error Message : '+ E.message ); Log.LogError(' In : '+ E.ClassName +' (TScreenSing.onShowFinish)' ); - Log.LogError('Corrupted File: ' + AktSong.Video); + Log.LogError('Corrupted File: ' + CurrentSong.Video); try // CloseSmpeg; fCurrentVideoPlaybackEngine.Close; @@ -1141,7 +1149,8 @@ begin SingDrawBackground; // update and draw movie - if ShowFinish and ( AktSong.VideoLoaded or fShowVisualization ) then + if ShowFinish and + ( CurrentSong.VideoLoaded or fShowVisualization ) then // if ShowFinish then begin // try @@ -1161,12 +1170,12 @@ begin begin //If an Error occurs drawing: prevent Video from being Drawn again and Close Video - AktSong.VideoLoaded := False; + CurrentSong.VideoLoaded := False; log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); Log.LogError('Error Message : '+ E.message ); Log.LogError(' In : '+ E.ClassName +' (TScreenSing.Draw)' ); - Log.LogError('Corrupted File: ' + AktSong.Video); + Log.LogError('Corrupted File: ' + CurrentSong.Video); try // CloseSmpeg; fCurrentVideoPlaybackEngine.Close; @@ -1183,9 +1192,9 @@ begin DrawFG; // check for music finish -// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish)); +// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(CurrentSong.Finish)); if ShowFinish then begin - if (not AudioPlayback.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin + if (not AudioPlayback.Finished) and ((CurrentSong.Finish = 0) or (Czas.Teraz*1000 <= CurrentSong.Finish)) then begin //Pause Mod: if not Paused then Sing(Self); // analyze song @@ -1251,11 +1260,11 @@ begin Log.LogBenchmark('Creating files', 0); end; - if AktSong.VideoLoaded then + if CurrentSong.VideoLoaded then begin // CloseSmpeg; fCurrentVideoPlaybackEngine.Close; - AktSong.VideoLoaded := false; // to prevent drawing closed video + CurrentSong.VideoLoaded := false; // to prevent drawing closed video end; SetFontItalic (False); -- cgit v1.2.3 From 1b458d8b1f4723ce82bb74f2157982980274e79c Mon Sep 17 00:00:00 2001 From: jaybinks Date: Mon, 14 Jan 2008 12:27:38 +0000 Subject: tidy up sing mode, to be an enum now. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@794 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index adfc4d2c..5216477d 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -120,6 +120,7 @@ implementation uses UGraphic, UDraw, UMain, + USong, Classes, URecord, ULanguage, @@ -443,7 +444,7 @@ begin //Error Loading Song -> Go back to Song Screen and Show some Error Message FadeTo(@ScreenSong); //Select New Song in Party Mode - if ScreenSong.Mode = 1 then + if ScreenSong.Mode = smPartyMode then ScreenSong.SelectRandomSong; ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); Exit; @@ -452,7 +453,7 @@ begin //Error Loading Song -> Go back to Song Screen and Show some Error Message FadeTo(@ScreenSong); //Select New Song in Party Mode - if ScreenSong.Mode = 1 then + if ScreenSong.Mode = smPartyMode then ScreenSong.SelectRandomSong; ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); Exit; -- cgit v1.2.3 From dee94f5dae9e6b5ae6c7b54a12a567745abc8dc3 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 5 Feb 2008 20:36:19 +0000 Subject: General: - cleanup and adaption of SingDrawOscilloscope Portaudio/SDL audio output: - stuttering in portaudio output has been fixed (SDL_MixBuffers cannot be used without initializing the SDL audio stuff first, so it is not usable with portaudio. Now SDL is used for audio-output instead of portaudio (although the file-name is UAudioPlayback_Portaudio.pas at the moment). - cleaner file closing - volume adjustment UMusic: - cleanup of the audio-interfaces - introduced TNoteType = (ntFreestyle, ntNormal, ntGolden) - some bug-fixes - introduced TSoundLibrary. This is library for all in-game sounds used by USDX. Instead of calling AudioPlayer.PlaySwoosh you should call AudioPlayer.PlaySound(SoundLib.Swoosh) now. You might call SoundLib.Swoosh.Play too, but this is not recommended at the moment because SoundLib.Swoosh could be nil if the file was not found. The SoundLibrary approach is much cleaner than the previous one. The AudioPlayer does not have to specify a Play... and Stop... method for every available sound anymore. In addition it is not an AudioPlayers responsibility to init the in-game sounds. URecord: - polish to english translation of some variables - CaptureSoundLeft/Right is CaptureChannel[0/1] now - TSoundCardInput -> TAudioInputDeviceSource - TGenericSoundCard.Input -> TGenericSoundCard.Source - autocorrelation algorithm more readable now - Clean-up of the audio-input interface - moved cloned code of the input-classes to one base class (TAudioInputBase) - Cleaner finalization - Start-/StopCapture will not crash anymore in the recording-options menu - Fixed several bugs in the autocorrelation stuff (e.g. wrong usage of $10000) - SzczytJest (now ToneValid) was not used correctly. ToneValid is set to true if a valid tone was found (= the sound was louder than the threshold -> no background noise). If i remember correctly the sound was accepted although the tone was invalid. So the old data was used although noone was singing. This resulted in some sort of ghost-singer effect. UIni: - moved TIni.Card to TScreenOptionsRecord.Card because it is not stored in the ini-file and will not be in the future. - TIni.CardList ist now TIni.InputDeviceConfig. The name cardlist was misleading because it just specifies input- but no output-devices. In addition a soundcard can have multiple input-devices (at least in linux). - bugfix on InputDeviceConfig (formerly CardList) usage. USDX expected that the indices of the corresponding elements in TIni.InputDeviceConfig[] and TAudioInputProcessor.Device[] were the same. This is wrong. If device 2 was defined at first place in the ini and device 1 at the second, the indices of the two arrays didn't match (they were swapped) erroneously. To fix this and to support the item listed below the index to TIni.InputDeviceConfig[] is now stored in TAudioInputDevice.CfgIndex. NOTE: InputDeviceConfig[] contains configurations of non-available (unplugged) devices. Iterate over TAudioInputProcessor.Device[] for available devices. - configurations of external devices that are not plugged in will not be deleted anymore. - multiple definitions of one device in the ini-file will not crash USDX anymore - CardList[I].ChannelL/R now are InputDeviceConfig[I].ChannelToPlayerMap[0/1]. I think the new name is more intuitive because it maps a channel to a player number. Now the both vars are joint to one array. Now it is possible to use loops to process them and we might support more than two input channels on one device in the future (if such devices exist) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@827 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 5216477d..6a5b4e90 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -153,7 +153,7 @@ begin //Sound[0].BufferLong Finish; - AudioPlayback.PlayBack; + AudioPlayback.PlaySound(SoundLib.Back); FadeTo(@ScreenScore); end; -- cgit v1.2.3 From d22d5070d1b847611786ca483055ea7348cda132 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 5 Feb 2008 21:33:30 +0000 Subject: cleanup git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@828 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 6a5b4e90..2342d371 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -325,6 +325,8 @@ var NR: TRecR; //Line Bonus Mod Color: TRGB; + + success: boolean; begin Log.LogStatus('Begin', 'onShow'); FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented @@ -433,34 +435,30 @@ begin {Static[StaticP3RScoreBG].Visible := V3R; Text[TextP3RScore].Visible := V3R; } + // FIXME: sets Path and Filename to '' ResetSingTemp; -// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); + CurrentSong := CatSongs.Song[CatSongs.Selected]; + // FIXME: bad style, put the try-except into LoadSong() and not here try - if not CurrentSong.LoadSong then -// if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then - begin - //Error Loading Song -> Go back to Song Screen and Show some Error Message - FadeTo(@ScreenSong); - //Select New Song in Party Mode - if ScreenSong.Mode = smPartyMode then - ScreenSong.SelectRandomSong; - ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); - Exit; - end; + success := CurrentSong.LoadSong(); except + success := false; + end; + if (not success) then + begin //Error Loading Song -> Go back to Song Screen and Show some Error Message FadeTo(@ScreenSong); //Select New Song in Party Mode if ScreenSong.Mode = smPartyMode then - ScreenSong.SelectRandomSong; + ScreenSong.SelectRandomSong(); ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + // FIXME: do we need this? + CurrentSong.Path := CatSongs.Song[CatSongs.Selected].Path; Exit; end; - CurrentSong.Path := CatSongs.Song[CatSongs.Selected].Path; -// CurrentSong.GAP := CurrentSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / CurrentSong.BPM[0].BPM / 2; // temporary until UMain will be fixed - + // set movie if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then begin -- cgit v1.2.3