Skip to content

Commit

Permalink
Refer to color inversion value as P1_INVERTED
Browse files Browse the repository at this point in the history
  • Loading branch information
DeinAlptraum committed Jul 18, 2024
1 parent 81f2e1c commit 466db0e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
15 changes: 9 additions & 6 deletions src/base/UDraw.pas
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ TRecR = record
Mid: real;
end;

const
P1_INVERTED = 99;

var
NotesW: array [0..UIni.IMaxPlayerCount-1] of real;
NotesH: array [0..UIni.IMaxPlayerCount-1] of real;
Expand Down Expand Up @@ -1661,14 +1664,14 @@ procedure EditDrawLine(X, YBaseNote, W, H: real; Track: integer; NumLines: integ
Rec.Bottom := Rec.Top + 2 * NotesH[0];
If (NoteType = ntRap) or (NoteType = ntRapGolden) then
begin
If Color = 99 then
If Color = P1_INVERTED then
glBindTexture(GL_TEXTURE_2D, Tex_Left_Rap_Inv.TexNum)
else
glBindTexture(GL_TEXTURE_2D, Tex_Left_Rap[Color].TexNum)
end
else
begin
If Color = 99 then
If Color = P1_INVERTED then
glBindTexture(GL_TEXTURE_2D, Tex_Left_Inv.TexNum)
else
glBindTexture(GL_TEXTURE_2D, Tex_Left[Color].TexNum)
Expand All @@ -1687,14 +1690,14 @@ procedure EditDrawLine(X, YBaseNote, W, H: real; Track: integer; NumLines: integ

If (NoteType = ntRap) or (NoteType = ntRapGolden) then
begin
If Color = 99 then
If Color = P1_INVERTED then
glBindTexture(GL_TEXTURE_2D, Tex_Mid_Rap_Inv.TexNum)
else
glBindTexture(GL_TEXTURE_2D, Tex_Mid_Rap[Color].TexNum)
end
else
begin
If Color = 99 then
If Color = P1_INVERTED then
glBindTexture(GL_TEXTURE_2D, Tex_Mid_Inv.TexNum)
else
glBindTexture(GL_TEXTURE_2D, Tex_Mid[Color].TexNum)
Expand All @@ -1712,14 +1715,14 @@ procedure EditDrawLine(X, YBaseNote, W, H: real; Track: integer; NumLines: integ

If (NoteType = ntRap) or (NoteType = ntRapGolden) then
begin
If Color = 99 then
If Color = P1_INVERTED then
glBindTexture(GL_TEXTURE_2D, Tex_Right_Rap_Inv.TexNum)
else
glBindTexture(GL_TEXTURE_2D, Tex_Right_Rap[Color].TexNum)
end
else
begin
If Color = 99 then
If Color = P1_INVERTED then
begin
glBindTexture(GL_TEXTURE_2D, Tex_Right_Inv.TexNum);
end
Expand Down
38 changes: 19 additions & 19 deletions src/screens/UScreenEditSub.pas
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
while (CurrentNote[CurrentTrack] <= Tracks[CurrentTrack].Lines[LineIndex].HighNote) and (CurrentBeat > Tracks[CurrentTrack].Lines[LineIndex].Notes[CurrentNote[CurrentTrack]].EndBeat) do
Inc(CurrentNote[CurrentTrack]);

Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
EditorLyrics[CurrentTrack].Selected := 0;

Expand Down Expand Up @@ -826,7 +826,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
begin
Tracks[CurrentTrack].CurrentLine := MedleyNotes.end_.line;
CurrentNote[CurrentTrack] := MedleyNotes.end_.note;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;

EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
EditorLyrics[CurrentTrack].Selected := 0;
Expand All @@ -849,7 +849,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
begin
Tracks[CurrentTrack].CurrentLine := MedleyNotes.start.line;
CurrentNote[CurrentTrack] := MedleyNotes.start.note;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;

EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
EditorLyrics[CurrentTrack].Selected := 0;
Expand Down Expand Up @@ -1793,7 +1793,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
Tracks[CurrentTrack].CurrentLine := LineIndex;
ShowInteractiveBackground;
CurrentNote[CurrentTrack] := 0;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack];
end;
Expand All @@ -1817,7 +1817,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre

Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 1;
CurrentNote[CurrentTrack] := NoteIndex;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack];
//play current note playonewithmidi
PlaySentenceMidi := false;
Expand Down Expand Up @@ -1898,7 +1898,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
Inc(CurrentNote[CurrentTrack]);
if CurrentNote[CurrentTrack] > Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].HighNote then
CurrentNote[CurrentTrack] := 0;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack];
end;

Expand Down Expand Up @@ -1976,7 +1976,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
Dec(CurrentNote[CurrentTrack]);
if CurrentNote[CurrentTrack] = -1 then
CurrentNote[CurrentTrack] := Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].HighNote;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack];
end;

Expand Down Expand Up @@ -3115,7 +3115,7 @@ procedure TScreenEditSub.DivideSentence;
end;

Refresh;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack];
end;
Expand Down Expand Up @@ -3187,7 +3187,7 @@ procedure TScreenEditSub.JoinSentence;
end;

Refresh;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack];
end;
Expand All @@ -3205,7 +3205,7 @@ procedure TScreenEditSub.NextSentence;
CurrentNote[CurrentTrack] := 0;
if Tracks[CurrentTrack].CurrentLine > Tracks[CurrentTrack].High then
Tracks[CurrentTrack].CurrentLine := 0;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;

EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
EditorLyrics[CurrentTrack].Selected := 0;
Expand All @@ -3232,7 +3232,7 @@ procedure TScreenEditSub.PreviousSentence;
CurrentNote[CurrentTrack] := 0;
if Tracks[CurrentTrack].CurrentLine = -1 then
Tracks[CurrentTrack].CurrentLine := Tracks[CurrentTrack].High;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;

EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
EditorLyrics[CurrentTrack].Selected := 0;
Expand Down Expand Up @@ -3340,7 +3340,7 @@ procedure TScreenEditSub.DeleteNote;
EndBeat := Notes[HighNote].StartBeat + Notes[HighNote].Duration;
end;

Tracks[CurrentTrack].Lines[CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
end
// Last Note of current Sentence Deleted - > Delete Sentence
// if there are more than two left
Expand All @@ -3362,7 +3362,7 @@ procedure TScreenEditSub.DeleteNote;
else
Tracks[CurrentTrack].CurrentLine := 0;

Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
end;

// update lyric display
Expand Down Expand Up @@ -3396,7 +3396,7 @@ procedure TScreenEditSub.DeleteSentence;
Refresh;
//SelectPrevNote();
//SelectNextNote();
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
end;

Expand Down Expand Up @@ -3511,7 +3511,7 @@ procedure TScreenEditSub.CopySentence(SrcTrack, SrcLine, DstTrack, DstLine: Inte
Tracks[DstTrack].Lines[DstLine].EndBeat := Tracks[DstTrack].Lines[DstLine].Notes[NoteIndex].StartBeat + Tracks[DstTrack].Lines[DstLine].Notes[NoteIndex].Duration;

Refresh;
Tracks[DstTrack].Lines[DstLine].Notes[CurrentNote[DstTrack]].Color := 99;
Tracks[DstTrack].Lines[DstLine].Notes[CurrentNote[DstTrack]].Color := P1_INVERTED;
EditorLyrics[DstTrack].AddLine(DstTrack, Tracks[DstTrack].CurrentLine);
end;

Expand Down Expand Up @@ -3563,7 +3563,7 @@ procedure TScreenEditSub.MakeSolo;
CurrentTrack := 0;
Refresh;
CurrentNote[CurrentTrack] := 0;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;

EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine);
end;
Expand Down Expand Up @@ -3710,7 +3710,7 @@ function TScreenEditSub.DuetCopyLine: boolean;
EditorLyrics[DstTrack].AddLine(DstTrack, Tracks[DstTrack].CurrentLine);
EditorLyrics[DstTrack].Selected := 0;
CurrentNote[DstTrack] := 0;
Tracks[SrcTrack].Lines[SrcLine].Notes[CurrentNote[SrcTrack]].Color := 99;
Tracks[SrcTrack].Lines[SrcLine].Notes[CurrentNote[SrcTrack]].Color := P1_INVERTED;
Result := true;
end;

Expand Down Expand Up @@ -4930,7 +4930,7 @@ procedure TScreenEditSub.OnShow;
begin
Tracks[TrackIndex].CurrentLine := 0;
CurrentNote[TrackIndex] := 0;
Tracks[TrackIndex].Lines[0].Notes[0].Color := 99;
Tracks[TrackIndex].Lines[0].Notes[0].Color := P1_INVERTED;
end;

AudioPlayBack.Open(CurrentSong.Path.Append(CurrentSong.Mp3));
Expand Down Expand Up @@ -5090,7 +5090,7 @@ function TScreenEditSub.Draw: boolean;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 1;
CurrentNote[CurrentTrack] := NoteIndex;
EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack];
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99;
Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED;
end; //if
end; //for NoteIndex}
end; //end move cursor
Expand Down

0 comments on commit 466db0e

Please sign in to comment.