aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/USong.pas
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-04-06 10:54:07 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-04-06 10:54:07 +0000
commit7ff5648675e396d529686a4a5096812a7972a4ca (patch)
tree405549e85f6eb10c79b44757a6da4e85d6a0a8f5 /Game/Code/Classes/USong.pas
parent30f9cbaa9b36454e68cba0aabe28c42bf7ebfd08 (diff)
downloadusdx-7ff5648675e396d529686a4a5096812a7972a4ca.tar.gz
usdx-7ff5648675e396d529686a4a5096812a7972a4ca.tar.xz
usdx-7ff5648675e396d529686a4a5096812a7972a4ca.zip
Replaced some {-comments with (*-comments to remove nested comments of the same type like: { {} }.
Although delphi and FPC can cope with them, some editors (like lazarus) don't like them and erroneously display everything after the comment as commented out. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1004 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/USong.pas129
1 files changed, 65 insertions, 64 deletions
diff --git a/Game/Code/Classes/USong.pas b/Game/Code/Classes/USong.pas
index 60f5f0bf..9e55671e 100644
--- a/Game/Code/Classes/USong.pas
+++ b/Game/Code/Classes/USong.pas
@@ -503,7 +503,8 @@ begin
end;
end;
-
+}
+(*
//Load TXT Song
function TSong.LoadSong(): boolean;
@@ -729,7 +730,7 @@ begin
Parser := TParser.Create;
- Parser.Settings.DashReplacement := '~';
+ Parser.Settings.DashReplacement := '~';
for Count := 0 to High(Lines) do begin
@@ -747,38 +748,38 @@ begin
//Try to Parse the Song
If Parser.ParseSong(Path + PathDelim + FileName) then
- begin
-// Writeln('XML Inputfile Parsed succesful');
- //Start write parsed information to Song
- //Notes Part
- For I := 0 to High(Parser.SongInfo.Sentences) do
- begin
- //Add Notes
- For J := 0 to High(Parser.SongInfo.Sentences[I].Notes) do
- begin
- Case Parser.SongInfo.Sentences[I].Notes[J].NoteTyp of
- NT_Normal: NoteType := ':';
- NT_Golden: NoteType := '*';
- NT_Freestyle: NoteType := 'F';
- end;
-
- Param1:=Parser.SongInfo.Sentences[I].Notes[J].Start; //Note Start
- Param2:=Parser.SongInfo.Sentences[I].Notes[J].Duration; //Note Duration
- Param3:=Parser.SongInfo.Sentences[I].Notes[J].Tone; //Note Tone
- ParamS:=' ' + Parser.SongInfo.Sentences[I].Notes[J].Lyric; //Note Lyric
-
-
- if not Both then
+ begin
+// Writeln('XML Inputfile Parsed succesful');
+ //Start write parsed information to Song
+ //Notes Part
+ For I := 0 to High(Parser.SongInfo.Sentences) do
+ begin
+ //Add Notes
+ For J := 0 to High(Parser.SongInfo.Sentences[I].Notes) do
+ begin
+ Case Parser.SongInfo.Sentences[I].Notes[J].NoteTyp of
+ NT_Normal: NoteType := ':';
+ NT_Golden: NoteType := '*';
+ NT_Freestyle: NoteType := 'F';
+ end;
+
+ Param1:=Parser.SongInfo.Sentences[I].Notes[J].Start; //Note Start
+ Param2:=Parser.SongInfo.Sentences[I].Notes[J].Duration; //Note Duration
+ Param3:=Parser.SongInfo.Sentences[I].Notes[J].Tone; //Note Tone
+ ParamS:=' ' + Parser.SongInfo.Sentences[I].Notes[J].Lyric; //Note Lyric
+
+
+ if not Both then
// P1
ParseNote(0, NoteType, (Param1+Rel[0]) * Mult, Param2 * Mult, Param3, ParamS)
else begin
// P1 + P2
ParseNote(0, NoteType, (Param1+Rel[0]) * Mult, Param2 * Mult, Param3, ParamS);
ParseNote(1, NoteType, (Param1+Rel[1]) * Mult, Param2 * Mult, Param3, ParamS);
- end;
-
-
- if not Both then
+ end;
+
+
+ if not Both then
begin
Lines[CP].Line[Lines[CP].High].BaseNote := Base[CP];
Lines[CP].Line[Lines[CP].High].LyricWidth := glTextWidth(PChar(Lines[CP].Line[Lines[CP].High].Lyric));
@@ -802,30 +803,30 @@ If Parser.ParseSong(Path + PathDelim + FileName) then
//Total Notes Patch End
end;
end;
-
-
-
- end; //J Forloop
-
- //Add Sentence break
- If (I < High(Parser.SongInfo.Sentences)) then
- begin
-
- SentenceEnd := Parser.SongInfo.Sentences[I].Notes[High(Parser.SongInfo.Sentences[I].Notes)].Start + Parser.SongInfo.Sentences[I].Notes[High(Parser.SongInfo.Sentences[I].Notes)].Duration;
- Rest := Parser.SongInfo.Sentences[I+1].Notes[0].Start - SentenceEnd;
-
- //Calculate Time
- Case Rest of
- 0, 1: Time := Parser.SongInfo.Sentences[I+1].Notes[0].Start;
- 2: Time := Parser.SongInfo.Sentences[I+1].Notes[0].Start - 1;
- 3: Time := Parser.SongInfo.Sentences[I+1].Notes[0].Start - 2;
- else
- If (Rest >= 4) then
- Time := SentenceEnd + 2
- Else //Sentence overlapping :/
- Time := Parser.SongInfo.Sentences[I+1].Notes[0].Start;
- end;
- // new sentence
+
+
+
+ end; //J Forloop
+
+ //Add Sentence break
+ If (I < High(Parser.SongInfo.Sentences)) then
+ begin
+
+ SentenceEnd := Parser.SongInfo.Sentences[I].Notes[High(Parser.SongInfo.Sentences[I].Notes)].Start + Parser.SongInfo.Sentences[I].Notes[High(Parser.SongInfo.Sentences[I].Notes)].Duration;
+ Rest := Parser.SongInfo.Sentences[I+1].Notes[0].Start - SentenceEnd;
+
+ //Calculate Time
+ Case Rest of
+ 0, 1: Time := Parser.SongInfo.Sentences[I+1].Notes[0].Start;
+ 2: Time := Parser.SongInfo.Sentences[I+1].Notes[0].Start - 1;
+ 3: Time := Parser.SongInfo.Sentences[I+1].Notes[0].Start - 2;
+ else
+ If (Rest >= 4) then
+ Time := SentenceEnd + 2
+ Else //Sentence overlapping :/
+ Time := Parser.SongInfo.Sentences[I+1].Notes[0].Start;
+ end;
+ // new sentence
if not Both then
// P1
NewSentence(0, (Time + Rel[0]) * Mult, Param2)
@@ -833,19 +834,19 @@ If Parser.ParseSong(Path + PathDelim + FileName) then
// P1 + P2
NewSentence(0, (Time + Rel[0]) * Mult, Param2);
NewSentence(1, (Time + Rel[1]) * Mult, Param2);
- end;
-
- end;
- end;
+ end;
+
+ end;
+ end;
//End write parsed information to Song
Parser.Free;
- end
- else
- begin
- Log.LogError('Could not parse Inputfile: ' + Path + PathDelim + FileName);
- exit;
- end;
-
+ end
+ else
+ begin
+ Log.LogError('Could not parse Inputfile: ' + Path + PathDelim + FileName);
+ exit;
+ end;
+
for Count := 0 to High(Lines) do begin
Lines[Count].Line[High(Lines[Count].Line)].LastLine := True;
end;
@@ -1232,6 +1233,6 @@ begin
//Read Header
Result := self.ReadXMLHeader( FileName );
-end; }
+end; *)
end.