aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r--Game/Code/Classes/TextGL.pas33
-rw-r--r--Game/Code/Classes/UDraw.pas2
-rw-r--r--Game/Code/Classes/UGraphic.pas4
-rw-r--r--Game/Code/Classes/UIni.pas13
-rw-r--r--Game/Code/Classes/UMain.pas4
-rw-r--r--Game/Code/Classes/UTexture.pas2
-rw-r--r--Game/Code/Classes/UWebCam.pas14
7 files changed, 51 insertions, 21 deletions
diff --git a/Game/Code/Classes/TextGL.pas b/Game/Code/Classes/TextGL.pas
index 7bb9699d..bc7e24e7 100644
--- a/Game/Code/Classes/TextGL.pas
+++ b/Game/Code/Classes/TextGL.pas
@@ -71,7 +71,7 @@ var
implementation
-uses UMain, Windows, SysUtils, UGraphic, UFiles;
+uses UMain, Windows, SysUtils, UGraphic, UFiles, UIni;
procedure BuildFont; // Build Our Bitmap Font
var
@@ -290,10 +290,20 @@ var
begin
ActFont := 0;
SetLength(FontFiles, 5);
- FontFiles[0] := 'Normal.fnt';
- FontFiles[1] := 'Bold.fnt';
- FontFiles[2] := 'FontO.fnt';
- FontFiles[3] := 'FontO2.fnt';
+ if (Uppercase(ILanguage[Ini.Language]) <> 'POLISH') then
+ begin
+ FontFiles[0] := 'Normal.fnt';
+ FontFiles[1] := 'Bold.fnt';
+ FontFiles[2] := 'FontO.fnt';
+ FontFiles[3] := 'FontO2.fnt';
+ end else
+ begin
+ FontFiles[0] := 'Normal_p.fnt';
+ FontFiles[1] := 'Bold_p.fnt';
+ FontFiles[2] := 'FontO_p.fnt';
+ FontFiles[3] := 'FontO2_p.fnt';
+ end;
+
FontFiles[4] := 'HighResNumbersO.fnt';
SetLength(Fonts, 5);
@@ -307,9 +317,18 @@ begin
end;
end;
-procedure KillFont; // Delete The Font
+procedure KillFont;
+var
+ F, Tex: integer;
+
begin
-// glDeleteLists(base, 256); // Delete All 96 Characters
+ for F := 0 to Length(Fonts) - 1 do
+ begin
+ for Tex := 0 to Length(Fonts[F].Tex) - 1 do
+ Texture.UnloadTexture(Fonts[F].Tex[Tex].Name, false);
+ end;
+
+ SetLength(Fonts, 0);
end;
function glTextWidth(text: pchar): real;
diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas
index bfc51916..e4735a39 100644
--- a/Game/Code/Classes/UDraw.pas
+++ b/Game/Code/Classes/UDraw.pas
@@ -519,7 +519,7 @@ begin
end;}
end;
- glColor4f(1, 1, 1, (sqrt((1+sin(Music.Position * 3))/4)/ 2 + 0.5)*Alpha);
+ glColor4f(1, 1, 1, (sqrt((1+sin((Music.Position+Ini.LipSync*0.01) * 3))/4)/ 2 + 0.5)*Alpha);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
diff --git a/Game/Code/Classes/UGraphic.pas b/Game/Code/Classes/UGraphic.pas
index 99ffe3a1..bd276b6f 100644
--- a/Game/Code/Classes/UGraphic.pas
+++ b/Game/Code/Classes/UGraphic.pas
@@ -583,7 +583,7 @@ begin
freeandnil( ScreenOptionsGraphics );
freeandnil( ScreenOptionsSound );
freeandnil( ScreenOptionsLyrics );
-// freeandnil( ScreenOptionsThemes );
+ freeandnil( ScreenOptionsThemes );
freeandnil( ScreenOptionsRecord );
freeandnil( ScreenOptionsAdvanced );
freeandnil( ScreenEditSub );
@@ -605,8 +605,6 @@ begin
//Party M2 Screens
freeandnil( ScreenPartyNewRoundM2 );
- //freeandnil( ScreenPartyScoreM2 );
- //freeandnil( ScreenPartyWinM2 );
freeandnil( ScreenPartyOptionsM2 );
freeandnil( ScreenPartyPlayerM2 );
end;
diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas
index 46137de8..d3f912d9 100644
--- a/Game/Code/Classes/UIni.pas
+++ b/Game/Code/Classes/UIni.pas
@@ -52,6 +52,7 @@ type
SavePlayback: integer;
Threshold: integer;
Delay: integer;
+ LipSync: integer;
//Song Preview
PreviewVolume: integer;
@@ -170,6 +171,7 @@ const
ISavePlayback: array[0..1] of string = ('Off', 'On');
IThreshold: array[0..3] of string = ('5%', '10%', '15%', '20%');
IDelay: array[0..9] of string = ('0ms', '10ms', '20ms', '30ms', '40ms', '50ms', '60ms', '70ms', '80ms', '90ms');
+ ILipSync: array[0..20] of string = ('0ms', '10ms', '20ms', '30ms', '40ms', '50ms', '60ms', '70ms', '80ms', '90ms', '100ms', '110ms', '120ms', '130ms', '140ms', '150ms', '160ms', '170ms', '180ms', '190ms', '200ms');
//Song Preview
IPreviewVolume: array[0..10] of string = ('Off', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%');
@@ -442,6 +444,12 @@ begin
for Pet := 0 to High(IDelay) do
if Tekst = IDelay[Pet] then Ini.Delay := Pet;
+ // LipSync
+ Tekst := IniFile.ReadString('Sound', 'LipSync', ILipSync[0]);
+ for Pet := 0 to High(ILipSync) do
+ if Tekst = ILipSync[Pet] then Ini.LipSync := Pet;
+
+
//Song Preview
Tekst := IniFile.ReadString('Sound', 'PreviewVolume', IPreviewVolume[7]);
for Pet := 0 to High(IPreviewVolume) do
@@ -803,6 +811,11 @@ begin
Tekst := IDelay[Ini.Delay];
IniFile.WriteString('Sound', 'Delay', Tekst);
+ // LipSync
+ Tekst := ILipSync[Ini.LipSync];
+ IniFile.WriteString('Sound', 'LipSync', Tekst);
+
+
// Song Preview
Tekst := IPreviewVolume[Ini.PreviewVolume];
IniFile.WriteString('Sound', 'PreviewVolume', Tekst);
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index 4e0ffef4..e1205cd8 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -349,7 +349,7 @@ var
N: integer;
begin
//Czas.Teraz := Czas.Teraz + TimeSkip;
- Czas.Teraz := Music.Position;
+ Czas.Teraz := Music.Position+Ini.LipSync*0.01;
Czas.OldBeat := Czas.AktBeat;
Czas.MidBeat := GetMidBeat(Czas.Teraz - (AktSong.Gap{ + 90 I've forgotten for what it is}) / 1000); // new system with variable BPM in function
@@ -360,7 +360,7 @@ begin
Czas.AktBeatC := Floor(Czas.MidBeatC);
Czas.OldBeatD := Czas.AktBeatD;
- Czas.MidBeatD := -0.5+GetMidBeat(Czas.Teraz - (AktSong.Gap + 120 + Ini.Delay*10) / 1000); // MidBeat with addition GAP
+ Czas.MidBeatD := -0.5+GetMidBeat(Czas.Teraz - Ini.LipSync*0.01 - (AktSong.Gap + 120 + Ini.Delay*10) / 1000); // MidBeat with addition GAP
Czas.AktBeatD := Floor(Czas.MidBeatD);
Czas.FracBeatD := Frac(Czas.MidBeatD);
diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas
index cd39dd2f..e40b5a92 100644
--- a/Game/Code/Classes/UTexture.pas
+++ b/Game/Code/Classes/UTexture.pas
@@ -869,14 +869,12 @@ begin
if TexNum >= 0 then begin
glDeleteTextures(1, @TexNum);
TextureDatabase.Texture[T].Texture.TexNum := -1;
-// Log.LogError('Unload texture no '+IntToStr(TexNum));
end;
end else begin
TexNum := TextureDatabase.Texture[T].TextureCache.TexNum;
if TexNum >= 0 then begin
glDeleteTextures(1, @TexNum);
TextureDatabase.Texture[T].TextureCache.TexNum := -1;
-// Log.LogError('Unload texture cache no '+IntToStr(TexNum));
end;
end;
end;
diff --git a/Game/Code/Classes/UWebCam.pas b/Game/Code/Classes/UWebCam.pas
index a0ba38f0..5abb7622 100644
--- a/Game/Code/Classes/UWebCam.pas
+++ b/Game/Code/Classes/UWebCam.pas
@@ -18,7 +18,7 @@ procedure wStopWebCam;
procedure wInit;
procedure wClose;
-procedure wDraw(DoDraw: boolean);
+procedure wDraw(DoDraw: boolean; Screen: integer);
var
@@ -159,7 +159,7 @@ begin
end;
-procedure wDraw(DoDraw: boolean);
+procedure wDraw(DoDraw: boolean; Screen: integer);
var
SRect: record
left, right, upper, lower: double;
@@ -203,10 +203,12 @@ begin
SRect.lower := (RenderH - ScaledVideoHeight) / 2;
SRect.upper := SRect.lower + ScaledVideoHeight;
- // have a nice black background to draw on (even if there were errors opening the vid)
- glClearColor(0,0,0,1);
- glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
-
+ if (Screen=1) then
+ begin
+ glClearColor(0,0,0,1);
+ glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
+ end;
+
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);