diff options
author | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-10-30 11:22:25 +0000 |
---|---|---|
committer | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-10-30 11:22:25 +0000 |
commit | a7d0970a2e7dec907fccbc2d63ffb5cb799a7505 (patch) | |
tree | 71dda6083f7a032585010f842a2d44135c5f4168 /Game/Code | |
parent | f3c351b423c1a3439d64c7ed7e3c66a3af0ca36b (diff) | |
download | usdx-a7d0970a2e7dec907fccbc2d63ffb5cb799a7505.tar.gz usdx-a7d0970a2e7dec907fccbc2d63ffb5cb799a7505.tar.xz usdx-a7d0970a2e7dec907fccbc2d63ffb5cb799a7505.zip |
- correct drawing of short notes in 4/6-player mode on one screen
- rimshot022b.mp3 + 15db
- changed fonts: higher resolution esp. for medley countdown
- some other bugfixes and corrections
- update of installer files
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2699 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code')
-rw-r--r-- | Game/Code/Classes/TextGL.pas | 485 | ||||
-rw-r--r-- | Game/Code/Classes/UDraw.pas | 100 | ||||
-rw-r--r-- | Game/Code/Classes/UFiles.pas | 9 | ||||
-rw-r--r-- | Game/Code/Classes/UGraphicClasses.pas | 27 | ||||
-rw-r--r-- | Game/Code/Classes/UIni.pas | 2 | ||||
-rw-r--r-- | Game/Code/Classes/UTexture.pas | 21 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenCredits.pas | 12 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenEditSub.pas | 25 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSing.pas | 21 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSong.pas | 9 | ||||
-rw-r--r-- | Game/Code/UltraStar.bdsproj | 3 | ||||
-rw-r--r-- | Game/Code/UltraStar.dpr | 2 |
12 files changed, 489 insertions, 227 deletions
diff --git a/Game/Code/Classes/TextGL.pas b/Game/Code/Classes/TextGL.pas index ee8187ad..7bb9699d 100644 --- a/Game/Code/Classes/TextGL.pas +++ b/Game/Code/Classes/TextGL.pas @@ -19,6 +19,18 @@ procedure SetFontItalic(Enable: boolean); // sets italic type letter (works for procedure SetFontAspectW(Aspect: real);
type
+ TChar = record
+ id: integer;
+ x: integer;
+ y: integer;
+ width: integer;
+ height: integer;
+ xOffset: integer;
+ yOffset: integer;
+ xAdvance: integer;
+ page: integer;
+ end;
+
TTextGL = record
X: real;
Y: real;
@@ -30,15 +42,24 @@ type end;
TFont = record
- Tex: TTexture;
- Width: array[0..255] of byte;
- AspectW: real;
- Centered: boolean;
+ Tex: array of TTexture;
+ Chars: array of TChar;
+ IDs: array of integer;
+ TexSize: integer;
+ Size: integer;
Done: real;
- Outline: real;
+ AspectW: real;
+ AspectH: real;
+ Bold: boolean;
Italic: boolean;
+ lineH: integer;
+ base: integer;
+ X, Y: real;
+ W, H: real;
end;
+const
+ SCALE = 28;
var
base: GLuint; // Base Display List For The Font Set
@@ -50,79 +71,240 @@ var implementation
-uses UMain, Windows, SysUtils, UGraphic;
+uses UMain, Windows, SysUtils, UGraphic, UFiles;
procedure BuildFont; // Build Our Bitmap Font
var
- Rejestr: TResourceStream;
- Pet: integer;
-begin
- ActFont := 0;
-
- SetLength(Fonts, 5);
- Fonts[0].Tex := Texture.LoadTexture(true, 'Font', 'PNG', 'Font', 0);
- Fonts[0].Tex.H := 30;
- Fonts[0].AspectW := 0.9;
- Fonts[0].Done := -1;
- Fonts[0].Outline := 0;
-
- Fonts[1].Tex := Texture.LoadTexture(true, 'FontB', 'PNG', 'Font', 0);
- Fonts[1].Tex.H := 30;
- Fonts[1].AspectW := 1;
- Fonts[1].Done := -1;
- Fonts[1].Outline := 0;
-
- Fonts[2].Tex := Texture.LoadTexture(true, 'FontO', 'PNG', 'Font Outline', 0);
- Fonts[2].Tex.H := 30;
- Fonts[2].AspectW := 0.95;
- Fonts[2].Done := -1;
- Fonts[2].Outline := 5;
-
- Fonts[3].Tex := Texture.LoadTexture(true, 'FontO2', 'PNG', 'Font Outline 2', 0);
- Fonts[3].Tex.H := 30;
- Fonts[3].AspectW := 0.95;
- Fonts[3].Done := -1;
- Fonts[3].Outline := 4;
-
-{ Fonts[4].Tex := Texture.LoadTexture('FontO', 'BMP', 'Arrow', 0); // for score screen
- Fonts[4].Tex.H := 30;
- Fonts[4].AspectW := 0.95;
- Fonts[4].Done := -1;
- Fonts[4].Outline := 5;}
-
-
- Rejestr := TResourceStream.Create(HInstance, 'Font', 'FNT');
- Rejestr.Read(Fonts[0].Width, 256);
- Rejestr.Free;
-
- Rejestr := TResourceStream.Create(HInstance, 'FontB', 'FNT');
- Rejestr.Read(Fonts[1].Width, 256);
- Rejestr.Free;
-
- Rejestr := TResourceStream.Create(HInstance, 'FontO', 'FNT');
- Rejestr.Read(Fonts[2].Width, 256);
- Rejestr.Free;
-
- Rejestr := TResourceStream.Create(HInstance, 'FontO2', 'FNT');
- Rejestr.Read(Fonts[3].Width, 256);
- Rejestr.Free;
-
-{ Rejestr := TResourceStream.Create(HInstance, 'FontO', 'FNT');
- Rejestr.Read(Fonts[4].Width, 256);
- Rejestr.Free;}
-
- for Pet := 0 to 255 do
- Fonts[1].Width[Pet] := Fonts[1].Width[Pet] div 2;
+ I: integer;
+ FontFiles: array of string;
+
+ procedure ReadFontFile(num: integer);
+ var
+ Line: string;
+ Fractal: string;
+ FontFile: TextFile;
+ Position: word;
+ id: integer;
+ idstr: string;
+ len: integer;
+ I: integer;
+ Ident: string;
+ maxID: integer;
+
+ begin
+ maxID := 0;
+ AssignFile(FontFile, FontPath + FontFiles[num]);
+ Reset(FontFile);
+
+ ReadLn(FontFile, Line);
+ While (Length(Line) <> 0) do
+ begin
+ Position := Pos(' ', Line);
+ Ident := Trim(Copy(Line, 1, Position - 1));
+ Fractal := Trim(Copy(Line, Position + 1, Length(Line) - Position));
+
+ if (Ident='info') then
+ begin
+ //face
+
+ //size
+ Position := Pos('size=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 5, Length(Fractal) - Position - 4));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].size);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //bold
+
+ //italic
+
+ //charset
+
+ //unicode
+
+ //stretchH
+
+ //smooth
+
+ //aa
+
+ //padding
+
+ //spacing
+
+ //outline
+ end
+
+ else if (Ident='common') then
+ begin
+ //lineHeight
+ Position := Pos('lineHeight=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 11, Length(Fractal) - Position - 10));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].lineH);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //base
+ Position := Pos('base=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 5, Length(Fractal) - Position - 4));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].base);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //scaleW (TexSize)
+ Position := Pos('scaleW=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 7, Length(Fractal) - Position - 6));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].TexSize);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //scaleH
+ end
+
+ else if (Ident='page') then
+ begin
+ len := Length(Fonts[num].Tex);
+ SetLength(Fonts[num].Tex, len+1);
+
+ //id
+ Position := Pos('id=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 3, Length(Fractal) - Position - 2));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), id);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //file
+ Position := Pos('file="', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 6, Length(Fractal) - Position - 5));
+ Position := Pos('"', Fractal);
+ idstr := Trim(Copy(Fractal, 1, Position - 1));
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ if (num<2) then
+ Fonts[num].Tex[len] := Texture.LoadTexture(false, PChar(FontPath + idstr), 'PNG', 'Font', 0)
+ else
+ Fonts[num].Tex[len] := Texture.LoadTexture(false, PChar(FontPath + idstr), 'PNG', 'Font Outline', 0);
+ end
+
+ else if (Ident='chars') then
+ begin
+ end
+
+ else if (Ident='char') then
+ begin
+ len := Length(Fonts[num].Chars);
+ SetLength(Fonts[num].Chars, len+1);
+
+ //id
+ Position := Pos('id=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 3, Length(Fractal) - Position - 2));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].Chars[len].id);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ if (maxID < Fonts[num].Chars[len].id) then
+ maxID := Fonts[num].Chars[len].id;
+
+ //x
+ Position := Pos('x=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 2, Length(Fractal) - Position - 1));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].Chars[len].x);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //y
+ Position := Pos('y=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 2, Length(Fractal) - Position - 1));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].Chars[len].y);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //width
+ Position := Pos('width=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 6, Length(Fractal) - Position - 5));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].Chars[len].width);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //height
+ Position := Pos('height=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 7, Length(Fractal) - Position - 6));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].Chars[len].height);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //xoffset
+ Position := Pos('xoffset=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 8, Length(Fractal) - Position - 7));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].Chars[len].xOffset);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //yoffset
+ Position := Pos('yoffset=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 8, Length(Fractal) - Position - 7));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].Chars[len].yOffset);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //xadvance
+ Position := Pos('xadvance=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 9, Length(Fractal) - Position - 8));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].Chars[len].xAdvance);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //page
+ Position := Pos('page=', Fractal);
+ Fractal := Trim(Copy(Fractal, Position + 5, Length(Fractal) - Position - 4));
+ Position := Pos(' ', Fractal);
+ TryStrtoInt(Trim(Copy(Fractal, 1, Position - 1)), Fonts[num].Chars[len].page);
+ Fractal := Trim(Copy(Fractal, Position + 1, Length(Fractal) - Position));
+
+ //chnl
+ end
+
+ else if (Ident='kernings') then
+ begin
+ end
+
+ else if (Ident='kerning') then
+ begin
+ end;
+
+ if not EOf(FontFile) then
+ ReadLn (FontFile, Line)
+ else
+ break;
+ end;
- for Pet := 0 to 255 do
- Fonts[2].Width[Pet] := Fonts[2].Width[Pet] div 2 + 2;
+ CloseFile(FontFile);
- for Pet := 0 to 255 do
- Fonts[3].Width[Pet] := Fonts[3].Width[Pet] + 1;
+ SetLength(Fonts[num].IDs, maxID+1);
+ for I := 0 to Length(Fonts[num].Chars) - 1 do
+ begin
+ Fonts[num].IDs[Fonts[num].Chars[I].id] := I;
+ end;
+ end;
-{ for Pet := 0 to 255 do
- Fonts[4].Width[Pet] := Fonts[4].Width[Pet] div 2 + 2;}
+begin
+ ActFont := 0;
+ SetLength(FontFiles, 5);
+ FontFiles[0] := 'Normal.fnt';
+ FontFiles[1] := 'Bold.fnt';
+ FontFiles[2] := 'FontO.fnt';
+ FontFiles[3] := 'FontO2.fnt';
+ FontFiles[4] := 'HighResNumbersO.fnt';
+ SetLength(Fonts, 5);
+ for I := 0 to Length(FontFiles) - 1 do
+ begin
+ Fonts[I].Done := -1;
+ Fonts[I].AspectW := 1.0;
+ Fonts[I].AspectH := 1.0;
+ Fonts[I].H := 30;
+ ReadFontFile(I);
+ end;
end;
procedure KillFont; // Delete The Font
@@ -134,13 +316,14 @@ function glTextWidth(text: pchar): real; var
Letter: char;
begin
-// Log.LogStatus(Text, 'glTextWidth');
Result := 0;
- while (length(text) > 0) do begin
+ while (length(text) > 0) do
+ begin
Letter := Text[0];
text := pchar(Copy(text, 2, Length(text)-1));
- Result := Result + Fonts[ActFont].Width[Ord(Letter)] * Fonts[ActFont].Tex.H / 30 * Fonts[ActFont].AspectW;
- end; // while
+ Result := Result + Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].xAdvance *
+ (Fonts[ActFont].H/30) * Fonts[ActFont].AspectW * SCALE/Fonts[ActFont].lineH;
+ end;
end;
procedure glPrintDone(text: pchar; Done: real; ColR, ColG, ColB, Alpha: real);
@@ -155,104 +338,107 @@ end; procedure glPrintLetter(Letter: char);
var
- TexX, TexY: real;
- TexR, TexB: real;
- FWidth: real;
- PL, PT: real;
- PR, PB: real;
XItal: real; // X shift for italic type letter
+ gXO, gYO: real;
+ gX, gY: real;
+ gW, gH: real;
+ tW, tH: real;
+ fW, fH: real;
begin
- with Fonts[ActFont].Tex do begin
- FWidth := Fonts[ActFont].Width[Ord(Letter)];
-
- W := FWidth * (H/30) * Fonts[ActFont].AspectW;
-// H := 30;
-
- // set texture positions
- TexX := (ord(Letter) mod 16) * 1/16 + 1/32 - FWidth/1024 - Fonts[ActFont].Outline/1024;
- TexY := (ord(Letter) div 16) * 1/16 + 2/1024; // 2/1024
- TexR := (ord(Letter) mod 16) * 1/16 + 1/32 + FWidth/1024 + Fonts[ActFont].Outline/1024;
- TexB := (1 + ord(Letter) div 16) * 1/16 - 2/1024;
-
- // set vector positions
- PL := X - Fonts[ActFont].Outline * (H/30) * Fonts[ActFont].AspectW /2;
- PT := Y;
- PR := PL + W + Fonts[ActFont].Outline * (H/30) * Fonts[ActFont].AspectW;
- PB := PT + H;
+ fW := Fonts[ActFont].H/30 * Fonts[ActFont].AspectW * SCALE/Fonts[ActFont].lineH;
+ fH := Fonts[ActFont].H/30 * Fonts[ActFont].AspectH * SCALE/Fonts[ActFont].lineH;
+
+ tW := Fonts[ActFont].TexSize;
+ tH := Fonts[ActFont].TexSize;
+
+ gX := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].x;
+ gY := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].y;
+ gW := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].width;
+ gH := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].height;
+ gXO := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].xOffset * fW;
+ gYO := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].yOffset * fH +
+ Fonts[ActFont].H/30 * 2.5;
+
if Fonts[ActFont].Italic = false then
XItal := 0
else
- XItal := 12;
+ XItal := fH*gH*0.3;
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glBindTexture(GL_TEXTURE_2D, TexNum);
+ glBindTexture(GL_TEXTURE_2D, Fonts[ActFont].Tex[Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].page].TexNum);
glBegin(GL_QUADS);
- glTexCoord2f(TexX, TexY); glVertex2f(PL+XItal, PT);
- glTexCoord2f(TexX, TexB); glVertex2f(PL, PB);
- glTexCoord2f(TexR, TexB); glVertex2f(PR, PB);
- glTexCoord2f(TexR, TexY); glVertex2f(PR+XItal, PT);
+ glTexCoord2f(gX/tW, gY/tH);
+ glVertex2f(Fonts[ActFont].X + gXO + XItal, Fonts[ActFont].Y + gYO);
+
+ glTexCoord2f((gX+gW)/tW, gY/tH);
+ glVertex2f(Fonts[ActFont].X + gW*fW + gXO + XItal, Fonts[ActFont].Y + gYO);
+
+ glTexCoord2f((gX+gW)/tW, (gY+gH)/tH);
+ glVertex2f(Fonts[ActFont].X + gW*fW + gXO, Fonts[ActFont].Y + gH*fH + gYO);
+
+ glTexCoord2f(gX/tW, (gY+gH)/tH);
+ glVertex2f(Fonts[ActFont].X + gXO, Fonts[ActFont].Y + gH*fH + gYO);
glEnd;
- X := X + W;
+ Fonts[ActFont].X := Fonts[ActFont].X + Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].xAdvance * fW;
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
- end; // with
end;
procedure glPrintLetterCut(letter: char; Start, Finish: real);
var
- TexX, TexY: real;
- TexR, TexB: real;
- TexTemp: real;
- FWidth: real;
- PL, PT: real;
- PR, PB: real;
- OutTemp: real;
+ gXO, gYO: real;
+ gX, gY: real;
+ gW, gH: real;
+ tW, tH: real;
+ fW, fH: real;
+ TexR: real;
XItal: real;
+
begin
- with Fonts[ActFont].Tex do begin
- FWidth := Fonts[ActFont].Width[Ord(Letter)];
-
- W := FWidth * (H/30) * Fonts[ActFont].AspectW;
-// H := 30;
- OutTemp := Fonts[ActFont].Outline * (H/30) * Fonts[ActFont].AspectW;
-
- // set texture positions
- TexX := (ord(Letter) mod 16) * 1/16 + 1/32 - FWidth/1024 - Fonts[ActFont].Outline/1024;
- TexY := (ord(Letter) div 16) * 1/16 + 2/1024; // 2/1024
- TexR := (ord(Letter) mod 16) * 1/16 + 1/32 + FWidth/1024 + Fonts[ActFont].Outline/1024;
- TexB := (1 + ord(Letter) div 16) * 1/16 - 2/1024;
-
- TexTemp := TexX + Start * (TexR - TexX);
- TexR := TexX + Finish * (TexR - TexX);
- TexX := TexTemp;
-
- // set vector positions
- PL := X - OutTemp / 2 + OutTemp * Start;
- PT := Y;
- PR := PL + (W + OutTemp) * (Finish - Start);
- PB := PT + H;
+ fW := Fonts[ActFont].H/30 * Fonts[ActFont].AspectW * SCALE/Fonts[ActFont].lineH;
+ fH := Fonts[ActFont].H/30 * Fonts[ActFont].AspectH * SCALE/Fonts[ActFont].lineH;
+
+ tW := Fonts[ActFont].TexSize;
+ tH := Fonts[ActFont].TexSize;
+
+ gX := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].x;
+ gY := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].y;
+ gW := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].width;
+ gH := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].height;
+ gXO := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].xOffset * fW;
+ gYO := Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].yOffset * fH +
+ Fonts[ActFont].H/30 * 2.5;
+
+ TexR := gX + Finish * gW;
+ gX := gX + Start * gW;
+
if Fonts[ActFont].Italic = false then
XItal := 0
else
- XItal := 12;
+ XItal := fH*gH*0.3;
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glBindTexture(GL_TEXTURE_2D, TexNum);
+ glBindTexture(GL_TEXTURE_2D, Fonts[ActFont].Tex[Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].page].TexNum);
glBegin(GL_QUADS);
- glTexCoord2f(TexX, TexY); glVertex2f(PL+XItal, PT);
- glTexCoord2f(TexX, TexB); glVertex2f(PL, PB);
- glTexCoord2f(TexR, TexB); glVertex2f(PR, PB);
- glTexCoord2f(TexR, TexY); glVertex2f(PR+XItal, PT); // not tested with XItal
+ glTexCoord2f(gX/tW, gY/tH);
+ glVertex2f(Fonts[ActFont].X + gXO + XItal, Fonts[ActFont].Y + gYO);
+
+ glTexCoord2f(TexR/tW, gY/tH);
+ glVertex2f(Fonts[ActFont].X + gXO + gW*fW*(Finish-Start) + XItal, Fonts[ActFont].Y + gYO);
+
+ glTexCoord2f(TexR/tW, (gY+gH)/tH);
+ glVertex2f(Fonts[ActFont].X + gXO + gW*fW*(Finish-Start), Fonts[ActFont].Y + gH*fH + gYO);
+
+ glTexCoord2f(gX/tW, (gY+gH)/tH);
+ glVertex2f(Fonts[ActFont].X + gXO, Fonts[ActFont].Y + gH*fH + gYO);
glEnd;
- X := X + W * (Finish - Start);
+ Fonts[ActFont].X := Fonts[ActFont].X + gW*fW*(Finish-Start);
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
- end; // with
-
end;
procedure glPrint(text: pchar); // Custom GL "Print" Routine
@@ -279,6 +465,7 @@ var PTotWidth: real;
PDoingNow: real;
S: string;
+ lastX: real;
begin
if (Text = '') then // If There's No Text
Exit; // Do Nothing
@@ -299,10 +486,14 @@ begin if (PToDo > 0) and (PDoingNow <= PToDo) then
glPrintLetter(Letter);
- if (PToDo > 0) and (PDoingNow > PToDo) then begin
+ if (PToDo > 0) and (PDoingNow > PToDo) then
+ begin
+ lastX := Fonts[ActFont].X;
glPrintLetterCut(Letter, 0, PToDo / PDoingNow);
glColor4f(PColR, PColG, PColB, Alpha);
glPrintLetterCut(Letter, PToDo / PDoingNow, 1);
+ Fonts[ActFont].X := lastX + Fonts[ActFont].Chars[Fonts[ActFont].IDs[Ord(Letter)]].xAdvance *
+ (Fonts[ActFont].H/30) * Fonts[ActFont].AspectW * SCALE/Fonts[ActFont].lineH;
end;
if (PToDo <= 0) then
@@ -316,13 +507,13 @@ end; procedure SetFontPos(X, Y: real);
begin
- Fonts[ActFont].Tex.X := X;
- Fonts[ActFont].Tex.Y := Y;
+ Fonts[ActFont].X := X;
+ Fonts[ActFont].Y := Y;
end;
procedure SetFontSize(Size: real);
begin
- Fonts[ActFont].Tex.H := 30 * (Size/10);
+ Fonts[ActFont].H := 30 * (Size/10);
end;
procedure SetFontStyle(Style: integer);
diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index 162164d6..9fa0a4f7 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -100,7 +100,7 @@ var begin
if ScreenSing.Tex_Background.TexNum >= 1 then
begin
-
+ exit;
glClearColor (1, 1, 1, 1);
glColor4f (1, 1, 1, 1);
@@ -261,6 +261,7 @@ var CP: integer;
end_: integer;
st: integer;
+ nW: real;
begin
CP := NrCzesci;
if (Length(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta)=0) then
@@ -277,12 +278,17 @@ begin glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
TempR := (Right-Left) / (end_ - st);
+
with Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt] do
begin
for Pet := 0 to HighNut do
begin
with Nuta[Pet] do
begin
+ nW := NotesW;
+ if ( 1 + 2*NotesW >Dlugosc * TempR ) then
+ nW := TempR/2;
+
if not FreeStyle then
begin
if Ini.EffectSing = 0 then
@@ -297,8 +303,8 @@ begin glColor4f(1, 1, 1, 0.85*Alpha);
// lewa czesc - left part
- Rec.Left := (Start-st) * TempR + Left + 0.5 + 10*ScreenX;
- Rec.Right := Rec.Left + NotesW;
+ Rec.Left := (Start-st) * TempR + Left + 0.5 {+ 10*ScreenX};
+ Rec.Right := Rec.Left + nW;
Rec.Top := Top - (Ton-BaseNote)*Space/2 - NotesH;
Rec.Bottom := Rec.Top + 2 * NotesH;
glBindTexture(GL_TEXTURE_2D, Tex_Left[Color].TexNum);
@@ -315,19 +321,22 @@ begin // srodkowa czesc - middle part
Rec.Left := Rec.Right;
- Rec.Right := (Start+Dlugosc-st) * TempR + Left - NotesW - 0.5 + 10*ScreenX;
-
- glBindTexture(GL_TEXTURE_2D, Tex_Mid[Color].TexNum);
- glBegin(GL_QUADS);
- glTexCoord2f(0, 0); glVertex2f(Rec.Left, Rec.Top);
- glTexCoord2f(0, 1); glVertex2f(Rec.Left, Rec.Bottom);
- glTexCoord2f(1, 1); glVertex2f(Rec.Right, Rec.Bottom);
- glTexCoord2f(1, 0); glVertex2f(Rec.Right, Rec.Top);
- glEnd;
+ Rec.Right := (Start+Dlugosc-st) * TempR + Left - nW - 0.5 {+ 10*ScreenX};
+ if (nW=NotesW) then
+ begin
+ glBindTexture(GL_TEXTURE_2D, Tex_Mid[Color].TexNum);
+ glBegin(GL_QUADS);
+ glTexCoord2f(0, 0); glVertex2f(Rec.Left, Rec.Top);
+ glTexCoord2f(0, 1); glVertex2f(Rec.Left, Rec.Bottom);
+ glTexCoord2f(1, 1); glVertex2f(Rec.Right, Rec.Bottom);
+ glTexCoord2f(1, 0); glVertex2f(Rec.Right, Rec.Top);
+ glEnd;
+ end;
+
// prawa czesc - right part
Rec.Left := Rec.Right;
- Rec.Right := Rec.Right + NotesW;
+ Rec.Right := Rec.Right + nW;
glBindTexture(GL_TEXTURE_2D, Tex_Right[Color].TexNum);
glBegin(GL_QUADS);
@@ -362,6 +371,7 @@ var NotesH2: real;
end_: integer;
st: integer;
+ nW: real;
begin
if (Length(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta)=0) then
Exit
@@ -381,9 +391,13 @@ begin begin
with Player[NrGracza].Nuta[N] do
begin
+ nW := NotesW;
+ if ( 1 + 2*NotesW >Dlugosc * TempR ) then
+ nW := TempR/2;
+
// lewa czesc
- Rec.Left := X + (Start-st) * TempR + 0.5 + 10*ScreenX;
- Rec.Right := Rec.Left + NotesW;
+ Rec.Left := X + (Start-st) * TempR + 0.5 {+ 10*ScreenX};
+ Rec.Right := Rec.Left + nW;
// Half size Notes Patch
if Hit then
@@ -408,24 +422,27 @@ begin // srodkowa czesc
Rec.Left := Rec.Right;
- Rec.Right := X + (Start+Dlugosc-st) * TempR - NotesW - 0.5 + 10*ScreenX;
+ Rec.Right := X + (Start+Dlugosc-st) * TempR - nW - 0.5 { + 10*ScreenX};
// (nowe)
if (Start+Dlugosc-1 = Czas.AktBeatD) then
Rec.Right := Rec.Right - (1-Frac(Czas.MidBeatD)) * TempR;
if Rec.Right <= Rec.Left then Rec.Right := Rec.Left;
- glBindTexture(GL_TEXTURE_2D, Tex_Mid[NrGracza+1].TexNum);
- glBegin(GL_QUADS);
- glTexCoord2f(0, 0); glVertex2f(Rec.Left, Rec.Top);
- glTexCoord2f(0, 1); glVertex2f(Rec.Left, Rec.Bottom);
- glTexCoord2f(1, 1); glVertex2f(Rec.Right, Rec.Bottom);
- glTexCoord2f(1, 0); glVertex2f(Rec.Right, Rec.Top);
- glEnd;
+ if (nW=NotesW) then
+ begin
+ glBindTexture(GL_TEXTURE_2D, Tex_Mid[NrGracza+1].TexNum);
+ glBegin(GL_QUADS);
+ glTexCoord2f(0, 0); glVertex2f(Rec.Left, Rec.Top);
+ glTexCoord2f(0, 1); glVertex2f(Rec.Left, Rec.Bottom);
+ glTexCoord2f(1, 1); glVertex2f(Rec.Right, Rec.Bottom);
+ glTexCoord2f(1, 0); glVertex2f(Rec.Right, Rec.Top);
+ glEnd;
+ end;
// prawa czesc
Rec.Left := Rec.Right;
- Rec.Right := Rec.Right + NotesW;
+ Rec.Right := Rec.Right + nW;
glBindTexture(GL_TEXTURE_2D, Tex_Right[NrGracza+1].TexNum);
glBegin(GL_QUADS);
@@ -463,6 +480,7 @@ var CP: integer;
end_: integer;
st: integer;
+ nW: real;
begin
if (Player[NrGracza].ScoreTotalI >= 0) then
begin
@@ -499,17 +517,21 @@ begin begin
if not FreeStyle then
begin
+ nW := NotesW;
+ if ( 1 + 2*NotesW >Dlugosc * TempR ) then
+ nW := TempR/2;
+
// begin: 14, 20
// easy: 6, 11
- W := NotesW * 2 + 2;
+ W := nW * 2 + 2;
H := NotesH * 1.5 + 3.5;
-
- X2 := (Start-st) * TempR + Left + 0.5 + 10*ScreenX + 4; // wciecie
+
+ X2 := (Start-st) * TempR + Left + 0.5 {+ 10*ScreenX} + 4; // wciecie
X1 := X2-W;
- X3 := (Start+Dlugosc-st) * TempR + Left - 0.5 + 10*ScreenX - 4; // wciecie
+ X3 := (Start+Dlugosc-st) * TempR + Left - 0.5 {+ 10*ScreenX} - 4; // wciecie
X4 := X3+W;
-
+
// left
Rec.Left := X1;
Rec.Right := X2;
@@ -528,15 +550,17 @@ begin // srodkowa czesc
Rec.Left := X2;
Rec.Right := X3;
-
- glBindTexture(GL_TEXTURE_2D, Tex_BG_Mid[NrGracza+1].TexNum);
- glBegin(GL_QUADS);
- glTexCoord2f(0, 0); glVertex2f(Rec.Left, Rec.Top);
- glTexCoord2f(0, 1); glVertex2f(Rec.Left, Rec.Bottom);
- glTexCoord2f(1, 1); glVertex2f(Rec.Right, Rec.Bottom);
- glTexCoord2f(1, 0); glVertex2f(Rec.Right, Rec.Top);
- glEnd;
-
+ if (nW=NotesW) then
+ begin
+ glBindTexture(GL_TEXTURE_2D, Tex_BG_Mid[NrGracza+1].TexNum);
+ glBegin(GL_QUADS);
+ glTexCoord2f(0, 0); glVertex2f(Rec.Left, Rec.Top);
+ glTexCoord2f(0, 1); glVertex2f(Rec.Left, Rec.Bottom);
+ glTexCoord2f(1, 1); glVertex2f(Rec.Right, Rec.Bottom);
+ glTexCoord2f(1, 0); glVertex2f(Rec.Right, Rec.Top);
+ glEnd;
+ end;
+
// prawa czesc
Rec.Left := X3;
Rec.Right := X4;
diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas index ebeb1314..93e745e5 100644 --- a/Game/Code/Classes/UFiles.pas +++ b/Game/Code/Classes/UFiles.pas @@ -55,6 +55,7 @@ var PlayListPath: string;
RecordingsPath: string;
SessionLogPath: string;
+ FontPath: string;
SongFile: TextFile; // all procedures in this unit operates on this file
FileLineNo: integer; //Line which is readed at Last, for error reporting
@@ -91,6 +92,7 @@ begin PlaylistPath := GamePath + 'Playlists\';
RecordingsPath := GamePath + 'Recordings\';
SessionLogPath := GamePath + 'SessionLog\';
+ FontPath := GamePath + 'Fonts\';
Writeable := true;
@@ -125,6 +127,9 @@ begin If Writeable And (not DirectoryExists(SessionLogPath)) then
Writeable := ForceDirectories(SessionLogPath);
+ If Writeable And (not DirectoryExists(FontPath)) then
+ Writeable := ForceDirectories(FontPath);
+
if not Writeable then
Log.LogError('Error: Dir is Readonly');
@@ -1334,7 +1339,7 @@ begin begin
for J := I+1 to num_lines - 1 do
begin
- if sentences[I]=sentences[J] then
+ if (sentences[I]<>'') and (sentences[I]=sentences[J]) then
begin
temp_series.start := I;
temp_series.end_ := I;
@@ -1346,7 +1351,7 @@ begin for K := 1 to max do
begin
- if sentences[I+K]=sentences[J+K] then
+ if (sentences[I+K]<>'') and (sentences[I+K]=sentences[J+K]) then
temp_series.end_ := I+K
else
break;
diff --git a/Game/Code/Classes/UGraphicClasses.pas b/Game/Code/Classes/UGraphicClasses.pas index d9aeb227..6f192af6 100644 --- a/Game/Code/Classes/UGraphicClasses.pas +++ b/Game/Code/Classes/UGraphicClasses.pas @@ -305,27 +305,32 @@ end; procedure TParticle.Draw(Alph: TAlpha);
var L: Cardinal;
begin
- if ScreenAct = Screen then
+ if (ScreenAct = Screen) then
+ begin
// this draws (multiple) texture(s) of our particle
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, Tex);
+
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+
for L:=0 to High(Col) do
begin
glColor4f(Col[L].r, Col[L].g, Col[L].b, Alpha*Alph[CP]);
- glBindTexture(GL_TEXTURE_2D, Tex);
- glEnable(GL_TEXTURE_2D);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- begin
- glBegin(GL_QUADS);
+ glBegin(GL_QUADS);
glTexCoord2f((1/16) * Frame, 0); glVertex2f(X-W*Scale[L]*SizeMod, Y-H*Scale[L]*SizeMod);
glTexCoord2f((1/16) * Frame + (1/16), 0); glVertex2f(X-W*Scale[L]*SizeMod, Y+H*Scale[L]*SizeMod);
glTexCoord2f((1/16) * Frame + (1/16), 1); glVertex2f(X+W*Scale[L]*SizeMod, Y+H*Scale[L]*SizeMod);
glTexCoord2f((1/16) * Frame, 1); glVertex2f(X+W*Scale[L]*SizeMod, Y-H*Scale[L]*SizeMod);
- glEnd;
- end;
+ glEnd;
end;
- glcolor4f(1,1,1,1);
+
+ glDisable(GL_BLEND);
+ glDisable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glcolor4f(1,1,1,1);
+ end;
end;
// end of TParticle
diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas index 66bfba26..46137de8 100644 --- a/Game/Code/Classes/UIni.pas +++ b/Game/Code/Classes/UIni.pas @@ -294,7 +294,7 @@ begin if Tekst = INewPartyPoints[Pet] then Ini.NewPartyPoints := Pet;
// ShowCredits
- Tekst := IniFile.ReadString('Game', 'ShowCredits', IShowCredits[1]);
+ Tekst := IniFile.ReadString('Game', 'ShowCredits', IShowCredits[0]);
for Pet := 0 to High(IShowCredits) do
if Tekst = IShowCredits[Pet] then Ini.ShowCredits := Pet;
diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas index d7d3e690..cd39dd2f 100644 --- a/Game/Code/Classes/UTexture.pas +++ b/Game/Code/Classes/UTexture.pas @@ -73,6 +73,9 @@ type procedure UnloadTexture(Name: string; FromCache: boolean);
end;
+const
+ max = 2048;
+
var
Texture: TTextureUnit;
TextureDatabase: TTextureDatabase;
@@ -99,11 +102,11 @@ var TexFitW: integer;
TexFitH: integer; // new for limit
- TextureD8: array[1..1024*1024] of byte; // 1MB
- TextureD16: array[1..1024*1024, 1..2] of byte; // luminance/alpha tex (2MB)
- TextureD24: array[1..1024*1024, 1..3] of byte; // normal 24-bit tex (3MB)
+ TextureD8: array[1..max*max] of byte; // 1MB
+ TextureD16: array[1..max*max, 1..2] of byte; // luminance/alpha tex (2MB)
+ TextureD24: array[1..max*max, 1..3] of byte; // normal 24-bit tex (3MB)
TextureD242: array[1..512*512, 1..3] of byte; // normal 24-bit tex (0,75MB)
- TextureD32: array[1..1024*1024, 1..4] of byte; // transparent 32-bit tex (4MB)
+ TextureD32: array[1..max*max, 1..4] of byte; // transparent 32-bit tex (4MB)
// total 40MB at 2048*2048
// total 10MB at 1024*1024
@@ -245,7 +248,8 @@ begin TextureJ.Free;
end
- else if Format = 'PNG' then begin
+ else if Format = 'PNG' then
+ begin
TexturePNG := TPNGObject.Create;
if FromRegistry then TexturePNG.LoadFromStream(Res)
else begin
@@ -281,7 +285,7 @@ begin if FromRegistry then Res.Free;
- if (TextureB.Width > 1024) or (TextureB.Height > 1024) then begin // will be fixed in 0.5.1 and dynamically extended to 8192x8192 depending on the driver
+ if (TextureB.Width > max) or (TextureB.Height > max) then begin // will be fixed in 0.5.1 and dynamically extended to 8192x8192 depending on the driver
Log.LogError('Image ' + Nazwa + ' is too big (' + IntToStr(TextureB.Width) + 'x' + IntToStr(TextureB.Height) + ')');
Result.TexNum := -1;
end else begin
@@ -452,7 +456,8 @@ begin end;}
end;
- if Typ = 'Font' then begin
+ if Typ = 'Font' then
+ begin
// a patch from Linnex, that solves the font problem in wine which causes chrashes
//TextureB.PixelFormat := pf24bit;
@@ -469,6 +474,8 @@ begin PPix := TextureB.ScanLine[Pet];
for Pet2 := 0 to TextureB.Width-1 do begin
Pix := PPix[Pet2 * 3];
+ if Pix>0 then
+ Pix := Pix * 1;
TextureD16[Pet*TextureB.Width + Pet2 + 1, 1] := 255;
TextureD16[Pet*TextureB.Width + Pet2 + 1, 2] := Pix;
end;
diff --git a/Game/Code/Screens/UScreenCredits.pas b/Game/Code/Screens/UScreenCredits.pas index a59ba863..54225682 100644 --- a/Game/Code/Screens/UScreenCredits.pas +++ b/Game/Code/Screens/UScreenCredits.pas @@ -206,7 +206,8 @@ Procedure TScreenCredits.Draw_FunkyText; var
S{,I, Len}: Integer;
X,Y,A: Real;
- visibleText: PChar;
+ visibleText: PChar;
+ visibleString: string;
begin
SetFontSize(10);
//Init ScrollingText
@@ -230,10 +231,13 @@ begin if Credits_X+X > 32 then A:=17;
glColor4f( 230/255-40/255+Y*(Credits_X+X)/900, 200/255-30/255+Y*(Credits_X+X)/1000, 155/255-20/255+Y*(Credits_X+X)/1100, A/17);
glPrintLetter(visibleText[S]);
- X := X + Fonts[ActFont].Width[Ord(visibleText[S])] * Fonts[ActFont].Tex.H / 30 * Fonts[ActFont].AspectW;
+ visibleString := visibleText[S];
+ X := X + glTextWidth(PChar(visibleString));
end;
- if (Credits_X<0) and (CurrentScrollStart < length(Funky_Text)) then begin
- Credits_X:=Credits_X + Fonts[ActFont].Width[Ord(Funky_Text[CurrentScrollStart])] * Fonts[ActFont].Tex.H / 30 * Fonts[ActFont].AspectW;
+ if (Credits_X<0) and (CurrentScrollStart < length(Funky_Text)) then
+ begin
+ visibleString := Funky_Text[CurrentScrollStart];
+ Credits_X:=Credits_X + glTextWidth(PChar(visibleString));
inc(CurrentScrollStart);
end;
visibleText:=pchar(Copy(Funky_Text, CurrentScrollStart, CurrentScrollEnd));
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas index 5c2e121a..ff1340de 100644 --- a/Game/Code/Screens/UScreenEditSub.pas +++ b/Game/Code/Screens/UScreenEditSub.pas @@ -1561,6 +1561,7 @@ begin Czesci[P].Czesc[C].Nuta[0].Tekst := Copy(Czesci[P].Czesc[C].Nuta[0].Tekst, 2, 100);
// move spaces on the start to the end of the previous note
+ {
for N := 1 to Czesci[P].Czesc[C].HighNut do
begin
while (Copy(Czesci[P].Czesc[C].Nuta[N].Tekst, 1, 1) = ' ') do
@@ -1569,20 +1570,22 @@ begin Czesci[P].Czesc[C].Nuta[N-1].Tekst := Czesci[P].Czesc[C].Nuta[N-1].Tekst + ' ';
end;
end; // N
+ }
// correct '-' to '- '
- for N := 0 to Czesci[P].Czesc[C].HighNut do
+ {for N := 0 to Czesci[P].Czesc[C].HighNut do
begin
if Czesci[P].Czesc[C].Nuta[N].Tekst = '-' then
Czesci[P].Czesc[C].Nuta[N].Tekst := '- ';
end; // N
-
+ }
// add space to the previous note when the current word is '- '
- for N := 1 to Czesci[P].Czesc[C].HighNut do
+ {for N := 1 to Czesci[P].Czesc[C].HighNut do
begin
if Czesci[P].Czesc[C].Nuta[N].Tekst = '- ' then
Czesci[P].Czesc[C].Nuta[N-1].Tekst := Czesci[P].Czesc[C].Nuta[N-1].Tekst + ' ';
end; // N
+ }
// correct too many spaces at the end of note
for N := 0 to Czesci[P].Czesc[C].HighNut do
@@ -1592,9 +1595,9 @@ begin end; // N
// and correct if there is no space at the end of sentence
- N := Czesci[P].Czesc[C].HighNut;
+ {N := Czesci[P].Czesc[C].HighNut;
if Copy(Czesci[P].Czesc[C].Nuta[N].Tekst, Length(Czesci[P].Czesc[C].Nuta[N].Tekst), 1) <> ' ' then
- Czesci[P].Czesc[C].Nuta[N].Tekst := Czesci[P].Czesc[C].Nuta[N].Tekst + ' ';
+ Czesci[P].Czesc[C].Nuta[N].Tekst := Czesci[P].Czesc[C].Nuta[N].Tekst + ' ';}
end;
end; // C
EditorLyric[P].AddCzesc(P, Czesci[P].Akt);
@@ -2171,12 +2174,12 @@ begin cRR := 1; cGR := 0.8; cBR := 0.8;
// Line
- AddText(500, 573, 1, 7, 0, 0, 0, 'Line:');
- TextSentence := AddText(545, 573, 1, 7, 0, 0, 0, '0 / 0');
+ //AddText(500, 573, 1, 7, 0, 0, 0, 'Line:');
+ TextSentence := AddText(500, 573, 1, 7, 0, 0, 0, 'Line: 0/0');
// Note
- AddText(655, 573, 1, 7, 0, 0, 0, 'Note:');
- TextNote := AddText(710, 573, 1, 7, 0, 0, 0, '0 / 0');
+ //AddText(655, 573, 1, 7, 0, 0, 0, 'Note:');
+ TextNote := AddText(655, 573, 1, 7, 0, 0, 0, 'Note: 0/0');
AddText(10, 10, 0, 8, 0, 0, 0, 'Title:');
AddText(10, 30, 0, 8, 0, 0, 0, 'Artist:');
@@ -2847,8 +2850,8 @@ begin end; // click
end; // if PlayOneNote
- Text[TextSentence].Text := IntToStr(Czesci[CP].Akt + 1) + ' / ' + IntToStr(Czesci[CP].Ilosc);
- Text[TextNote].Text := IntToStr(AktNuta[CP] + 1) + ' / ' + IntToStr(Czesci[CP].Czesc[Czesci[CP].Akt].IlNut);
+ Text[TextSentence].Text := 'Line: ' + IntToStr(Czesci[CP].Akt + 1) + '/' + IntToStr(Czesci[CP].Ilosc);
+ Text[TextNote].Text := 'Note: ' + IntToStr(AktNuta[CP] + 1) + '/' + IntToStr(Czesci[CP].Czesc[Czesci[CP].Akt].IlNut);
// Song info
if not BPMEditMode then
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 0fa5227c..7f60fe95 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1343,6 +1343,8 @@ end; procedure TScreenSing.LoadNextSong;
var
P, I: integer;
+ C, N, beat: integer;
+ error: boolean;
begin
// load notes
@@ -1383,6 +1385,23 @@ begin AktSong.Path := CatSongs.Song[CatSongs.Selected].Path;
+ error := false;
+ for P := 0 to Length(Czesci) - 1 do
+ begin
+ C := Length(Czesci[P].Czesc)-1;
+ N := Length(Czesci[P].Czesc[C].Nuta)-1;
+ beat := Czesci[P].Czesc[C].Nuta[N].Start + Czesci[P].Czesc[C].Nuta[N].Dlugosc;
+ if (Music.Length < GetTimeFromBeat(beat)) then
+ error := true;
+ end;
+
+ if error then
+ begin
+ Log.LogError('Error: TXT is longer then the MP3 in Song: ' + AktSong.Path + AktSong.Filename);
+ SongError;
+ Exit;
+ end;
+
if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
begin
SetMedleyMode;
@@ -2510,7 +2529,7 @@ begin glColor4f(0.15, 0.30, 0.6, t);
h := 100*t*ScreenH/RenderH;
- SetFontStyle(1); + SetFontStyle(4); SetFontItalic(false); SetFontSize(h); CountDownText := IntToStr(round(timeDiff-t)); diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index 7450fadb..59d4b50b 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -2257,12 +2257,14 @@ begin Music.SetMusicVolume(100);
//If Preview is deactivated: Load MUsicfile now
- If (Ini.PreviewVolume = 0) then
+ If (Ini.PreviewVolume = 0) and (Display.NextScreen <> @ScreenEditSub) and
+ (not CatSongs.Song[Interaction].Main) then
Music.Open(CatSongs.Song[Interaction].Path + CatSongs.Song[Interaction].Mp3);
//When hide then Stop Music (For Party Mode Popup on Exit)
if (Display.NextScreen <> @ScreenSong) and (Display.NextScreen <> @ScreenSing) and
- (Display.NextScreen <> @ScreenSingModi) and (Music <> nil) then
+ (Display.NextScreen <> @ScreenSingModi) and (Display.NextScreen <> @ScreenEditSub) and
+ (Music <> nil) then
Music.Stop;
end;
@@ -3621,7 +3623,8 @@ end; procedure TScreenSong.OpenEditor;
begin
- if (Length(Songs.Song) > 0) and (not CatSongs.Song[Interaction].Main) AND (Mode = smNormal) then begin
+ if (Length(Songs.Song) > 0) and (not CatSongs.Song[Interaction].Main) AND (Mode = smNormal) then
+ begin
Music.Stop;
acClose;
VidVis := none;
diff --git a/Game/Code/UltraStar.bdsproj b/Game/Code/UltraStar.bdsproj index 36df4a05..04b68b7c 100644 --- a/Game/Code/UltraStar.bdsproj +++ b/Game/Code/UltraStar.bdsproj @@ -170,7 +170,8 @@ <VersionInfoKeys Name="ProductName"></VersionInfoKeys>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
- </VersionInfoKeys> <Excluded_Packages>
+ </VersionInfoKeys>
+ <Excluded_Packages>
<Excluded_Packages Name="c:\program files\borland\bds\4.0\Bin\dclib100.bpl">Borland InterBase Express Components</Excluded_Packages>
<Excluded_Packages Name="c:\program files\borland\bds\4.0\Bin\dclIntraweb_80_100.bpl">Intraweb 8.0 Design Package for Borland Development Studio 2006</Excluded_Packages>
<Excluded_Packages Name="c:\program files\borland\bds\4.0\Bin\dclIndyCore100.bpl">Indy 10 Core Design Time</Excluded_Packages>
diff --git a/Game/Code/UltraStar.dpr b/Game/Code/UltraStar.dpr index f60ee8af..0aa0ebaf 100644 --- a/Game/Code/UltraStar.dpr +++ b/Game/Code/UltraStar.dpr @@ -122,7 +122,7 @@ uses UVideo in 'Classes\UVideo.pas';
const
- Version = 'UltraStar Deluxe Challenge, Medley & Duet Edition r9 RC5';
+ Version = 'UltraStar Deluxe Challenge, Medley & Duet Edition r9 RC6.1';
var
WndTitle: string;
|