aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code')
-rw-r--r--Game/Code/Screens/UScreenEditConvert.pas30
-rw-r--r--Game/Code/Screens/UScreenEditSub.pas8
2 files changed, 36 insertions, 2 deletions
diff --git a/Game/Code/Screens/UScreenEditConvert.pas b/Game/Code/Screens/UScreenEditConvert.pas
index 92e8544c..f1e3ba32 100644
--- a/Game/Code/Screens/UScreenEditConvert.pas
+++ b/Game/Code/Screens/UScreenEditConvert.pas
@@ -54,8 +54,10 @@ type
BPM: real;
Ticks: real;
Nuta: array of TNuta;
+
procedure AddLyric(Start: integer; Tekst: string);
procedure Extract;
+
procedure MidiFile1MidiEvent(event: PMidiEvent);
function SelectedNumber: integer;
constructor Create; override;
@@ -192,6 +194,7 @@ var
Nu: integer;
NutaTemp: TNuta;
Move: integer;
+ Max, Min: integer;
begin
// song info
Song.Title := '';
@@ -201,6 +204,8 @@ begin
SetLength(Song.BPM, 1);
Song.BPM[0].BPM := BPM*4;
+ SetLength(Nuta, 0);
+
// extract notes
for T := 0 to High(ATrack) do begin
// if ATrack[T].Hear then begin
@@ -265,6 +270,27 @@ begin
SetLength(Czesc.Czesc[C].Nuta, 0);
Czesc.Czesc[C].IlNut := 0;
Czesc.Czesc[C].HighNut := -1;
+
+ //Calculate Start of the Last Sentence
+ if (C > 0) and (Nu > 0) then
+ begin
+ Max := Nuta[Nu].Start;
+ Min := Nuta[Nu-1].Start + Nuta[Nu-1].Len;
+
+ case (Max - Min) of
+ 0: Czesc.Czesc[C].Start := Max;
+ 1: Czesc.Czesc[C].Start := Max;
+ 2: Czesc.Czesc[C].Start := Max - 1;
+ 3: Czesc.Czesc[C].Start := Max - 2;
+ else
+ if ((Max - Min) > 4) then
+ Czesc.Czesc[C].Start := Min + 2
+ else
+ Czesc.Czesc[C].Start := Max;
+
+ end; // case
+
+ end;
end;
// tworzy miejsce na nowa nute
@@ -388,7 +414,11 @@ begin
SetLength(Channel, 16);
for T := 0 to 15 do
+ begin
Channel[T].Name := IntToStr(T+1);
+ SetLength(Channel[T].Note, 0);
+ Channel[T].Status := 0;
+ end;
for T := 0 to MidiFile.NumberOfTracks-1 do begin
MidiTrack := MidiFile.GetTrack(T);
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas
index a0adef2c..8a5eaab8 100644
--- a/Game/Code/Screens/UScreenEditSub.pas
+++ b/Game/Code/Screens/UScreenEditSub.pas
@@ -730,8 +730,12 @@ begin
0: S := Max;
1: S := Max;
2: S := Max - 1;
- 3..3: S := Max - 2;
- 4..10000: S := Min + 2; // poczatek + 2
+ 3: S := Max - 2;
+ else
+ if ((Max - Min) > 4) then
+ S := Min + 2
+ else
+ S := Max;
end; // case
Czesci[0].Czesc[C].Start := S;