aboutsummaryrefslogtreecommitdiffstats
path: root/unicode/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--unicode/src/Makefile.in2
-rw-r--r--unicode/src/base/UImage.pas82
-rw-r--r--unicode/src/base/UIni.pas297
-rw-r--r--unicode/src/base/USongs.pas10
-rw-r--r--unicode/src/lib/JEDI-SDL/OpenGL/Pas/glext.pas19
-rw-r--r--unicode/src/screens/UScreenOptionsAdvanced.pas14
-rw-r--r--unicode/src/screens/UScreenOptionsGame.pas10
-rw-r--r--unicode/src/screens/UScreenOptionsGraphics.pas8
-rw-r--r--unicode/src/screens/UScreenOptionsLyrics.pas6
-rw-r--r--unicode/src/screens/UScreenOptionsRecord.pas8
-rw-r--r--unicode/src/screens/UScreenOptionsSound.pas14
-rw-r--r--unicode/src/screens/UScreenOptionsThemes.pas2
-rw-r--r--unicode/src/screens/UScreenSing.pas12
13 files changed, 406 insertions, 78 deletions
diff --git a/unicode/src/Makefile.in b/unicode/src/Makefile.in
index 06e62c43..3d4b6def 100644
--- a/unicode/src/Makefile.in
+++ b/unicode/src/Makefile.in
@@ -122,7 +122,7 @@ endif
LIBS ?= @LIBS@
LDFLAGS ?= @LDFLAGS@
-linkflags := -L/usr/lib $(sort $(LDFLAGS) $(LIBS))
+linkflags := $(sort $(LDFLAGS) $(LIBS))
ifneq ($(linkflags),)
PLINKFLAGS := -k"$(linkflags)"
endif
diff --git a/unicode/src/base/UImage.pas b/unicode/src/base/UImage.pas
index 9efcf9cc..1866316e 100644
--- a/unicode/src/base/UImage.pas
+++ b/unicode/src/base/UImage.pas
@@ -613,7 +613,7 @@ var
jpgFile: TBinaryFileStream;
rowPtr: array[0..0] of JSAMPROW;
{$ENDIF}
- converted: boolean;
+ converted: boolean;
begin
Result := false;
@@ -812,17 +812,13 @@ end;
function PixelFormatEquals(fmt1, fmt2: PSDL_PixelFormat): boolean;
begin
- if (fmt1^.BitsPerPixel = fmt2^.BitsPerPixel) and
- (fmt1^.BytesPerPixel = fmt2^.BytesPerPixel) and
- (fmt1^.Rloss = fmt2^.Rloss) and (fmt1^.Gloss = fmt2^.Gloss) and
- (fmt1^.Bloss = fmt2^.Bloss) and (fmt1^.Rmask = fmt2^.Rmask) and
- (fmt1^.Gmask = fmt2^.Gmask) and (fmt1^.Bmask = fmt2^.Bmask) and
- (fmt1^.Rshift = fmt2^.Rshift) and (fmt1^.Gshift = fmt2^.Gshift) and
- (fmt1^.Bshift = fmt2^.Bshift)
- then
- Result := true
- else
- Result := false;
+ Result :=
+ (fmt1^.BitsPerPixel = fmt2^.BitsPerPixel) and
+ (fmt1^.BytesPerPixel = fmt2^.BytesPerPixel) and
+ (fmt1^.Rloss = fmt2^.Rloss) and (fmt1^.Gloss = fmt2^.Gloss) and (fmt1^.Bloss = fmt2^.Bloss) and
+ (fmt1^.Rmask = fmt2^.Rmask) and (fmt1^.Gmask = fmt2^.Gmask) and (fmt1^.Bmask = fmt2^.Bmask) and
+ (fmt1^.Rshift = fmt2^.Rshift) and (fmt1^.Gshift = fmt2^.Gshift) and (fmt1^.Bshift = fmt2^.Bshift)
+ ;
end;
procedure ScaleImage(var ImgSurface: PSDL_Surface; Width, Height: cardinal);
@@ -903,7 +899,7 @@ begin
end;
*)
-procedure ColorizeImage(ImgSurface: PSDL_Surface; NewColor: cardinal);
+procedure ColorizeImage(ImgSurface: PSDL_Surface; NewColor: longword);
// First, the rgb colors are converted to hsv, second hue is replaced by
// the NewColor, saturation and value remain unchanged, finally this
@@ -911,7 +907,7 @@ procedure ColorizeImage(ImgSurface: PSDL_Surface; NewColor: cardinal);
// For the conversion algorithms of colors from rgb to hsv space
// and back simply check the wikipedia.
// In order to speed up starting time of USDX the division of reals is
- // replaced by division of longwords, shifted by 10 bits to keep
+ // replaced by division of longints, shifted by 10 bits to keep
// digits.
// The use of longwards leeds to some type size mismatch warnings
@@ -922,8 +918,8 @@ procedure ColorizeImage(ImgSurface: PSDL_Surface; NewColor: cardinal);
function ColorToHue(const Color: longword): longword;
// returns hue within the range [0.0-6.0] but shl 10, ie. times 1024
var
- Red, Green, Blue: longword;
- Min, Max, Delta: longword;
+ Red, Green, Blue: longint;
+ Min, Max, Delta: longint;
Hue: double;
begin
// extract the colors
@@ -951,6 +947,8 @@ procedure ColorizeImage(ImgSurface: PSDL_Surface; NewColor: cardinal);
// The division by Delta is done separately afterwards.
// Necessary because Delphi did not do the type conversion from
// longword to double as expected.
+ // After the change to longint, we may not need it, but left for now
+ // Something to check
if (Max = Red ) then Hue := Green - Blue
else if (Max = Green) then Hue := 2.0*Delta + Blue - Red
else if (Max = Blue ) then Hue := 4.0*Delta + Red - Green;
@@ -958,6 +956,8 @@ procedure ColorizeImage(ImgSurface: PSDL_Surface; NewColor: cardinal);
if (Hue < 0.0) then
Hue := Hue + 6.0;
Result := trunc(Hue*1024); // '*1024' is shl 10
+ // if NewColor = $000000 then
+ // Log.LogError ('Hue: ' + FloatToStr(Hue), 'ColorToHue');
end;
end;
@@ -970,6 +970,8 @@ var
Min, Max, Delta: longword;
HueInteger: longword;
f, p, q, t: longword;
+ GreyReal: real;
+ Grey: byte;
begin
Pixel := ImgSurface^.Pixels;
@@ -983,8 +985,48 @@ begin
Log.LogError ('ColorizeImage: The pixel size should be 4, but it is '
+ IntToStr(ImgSurface^.format.BytesPerPixel));
+ // Check whether the new color is white, grey or black,
+ // because a greyscale must be created in a different
+ // way.
+
+ Red := ((NewColor and $ff0000) shr 16); // R
+ Green := ((NewColor and $ff00) shr 8); // G
+ Blue := (NewColor and $ff) ; // B
+
+ if (Red = Green) and (Green = Blue) then // greyscale image
+ begin
+ // According to these recommendations (ITU-R BT.709-5)
+ // the conversion parameters for rgb to greyscale are
+ // 0.299, 0.587, 0.114
+ for PixelIndex := 0 to (ImgSurface^.W * ImgSurface^.H)-1 do
+ begin
+ PixelColors := PByteArray(Pixel);
+ {$IFDEF FPC_BIG_ENDIAN}
+ GreyReal := 0.299*PixelColors[3] + 0.587*PixelColors[2] + 0.114*PixelColors[1];
+ // PixelColors[0] is alpha and remains untouched
+ {$ELSE}
+ GreyReal := 0.299*PixelColors[0] + 0.587*PixelColors[1] + 0.114*PixelColors[2];
+ // PixelColors[3] is alpha and remains untouched
+ {$ENDIF}
+ Grey := round(GreyReal);
+ {$IFDEF FPC_BIG_ENDIAN}
+ PixelColors[3] := Grey;
+ PixelColors[2] := Grey;
+ PixelColors[1] := Grey;
+ // PixelColors[0] is alpha and remains untouched
+ {$ELSE}
+ PixelColors[0] := Grey;
+ PixelColors[1] := Grey;
+ PixelColors[2] := Grey;
+ // PixelColors[3] is alpha and remains untouched
+ {$ENDIF}
+ Inc(Pixel, ImgSurface^.format.BytesPerPixel);
+ end;
+ exit; // we are done with a greyscale image.
+ end;
+
Hue := ColorToHue(NewColor); // Hue is shl 10
- f := Hue and $3ff; // f is the dezimal part of hue
+ f := Hue and $3ff; // f is the dezimal part of hue
HueInteger := Hue shr 10;
for PixelIndex := 0 to (ImgSurface^.W * ImgSurface^.H)-1 do
@@ -1054,9 +1096,9 @@ begin
// shr 10 corrects that Sat and f are shl 10
// the resulting p, q and t are unshifted
- p := (Max*(1024-Sat)) shr 10;
- q := (Max*(1024-(Sat*f) shr 10)) shr 10;
- t := (Max*(1024-(Sat*(1024-f)) shr 10)) shr 10;
+ p := (Max * (1024 - Sat )) shr 10;
+ q := (Max * (1024 - (Sat * f ) shr 10)) shr 10;
+ t := (Max * (1024 - (Sat * (1024 - f)) shr 10)) shr 10;
// The above 3 lines give type size mismatch warning, but all variables are longword and the ranges should be ok.
diff --git a/unicode/src/base/UIni.pas b/unicode/src/base/UIni.pas
index 85f925ad..28836d06 100644
--- a/unicode/src/base/UIni.pas
+++ b/unicode/src/base/UIni.pas
@@ -79,6 +79,7 @@ type
function ReadArrayIndex(const SearchArray: array of UTF8String; IniFile: TCustomIniFile;
IniSection: string; IniProperty: string; Default: integer): integer;
+ procedure TranslateOptionValues;
procedure LoadInputDeviceCfg(IniFile: TMemIniFile);
procedure SaveInputDeviceCfg(IniFile: TIniFile);
procedure LoadThemes(IniFile: TCustomIniFile);
@@ -254,21 +255,308 @@ const
IChannelPlayer: array[0..6] of UTF8String = ('Off', '1', '2', '3', '4', '5', '6');
IMicBoost: array[0..3] of UTF8String = ('Off', '+6dB', '+12dB', '+18dB');
+var
+ ILanguageTranslated: array of string;
+
+ IDifficultyTranslated: array[0..2] of string = ('Easy', 'Medium', 'Hard');
+ ITabsTranslated: array[0..1] of string = ('Off', 'On');
+
+ ISortingTranslated: array[0..7] of string = ('Edition', 'Genre', 'Language', 'Folder', 'Title', 'Artist', 'Title2', 'Artist2');
+
+ IDebugTranslated: array[0..1] of string = ('Off', 'On');
+
+ IFullScreenTranslated: array[0..1] of string = ('Off', 'On');
+ IVisualizerTranslated: array[0..2] of string = ('Off', 'WhenNoVideo','On');
+
+ IBackgroundMusicTranslated: array[0..1] of string = ('Off', 'On');
+ ISingWindowTranslated: array[0..1] of string = ('Small', 'Big');
+
+ //SingBar Mod
+ IOscilloscopeTranslated: array[0..1] of string = ('Off', 'On');
+
+ ISpectrumTranslated: array[0..1] of string = ('Off', 'On');
+ ISpectrographTranslated: array[0..1] of string = ('Off', 'On');
+ IMovieSizeTranslated: array[0..2] of string = ('Half', 'Full [Vid]', 'Full [BG+Vid]');
+
+ IClickAssistTranslated: array[0..1] of string = ('Off', 'On');
+ IBeatClickTranslated: array[0..1] of string = ('Off', 'On');
+ ISavePlaybackTranslated: array[0..1] of string = ('Off', 'On');
+
+ IVoicePassthroughTranslated: array[0..1] of string = ('Off', 'On');
+
+ //Song Preview
+ IPreviewVolumeTranslated: array[0..10] of string = ('Off', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%');
+
+ IAudioOutputBufferSizeTranslated: array[0..9] of string = ('Auto', '256', '512', '1024', '2048', '4096', '8192', '16384', '32768', '65536');
+
+ IAudioInputBufferSizeTranslated: array[0..9] of string = ('Auto', '256', '512', '1024', '2048', '4096', '8192', '16384', '32768', '65536');
+
+ IPreviewFadingTranslated: array[0..5] of string = ('Off', '1 Sec', '2 Secs', '3 Secs', '4 Secs', '5 Secs');
+
+ ILyricsFontTranslated: array[0..2] of string = ('Plain', 'OLine1', 'OLine2');
+ ILyricsEffectTranslated: array[0..4] of string = ('Simple', 'Zoom', 'Slide', 'Ball', 'Shift');
+ ISolmizationTranslated: array[0..3] of string = ('Off', 'Euro', 'Jap', 'American');
+ INoteLinesTranslated: array[0..1] of string = ('Off', 'On');
+
+ IColorTranslated: array[0..8] of string = ('Blue', 'Green', 'Pink', 'Red', 'Violet', 'Orange', 'Yellow', 'Brown', 'Black');
+
+ // Advanced
+ ILoadAnimationTranslated: array[0..1] of string = ('Off', 'On');
+ IEffectSingTranslated: array[0..1] of string = ('Off', 'On');
+ IScreenFadeTranslated: array[0..1] of string = ('Off', 'On');
+ IAskbeforeDelTranslated: array[0..1] of string = ('Off', 'On');
+ IOnSongClickTranslated: array[0..2] of string = ('Sing', 'Select Players', 'Open Menu');
+ ILineBonusTranslated: array[0..1] of string = ('Off', 'On');
+ IPartyPopupTranslated: array[0..1] of string = ('Off', 'On');
+
+ IJoypadTranslated: array[0..1] of string = ('Off', 'On');
+ IMouseTranslated: array[0..2] of string = ('Off', 'Hardware Cursor', 'Software Cursor');
+
+ // Recording options
+ IChannelPlayerTranslated: array[0..6] of string = ('Off', '1', '2', '3', '4', '5', '6');
+ IMicBoostTranslated: array[0..3] of string = ('Off', '+6dB', '+12dB', '+18dB');
+
implementation
uses
StrUtils,
- UMain,
SDL,
+ UCommandLine,
ULanguage,
UPlatform,
- USkins,
+ UMain,
+ UPath,
URecord,
- UCommandLine,
+ USkins,
UPathUtils,
UUnicodeUtils;
(**
+ * Translate and set the values of options, which need translation.
+ *)
+procedure TIni.TranslateOptionValues;
+const
+ NumberOfLanguages = 14;
+var
+ ErrorStringStart: string;
+begin
+ ULanguage.Language.ChangeLanguage(ILanguage[Language]);
+
+ ErrorStringStart := 'The number of language files ('
+ + IntToStr(Length(ILanguage)) + ') is ';
+
+ if Length(ILanguage) > NumberOfLanguages then
+ begin
+ Log.LogError(ErrorStringStart + 'larger than expected (' + IntToStr(NumberOfLanguages) + ').',
+ 'Ini.TranslateOptionValues');
+ Halt;
+ end;
+
+ if Length(ILanguage) < NumberOfLanguages then
+ Log.LogWarn(ErrorStringStart + 'smaller than expected (' + IntToStr(NumberOfLanguages) + ').',
+ 'Ini.TranslateOptionValues');
+
+ SetLength(ILanguageTranslated, NumberOfLanguages);
+
+ ILanguageTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_CATALAN');
+ ILanguageTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_CROATIAN');
+ ILanguageTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_DUTCH');
+ ILanguageTranslated[3] := ULanguage.Language.Translate('OPTION_VALUE_ENGLISH');
+ ILanguageTranslated[4] := ULanguage.Language.Translate('OPTION_VALUE_EUSKARA');
+ ILanguageTranslated[5] := ULanguage.Language.Translate('OPTION_VALUE_FINNISH');
+ ILanguageTranslated[6] := ULanguage.Language.Translate('OPTION_VALUE_FRENCH');
+ ILanguageTranslated[7] := ULanguage.Language.Translate('OPTION_VALUE_GERMAN');
+ ILanguageTranslated[8] := ULanguage.Language.Translate('OPTION_VALUE_GREEK');
+ ILanguageTranslated[9] := ULanguage.Language.Translate('OPTION_VALUE_ITALIAN');
+ ILanguageTranslated[10] := ULanguage.Language.Translate('OPTION_VALUE_JAPANESE');
+ ILanguageTranslated[11] := ULanguage.Language.Translate('OPTION_VALUE_PORTUGUESE');
+ ILanguageTranslated[12] := ULanguage.Language.Translate('OPTION_VALUE_SPANISH');
+ ILanguageTranslated[13] := ULanguage.Language.Translate('OPTION_VALUE_SWEDISH');
+
+ IDifficultyTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_EASY');
+ IDifficultyTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_MEDIUM');
+ IDifficultyTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_HARD');
+
+ ITabsTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ ITabsTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ ISortingTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_EDITION');
+ ISortingTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_GENRE');
+ ISortingTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_LANGUAGE');
+ ISortingTranslated[3] := ULanguage.Language.Translate('OPTION_VALUE_FOLDER');
+ ISortingTranslated[4] := ULanguage.Language.Translate('OPTION_VALUE_TITLE');
+ ISortingTranslated[5] := ULanguage.Language.Translate('OPTION_VALUE_ARTIST');
+ ISortingTranslated[6] := ULanguage.Language.Translate('OPTION_VALUE_TITLE2');
+ ISortingTranslated[7] := ULanguage.Language.Translate('OPTION_VALUE_ARTIST2');
+
+ IDebugTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IDebugTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IFullScreenTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IFullScreenTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IVisualizerTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IVisualizerTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_WHENNOVIDEO');
+ IVisualizerTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IBackgroundMusicTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IBackgroundMusicTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ ISingWindowTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_SMALL');
+ ISingWindowTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_BIG');
+
+ IOscilloscopeTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IOscilloscopeTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ ISpectrumTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ ISpectrumTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ ISpectrographTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ ISpectrographTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IMovieSizeTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_HALF');
+ IMovieSizeTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_FULL_VID');
+ IMovieSizeTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_FULL_VID_BG');
+
+ IClickAssistTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IClickAssistTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IBeatClickTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IBeatClickTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ ISavePlaybackTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ ISavePlaybackTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IVoicePassthroughTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IVoicePassthroughTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ ILyricsFontTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_PLAIN');
+ ILyricsFontTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_OLINE1');
+ ILyricsFontTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_OLINE2');
+
+ ILyricsEffectTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_SIMPLE');
+ ILyricsEffectTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ZOOM');
+ ILyricsEffectTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_SLIDE');
+ ILyricsEffectTranslated[3] := ULanguage.Language.Translate('OPTION_VALUE_BALL');
+ ILyricsEffectTranslated[4] := ULanguage.Language.Translate('OPTION_VALUE_SHIFT');
+
+ ISolmizationTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ ISolmizationTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_EURO');
+ ISolmizationTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_JAPAN');
+ ISolmizationTranslated[3] := ULanguage.Language.Translate('OPTION_VALUE_AMERICAN');
+
+ INoteLinesTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ INoteLinesTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IColorTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_BLUE');
+ IColorTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_GREEN');
+ IColorTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_PINK');
+ IColorTranslated[3] := ULanguage.Language.Translate('OPTION_VALUE_RED');
+ IColorTranslated[4] := ULanguage.Language.Translate('OPTION_VALUE_VIOLET');
+ IColorTranslated[5] := ULanguage.Language.Translate('OPTION_VALUE_ORANGE');
+ IColorTranslated[6] := ULanguage.Language.Translate('OPTION_VALUE_YELLOW');
+ IColorTranslated[7] := ULanguage.Language.Translate('OPTION_VALUE_BROWN');
+ IColorTranslated[8] := ULanguage.Language.Translate('OPTION_VALUE_BLACK');
+
+ // Advanced
+ ILoadAnimationTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ ILoadAnimationTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IEffectSingTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IEffectSingTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IScreenFadeTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IScreenFadeTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IAskbeforeDelTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IAskbeforeDelTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IOnSongClickTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_SING');
+ IOnSongClickTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_SELECT_PLAYERS');
+ IOnSongClickTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_OPEN_MENU');
+
+ ILineBonusTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ ILineBonusTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IPartyPopupTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IPartyPopupTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IJoypadTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IJoypadTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_ON');
+
+ IMouseTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IMouseTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_HARDWARE_CURSOR');
+ IMouseTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_SOFTWARE_CURSOR');
+
+ IAudioOutputBufferSizeTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_AUTO');
+ IAudioOutputBufferSizeTranslated[1] := '256';
+ IAudioOutputBufferSizeTranslated[2] := '512';
+ IAudioOutputBufferSizeTranslated[3] := '1024';
+ IAudioOutputBufferSizeTranslated[4] := '2048';
+ IAudioOutputBufferSizeTranslated[5] := '4096';
+ IAudioOutputBufferSizeTranslated[6] := '8192';
+ IAudioOutputBufferSizeTranslated[7] := '16384';
+ IAudioOutputBufferSizeTranslated[8] := '32768';
+ IAudioOutputBufferSizeTranslated[9] := '65536';
+
+
+ IAudioInputBufferSizeTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_AUTO');
+ IAudioInputBufferSizeTranslated[1] := '256';
+ IAudioInputBufferSizeTranslated[2] := '512';
+ IAudioInputBufferSizeTranslated[3] := '1024';
+ IAudioInputBufferSizeTranslated[4] := '2048';
+ IAudioInputBufferSizeTranslated[5] := '4096';
+ IAudioInputBufferSizeTranslated[6] := '8192';
+ IAudioInputBufferSizeTranslated[7] := '16384';
+ IAudioInputBufferSizeTranslated[8] := '32768';
+ IAudioInputBufferSizeTranslated[9] := '65536';
+
+ //Song Preview
+ IPreviewVolumeTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IPreviewVolumeTranslated[1] := '10%';
+ IPreviewVolumeTranslated[2] := '20%';
+ IPreviewVolumeTranslated[3] := '30%';
+ IPreviewVolumeTranslated[4] := '40%';
+ IPreviewVolumeTranslated[5] := '50%';
+ IPreviewVolumeTranslated[6] := '60%';
+ IPreviewVolumeTranslated[7] := '70%';
+ IPreviewVolumeTranslated[8] := '80%';
+ IPreviewVolumeTranslated[9] := '90%';
+ IPreviewVolumeTranslated[10] := '100%';
+
+
+ IPreviewFadingTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IPreviewFadingTranslated[1] := '1 ' + ULanguage.Language.Translate('OPTION_VALUE_SEC');
+ IPreviewFadingTranslated[2] := '2 ' + ULanguage.Language.Translate('OPTION_VALUE_SECS');
+ IPreviewFadingTranslated[3] := '3 ' + ULanguage.Language.Translate('OPTION_VALUE_SECS');
+ IPreviewFadingTranslated[4] := '4 ' + ULanguage.Language.Translate('OPTION_VALUE_SECS');
+ IPreviewFadingTranslated[5] := '5 ' + ULanguage.Language.Translate('OPTION_VALUE_SECS');
+
+ // Recording options
+ IChannelPlayerTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IChannelPlayerTranslated[1] := '1';
+ IChannelPlayerTranslated[2] := '2';
+ IChannelPlayerTranslated[3] := '3';
+ IChannelPlayerTranslated[4] := '4';
+ IChannelPlayerTranslated[5] := '5';
+ IChannelPlayerTranslated[6] := '6';
+
+ IMicBoostTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_OFF');
+ IMicBoostTranslated[1] := '+6dB';
+ IMicBoostTranslated[2] := '+12dB';
+ IMicBoostTranslated[3] := '+18dB';
+
+end;
+
+(**
+ * Returns the filename without its fileextension
+ *)
+function TIni.RemoveFileExt(FullName: string): string;
+begin
+ Result := ChangeFileExt(FullName, '');
+end;
+
+(**
* Extracts an index of a key that is surrounded by a Prefix/Suffix pair.
* Example: ExtractKeyIndex('MyKey[1]', '[', ']') will return 1.
*)
@@ -588,6 +876,7 @@ begin
end;
// reverse order
+ Log.LogStatus( 'Log size of resolution: ' + IntToStr(Length(IResolution)), 'Video');
for I := 0 to (Length(IResolution) div 2) - 1 do
begin
swap(IResolution[I], IResolution[High(IResolution)-I]);
@@ -770,6 +1059,8 @@ begin
LoadPaths(IniFile);
+ TranslateOptionValues;
+
IniFile.Free;
end;
diff --git a/unicode/src/base/USongs.pas b/unicode/src/base/USongs.pas
index 5c1f570a..61459918 100644
--- a/unicode/src/base/USongs.pas
+++ b/unicode/src/base/USongs.pas
@@ -529,16 +529,6 @@ begin
begin
CurCategory := CurSong.Edition;
- // TODO: remove this block if it is not needed anymore
- {
- if CurSection = 'Singstar Part 2' then CoverName := 'Singstar';
- if CurSection = 'Singstar German' then CoverName := 'Singstar';
- if CurSection = 'Singstar Spanish' then CoverName := 'Singstar';
- if CurSection = 'Singstar Italian' then CoverName := 'Singstar';
- if CurSection = 'Singstar French' then CoverName := 'Singstar';
- if CurSection = 'Singstar 80s Polish' then CoverName := 'Singstar 80s';
- }
-
// add Category Button
AddCategoryButton(CurCategory);
end;
diff --git a/unicode/src/lib/JEDI-SDL/OpenGL/Pas/glext.pas b/unicode/src/lib/JEDI-SDL/OpenGL/Pas/glext.pas
index 1fc70f8a..871247a9 100644
--- a/unicode/src/lib/JEDI-SDL/OpenGL/Pas/glext.pas
+++ b/unicode/src/lib/JEDI-SDL/OpenGL/Pas/glext.pas
@@ -4282,32 +4282,33 @@ begin
if (Pos(' ', extension) <> 0) or (extension = '') then
begin
- Result := FALSE;
+ Result := false;
Exit;
end;
if searchIn = '' then
extensions := glGetString(GL_EXTENSIONS)
else
- //StrLCopy( extensions, searchIn, StrLen(searchIn)+1 );
+ //StrLCopy(extensions, searchIn, StrLen(searchIn) + 1);
extensions := searchIn;
start := extensions;
- while TRUE do
+ while true do
begin
- where := StrPos(start, extension );
- if where = nil then Break;
- terminator := Pointer(Integer(where) + Integer( strlen( extension ) ) );
- if (where = start) or (PChar(Integer(where) - 1)^ = ' ') then
+ where := StrPos(start, extension);
+ if where = nil then
+ Break;
+ terminator := where + Length(extension);
+ if (where = start) or ((where - 1)^ = ' ') then
begin
if (terminator^ = ' ') or (terminator^ = #0) then
begin
- Result := TRUE;
+ Result := true;
Exit;
end;
end;
start := terminator;
end;
- Result := FALSE;
+ Result := false;
end;
diff --git a/unicode/src/screens/UScreenOptionsAdvanced.pas b/unicode/src/screens/UScreenOptionsAdvanced.pas
index a89e95a8..7116ad40 100644
--- a/unicode/src/screens/UScreenOptionsAdvanced.pas
+++ b/unicode/src/screens/UScreenOptionsAdvanced.pas
@@ -129,30 +129,30 @@ begin
LoadFromTheme(Theme.OptionsAdvanced);
//SelectLoadAnimation Hidden because it is useless atm
- //AddSelect(Theme.OptionsAdvanced.SelectLoadAnimation, Ini.LoadAnimation, ILoadAnimation);
+ //AddSelect(Theme.OptionsAdvanced.SelectLoadAnimation, Ini.LoadAnimation, ILoadAnimationTranslated);
Theme.OptionsAdvanced.SelectScreenFade.showArrows := true;
Theme.OptionsAdvanced.SelectScreenFade.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsAdvanced.SelectScreenFade, Ini.ScreenFade, IScreenFade);
+ AddSelectSlide(Theme.OptionsAdvanced.SelectScreenFade, Ini.ScreenFade, IScreenFadeTranslated);
Theme.OptionsAdvanced.SelectEffectSing.showArrows := true;
Theme.OptionsAdvanced.SelectEffectSing.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsAdvanced.SelectEffectSing, Ini.EffectSing, IEffectSing);
+ AddSelectSlide(Theme.OptionsAdvanced.SelectEffectSing, Ini.EffectSing, IEffectSingTranslated);
Theme.OptionsAdvanced.SelectLineBonus.showArrows := true;
Theme.OptionsAdvanced.SelectLineBonus.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsAdvanced.SelectLineBonus, Ini.LineBonus, ILineBonus);
+ AddSelectSlide(Theme.OptionsAdvanced.SelectLineBonus, Ini.LineBonus, ILineBonusTranslated);
Theme.OptionsAdvanced.SelectOnSongClick.showArrows := true;
Theme.OptionsAdvanced.SelectOnSongClick.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsAdvanced.SelectOnSongClick, Ini.OnSongClick, IOnSongClick);
+ AddSelectSlide(Theme.OptionsAdvanced.SelectOnSongClick, Ini.OnSongClick, IOnSongClickTranslated);
Theme.OptionsAdvanced.SelectAskbeforeDel.showArrows := true;
Theme.OptionsAdvanced.SelectAskbeforeDel.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsAdvanced.SelectAskbeforeDel, Ini.AskBeforeDel, IAskbeforeDel);
+ AddSelectSlide(Theme.OptionsAdvanced.SelectAskbeforeDel, Ini.AskBeforeDel, IAskbeforeDelTranslated);
Theme.OptionsAdvanced.SelectPartyPopup.showArrows := true;
Theme.OptionsAdvanced.SelectPartyPopup.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsAdvanced.SelectPartyPopup, Ini.PartyPopup, IPartyPopup);
+ AddSelectSlide(Theme.OptionsAdvanced.SelectPartyPopup, Ini.PartyPopup, IPartyPopupTranslated);
AddButton(Theme.OptionsAdvanced.ButtonExit);
if (Length(Button[0].Text)=0) then
diff --git a/unicode/src/screens/UScreenOptionsGame.pas b/unicode/src/screens/UScreenOptionsGame.pas
index a7affa40..caeaad6e 100644
--- a/unicode/src/screens/UScreenOptionsGame.pas
+++ b/unicode/src/screens/UScreenOptionsGame.pas
@@ -132,23 +132,23 @@ begin
Theme.OptionsGame.SelectDifficulty.showArrows := true;
Theme.OptionsGame.SelectDifficulty.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsGame.SelectDifficulty, Ini.Difficulty, IDifficulty);
+ AddSelectSlide(Theme.OptionsGame.SelectDifficulty, Ini.Difficulty, IDifficultyTranslated);
Theme.OptionsGame.SelectLanguage.showArrows := true;
Theme.OptionsGame.SelectLanguage.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsGame.SelectLanguage, Ini.Language, ILanguage);
+ AddSelectSlide(Theme.OptionsGame.SelectLanguage, Ini.Language, ILanguageTranslated);
Theme.OptionsGame.SelectTabs.showArrows := true;
Theme.OptionsGame.SelectTabs.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsGame.SelectTabs, Ini.Tabs, ITabs);
+ AddSelectSlide(Theme.OptionsGame.SelectTabs, Ini.Tabs, ITabsTranslated);
Theme.OptionsGame.SelectSorting.showArrows := true;
Theme.OptionsGame.SelectSorting.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsGame.SelectSorting, Ini.Sorting, ISorting);
+ AddSelectSlide(Theme.OptionsGame.SelectSorting, Ini.Sorting, ISortingTranslated);
Theme.OptionsGame.SelectDebug.showArrows := true;
Theme.OptionsGame.SelectDebug.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsGame.SelectDebug, Ini.Debug, IDebug);
+ AddSelectSlide(Theme.OptionsGame.SelectDebug, Ini.Debug, IDebugTranslated);
diff --git a/unicode/src/screens/UScreenOptionsGraphics.pas b/unicode/src/screens/UScreenOptionsGraphics.pas
index bdf5cc6e..8ca13f09 100644
--- a/unicode/src/screens/UScreenOptionsGraphics.pas
+++ b/unicode/src/screens/UScreenOptionsGraphics.pas
@@ -138,7 +138,7 @@ begin
Theme.OptionsGraphics.SelectFullscreen.showArrows := true;
Theme.OptionsGraphics.SelectFullscreen.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsGraphics.SelectFullscreen, Ini.Fullscreen, IFullscreen);
+ AddSelectSlide(Theme.OptionsGraphics.SelectFullscreen, Ini.Fullscreen, IFullScreenTranslated);
Theme.OptionsGraphics.SelectDepth.showArrows := true;
Theme.OptionsGraphics.SelectDepth.oneItemOnly := true;
@@ -146,15 +146,15 @@ begin
Theme.OptionsGraphics.SelectVisualizer.showArrows := true;
Theme.OptionsGraphics.SelectVisualizer.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsGraphics.SelectVisualizer, Ini.VisualizerOption, IVisualizer);
+ AddSelectSlide(Theme.OptionsGraphics.SelectVisualizer, Ini.VisualizerOption, IVisualizerTranslated);
Theme.OptionsGraphics.SelectOscilloscope.showArrows := true;
Theme.OptionsGraphics.SelectOscilloscope.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsGraphics.SelectOscilloscope, Ini.Oscilloscope, IOscilloscope);
+ AddSelectSlide(Theme.OptionsGraphics.SelectOscilloscope, Ini.Oscilloscope, IOscilloscopeTranslated);
Theme.OptionsGraphics.SelectMovieSize.showArrows := true;
Theme.OptionsGraphics.SelectMovieSize.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsGraphics.SelectMovieSize, Ini.MovieSize, IMovieSize);
+ AddSelectSlide(Theme.OptionsGraphics.SelectMovieSize, Ini.MovieSize, IMovieSizeTranslated);
AddButton(Theme.OptionsGraphics.ButtonExit);
if (Length(Button[0].Text)=0) then
diff --git a/unicode/src/screens/UScreenOptionsLyrics.pas b/unicode/src/screens/UScreenOptionsLyrics.pas
index bc42740b..0ef4e2a6 100644
--- a/unicode/src/screens/UScreenOptionsLyrics.pas
+++ b/unicode/src/screens/UScreenOptionsLyrics.pas
@@ -122,15 +122,15 @@ begin
Theme.OptionsLyrics.SelectLyricsFont.showArrows := true;
Theme.OptionsLyrics.SelectLyricsFont.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsLyrics.SelectLyricsFont, Ini.LyricsFont, ILyricsFont);
+ AddSelectSlide(Theme.OptionsLyrics.SelectLyricsFont, Ini.LyricsFont, ILyricsFontTranslated);
Theme.OptionsLyrics.SelectLyricsEffect.showArrows := true;
Theme.OptionsLyrics.SelectLyricsEffect.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsLyrics.SelectLyricsEffect, Ini.LyricsEffect, ILyricsEffect);
+ AddSelectSlide(Theme.OptionsLyrics.SelectLyricsEffect, Ini.LyricsEffect, ILyricsEffectTranslated);
Theme.OptionsLyrics.SelectNoteLines.showArrows := true;
Theme.OptionsLyrics.SelectNoteLines.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsLyrics.SelectNoteLines, Ini.NoteLines, INoteLines);
+ AddSelectSlide(Theme.OptionsLyrics.SelectNoteLines, Ini.NoteLines, INoteLinesTranslated);
AddButton(Theme.OptionsLyrics.ButtonExit);
if (Length(Button[0].Text)=0) then
diff --git a/unicode/src/screens/UScreenOptionsRecord.pas b/unicode/src/screens/UScreenOptionsRecord.pas
index a330d2dc..828c20f6 100644
--- a/unicode/src/screens/UScreenOptionsRecord.pas
+++ b/unicode/src/screens/UScreenOptionsRecord.pas
@@ -300,7 +300,7 @@ begin
// add slider
SelectSlideChannelID[ChannelIndex] := AddSelectSlide(ChannelTheme^,
- InputDeviceCfg.ChannelToPlayerMap[ChannelIndex], IChannelPlayer);
+ InputDeviceCfg.ChannelToPlayerMap[ChannelIndex], IChannelPlayerTranslated);
end
else
begin
@@ -308,7 +308,7 @@ begin
// add slider but hide it and assign a dummy variable to it
SelectSlideChannelID[ChannelIndex] := AddSelectSlide(ChannelTheme^,
- ChannelToPlayerMapDummy, IChannelPlayer);
+ ChannelToPlayerMapDummy, IChannelPlayerTranslated);
SelectsS[SelectSlideChannelID[ChannelIndex]].Visible := false;
end;
end;
@@ -374,7 +374,7 @@ begin
// show slider
UpdateSelectSlideOptions(SelectSlideChannelTheme[ChannelIndex],
- SelectSlideChannelID[ChannelIndex], IChannelPlayer,
+ SelectSlideChannelID[ChannelIndex], IChannelPlayerTranslated,
InputDeviceCfg.ChannelToPlayerMap[ChannelIndex]);
SelectsS[SelectSlideChannelID[ChannelIndex]].Visible := true;
end
@@ -384,7 +384,7 @@ begin
// hide slider and assign a dummy variable to it
UpdateSelectSlideOptions(SelectSlideChannelTheme[ChannelIndex],
- SelectSlideChannelID[ChannelIndex], IChannelPlayer,
+ SelectSlideChannelID[ChannelIndex], IChannelPlayerTranslated,
ChannelToPlayerMapDummy);
SelectsS[SelectSlideChannelID[ChannelIndex]].Visible := false;
end;
diff --git a/unicode/src/screens/UScreenOptionsSound.pas b/unicode/src/screens/UScreenOptionsSound.pas
index 091e156b..7556dceb 100644
--- a/unicode/src/screens/UScreenOptionsSound.pas
+++ b/unicode/src/screens/UScreenOptionsSound.pas
@@ -139,25 +139,25 @@ begin
Theme.OptionsSound.SelectSlideVoicePassthrough.showArrows := true;
Theme.OptionsSound.SelectSlideVoicePassthrough.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsSound.SelectSlideVoicePassthrough, Ini.VoicePassthrough, IVoicePassthrough);
+ AddSelectSlide(Theme.OptionsSound.SelectSlideVoicePassthrough, Ini.VoicePassthrough, IVoicePassthroughTranslated);
Theme.OptionsSound.SelectBackgroundMusic.showArrows := true;
Theme.OptionsSound.SelectBackgroundMusic.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsSound.SelectBackgroundMusic, Ini.BackgroundMusicOption, IBackgroundMusic);
+ AddSelectSlide(Theme.OptionsSound.SelectBackgroundMusic, Ini.BackgroundMusicOption, IBackgroundMusicTranslated);
// TODO: - MicBoost needs to be moved to ScreenOptionsRecord
Theme.OptionsSound.SelectMicBoost.showArrows := true;
Theme.OptionsSound.SelectMicBoost.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoost);
+ AddSelectSlide(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoostTranslated);
Theme.OptionsSound.SelectClickAssist.showArrows := true;
Theme.OptionsSound.SelectClickAssist.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsSound.SelectClickAssist, Ini.ClickAssist, IClickAssist);
+ AddSelectSlide(Theme.OptionsSound.SelectClickAssist, Ini.ClickAssist, IClickAssistTranslated);
Theme.OptionsSound.SelectBeatClick.showArrows := true;
Theme.OptionsSound.SelectBeatClick.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsSound.SelectBeatClick, Ini.BeatClick, IBeatClick);
+ AddSelectSlide(Theme.OptionsSound.SelectBeatClick, Ini.BeatClick, IBeatClickTranslated);
Theme.OptionsSound.SelectThreshold.showArrows := true;
Theme.OptionsSound.SelectThreshold.oneItemOnly := true;
@@ -165,11 +165,11 @@ begin
Theme.OptionsSound.SelectSlidePreviewVolume.showArrows := true;
Theme.OptionsSound.SelectSlidePreviewVolume.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewVolume, Ini.PreviewVolume, IPreviewVolume);
+ AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewVolume, Ini.PreviewVolume, IPreviewVolumeTranslated);
Theme.OptionsSound.SelectSlidePreviewFading.showArrows := true;
Theme.OptionsSound.SelectSlidePreviewFading.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewFading, Ini.PreviewFading, IPreviewFading);
+ AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewFading, Ini.PreviewFading, IPreviewFadingTranslated);
AddButton(Theme.OptionsSound.ButtonExit);
if (Length(Button[0].Text) = 0) then
diff --git a/unicode/src/screens/UScreenOptionsThemes.pas b/unicode/src/screens/UScreenOptionsThemes.pas
index 1fdabbda..dca581a2 100644
--- a/unicode/src/screens/UScreenOptionsThemes.pas
+++ b/unicode/src/screens/UScreenOptionsThemes.pas
@@ -172,7 +172,7 @@ begin
Theme.OptionsThemes.SelectColor.showArrows := true;
Theme.OptionsThemes.SelectColor.oneItemOnly := true;
- AddSelectSlide(Theme.OptionsThemes.SelectColor, Ini.Color, IColor);
+ AddSelectSlide(Theme.OptionsThemes.SelectColor, Ini.Color, IColorTranslated);
AddButton(Theme.OptionsThemes.ButtonExit);
if (Length(Button[0].Text)=0) then
diff --git a/unicode/src/screens/UScreenSing.pas b/unicode/src/screens/UScreenSing.pas
index 6b361b81..ef8289a5 100644
--- a/unicode/src/screens/UScreenSing.pas
+++ b/unicode/src/screens/UScreenSing.pas
@@ -905,10 +905,14 @@ begin
// points for this line
LineScore := CurrentScore - CurrentPlayer.ScoreLast;
- // determine LinePerfection
- // Note: the "+2" extra points are a little bonus so the player does not
- // have to be that perfect to reach the bonus steps.
- LinePerfection := (LineScore + 2) / MaxLineScore;
+ // check for lines with low points
+ if (MaxLineScore <= 2) then
+ LinePerfection := 1
+ else
+ // determine LinePerfection
+ // Note: the "+2" extra points are a little bonus so the player does not
+ // have to be that perfect to reach the bonus steps.
+ LinePerfection := LineScore / (MaxLineScore - 2);
// clamp LinePerfection to range [0..1]
if (LinePerfection < 0) then