From 041ee1b932cc9c058c545595751b77893dde75dc Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Mon, 21 Jun 2010 16:33:16 +0000 Subject: - individual line breaks for each player in duet songs are now possible - fade in and out of lyrics, notes and notelines in sing screen - update of acinerella.dll - update of BASS to v2.4 - removed joypad support (did it ever worked?) - removed unused units and options git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2553 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/TextGL.pas | 12 +- Game/Code/Classes/UCommandLine.pas | 4 - Game/Code/Classes/UDraw.pas | 392 ++++++++++++++++++---------------- Game/Code/Classes/UFiles.pas | 120 ++++------- Game/Code/Classes/UGraphicClasses.pas | 66 +++--- Game/Code/Classes/UIni.pas | 24 --- Game/Code/Classes/UJoystick.pas | 273 ----------------------- Game/Code/Classes/ULCD.pas | 289 ------------------------- Game/Code/Classes/ULight.pas | 116 ---------- Game/Code/Classes/ULyrics.pas | 39 +++- Game/Code/Classes/UMain.pas | 27 +-- Game/Code/Classes/UMusic.pas | 32 +-- Game/Code/Classes/URecord.pas | 27 ++- Game/Code/Classes/UThemes.pas | 4 +- Game/Code/Classes/UVideo.pas | 83 ++++--- 15 files changed, 417 insertions(+), 1091 deletions(-) delete mode 100644 Game/Code/Classes/UJoystick.pas delete mode 100644 Game/Code/Classes/ULCD.pas delete mode 100644 Game/Code/Classes/ULight.pas (limited to 'Game/Code/Classes') diff --git a/Game/Code/Classes/TextGL.pas b/Game/Code/Classes/TextGL.pas index 10043e3b..ee8187ad 100644 --- a/Game/Code/Classes/TextGL.pas +++ b/Game/Code/Classes/TextGL.pas @@ -7,11 +7,11 @@ uses gl, SDL, UTexture, Classes, ULog; procedure BuildFont; // Build Our Bitmap Font procedure KillFont; // Delete The Font function glTextWidth(text: pchar): real; // Returns Text Width -procedure glPrintDone(text: pchar; Done: real; ColR, ColG, ColB: real); +procedure glPrintDone(text: pchar; Done: real; ColR, ColG, ColB, Alpha: real); procedure glPrintLetter(letter: char); procedure glPrintLetterCut(letter: char; Start, Finish: real); procedure glPrint(text: pchar); // Custom GL "Print" Routine -procedure glPrintCut(text: pchar); +procedure glPrintCut(text: pchar; Alpha: real); procedure SetFontPos(X, Y: real); // Sets X And Y procedure SetFontSize(Size: real); procedure SetFontStyle(Style: integer); // sets active font style (normal, bold, etc) @@ -143,13 +143,13 @@ begin end; // while end; -procedure glPrintDone(text: pchar; Done: real; ColR, ColG, ColB: real); +procedure glPrintDone(text: pchar; Done: real; ColR, ColG, ColB, Alpha: real); begin Fonts[ActFont].Done := Done; PColR := ColR; PColG := ColG; PColB := ColB; - glPrintCut(text); + glPrintCut(text, Alpha); Fonts[ActFont].Done := -1; end; @@ -272,7 +272,7 @@ begin end; // while end; -procedure glPrintCut(text: pchar); +procedure glPrintCut(text: pchar; Alpha: real); var Letter: char; PToDo: real; @@ -301,7 +301,7 @@ begin if (PToDo > 0) and (PDoingNow > PToDo) then begin glPrintLetterCut(Letter, 0, PToDo / PDoingNow); - glColor3f(PColR, PColG, PColB); + glColor4f(PColR, PColG, PColB, Alpha); glPrintLetterCut(Letter, PToDo / PDoingNow, 1); end; diff --git a/Game/Code/Classes/UCommandLine.pas b/Game/Code/Classes/UCommandLine.pas index 03229721..05f638a9 100644 --- a/Game/Code/Classes/UCommandLine.pas +++ b/Game/Code/Classes/UCommandLine.pas @@ -16,7 +16,6 @@ type Benchmark: Boolean; NoLog: Boolean; FullScreen: Boolean; - Joypad: Boolean; //Some Value Variables Set when Reading Infos {-1: Not Set, others: Value} Depth: Integer; @@ -65,7 +64,6 @@ begin Benchmark := False; NoLog := False; FullScreen := False; - Joypad := False; //Some Value Variables Set when Reading Infos {-1: Not Set, others: Value} sResolution := ''; @@ -114,8 +112,6 @@ begin NoLog := True else if (Command = 'fullscreen') then Fullscreen := True - else if (Command = 'joypad') then - Joypad := True //Integer Variables else if (Command = 'depth') then diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index 94142bc7..fd9219ce 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -18,19 +18,19 @@ type Mid: real; end; -procedure SingDraw; +procedure SingDraw(Alpha: TAlpha); procedure SingDrawLyricHelper(CP: integer; NR: TRecR); -procedure SingDrawNotes(NR: TRecR); -procedure SingDrawNotesDuet(NR: TRecR); -procedure SingModiDraw (PlayerInfo: TPlayerInfo); +procedure SingDrawNotes(NR: TRecR; Alpha: TAlpha); +procedure SingDrawNotesDuet(NR: TRecR; Alpha: TAlpha); +procedure SingModiDraw(PlayerInfo: TPlayerInfo; Alpha: TAlpha); procedure SingDrawBackground; procedure SingDrawOscilloscope(X, Y, W, H: real; NrSound: integer); -procedure SingDrawNoteLines(Left, Top, Right: real; Space: integer); +procedure SingDrawNoteLines(Left, Top, Right: real; Space: integer; Alpha: real); procedure SingDrawBeatDelimeters(Left, Top, Right: real; NrCzesci: integer); -procedure SingDrawCzesc(Left, Top, Right: real; NrCzesci: integer; Space: integer); -procedure SingDrawPlayerCzesc(X, Y, W: real; CP, NrGracza: integer; Space: integer); -procedure SingDrawPlayerBGCzesc(Left, Top, Right: real; NrCzesci, NrGracza: integer; Space: integer); +procedure SingDrawCzesc(Left, Top, Right: real; NrCzesci: integer; Space: integer; Alpha: real); +procedure SingDrawPlayerCzesc(X, Y, W: real; CP, NrGracza: integer; Space: integer; Alpha: real); +procedure SingDrawPlayerBGCzesc(Left, Top, Right: real; NrCzesci, NrGracza: integer; Space: integer; Alpha: real); // TimeBar mod procedure SingDrawTimeBar(); @@ -189,12 +189,12 @@ begin; glEnd; end; -procedure SingDrawNoteLines(Left, Top, Right: real; Space: integer); +procedure SingDrawNoteLines(Left, Top, Right: real; Space: integer; Alpha: real); var Pet: integer; begin glEnable(GL_BLEND); - glColor4f(Skin_P1_LinesR, Skin_P1_LinesG, Skin_P1_LinesB, 0.4); + glColor4f(Skin_P1_LinesR, Skin_P1_LinesG, Skin_P1_LinesB, 0.4*Alpha); glBegin(GL_LINES); for Pet := 0 to 9 do begin glVertex2f(Left, Top + Pet * Space); @@ -213,16 +213,16 @@ var st: integer; begin CP := NrCzesci; - if (Length(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta)=0) then + {if (Length(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta)=0) then begin CP := (CP+1) mod 2; st := Czesci[CP].Czesc[Czesci[CP].Akt].StartNote; end_ := Czesci[CP].Czesc[Czesci[CP].Akt].Koniec; end else - begin + begin } st := Czesci[CP].Czesc[Czesci[CP].Akt].StartNote; end_ := Czesci[CP].Czesc[Czesci[CP].Akt].Koniec; - if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then + {if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then begin if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec > end_) then end_ := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec; @@ -230,7 +230,7 @@ begin if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote < st) then st := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote; end; - end; + end; } TempR := (Right-Left) / (end_ - st); @@ -250,7 +250,7 @@ begin end; // draw blank Notebars -procedure SingDrawCzesc(Left, Top, Right: real; NrCzesci: integer; Space: integer); +procedure SingDrawCzesc(Left, Top, Right: real; NrCzesci: integer; Space: integer; Alpha: real); var Rec: TRecR; Pet: integer; @@ -268,17 +268,17 @@ begin begin st := Czesci[CP].Czesc[Czesci[CP].Akt].StartNote; end_ := Czesci[CP].Czesc[Czesci[CP].Akt].Koniec; - if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then + {if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then begin if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec > end_) then end_ := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec; if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote < st) then st := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote; - end; + end;} end; - glColor3f(1, 1, 1); + glColor4f(1, 1, 1, Alpha); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -296,12 +296,12 @@ begin // If Golden note Effect of then Change not Color begin case Wartosc of - 1: glColor4f(1, 1, 1, 0.85); - 2: glColor4f(1, 1, 0.3, 0.85); // no stars, paint yellow -> glColor4f(1, 1, 0.3, 0.85); + 1: glColor4f(1, 1, 1, 0.85*Alpha); + 2: glColor4f(1, 1, 0.3, 0.85*Alpha); // no stars, paint yellow -> glColor4f(1, 1, 0.3, 0.85); end; // case end //Else all Notes same Color else - glColor4f(1, 1, 1, 0.85); + glColor4f(1, 1, 1, 0.85*Alpha); // lewa czesc - left part Rec.Left := (Start-st) * TempR + Left + 0.5 + 10*ScreenX; @@ -347,7 +347,7 @@ begin // Golden Star Patch if (Wartosc = 2) AND (Ini.EffectSing=1) then begin - GoldenRec.SaveGoldenStarsRec(GoldenStarPos, Rec.Top, Rec.Right, Rec.Bottom); + GoldenRec.SaveGoldenStarsRec(GoldenStarPos, Rec.Top, Rec.Right, Rec.Bottom, NrCzesci); end; end; // if not FreeStyle @@ -361,7 +361,7 @@ end; // draw sung notes -procedure SingDrawPlayerCzesc(X, Y, W: real; CP, NrGracza: integer; Space: integer); +procedure SingDrawPlayerCzesc(X, Y, W: real; CP, NrGracza: integer; Space: integer; Alpha: real); var TempR: real; Rec: TRecR; @@ -376,17 +376,17 @@ begin begin st := Czesci[CP].Czesc[Czesci[CP].Akt].StartNote; end_ := Czesci[CP].Czesc[Czesci[CP].Akt].Koniec; - if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then + {if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then begin if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec > end_) then end_ := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec; if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote < st) then st := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote; - end; + end; } end; - glColor3f(1, 1, 1); + glColor4f(1, 1, 1, Alpha); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -411,7 +411,7 @@ begin end; //if // if True then - Rec.Top := Y - (Ton-Czesci[CP].Czesc[Czesci[0].Akt].BaseNote)*Space/2 - NotesH2; + Rec.Top := Y - (Ton-Czesci[CP].Czesc[Czesci[CP].Akt].BaseNote)*Space/2 - NotesH2; Rec.Bottom := Rec.Top + 2 *NotesH2; glColor3f(1, 1, 1); @@ -485,7 +485,7 @@ begin end; //draw Note glow -procedure SingDrawPlayerBGCzesc(Left, Top, Right: real; NrCzesci, NrGracza: integer; Space: integer); +procedure SingDrawPlayerBGCzesc(Left, Top, Right: real; NrCzesci, NrGracza: integer; Space: integer; Alpha: real); var Rec: TRecR; Pet: integer; @@ -508,17 +508,17 @@ begin begin st := Czesci[CP].Czesc[Czesci[CP].Akt].StartNote; end_ := Czesci[CP].Czesc[Czesci[CP].Akt].Koniec; - if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then + {if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then begin if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec > end_) then end_ := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec; if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote < st) then st := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote; - end; + end;} end; - glColor4f(1, 1, 1, sqrt((1+sin(Music.Position * 3))/4)/ 2 + 0.5 ); + glColor4f(1, 1, 1, (sqrt((1+sin(Music.Position * 3))/4)/ 2 + 0.5)*Alpha); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -605,7 +605,7 @@ begin if BarFrom > 40 then BarFrom := 40; - if (Czesci[CP].Czesc[Czesci[CP].Akt].StartNote - Czesci[CP].Czesc[Czesci[CP].Akt].Start > 8) and //16->12 for more help bars and then 12->8 for even more + if (BarFrom > 8) and //16->12 for more help bars and then 12->8 for even more (Czesci[CP].Czesc[Czesci[CP].Akt].StartNote - Czas.MidBeat > 0) and (Czesci[CP].Czesc[Czesci[CP].Akt].StartNote - Czas.MidBeat < 40) then begin // ale nie za wczesnie @@ -636,7 +636,7 @@ begin end; end; -procedure SingDraw(); +procedure SingDraw(Alpha: TAlpha); var Pet: integer; Pet2: integer; @@ -644,6 +644,7 @@ var Rec: TRecR; TexRec: TRecR; NR: TRecR; + ab: real; //FS: real; BarAlpha: real; @@ -681,19 +682,24 @@ begin // rysuje paski pod nutami if PlayersPlay = 1 then - SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P2_NotesB - 105, Nr.Right + 10*ScreenX, 15); - if (PlayersPlay = 2) or (PlayersPlay = 4) then begin - SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P1_NotesB - 105, Nr.Right + 10*ScreenX, 15); - SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P2_NotesB - 105, Nr.Right + 10*ScreenX, 15); + SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P2_NotesB - 105, Nr.Right + 10*ScreenX, 15, Alpha[0]); + if (PlayersPlay = 2) or (PlayersPlay = 4) then + begin + SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P1_NotesB - 105, Nr.Right + 10*ScreenX, 15, Alpha[0]); + SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P2_NotesB - 105, Nr.Right + 10*ScreenX, 15, Alpha[1]); end; - if (PlayersPlay = 3) or (PlayersPlay = 6) then 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); + if (PlayersPlay = 3) or (PlayersPlay = 6) then + begin + SingDrawNoteLines(Nr.Left + 10*ScreenX, 120, Nr.Right + 10*ScreenX, 12, Alpha[0]); + SingDrawNoteLines(Nr.Left + 10*ScreenX, 245, Nr.Right + 10*ScreenX, 12, Alpha[1]); + SingDrawNoteLines(Nr.Left + 10*ScreenX, 370, Nr.Right + 10*ScreenX, 12, Alpha[0]); end; // rysuje tekst - new Lyric engine + ScreenSing.LyricMain[0].SetAlpha(Alpha[0]); + ScreenSing.LyricSub[0].SetAlpha(Alpha[2]); + ScreenSing.LyricMain[0].Draw; ScreenSing.LyricSub[0].Draw; @@ -701,6 +707,9 @@ begin if (AktSong.isDuet) then begin + ScreenSing.LyricMain[1].SetAlpha(Alpha[1]); + ScreenSing.LyricSub[1].SetAlpha(Alpha[3]); + ScreenSing.LyricMain[1].Draw; ScreenSing.LyricSub[1].Draw; SingDrawLyricHelper(1, NR); @@ -919,33 +928,33 @@ begin end; if AktSong.isDuet then - SingDrawNotesDuet(NR) + SingDrawNotesDuet(NR, Alpha) else - SingDrawNotes(NR); + SingDrawNotes(NR, Alpha); glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); end; -procedure SingDrawNotes(NR: TRecR); +procedure SingDrawNotes(NR: TRecR; Alpha: TAlpha); begin if PlayersPlay = 1 then begin - SingDrawPlayerBGCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 0, 15); - SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 0, 15); + SingDrawPlayerBGCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 0, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 0, 15, Alpha[0]); end; if (PlayersPlay = 2) then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15); - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 1, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 1, 15, Alpha[0]); - SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15); - SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15); + SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15, Alpha[0]); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 1, 15); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 1, 15, Alpha[0]); end; if PlayersPlay = 3 then @@ -953,40 +962,40 @@ begin NotesW := NotesW * 0.8; NotesH := NotesH * 0.8; - SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 1, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 1, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12, Alpha[0]); - SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12); - SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 0, 12); - SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12); + SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12, Alpha[0]); - SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 1, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12); + SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 1, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12, Alpha[0]); end; if PlayersPlay = 4 then begin if ScreenAct = 1 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15); - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 1, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 1, 15, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 2, 15); - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 3, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 2, 15, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 3, 15, Alpha[0]); end; - SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15); - SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15); + SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15, Alpha[0]); if ScreenAct = 1 then begin - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 1, 15); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 1, 15, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 2, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 3, 15); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 2, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 3, 15, Alpha[0]); end; end; @@ -995,52 +1004,52 @@ begin NotesH := NotesH * 0.8; if ScreenAct = 1 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 1, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 1, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 3, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 4, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 5, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 3, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 4, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 5, 12, Alpha[0]); end; - SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12); - SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 0, 12); - SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12); + SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12, Alpha[0]); if ScreenAct = 1 then begin - SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 1, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12); + SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 1, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 3, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 4, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 5, 12); + SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 3, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 4, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 5, 12, Alpha[0]); end; end; end; -procedure SingDrawNotesDuet(NR: TRecR); +procedure SingDrawNotesDuet(NR: TRecR; Alpha: TAlpha); begin if PlayersPlay = 1 then begin - SingDrawPlayerBGCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 0, 15); - SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 0, 15); + SingDrawPlayerBGCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 0, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 0, 15, Alpha[0]); end; if (PlayersPlay = 2) then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15); - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 1, 1, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 1, 1, 15, Alpha[1]); - SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15); - SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 1, 15); + SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 1, 15, Alpha[1]); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 1, 1, 15); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 1, 1, 15, Alpha[1]); end; if PlayersPlay = 3 then @@ -1048,40 +1057,40 @@ begin NotesW := NotesW * 0.8; NotesH := NotesH * 0.8; - SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 1, 1, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 1, 1, 12, Alpha[1]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12, Alpha[0]); - SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12); - SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 1, 12); - SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12); + SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 1, 12, Alpha[1]); + SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12, Alpha[0]); - SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 1, 1, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12); + SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 1, 1, 12, Alpha[1]); + SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12, Alpha[0]); end; if PlayersPlay = 4 then begin if ScreenAct = 1 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15); - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 1, 1, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 1, 1, 15, Alpha[1]); end; if ScreenAct = 2 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 2, 15); - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 1, 3, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 2, 15, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 1, 3, 15, Alpha[1]); end; - SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15); - SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 1, 15); + SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 1, 15, Alpha[1]); if ScreenAct = 1 then begin - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 1, 1, 15); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 1, 1, 15, Alpha[1]); end; if ScreenAct = 2 then begin - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 2, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 1, 3, 15); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 2, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 1, 3, 15, Alpha[1]); end; end; @@ -1090,34 +1099,34 @@ begin NotesH := NotesH * 0.8; if ScreenAct = 1 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 1, 1, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 1, 1, 12, Alpha[1]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 3, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 1, 4, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 5, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 3, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 1, 4, 12, Alpha[1]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 5, 12, Alpha[0]); end; - SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12); - SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 1, 12); - SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12); + SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 1, 12, Alpha[1]); + SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12, Alpha[0]); if ScreenAct = 1 then begin - SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 1, 1, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12); + SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 1, 1, 12, Alpha[1]); + SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 3, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 1, 4, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 5, 12); + SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 3, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 1, 4, 12, Alpha[1]); + SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 5, 12, Alpha[0]); end; end; end; -procedure SingModiDraw (PlayerInfo: TPlayerInfo); +procedure SingModiDraw (PlayerInfo: TPlayerInfo; Alpha: TAlpha); var Pet: integer; Pet2: integer; @@ -1125,6 +1134,8 @@ var Rec: TRecR; TexRec: TRecR; NR: TRecR; + ab: real; + //FS: real; BarFrom: integer; BarAlpha: real; @@ -1146,9 +1157,11 @@ var begin // positions - if Ini.SingWindow = 0 then begin + if Ini.SingWindow = 0 then + begin NR.Left := 120; - end else begin + end else + begin NR.Left := 20; end; NR.Right := 780; @@ -1168,20 +1181,25 @@ begin begin // rysuje paski pod nutami if PlayersPlay = 1 then - SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P2_NotesB - 105, Nr.Right + 10*ScreenX, 15); - if (PlayersPlay = 2) or (PlayersPlay = 4) then begin - SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P1_NotesB - 105, Nr.Right + 10*ScreenX, 15); - SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P2_NotesB - 105, Nr.Right + 10*ScreenX, 15); + SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P2_NotesB - 105, Nr.Right + 10*ScreenX, 15, Alpha[0]); + if (PlayersPlay = 2) or (PlayersPlay = 4) then + begin + SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P1_NotesB - 105, Nr.Right + 10*ScreenX, 15, Alpha[1]); + SingDrawNoteLines(Nr.Left + 10*ScreenX, Skin_P2_NotesB - 105, Nr.Right + 10*ScreenX, 15, Alpha[0]); end; - if (PlayersPlay = 3) or (PlayersPlay = 6) then 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); + if (PlayersPlay = 3) or (PlayersPlay = 6) then + begin + SingDrawNoteLines(Nr.Left + 10*ScreenX, 120, Nr.Right + 10*ScreenX, 12, Alpha[0]); + SingDrawNoteLines(Nr.Left + 10*ScreenX, 245, Nr.Right + 10*ScreenX, 12, Alpha[1]); + SingDrawNoteLines(Nr.Left + 10*ScreenX, 370, Nr.Right + 10*ScreenX, 12, Alpha[0]); end; end; // rysuje tekst - new Lyric engine + ScreenSingModi.LyricMain[0].SetAlpha(Alpha[0]); + ScreenSingModi.LyricSub[0].SetAlpha(Alpha[2]); + ScreenSingModi.LyricMain[0].Draw; ScreenSingModi.LyricSub[0].Draw; @@ -1472,23 +1490,23 @@ begin if (DLLMAn.Selected.ShowNotes And DLLMan.Selected.LoadSong) then begin if (PlayersPlay = 1) And PlayerInfo.Playerinfo[0].Enabled then begin - SingDrawPlayerBGCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 0, 15); - SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 0, 15); + SingDrawPlayerBGCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 0, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 0, 15, Alpha[0]); end; if (PlayersPlay = 2) then begin if PlayerInfo.Playerinfo[0].Enabled then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15); - SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15, Alpha[0]); end; if PlayerInfo.Playerinfo[1].Enabled then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 1, 15); - SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 1, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 1, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 1, 15, Alpha[0]); end; end; @@ -1499,46 +1517,46 @@ begin if PlayerInfo.Playerinfo[0].Enabled then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12); - SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12, Alpha[0]); end; if PlayerInfo.Playerinfo[1].Enabled then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 1, 12); - SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 0, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 1, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 1, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 1, 12, Alpha[0]); end; if PlayerInfo.Playerinfo[2].Enabled then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12); - SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12, Alpha[0]); end; end; if PlayersPlay = 4 then begin if ScreenAct = 1 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15); - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 1, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 0, 15, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 1, 15, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 2, 15); - SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 3, 15); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Right - 20, 0, 2, 15, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Right - 20, 0, 3, 15, Alpha[0]); end; - SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15); - SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15); + SingDrawCzesc(NR.Left + 20, Skin_P1_NotesB, NR.Right - 20, 0, 15, Alpha[0]); + SingDrawCzesc(NR.Left + 20, Skin_P2_NotesB, NR.Right - 20, 0, 15, Alpha[0]); if ScreenAct = 1 then begin - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 1, 15); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 0, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 1, 15, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 2, 15); - SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 3, 15); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P1_NotesB, Nr.Width - 40, 0, 2, 15, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, Skin_P2_NotesB, Nr.Width - 40, 0, 3, 15, Alpha[0]); end; end; @@ -1547,29 +1565,29 @@ begin NotesH := NotesH * 0.8; if ScreenAct = 1 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 1, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 0, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 1, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 2, 12, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 3, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 4, 12); - SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 5, 12); + SingDrawPlayerBGCzesc(Nr.Left + 20, 120+95, Nr.Right - 20, 0, 3, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 245+95, Nr.Right - 20, 0, 4, 12, Alpha[0]); + SingDrawPlayerBGCzesc(Nr.Left + 20, 370+95, Nr.Right - 20, 0, 5, 12, Alpha[0]); end; - SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12); - SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 0, 12); - SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12); + SingDrawCzesc(NR.Left + 20, 120+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 245+95, NR.Right - 20, 0, 12, Alpha[0]); + SingDrawCzesc(NR.Left + 20, 370+95, NR.Right - 20, 0, 12, Alpha[0]); if ScreenAct = 1 then begin - SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 1, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12); + SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 0, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 1, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 2, 12, Alpha[0]); end; if ScreenAct = 2 then begin - SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 3, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 4, 12); - SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 5, 12); + SingDrawPlayerCzesc(Nr.Left + 20, 120+95, Nr.Width - 40, 0, 3, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 245+95, Nr.Width - 40, 0, 4, 12, Alpha[0]); + SingDrawPlayerCzesc(Nr.Left + 20, 370+95, Nr.Width - 40, 0, 5, 12, Alpha[0]); end; end; end; @@ -1737,14 +1755,14 @@ begin begin st := Czesci[CP].Czesc[Czesci[CP].Akt].StartNote; end_ := Czesci[CP].Czesc[Czesci[CP].Akt].Koniec; - if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then + {if AktSong.isDuet and (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Nuta)>0)then begin if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec > end_) then end_ := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].Koniec; if (Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote < st) then st := Czesci[(CP+1) mod 2].Czesc[Czesci[CP].Akt].StartNote; - end; + end;} end; glColor3f(1, 1, 1); diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas index acab9abd..1787b740 100644 --- a/Game/Code/Classes/UFiles.pas +++ b/Game/Code/Classes/UFiles.pas @@ -563,7 +563,8 @@ begin Muzyka.IlNut := Muzyka.IlNut + 1; Nuta[HighNut].Start := StartP; - if IlNut = 1 then begin + if IlNut = 1 then + begin StartNote := Nuta[HighNut].Start; if Czesci[NrCzesci].Ilosc = 1 then Start := -100; @@ -623,6 +624,7 @@ begin Czesci[NrCzesciP].High := Czesci[NrCzesciP].High + 1; Czesci[NrCzesciP].Ilosc := Czesci[NrCzesciP].Ilosc + 1; Czesci[NrCzesciP].Czesc[Czesci[NrCzesciP].High].HighNut := -1; + Czesci[NrCzesciP].Czesc[Czesci[NrCzesciP].High].IlNut := 0; if not AktSong.Relative then Czesci[NrCzesciP].Czesc[Czesci[NrCzesciP].High].Start := Param1; @@ -662,7 +664,15 @@ begin bt := low(integer); numLines := Length(Czesci[p].Czesc); - if(numLines=0) and not AktSong.isDuet then + if (numLines>0) and (Length(Czesci[p].Czesc[numLines-1].Nuta)=0) then + begin + Dec(numLines); + SetLength(Czesci[p].Czesc, numLines); + Dec(Czesci[p].High); + Dec(Czesci[p].Ilosc); + end; + + if(numLines=0) then begin Log.LogError('Song ' + AktSong.Path + AktSong.Filename + ' has no lines?'); if (Ini.LoadFaultySongs=0) then @@ -673,7 +683,7 @@ begin begin numNotes := Length(Czesci[p].Czesc[line].Nuta); - if(numNotes=0) and not AktSong.isDuet then + if(numNotes=0) then begin Log.LogError('Sentence ' + IntToStr(line+1) + ' in song ' + AktSong.Path + AktSong.Filename + ' has no notes?'); if (Ini.LoadFaultySongs=0) then @@ -769,7 +779,7 @@ var Param2: integer; Param3: integer; ParamS: string; - I: Integer; + I: integer; isNewSentence: boolean; begin Result := false; @@ -845,6 +855,7 @@ begin begin AktSong.isDuet := true; SetLength(Czesci, 2); + CP := -1; end else SetLength(Czesci, 1); @@ -900,7 +911,8 @@ begin isNewSentence := false; end; - if TempC = '-' then begin + if TempC = '-' then + begin if isNewSentence then begin Log.LogError('Double sentence break in file: "' + Name + '"; Line '+IntToStr(FileLineNo)+' (LoadSong)'); @@ -917,9 +929,17 @@ begin NewSentence(CP, (Param1 + Rel[CP]) * Mult, Param2, LoadFullFile) else begin - // both singer - NewSentence(0, (Param1 + Rel[0]) * Mult, Param2, LoadFullFile); - NewSentence(1, (Param1 + Rel[1]) * Mult, Param2, LoadFullFile); + for I := 0 to 1 do + begin + if (Czesci[I].Czesc[Czesci[I].High].IlNut > 0) then + begin + with Czesci[I].Czesc[Czesci[I].High] do + begin + if (Nuta[HighNut].Start + Nuta[HighNut].Dlugosc <= (Param1 + Rel[I]) * Mult) then + NewSentence(I, (Param1 + Rel[I]) * Mult, Param2, LoadFullFile); + end; + end; + end; end; isNewSentence := true; end; // if @@ -935,7 +955,8 @@ begin end; - if not AktSong.isDuet then begin + if not AktSong.isDuet then + begin Czesci[CP].Czesc[Czesci[CP].High].BaseNote := Base[CP]; if LoadFullFile then Czesci[CP].Czesc[Czesci[CP].High].LyricWidth := glTextWidth(PChar(Czesci[CP].Czesc[Czesci[CP].High].Lyric)); @@ -948,7 +969,8 @@ begin //Total Notes Patch End end else begin - for Pet := 0 to High(Czesci) do begin + for Pet := 0 to High(Czesci) do + begin Czesci[Pet].Czesc[Czesci[Pet].High].BaseNote := Base[Pet]; if LoadFullFile then Czesci[Pet].Czesc[Czesci[Pet].High].LyricWidth := glTextWidth(PChar(Czesci[Pet].Czesc[Czesci[Pet].High].Lyric)); @@ -1113,81 +1135,27 @@ begin // write custom header tags (from 1.1) WriteCustomTags; - if not Song.isDuet then + for P := 0 to Length(Czesci) - 1 do begin - for C := 0 to Czesc[0].High do + if AktSong.isDuet then begin - WriteLine(0, C); + S := 'P' + IntToStr(P+1); + WriteLn(SongFile, S); + end; - if C < Czesc[0].High then - begin // don't write end of last sentence - if not Relative then - S := '- ' + IntToStr(Czesc[0].Czesc[C+1].Start) - else - begin - S := '- ' + IntToStr(Czesc[0].Czesc[C+1].Start - RelativeSubTime) + - ' ' + IntToStr(Czesc[0].Czesc[C+1].Start - RelativeSubTime); - RelativeSubTime := Czesc[0].Czesc[C+1].Start; - end; - WriteLn(SongFile, S); - end; - end; // C - end else - begin - P := -1; - for C := 0 to Czesc[0].High do //go through all lines + for C := 0 to Czesc[P].High do begin - if isIdenticalLine(C) then - begin - //not end? - if (C < Czesc[0].High) and (P <> 3) then - begin - //P1+P2 ==> P3 - S := 'P3'; - P := 3; - WriteLn(SongFile, S); - end; - WriteLine(0, C); - end else - begin - //singer 1 P1 - if (Length(Czesc[0].Czesc[C].Nuta)>0) then - begin - if (C < Czesc[0].High) and (P <> 1) then - begin - S := 'P1'; - P := 1; - WriteLn(SongFile, S); - end; - WriteLine(0, C); - end; - - //singer 2 P2 - if (Length(Czesc[1].Czesc[C].Nuta)>0) then - begin - if (C < Czesc[0].High) and (P <> 2) then - begin - S := 'P2'; - P := 2; - WriteLn(SongFile, S); - end; - WriteLine(1, C); - end; - end; - - CP := P-1; - if CP=2 then - CP := 0; + WriteLine(P, C); - if C < Czesc[CP].High then + if C < Czesc[P].High then begin // don't write end of last sentence if not Relative then - S := '- ' + IntToStr(Czesc[CP].Czesc[C+1].Start) + S := '- ' + IntToStr(Czesc[P].Czesc[C+1].Start) else begin - S := '- ' + IntToStr(Czesc[CP].Czesc[C+1].Start - RelativeSubTime) + - ' ' + IntToStr(Czesc[CP].Czesc[C+1].Start - RelativeSubTime); - RelativeSubTime := Czesc[CP].Czesc[C+1].Start; + S := '- ' + IntToStr(Czesc[P].Czesc[C+1].Start - RelativeSubTime) + + ' ' + IntToStr(Czesc[P].Czesc[C+1].Start - RelativeSubTime); + RelativeSubTime := Czesc[P].Czesc[C+1].Start; end; WriteLn(SongFile, S); end; diff --git a/Game/Code/Classes/UGraphicClasses.pas b/Game/Code/Classes/UGraphicClasses.pas index 6d1cd36e..260d7c5e 100644 --- a/Game/Code/Classes/UGraphicClasses.pas +++ b/Game/Code/Classes/UGraphicClasses.pas @@ -8,6 +8,8 @@ type TParticleType=(GoldenNote, PerfectNote, NoteHitTwinkle, PerfectLineTwinkle, ColoredStar, Flare); + TAlpha = array[0..3] of real; //p1 main, p2 main, p1 sub, p2 sub + TColour3f = Record r, g, b: Real; end; @@ -24,13 +26,16 @@ type RecIndex : Integer; //To which rectangle this particle belongs (only GoldenNote) StarType : TParticleType; // GoldenNote | PerfectNote | NoteHitTwinkle | PerfectLineTwinkle Alpha : Real; // used for fading... + CP : Integer; mX, mY : Real; // movement-vector for PerfectLineTwinkle SizeMod : Real; // experimental size modifier SurviveSentenceChange : Boolean; - Constructor Create(cX,cY: Real; cScreen: Integer; cLive: Byte; cFrame : integer; cRecArrayIndex : Integer; cStarType : TParticleType; Player: Cardinal); + Constructor Create(cX,cY: Real; cScreen: Integer; cLive: Byte; + cFrame : integer; cRecArrayIndex : Integer; cStarType : TParticleType; + Player: Cardinal; CP: integer); Destructor Destroy(); - procedure Draw; + procedure Draw(Alph: TAlpha); procedure LiveOn; end; @@ -39,6 +44,7 @@ type TotalStarCount : Integer; CurrentStarCount : Integer; Screen : Integer; + CP : Integer; end; PerfectNotePositions = Record @@ -57,20 +63,21 @@ type constructor Create; destructor Destroy; override; - procedure Draw; + procedure Draw(Alpha: TAlpha); function Spawn(X, Y: Real; Screen: Integer; Live: Byte; StartFrame: Integer; RecArrayIndex: Integer; // this is only used with GoldenNotes StarType: TParticleType; - Player: Cardinal // for PerfectLineTwinkle + Player: Cardinal; // for PerfectLineTwinkle + CP: integer ): Cardinal; - procedure SpawnRec(); + procedure SpawnRec(Alph: TAlpha); procedure Kill(index: Cardinal); procedure KillAll(); - procedure SentenceChange(); - procedure SaveGoldenStarsRec(Xtop, Ytop, Xbottom, Ybottom: Real); + procedure SentenceChange(CP: integer); //TODO!!!! + procedure SaveGoldenStarsRec(Xtop, Ytop, Xbottom, Ybottom: Real; CP: integer); procedure SavePerfectNotePos(Xtop, Ytop: Real); procedure GoldenNoteTwinkle(Top,Bottom,Right: Real; Player: Integer); procedure SpawnPerfectLineTwinkle(); @@ -82,7 +89,9 @@ implementation uses sysutils, Windows, gl, UIni, UMain, UThemes, USkins, UGraphic, UDrawTexture, math, dialogs; //TParticle -Constructor TParticle.Create(cX,cY: Real; cScreen: Integer; cLive: Byte; cFrame : integer; cRecArrayIndex : Integer; cStarType : TParticleType; Player: Cardinal); +Constructor TParticle.Create(cX,cY: Real; cScreen: Integer; cLive: Byte; + cFrame : integer; cRecArrayIndex : Integer; cStarType : TParticleType; + Player: Cardinal; CP: integer); begin inherited Create; // in this constructor we set all initial values for our particle @@ -94,6 +103,7 @@ begin RecIndex := cRecArrayIndex; StarType := cStarType; Alpha := (-cos((Frame+1)*2*pi/16)+1); // neat fade-in-and-out + Self.CP := CP; SetLength(Scale,1); Scale[0] := 1; SurviveSentenceChange := False; @@ -292,14 +302,14 @@ begin end; end; -procedure TParticle.Draw; +procedure TParticle.Draw(Alph: TAlpha); var L: Cardinal; begin if ScreenAct = Screen then // this draws (multiple) texture(s) of our particle for L:=0 to High(Col) do begin - glColor4f(Col[L].r, Col[L].g, Col[L].b, Alpha); + glColor4f(Col[L].r, Col[L].g, Col[L].b, Alpha*Alph[CP]); glBindTexture(GL_TEXTURE_2D, Tex); glEnable(GL_TEXTURE_2D); @@ -339,7 +349,7 @@ begin end; -procedure TEffectManager.Draw; +procedure TEffectManager.Draw(Alpha: TAlpha); var I: Integer; CurrentTime: Cardinal; @@ -373,20 +383,22 @@ begin //Draw for I := 0 to high(Particle) do begin - Particle[I].Draw; + Particle[I].Draw(Alpha); end; end; // this method creates just one particle -function TEffectManager.Spawn(X, Y: Real; Screen: Integer; Live: Byte; StartFrame : Integer; RecArrayIndex : Integer; StarType : TParticleType; Player: Cardinal): Cardinal; +function TEffectManager.Spawn(X, Y: Real; Screen: Integer; Live: Byte; + StartFrame : Integer; RecArrayIndex : Integer; StarType : TParticleType; + Player: Cardinal; CP: integer): Cardinal; begin Result := Length(Particle); SetLength(Particle, (Result + 1)); - Particle[Result] := TParticle.Create(X, Y, Screen, Live, StartFrame, RecArrayIndex, StarType, Player); + Particle[Result] := TParticle.Create(X, Y, Screen, Live, StartFrame, RecArrayIndex, StarType, Player, CP); end; // manage Sparkling of GoldenNote Bars -procedure TEffectManager.SpawnRec(); +procedure TEffectManager.SpawnRec(Alph: TAlpha); Var Xkatze, Ykatze : Real; RandomFrame : Integer; @@ -402,11 +414,12 @@ for P:= 0 to high(RecArray) do Ykatze := RandomRange(Ceil(RecArray[P].yTop), Ceil(RecArray[P].yBottom)); RandomFrame := RandomRange(0,14); // Spawn a GoldenNote Particle - Spawn(Xkatze, Ykatze, RecArray[P].Screen, 16 - RandomFrame, RandomFrame, P, GoldenNote, 0); + Spawn(Xkatze, Ykatze, RecArray[P].Screen, 16 - RandomFrame, + RandomFrame, P, GoldenNote, 0, RecArray[P].CP); inc(RecArray[P].CurrentStarCount); end; end; - draw; + draw(Alph); end; // kill one particle (with given index in our particle array) @@ -444,7 +457,7 @@ begin end; end; -procedure TEffectManager.SentenceChange(); +procedure TEffectManager.SentenceChange(CP: integer); var c: Cardinal; begin c:=0; @@ -486,35 +499,35 @@ begin Ykatze := RandomRange(ceil(Top) , ceil(Bottom)); XKatze := RandomRange(-7,3); LKatze := RandomRange(7,13); - Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0); + Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0, (Player+1) mod 2); end; for C := 1 to 3 do begin Ykatze := RandomRange(ceil(Top)-6 , ceil(Top)); XKatze := RandomRange(-5,1); LKatze := RandomRange(4,7); - Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0); + Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0, (Player+1) mod 2); end; for C := 1 to 3 do begin Ykatze := RandomRange(ceil(Bottom), ceil(Bottom)+6); XKatze := RandomRange(-5,1); LKatze := RandomRange(4,7); - Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0); + Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0, (Player+1) mod 2); end; for C := 1 to 3 do begin Ykatze := RandomRange(ceil(Top)-10 , ceil(Top)-6); XKatze := RandomRange(-5,1); LKatze := RandomRange(1,4); - Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0); + Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0, (Player+1) mod 2); end; for C := 1 to 3 do begin Ykatze := RandomRange(ceil(Bottom)+6 , ceil(Bottom)+10); XKatze := RandomRange(-5,1); LKatze := RandomRange(1,4); - Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0); + Spawn(Ceil(Right)+XKatze, YKatze, ScreenAct, LKatze, 0, -1, NoteHitTwinkle, 0, (Player+1) mod 2); end; exit; // found a matching GoldenRec, did spawning stuff... done @@ -522,7 +535,7 @@ begin end; end; -procedure TEffectManager.SaveGoldenStarsRec(Xtop, Ytop, Xbottom, Ybottom: Real); +procedure TEffectManager.SaveGoldenStarsRec(Xtop, Ytop, Xbottom, Ybottom: Real; CP: integer); var P : Integer; // P like used in Positions NewIndex : Integer; @@ -545,6 +558,7 @@ begin RecArray[NewIndex].TotalStarCount := ceil(Xbottom - Xtop) div 12 + 3; RecArray[NewIndex].CurrentStarCount := 0; RecArray[NewIndex].Screen := ScreenAct; + RecArray[NewIndex].CP := CP; end; procedure TEffectManager.SavePerfectNotePos(Xtop, Ytop: Real); @@ -574,7 +588,7 @@ begin Xkatze := RandomRange(ceil(Xtop) - 5 , ceil(Xtop) + 10); Ykatze := RandomRange(ceil(Ytop) - 5 , ceil(Ytop) + 10); RandomFrame := RandomRange(0,14); - Spawn(Xkatze, Ykatze, ScreenAct, 16 - RandomFrame, RandomFrame, -1, PerfectNote, 0); + Spawn(Xkatze, Ykatze, ScreenAct, 16 - RandomFrame, RandomFrame, -1, PerfectNote, 0, 0); end; //for end; @@ -646,7 +660,7 @@ begin for I:= 0 to 80 do begin Life:=RandomRange(8,16); - Spawn(RandomRange(Left,Right), RandomRange(Top,Bottom), cScreen, Life, 16-Life, -1, PerfectLineTwinkle, P); + Spawn(RandomRange(Left,Right), RandomRange(Top,Bottom), cScreen, Life, 16-Life, -1, PerfectLineTwinkle, P, (P+1) mod 2); end; end; end; diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas index 85aff535..cc24e3a8 100644 --- a/Game/Code/Classes/UIni.pas +++ b/Game/Code/Classes/UIni.pas @@ -83,15 +83,9 @@ type SumPlayers: integer; DuelRatio: integer; - // Controller - Joypad: integer; - // Soundcards SoundCard: array[0..7, 1..2] of integer; - // Devices - LPT: integer; - procedure Load; procedure Save; procedure SaveNames; @@ -183,9 +177,6 @@ const ISumPlayers: array[0..2] of string = ('Never', 'Dynamic', 'Always'); IDuelRatio: array[0..9] of string = ('normal', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%'); - IJoypad: array[0..1] of string = ('Off', 'On'); - ILPT: array[0..2] of string = ('Off', 'LCD', 'Lights'); - IChannel: array[0..6] of string = ('Off', '1', '2', '3', '4', '5', '6'); implementation @@ -613,17 +604,6 @@ begin for Pet := 0 to High(IDuelRatio) do if Tekst = IDuelRatio[Pet] then Ini.DuelRatio := Pet; - // Joypad - Tekst := IniFile.ReadString('Controller', 'Joypad', IJoypad[0]); - for Pet := 0 to High(IJoypad) do - if Tekst = IJoypad[Pet] then Ini.Joypad := Pet; - - // LCD - Tekst := IniFile.ReadString('Devices', 'LPT', ILPT[0]); - for Pet := 0 to High(ILPT) do - if Tekst = ILPT[Pet] then Ini.LPT := Pet; - - // SongPath if (Params.SongPath <> '') then SongPath := IncludeTrailingPathDelimiter(Params.SongPath) @@ -851,10 +831,6 @@ begin Tekst := IDuelRatio[Ini.DuelRatio]; IniFile.WriteString('Advanced', 'DuelRatio', Tekst); - // Joypad - Tekst := IJoypad[Ini.Joypad]; - IniFile.WriteString('Controller', 'Joypad', Tekst); - IniFile.Free; end; end; diff --git a/Game/Code/Classes/UJoystick.pas b/Game/Code/Classes/UJoystick.pas deleted file mode 100644 index cd9aadc5..00000000 --- a/Game/Code/Classes/UJoystick.pas +++ /dev/null @@ -1,273 +0,0 @@ -unit UJoystick; - -interface - -uses SDL; - -type - TJoyButton = record - State: integer; - Enabled: boolean; - Type_: byte; - Sym: cardinal; - end; - - TJoyHatState = record - State: Boolean; - LastTick: Cardinal; - Enabled: boolean; - Type_: byte; - Sym: cardinal; - end; - - TJoyUnit = record - Button: array[0..15] of TJoyButton; - HatState: Array[0..3] of TJoyHatState; - end; - - TJoy = class - constructor Create; - procedure Update; - end; - -var - Joy: TJoy; - JoyUnit: TJoyUnit; - SDL_Joy: PSDL_Joystick; - JoyEvent: TSDL_Event; - -implementation - -uses SysUtils, Windows, ULog; - -constructor TJoy.Create; -var - B{, N}: integer; -begin - //Old Corvus5 Method - {// joystick support - SDL_JoystickEventState(SDL_IGNORE); - SDL_InitSubSystem(SDL_INIT_JOYSTICK); - if SDL_NumJoysticks <> 1 then beep; - - SDL_Joy := SDL_JoystickOpen(0); - if SDL_Joy = nil then beep; - - if SDL_JoystickNumButtons(SDL_Joy) <> 16 then beep; - -// SDL_JoystickEventState(SDL_ENABLE); - // Events don't work - thay hang the whole application with SDL_JoystickEventState(SDL_ENABLE) - - // clear states - for B := 0 to 15 do - JoyUnit.Button[B].State := 1; - - // mapping - JoyUnit.Button[1].Enabled := true; - JoyUnit.Button[1].Type_ := SDL_KEYDOWN; - JoyUnit.Button[1].Sym := SDLK_RETURN; - JoyUnit.Button[2].Enabled := true; - JoyUnit.Button[2].Type_ := SDL_KEYDOWN; - JoyUnit.Button[2].Sym := SDLK_ESCAPE; - - JoyUnit.Button[12].Enabled := true; - JoyUnit.Button[12].Type_ := SDL_KEYDOWN; - JoyUnit.Button[12].Sym := SDLK_LEFT; - JoyUnit.Button[13].Enabled := true; - JoyUnit.Button[13].Type_ := SDL_KEYDOWN; - JoyUnit.Button[13].Sym := SDLK_DOWN; - JoyUnit.Button[14].Enabled := true; - JoyUnit.Button[14].Type_ := SDL_KEYDOWN; - JoyUnit.Button[14].Sym := SDLK_RIGHT; - JoyUnit.Button[15].Enabled := true; - JoyUnit.Button[15].Type_ := SDL_KEYDOWN; - JoyUnit.Button[15].Sym := SDLK_UP; - } - //New Sarutas method - SDL_JoystickEventState(SDL_IGNORE); - SDL_InitSubSystem(SDL_INIT_JOYSTICK); - if SDL_NumJoysticks < 1 then - begin - Log.LogError('No Joystick found'); - exit; - end; - - - SDL_Joy := SDL_JoystickOpen(0); - if SDL_Joy = nil then - begin - Log.LogError('Could not Init Joystick'); - exit; - end; - //N := SDL_JoystickNumButtons(SDL_Joy); - //if N < 6 then beep; - - for B := 0 to 5 do begin - JoyUnit.Button[B].Enabled := true; - JoyUnit.Button[B].State := 1; - JoyUnit.Button[B].Type_ := SDL_KEYDOWN; - end; - - JoyUnit.Button[0].Sym := SDLK_Return; - JoyUnit.Button[1].Sym := SDLK_Escape; - JoyUnit.Button[2].Sym := SDLK_M; - JoyUnit.Button[3].Sym := SDLK_R; - - JoyUnit.Button[4].Sym := SDLK_RETURN; - JoyUnit.Button[5].Sym := SDLK_ESCAPE; - - //Set HatState - for B := 0 to 3 do begin - JoyUnit.HatState[B].Enabled := true; - JoyUnit.HatState[B].State := False; - JoyUnit.HatState[B].Type_ := SDL_KEYDOWN; - end; - - JoyUnit.HatState[0].Sym := SDLK_UP; - JoyUnit.HatState[1].Sym := SDLK_RIGHT; - JoyUnit.HatState[2].Sym := SDLK_DOWN; - JoyUnit.HatState[3].Sym := SDLK_LEFT; -end; - -procedure TJoy.Update; -var - B: integer; - State: UInt8; - Tick: Cardinal; - Axes: Smallint; -begin - SDL_JoystickUpdate; - - //Manage Buttons - for B := 0 to 15 do begin - if (JoyUnit.Button[B].Enabled) and (JoyUnit.Button[B].State <> SDL_JoystickGetButton(SDL_Joy, B)) and (JoyUnit.Button[B].State = 0) then begin - JoyEvent.type_ := JoyUnit.Button[B].Type_; - JoyEvent.key.keysym.sym := JoyUnit.Button[B].Sym; - SDL_PushEvent(@JoyEvent); - end; - end; - - - for B := 0 to 15 do begin - JoyUnit.Button[B].State := SDL_JoystickGetButton(SDL_Joy, B); - end; - - //Get Tick - Tick := Gettickcount; - - //Get CoolieHat - if (SDL_JoystickNumHats(SDL_Joy)>=1) then - State := SDL_JoystickGetHat(SDL_Joy, 0) - else - State := 0; - - //Get Axis - if (SDL_JoystickNumAxes(SDL_Joy)>=2) then - begin - //Down - Up (X- Axis) - Axes := SDL_JoystickGetAxis(SDL_Joy, 1); - If Axes >= 15000 then - State := State or SDL_HAT_Down - Else If Axes <= -15000 then - State := State or SDL_HAT_UP; - - //Left - Right (Y- Axis) - Axes := SDL_JoystickGetAxis(SDL_Joy, 0); - If Axes >= 15000 then - State := State or SDL_HAT_Right - Else If Axes <= -15000 then - State := State or SDL_HAT_Left; - end; - - //Manage Hat and joystick Events - if (SDL_JoystickNumHats(SDL_Joy)>=1) OR (SDL_JoystickNumAxes(SDL_Joy)>=2) then - begin - - //Up Button - If (JoyUnit.HatState[0].Enabled) and ((SDL_HAT_UP AND State) = SDL_HAT_UP) then - begin //IF Button is newly Pressed or if he is Pressed longer than 500 msecs - if (JoyUnit.HatState[0].State = False) OR (JoyUnit.HatState[0].Lasttick < Tick) then - begin - //Set Tick and State - if JoyUnit.HatState[0].State then - JoyUnit.HatState[0].Lasttick := Tick + 200 - else - JoyUnit.HatState[0].Lasttick := Tick + 500; - - JoyUnit.HatState[0].State := True; - - JoyEvent.type_ := JoyUnit.HatState[0].Type_; - JoyEvent.key.keysym.sym := JoyUnit.HatState[0].Sym; - SDL_PushEvent(@JoyEvent); - end; - end - else - JoyUnit.HatState[0].State := False; - - //Right Button - If (JoyUnit.HatState[1].Enabled) and ((SDL_HAT_RIGHT AND State) = SDL_HAT_RIGHT) then - begin //IF Button is newly Pressed or if he is Pressed longer than 500 msecs - if (JoyUnit.HatState[1].State = False) OR (JoyUnit.HatState[1].Lasttick < Tick) then - begin - //Set Tick and State - if JoyUnit.HatState[1].State then - JoyUnit.HatState[1].Lasttick := Tick + 200 - else - JoyUnit.HatState[1].Lasttick := Tick + 500; - - JoyUnit.HatState[1].State := True; - - JoyEvent.type_ := JoyUnit.HatState[1].Type_; - JoyEvent.key.keysym.sym := JoyUnit.HatState[1].Sym; - SDL_PushEvent(@JoyEvent); - end; - end - else - JoyUnit.HatState[1].State := False; - - //Down button - If (JoyUnit.HatState[2].Enabled) and ((SDL_HAT_DOWN AND State) = SDL_HAT_DOWN) then - begin //IF Button is newly Pressed or if he is Pressed longer than 230 msecs - if (JoyUnit.HatState[2].State = False) OR (JoyUnit.HatState[2].Lasttick < Tick) then - begin - //Set Tick and State - if JoyUnit.HatState[2].State then - JoyUnit.HatState[2].Lasttick := Tick + 200 - else - JoyUnit.HatState[2].Lasttick := Tick + 500; - - JoyUnit.HatState[2].State := True; - - JoyEvent.type_ := JoyUnit.HatState[2].Type_; - JoyEvent.key.keysym.sym := JoyUnit.HatState[2].Sym; - SDL_PushEvent(@JoyEvent); - end; - end - else - JoyUnit.HatState[2].State := False; - - //Left Button - If (JoyUnit.HatState[3].Enabled) and ((SDL_HAT_LEFT AND State) = SDL_HAT_LEFT) then - begin //IF Button is newly Pressed or if he is Pressed longer than 230 msecs - if (JoyUnit.HatState[3].State = False) OR (JoyUnit.HatState[3].Lasttick < Tick) then - begin - //Set Tick and State - if JoyUnit.HatState[3].State then - JoyUnit.HatState[3].Lasttick := Tick + 200 - else - JoyUnit.HatState[3].Lasttick := Tick + 500; - - JoyUnit.HatState[3].State := True; - - JoyEvent.type_ := JoyUnit.HatState[3].Type_; - JoyEvent.key.keysym.sym := JoyUnit.HatState[3].Sym; - SDL_PushEvent(@JoyEvent); - end; - end - else - JoyUnit.HatState[3].State := False; - end; - -end; - -end. diff --git a/Game/Code/Classes/ULCD.pas b/Game/Code/Classes/ULCD.pas deleted file mode 100644 index abdf3584..00000000 --- a/Game/Code/Classes/ULCD.pas +++ /dev/null @@ -1,289 +0,0 @@ -unit ULCD; - -interface - -type - TLCD = class - private - Enabled: boolean; - Text: array[1..6] of string; - StartPos: integer; - LineBR: integer; - Position: integer; - procedure WriteCommand(B: byte); - procedure WriteData(B: byte); - procedure WriteString(S: string); - public - HalfInterface: boolean; - constructor Create; - procedure Enable; - procedure Clear; - procedure WriteText(Line: integer; S: string); - procedure MoveCursor(Line, Pos: integer); - procedure ShowCursor; - procedure HideCursor; - - // for 2x16 - procedure AddTextBR(S: string); - procedure MoveCursorBR(Pos: integer); - procedure ScrollUpBR; - procedure AddTextArray(Line:integer; S: string); - end; - -var - LCD: TLCD; - -const - Data = $378; // domyślny adres portu - Status = Data + 1; - Control = Data + 2; - -implementation - -uses - SysUtils, - zlportio, - UTime; - -procedure TLCD.WriteCommand(B: Byte); -// Wysylanie komend sterujacych -begin - if not HalfInterface then begin - zlioportwrite(Control, 0, $02); - zlioportwrite(Data, 0, B); - zlioportwrite(Control, 0, $03); - end else begin - zlioportwrite(Control, 0, $02); - zlioportwrite(Data, 0, B and $F0); - zlioportwrite(Control, 0, $03); - - TimeSleep(0.1); - - zlioportwrite(Control, 0, $02); - zlioportwrite(Data, 0, (B * 16) and $F0); - zlioportwrite(Control, 0, $03); - end; - - if (B=1) or (B=2) then - Sleep(2) - else - TimeSleep(0.1); -end; - -procedure TLCD.WriteData(B: Byte); -// Wysylanie danych -begin - if not HalfInterface then begin - zlioportwrite(Control, 0, $06); - zlioportwrite(Data, 0, B); - zlioportwrite(Control, 0, $07); - end else begin - zlioportwrite(Control, 0, $06); - zlioportwrite(Data, 0, B and $F0); - zlioportwrite(Control, 0, $07); - - TimeSleep(0.1); - - zlioportwrite(Control, 0, $06); - zlioportwrite(Data, 0, (B * 16) and $F0); - zlioportwrite(Control, 0, $07); - end; - - TimeSleep(0.1); - Inc(Position); -end; - -procedure TLCD.WriteString(S: string); -// Wysylanie slow -var - I: integer; -begin - for I := 1 to Length(S) do - WriteData(Ord(S[I])); -end; - -constructor TLCD.Create; -begin -// -end; - -procedure TLCD.Enable; -var - A: byte; - B: byte; -begin - Enabled := true; - if not HalfInterface then - WriteCommand($38) - else begin - WriteCommand($33); - WriteCommand($32); - WriteCommand($28); - end; - -// WriteCommand($06); -// WriteCommand($0C); -// sleep(10); -end; - -procedure TLCD.Clear; -begin - if Enabled then begin - WriteCommand(1); - WriteCommand(2); - Text[1] := ''; - Text[2] := ''; - Text[3] := ''; - Text[4] := ''; - Text[5] := ''; - Text[6] := ''; - StartPos := 1; - LineBR := 1; - end; -end; - -procedure TLCD.WriteText(Line: integer; S: string); -begin - if Enabled then begin - if Line <= 2 then begin - MoveCursor(Line, 1); - WriteString(S); - end; - - Text[Line] := ''; - AddTextArray(Line, S); - end; -end; - -procedure TLCD.MoveCursor(Line, Pos: integer); -var - I: integer; -begin - if Enabled then begin - Pos := Pos + (Line-1) * 40; - - if Position > Pos then begin - WriteCommand(2); - for I := 1 to Pos-1 do - WriteCommand(20); - end; - - if Position < Pos then - for I := 1 to Pos - Position do - WriteCommand(20); - - Position := Pos; - end; -end; - -procedure TLCD.ShowCursor; -begin - if Enabled then begin - WriteCommand(14); - end; -end; - -procedure TLCD.HideCursor; -begin - if Enabled then begin - WriteCommand(12); - end; -end; - -procedure TLCD.AddTextBR(S: string); -var - Word: string; - W: integer; - P: integer; - L: integer; -begin - if Enabled then begin - if LineBR <= 6 then begin - L := LineBR; - P := Pos(' ', S); - - if L <= 2 then - MoveCursor(L, 1); - - while (L <= 6) and (P > 0) do begin - Word := Copy(S, 1, P); - if (Length(Text[L]) + Length(Word)-1) > 16 then begin - L := L + 1; - if L <= 2 then - MoveCursor(L, 1); - end; - - if L <= 6 then begin - if L <= 2 then - WriteString(Word); - AddTextArray(L, Word); - end; - - Delete(S, 1, P); - P := Pos(' ', S) - end; - - LineBR := L + 1; - end; - end; -end; - -procedure TLCD.MoveCursorBR(Pos: integer); -var - I: integer; - L: integer; -begin - if Enabled then begin - Pos := Pos - (StartPos-1); - if Pos <= Length(Text[1]) then - MoveCursor(1, Pos); - - if Pos > Length(Text[1]) then begin - // bez zawijania -// Pos := Pos - Length(Text[1]); -// MoveCursor(2, Pos); - - // z zawijaniem - Pos := Pos - Length(Text[1]); - ScrollUpBR; - MoveCursor(1, Pos); - end; - end; -end; - -procedure TLCD.ScrollUpBR; -var - T: array[1..5] of string; - SP: integer; - LBR: integer; -begin - if Enabled then begin - T[1] := Text[2]; - T[2] := Text[3]; - T[3] := Text[4]; - T[4] := Text[5]; - T[5] := Text[6]; - SP := StartPos + Length(Text[1]); - LBR := LineBR; - - Clear; - - StartPos := SP; - WriteText(1, T[1]); - WriteText(2, T[2]); - WriteText(3, T[3]); - WriteText(4, T[4]); - WriteText(5, T[5]); - LineBR := LBR-1; - end; -end; - -procedure TLCD.AddTextArray(Line: integer; S: string); -begin - if Enabled then begin - Text[Line] := Text[Line] + S; - end; -end; - -end. - diff --git a/Game/Code/Classes/ULight.pas b/Game/Code/Classes/ULight.pas deleted file mode 100644 index 967d2ea1..00000000 --- a/Game/Code/Classes/ULight.pas +++ /dev/null @@ -1,116 +0,0 @@ -unit ULight; -interface - -type - TLight = class - private - Enabled: boolean; - Light: array[0..7] of boolean; - LightTime: array[0..7] of real; // time to stop, need to call update to change state - LastTime: real; - public - constructor Create; - procedure Enable; - procedure SetState(State: integer); - procedure AutoSetState; - procedure TurnOn; - procedure TurnOff; - procedure LightOne(Number: integer; Time: real); - procedure Refresh; - end; - -var - Light: TLight; - -const - Data = $378; // default port address - Status = Data + 1; - Control = Data + 2; - -implementation - -uses - SysUtils, zlportio, UTime; - -constructor TLight.Create; -begin - Enabled := false; -end; - -procedure TLight.Enable; -begin - Enabled := true; - LastTime := GetTime; -end; - -procedure TLight.SetState(State: integer); -begin - if Enabled then - PortWriteB($378, State); -end; - -procedure TLight.AutoSetState; -var - State: integer; -begin - if Enabled then begin - State := 0; - if Light[0] then State := State + 2; - if Light[1] then State := State + 1; - // etc - SetState(State); - end; -end; - -procedure TLight.TurnOn; -begin - if Enabled then - SetState(3); -end; - -procedure TLight.TurnOff; -begin - if Enabled then - SetState(0); -end; - -procedure TLight.LightOne(Number: integer; Time: real); -begin - if Enabled then begin - if Light[Number] = false then begin - Light[Number] := true; - AutoSetState; - end; - - LightTime[Number] := GetTime + Time/1000; // [s] - end; -end; - -procedure TLight.Refresh; -var - Time: real; - TimeSkip: real; - L: integer; -begin - if Enabled then begin - Time := GetTime; - TimeSkip := Time - LastTime; - for L := 0 to 7 do begin - if Light[L] = true then begin - if LightTime[L] > Time then begin - // jest jeszcze zapas - bez zmian - //LightTime[L] := LightTime[L] - TimeSkip; - end else begin - // czas minal - Light[L] := false; - end; - end; - end; - LastTime := Time; - AutoSetState; - end; -end; - -end. - - diff --git a/Game/Code/Classes/ULyrics.pas b/Game/Code/Classes/ULyrics.pas index 08563d66..c6a5e635 100644 --- a/Game/Code/Classes/ULyrics.pas +++ b/Game/Code/Classes/ULyrics.pas @@ -31,6 +31,7 @@ type StyleI: integer; // 0 - one selection, 1 - long selection, 2 - one selection with fade to normal text, 3 - long selection with fade with color from left FontStyleI: integer; // font number Word: array of TWord; + Alpha: real; procedure SetX(Value: real); procedure SetY(Value: real); function GetClientX: real; @@ -76,7 +77,9 @@ type function SelectedLength: integer; // LCD procedure Clear; - procedure Draw; + procedure Draw(); + procedure SetAlpha(alpha: real); + function GetAlpha: real; end; @@ -86,6 +89,22 @@ type implementation uses TextGL, UGraphic, UDrawTexture; +procedure TLyric.SetAlpha(alpha: real); +begin + Self.Alpha := alpha; + + if (Self.Alpha>1) then + Self.Alpha := 1; + + if (Self.Alpha<0) then + Self.Alpha := 0; +end; + +function TLyric.GetAlpha: real; +begin + Result := Alpha; +end; + procedure TLyric.SetX(Value: real); begin XR := Value; @@ -250,6 +269,7 @@ begin SetLength(Word, 0); Text := ''; SelectedI := -1; + Alpha := 1; end; procedure TLyric.Refresh; @@ -268,10 +288,11 @@ begin end; end; -procedure TLyric.Draw; +procedure TLyric.Draw(); var W: integer; begin + glEnable(GL_BLEND); case StyleI of 0: begin @@ -317,6 +338,7 @@ begin end; end; end; // case + glDisable(GL_BLEND); end; procedure TLyric.DrawNormal(W: integer); @@ -325,7 +347,7 @@ begin SetFontPos(Word[W].X+ 10*ScreenX, Word[W].Y); SetFontSize(Word[W].Size); SetFontItalic(Word[W].Italic); - glColor3f(Word[W].ColR, Word[W].ColG, Word[W].ColB); + glColor4f(Word[W].ColR, Word[W].ColG, Word[W].ColB, Alpha); glPrint(pchar(Word[W].Text)); end; @@ -339,11 +361,10 @@ begin SetFontPos(Word[W].X, Word[W].Y); SetFontSize(Word[W].Size); SetFontItalic(Word[W].Italic); - if D = 0 then - glColor3f(ColR, ColG, ColB) + glColor4f(ColR, ColG, ColB, Alpha) else - glColor3f(ColSR, ColSG, ColSB); + glColor4f(ColSR, ColSG, ColSB, Alpha); glPrint(pchar(Word[W].Text)); end; @@ -358,7 +379,7 @@ begin SetFontPos(Word[W].X - D * Word[W].Width * (Word[W].Scale - 1) / 2 + (D+1)*10*ScreenX, Word[W].Y - D * 1.5 * Word[W].Size *(Word[W].Scale - 1)); SetFontSize(Word[W].Size + D * (Word[W].Size * Word[W].Scale - Word[W].Size)); SetFontItalic(Word[W].Italic); - glColor3f(Word[W].ColR, Word[W].ColG, Word[W].ColB); + glColor4f(Word[W].ColR, Word[W].ColG, Word[W].ColB, Alpha); glPrint(pchar(Word[W].Text)) end; @@ -371,8 +392,8 @@ begin SetFontPos(Word[W].X, Word[W].Y); SetFontSize(Word[W].Size); SetFontItalic(Word[W].Italic); - glColor3f(Word[W].ColR, Word[W].ColG, Word[W].ColB); - glPrintDone(pchar(Word[W].Text), D, ColR, ColG, ColB); + glColor4f(Word[W].ColR, Word[W].ColG, Word[W].ColB, Alpha); + glPrintDone(pchar(Word[W].Text), D, ColR, ColG, ColB, Alpha); end; function TLyric.SelectedLetter; // LCD diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas index 04c19a47..c2497f32 100644 --- a/Game/Code/Classes/UMain.pas +++ b/Game/Code/Classes/UMain.pas @@ -112,7 +112,7 @@ function GetTimeFromBeat(Beat: integer): real; procedure ClearScores(PlayerNum: integer); implementation -uses USongs, UJoystick, math, UCommandLine, UVideo; +uses USongs, math, UCommandLine, UVideo; procedure MainLoop; var @@ -121,10 +121,6 @@ begin SDL_EnableKeyRepeat(125, 125); While not Done do Begin - // joypad - if (Ini.Joypad = 1) OR (Params.Joypad) then - Joy.Update; - // keyboard events CheckEvents; @@ -395,7 +391,10 @@ begin for Pet := 0 to Czesci[CP].High do begin if Czas.AktBeat >= Czesci[CP].Czesc[Pet].Start then - Czesci[CP].Akt := Pet; + begin + if (GetTimeFromBeat(Czesci[CP].Czesc[Pet].StartNote) <= Czas.Teraz+10) then + Czesci[CP].Akt := Pet; + end; end; // czysczenie nut gracza, gdy to jest nowa plansza @@ -479,8 +478,7 @@ begin end; //On Sentence Change... - if(CP=0) then - Sender.onSentenceChange(Czesci[CP].Akt); + Sender.onSentenceChange(CP, Czesci[CP].Akt); end; procedure NewBeat(CP: integer; Sender: TScreenSing); @@ -514,19 +512,6 @@ begin if (Ini.BeatClick = 1) and ((Czas.AktBeatC + Czesci[CP].Resolution + Czesci[CP].NotesGAP) mod Czesci[CP].Resolution = 0) then Music.PlayClick; - // debug system on LPT - {if ((Czas.AktBeatC + Czesci[CP].Resolution + Czesci[CP].NotesGAP) mod Czesci[CP].Resolution = 0) then - begin - //LPT_1 := 0; -// Light.LightOne(0, 150); - - -{ if ((Czas.AktBeatC + Czesci[0].Resolution + Czesci[0].NotesGAP) mod (Czesci[0].Resolution * 2) = 0) then - Light.LightOne(0, 150) - else - Light.LightOne(1, 150)} - //end; - if (Length(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta)=0) then Exit; diff --git a/Game/Code/Classes/UMusic.pas b/Game/Code/Classes/UMusic.pas index 7fae3017..a5355bbe 100644 --- a/Game/Code/Classes/UMusic.pas +++ b/Game/Code/Classes/UMusic.pas @@ -245,7 +245,7 @@ begin while (i < length) do begin - dmch := round((((0 - lch^) + (rch^)) div 2)*1.5); + dmch := round((((0 - lch^) + (rch^)) / 2)*1.5); lch^ := dmch; rch^ := dmch; @@ -479,9 +479,9 @@ begin //Old Sets Wave Volume //BASS_SetVolume(Volume); //New: Sets Volume only for this Application - BASS_SetConfig(BASS_CONFIG_GVOL_SAMPLE, Volume); - BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume); - BASS_SetConfig(BASS_CONFIG_GVOL_MUSIC, Volume); + BASS_SetConfig(BASS_CONFIG_GVOL_SAMPLE, Volume*100); + BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume*100); + BASS_SetConfig(BASS_CONFIG_GVOL_MUSIC, Volume*100); end; procedure TMusic.SetMusicVolume(Volume: Integer); @@ -491,10 +491,10 @@ begin Volume := 100; //Set MP3 Volume - BASS_ChannelSetAttributes (Bass, -1, Volume, -101); + BASS_ChannelSetAttribute(Bass, BASS_ATTRIB_VOL, Volume/100); //Set Applause Volume - BASS_ChannelSetAttributes (BassApplause, -1, Volume, -101); + BASS_ChannelSetAttribute(BassApplause, BASS_ATTRIB_VOL, Volume/100); end; procedure TMusic.Fade(InitVolume, TargetVolume: Integer; FadeTime: real); @@ -507,9 +507,9 @@ begin else if TargetVolume<0 then TargetVolume := 0; - BASS_ChannelSetAttributes (Bass, -1, InitVolume, -101); + BASS_ChannelSetAttribute(Bass, BASS_ATTRIB_VOL, InitVolume/100); time := round(FadeTime*1000); - BASS_ChannelSlideAttributes (Bass, -1, TargetVolume, -101, time); + BASS_ChannelSlideAttribute(Bass, BASS_ATTRIB_VOL, TargetVolume/100, time); end; procedure TMusic.FadeStop(FadeTime: real); @@ -517,7 +517,7 @@ var time: dword; begin time := round(FadeTime*1000); - BASS_ChannelSlideAttributes (Bass, -1, -2, -101, time); //fade out and stop + BASS_ChannelSlideAttribute(Bass, BASS_ATTRIB_VOL, -1, time); //fade out and stop end; procedure TMusic.SetLoop(Enabled: boolean); @@ -560,7 +560,7 @@ begin // if Loaded then begin // MediaPlayer.StartPos := Round(Time); bytes := BASS_ChannelSeconds2Bytes(Bass, Time); - BASS_ChannelSetPosition(Bass, bytes); + BASS_ChannelSetPosition(Bass, bytes, BASS_POS_BYTE); // end; end; @@ -603,7 +603,7 @@ var begin //Result := 60; - bytes := BASS_ChannelGetLength( Bass ); + bytes := BASS_ChannelGetLength(Bass, BASS_POS_BYTE); Result := BASS_ChannelBytes2Seconds(Bass, bytes); { if Assigned(MediaPlayer) then begin @@ -618,7 +618,7 @@ var bytes: integer; begin //Result := 0;//MediaPlayer.Position / 1000; - bytes := BASS_ChannelGetPosition(BASS); + bytes := BASS_ChannelGetPosition(BASS, BASS_POS_BYTE); Result := BASS_ChannelBytes2Seconds(BASS, bytes); end; @@ -836,6 +836,7 @@ procedure TMusic.CaptureCard(RecordI, PlayerLeft, PlayerRight: byte); var Error: integer; ErrorMsg: string; + Player: integer; begin if not BASS_RecordInit(RecordI) then begin Error := BASS_ErrorGetCode; @@ -855,10 +856,11 @@ begin Log.LogError('Music -> CaptureCard: Error initializing record: ' + ErrorMsg); - end else begin - + end else + begin + Player := PlayerLeft + PlayerRight*256; //SoundCard[RecordI].BassRecordStream := BASS_RecordStart(44100, 2, MakeLong(0, 20) , @GetMicrophone, PlayerLeft + PlayerRight*256); - Recording.SoundCard[RecordI].BassRecordStream := BASS_RecordStart(44100, 2, MakeLong(0, 20) , @GetMicrophone, PlayerLeft + PlayerRight*256); + Recording.SoundCard[RecordI].BassRecordStream := BASS_RecordStart(44100, 2, MakeLong(0, 20) , @GetMicrophone, Pointer(Player)); {if SoundCard[RecordI].BassRecordStream = 0 then begin Error := BASS_ErrorGetCode; diff --git a/Game/Code/Classes/URecord.pas b/Game/Code/Classes/URecord.pas index c478aebc..03cf137e 100644 --- a/Game/Code/Classes/URecord.pas +++ b/Game/Code/Classes/URecord.pas @@ -276,12 +276,15 @@ end; constructor TRecord.Create; var + Info: BASS_DEVICEINFO; SC: integer; // soundcard SCI: integer; // soundcard input Descr: string; InputName: string; Flags: integer; No: integer; + Proceed: boolean; + function isDuplicate(Desc: String): Boolean; var I: Integer; @@ -302,12 +305,14 @@ var begin // checks for recording devices and puts them into array; SetLength(SoundCard, 0); - + BASS_RecordFree; SC := 0; - Descr := BASS_RecordGetDeviceDescription(SC); - - while (Descr <> '') do begin + //Descr := BASS_RecordGetDeviceDescription(SC); + Proceed := BASS_RecordGetDeviceInfo(SC, &Info); + Descr := Info.name; + while {(Descr <> '')} Proceed and not (info.flags and BASS_DEVICE_ENABLED=0) do + begin //If there is another SoundCard with the Same ID, Search an available Name if (IsDuplicate(Descr)) then begin @@ -327,7 +332,7 @@ begin // mic[device] := -1; // default to no change SCI := 0; BASS_RecordInit(SC); - Flags := BASS_RecordGetInput(SCI); + Flags := BASS_RecordGetInput(SCI, PSingle(nil)^); InputName := BASS_RecordGetInputName(SCI); // Log.LogError('Input #' + IntToStr(SCI) + ' (' + IntToStr(Flags) + '): ' + InputName); @@ -335,8 +340,10 @@ begin SoundCard[SC].Input[SCI].Name := InputName; // process each input - while (Flags <> -1) do begin - if SCI >= 1 then begin + while (Flags <> -1) and (Flags and BASS_INPUT_OFF<>0) do + begin + if SCI >= 1 then + begin SetLength(SoundCard[SC].Input, SCI+1); InputName := BASS_RecordGetInputName(SCI); SoundCard[SC].Input[SCI].Name := InputName; @@ -348,7 +355,7 @@ begin end;} Inc(SCI); - Flags := BASS_RecordGetInput(SCI); + Flags := BASS_RecordGetInput(SCI, PSingle(nil)^); end; { if mic[device] <> -1 then begin @@ -363,7 +370,9 @@ begin BASS_RecordFree; Inc(SC); - Descr := BASS_RecordGetDeviceDescription(SC); + //Descr := BASS_RecordGetDeviceDescription(SC); + Proceed := BASS_RecordGetDeviceInfo(SC, &Info); + Descr := Info.name; end; // while end; end. diff --git a/Game/Code/Classes/UThemes.pas b/Game/Code/Classes/UThemes.pas index 36ac18b4..12fd5d12 100644 --- a/Game/Code/Classes/UThemes.pas +++ b/Game/Code/Classes/UThemes.pas @@ -338,7 +338,8 @@ type StaticSongName : TThemeStatic; TextSongName : TThemeText; - StaticLyricDuetBar : TThemeStatic; + StaticLyricBar : TThemeStatic; + StaticLyricDuetBar: TThemeStatic; //TimeBar mod StaticTimeProgress: TThemeStatic; @@ -1189,6 +1190,7 @@ begin ThemeLoadStatic(Sing.StaticSongName, 'SingSongNameStatic'); ThemeLoadText(Sing.TextSongName, 'SingSongNameText'); + ThemeLoadStatic(Sing.StaticLyricBar, 'SingStaticLyricBar'); ThemeLoadStatic(Sing.StaticLyricDuetBar, 'SingStaticLyricDuetBar'); //TimeBar mod diff --git a/Game/Code/Classes/UVideo.pas b/Game/Code/Classes/UVideo.pas index e59e4179..7342314c 100644 --- a/Game/Code/Classes/UVideo.pas +++ b/Game/Code/Classes/UVideo.pas @@ -34,7 +34,8 @@ uses SDL, dialogs, {$endif} {$ENDIF} - UIni; + UIni, + UTime; type TAspectCorrection = (acoStretch, acoCrop, acoLetterBox); //from 1.1 @@ -64,7 +65,9 @@ procedure GetVideoRect(var ScreenRect, TexRect: TRectCoords; Window: TRectCoords procedure SetAspectCorrection(aspect: TAspectCorrection); procedure ResetAspectCorrection; - +Const + MIN_FPS = 40; + MAX_FPS = 55; var VideoOpened: Boolean; @@ -256,7 +259,7 @@ begin glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0); end; - mmfps := 50; + mmfps := (MAX_FPS-MIN_FPS)/2; end; procedure acClose; @@ -388,13 +391,16 @@ begin if Ini.Debug = 1 then begin //frame decode debug display - GoldenRec.Spawn(200,85,1,16,0,-1,ColoredStar,$ffff00); + GoldenRec.Spawn(200,85,1,16,0,-1,ColoredStar,$ffff00,0); end; end; end; procedure acGetFrame(Time: Extended); +Const + MAX = 3000; + var FrameFinished: Integer; errnum: Integer; @@ -412,6 +418,36 @@ const begin if not VideoOpened then Exit; if VideoPaused then Exit; + + mmfps := (Display.mFPS+mmfps)/2; + if(Ini.PerformanceMode=1) then + begin + if (mmfps=MAX) then + begin + Inc(SkipLines); + mmfps:=(MAX_FPS-MIN_FPS)/2; + Counter := 0; + end; + end else if (mmfps>MAX_FPS) then + begin + if(SkipLines>0) and (Counter0) and (Counter>=MAX) then + begin + Dec(SkipLines); + LastSkipLines := SkipLines; + Counter := 0; + end; + end else Counter := 0; + end; + + if (Counter>MAX) then + Counter := MAX; + if (NegativeSkipTime < 0)and(Time+NegativeSkipTime>=0) then NegativeSkipTime:=0; myTime:=Time+VideoSkipTime; @@ -429,7 +465,7 @@ begin if Ini.Debug = 1 then begin // frame delay debug display - GoldenRec.Spawn(200,65,1,16,0,-1,ColoredStar,$00ff00); + GoldenRec.Spawn(200,65,1,16,0,-1,ColoredStar,$00ff00,0); end; Exit;// we don't need a new frame now end; @@ -438,7 +474,7 @@ begin if Ini.Debug = 1 then begin //frame drop debug display - GoldenRec.Spawn(200,105,1,16,0,-1,ColoredStar,$ff0000); + GoldenRec.Spawn(200,105,1,16,0,-1,ColoredStar,$ff0000,0); end; DropFrame:=True; @@ -501,32 +537,6 @@ begin errnum:=1; //TODO!! if errnum >=0 then begin - mmfps := (Display.mFPS+mmfps)/2; - if(Ini.PerformanceMode=1) then - begin - if (mmfps<45) then - begin - if(SkipLines<3) and (Counter<100) then - Counter := round(Counter+70/mmfps) - else if (SkipLines<3) and (Counter>=100) then - begin - Inc(SkipLines); - mmfps:=50; - Counter := 0; - end; - end else if (mmfps>75) then - begin - if(SkipLines>0) and (Counter<=100) then - Counter := round(Counter+70/mmfps) - else if (SkipLines>0) and (Counter>=100) then - begin - Dec(SkipLines); - LastSkipLines := SkipLines; - Counter := 0; - end; - end else Counter := 0; - end; - if(not pbo_supported) then begin FrameDataPtr:=Pointer(videodecoder^.buffer); @@ -614,7 +624,7 @@ begin if Ini.Debug = 1 then begin //frame decode debug display - GoldenRec.Spawn(200,85,1,16,0,-1,ColoredStar,$ffff00); + GoldenRec.Spawn(200,85,1,16,0,-1,ColoredStar,$ffff00,0); end; end; @@ -916,8 +926,8 @@ begin glColor4f(0, 0, 0, 0.2); glbegin(gl_quads); glVertex2f(0, 50); - glVertex2f(0, 160); - glVertex2f(250, 160); + glVertex2f(0, 170); + glVertex2f(250, 170); glVertex2f(250, 50); glEnd; @@ -946,6 +956,9 @@ begin SetFontPos (5, 125); glPrint(PChar('skipL: '+inttostr(SkipLines))); + + SetFontPos (5, 140); + glPrint(PChar('Counter: '+inttostr(Counter))); end; end; -- cgit v1.2.3