From e8f259a1a37ce5cf10a79dc53e184d6af4e7b7d6 Mon Sep 17 00:00:00 2001 From: b1indy Date: Tue, 17 Apr 2007 00:48:03 +0000 Subject: Changed aadvanced options to switch on/off sing-effects and screen-fading Changed Languages (english, german) and Theme (deluxe) to reflect these changes implemented checks for config values to make these things work as expected git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@101 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UDraw.pas | 11 ++++---- Game/Code/Classes/UIni.pas | 36 ++++++++++++------------- Game/Code/Classes/UThemes.pas | 8 +++--- Game/Code/Menu/UDisplay.pas | 40 +++++++++++++++++++--------- Game/Code/Screens/UScreenOptionsAdvanced.pas | 4 +-- Game/Code/Screens/UScreenSing.pas | 5 ++-- 6 files changed, 59 insertions(+), 45 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index e2c01b4b..7eaddac4 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -48,7 +48,7 @@ var StarfrG: integer; - + //SingBar Mod TickOld: cardinal; TickOld2:cardinal; @@ -216,7 +216,7 @@ begin if not FreeStyle then begin - if Ini.EffectGolden = 0 then + if Ini.EffectSing = 0 then // If Golden note Effect of then Change not Color begin case Wartosc of @@ -270,7 +270,7 @@ begin glEnd; // Golden Star Patch - if (Wartosc = 2) AND (Ini.EffectGolden=1) then + if (Wartosc = 2) AND (Ini.EffectSing=1) then begin GoldenRec.SaveGoldenStarsRec(GoldenStarPos, Rec.Top, Rec.Right, Rec.Bottom); end; @@ -379,7 +379,7 @@ var //Rec.Right := X + (Start+Dlugosc-Czesci[0].Czesc[Czesci[0].Akt].StartNote) * TempR - NotesW - 0.5 + 10*ScreenX; //if (Start+Dlugosc-1 = Czas.AktBeatD) then - if Perfect and (Ini.EffectPerfect=1) then begin + if Perfect and (Ini.EffectSing=1) then begin // A := sqrt((1+sin(Music.Position * 3))/2); A := 1 - 2*(Czas.Teraz - GetTimeFromBeat(Start+Dlugosc)); if not (Start+Dlugosc-1 = Czas.AktBeatD) then @@ -387,7 +387,6 @@ var //Star animation counter //inc(Starfr); //Starfr := Starfr mod 128; - GoldenRec.SavePerfectNotePos(Rec.Left, Rec.Top); { SingDrawStar(Rec.Left+2, Rec.Top+4, A);} end; @@ -431,7 +430,7 @@ var // passing on NrGracza... hope this is really something like the player-number, not only // some kind of weird index into a colour-table - if (Ini.EffectGolden=1) then + if (Ini.EffectSing=1) then GoldenRec.GoldenNoteTwinkle(Rec.Top,Rec.Bottom,Rec.Right, NrGracza); end; // if end; diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas index d5589ea3..cafbc912 100644 --- a/Game/Code/Classes/UIni.pas +++ b/Game/Code/Classes/UIni.pas @@ -58,8 +58,8 @@ type // Advanced LoadAnimation: integer; - EffectPerfect: integer; - EffectGolden: integer; + EffectSing: integer; + ScreenFade: integer; AskbeforeDel: integer; OnSongClick: integer; LineBonus: integer; @@ -135,8 +135,8 @@ const // Advanced ILoadAnimation: array[0..1] of string = ('Off', 'On'); - IEffectPerfect: array[0..1] of string = ('Off', 'On'); - IEffectGolden: array[0..1] of string = ('Off', 'On'); + IEffectSing: array[0..1] of string = ('Off', 'On'); + IScreenFade: array [0..1] of String =('Off', 'On'); IAskbeforeDel: array[0..1] of string = ('Off', 'On'); IOnSongClick: array[0..2] of string = ('Sing', 'Select Players', 'Open Menu'); ILineBonus: array[0..2] of string = ('Off', 'At Score', 'At Notes'); @@ -430,15 +430,15 @@ begin for Pet := 0 to High(ILoadAnimation) do if Tekst = ILoadAnimation[Pet] then Ini.LoadAnimation := Pet; - // EffectPerfect - Tekst := IniFile.ReadString('Advanced', 'EffectPerfect', 'On'); - for Pet := 0 to High(IEffectPerfect) do - if Tekst = IEffectPerfect[Pet] then Ini.EffectPerfect := Pet; + // ScreenFade + Tekst := IniFile.ReadString('Advanced', 'ScreenFade', 'On'); + for Pet := 0 to High(IScreenFade) do + if Tekst = IScreenFade[Pet] then Ini.ScreenFade := Pet; - // EffectGolden - Tekst := IniFile.ReadString('Advanced', 'EffectGolden', 'On'); - for Pet := 0 to High(IEffectGolden) do - if Tekst = IEffectGolden[Pet] then Ini.EffectGolden := Pet; + // EffectSing + Tekst := IniFile.ReadString('Advanced', 'EffectSing', 'On'); + for Pet := 0 to High(IEffectSing) do + if Tekst = IEffectSing[Pet] then Ini.EffectSing := Pet; // AskbeforeDel Tekst := IniFile.ReadString('Advanced', 'AskbeforeDel', 'On'); @@ -618,13 +618,13 @@ begin Tekst := ILoadAnimation[Ini.LoadAnimation]; IniFile.WriteString('Advanced', 'LoadAnimation', Tekst); - //EffectPerfect - Tekst := IEffectPerfect[Ini.EffectPerfect]; - IniFile.WriteString('Advanced', 'EffectPerfect', Tekst); + //EffectSing + Tekst := IEffectSing[Ini.EffectSing]; + IniFile.WriteString('Advanced', 'EffectSing', Tekst); - //EffectGolden - Tekst := IEffectGolden[Ini.EffectGolden]; - IniFile.WriteString('Advanced', 'EffectGolden', Tekst); + //ScreenFade + Tekst := IScreenFade[Ini.ScreenFade]; + IniFile.WriteString('Advanced', 'ScreenFade', Tekst); //AskbeforeDel Tekst := IAskbeforeDel[Ini.AskbeforeDel]; diff --git a/Game/Code/Classes/UThemes.pas b/Game/Code/Classes/UThemes.pas index 51b454ca..6837d17f 100644 --- a/Game/Code/Classes/UThemes.pas +++ b/Game/Code/Classes/UThemes.pas @@ -402,8 +402,8 @@ type TThemeOptionsAdvanced = class(TThemeBasic) SelectLoadAnimation: TThemeSelect; - SelectEffectPerfect: TThemeSelect; - SelectEffectGolden: TThemeSelect; + SelectEffectSing: TThemeSelect; + SelectScreenFade: TThemeSelect; SelectLineBonus: TThemeSelect; SelectAskbeforeDel: TThemeSelect; SelectOnSongClick: TThemeSelectSlide; @@ -1052,8 +1052,8 @@ begin ThemeLoadBasic(OptionsAdvanced, 'OptionsAdvanced'); ThemeLoadSelect (OptionsAdvanced.SelectLoadAnimation, 'OptionsAdvancedSelectLoadAnimation'); - ThemeLoadSelect (OptionsAdvanced.SelectEffectPerfect, 'OptionsAdvancedSelectEffectPerfect'); - ThemeLoadSelect (OptionsAdvanced.SelectEffectGolden, 'OptionsAdvancedSelectEffectGolden'); + ThemeLoadSelect (OptionsAdvanced.SelectScreenFade, 'OptionsAdvancedSelectScreenFade'); + ThemeLoadSelect (OptionsAdvanced.SelectEffectSing, 'OptionsAdvancedSelectEffectSing'); ThemeLoadSelect (OptionsAdvanced.SelectLineBonus, 'OptionsAdvancedSelectLineBonus'); ThemeLoadSelectSlide (OptionsAdvanced.SelectOnSongClick, 'OptionsAdvancedSelectSlideOnSongClick'); ThemeLoadSelect (OptionsAdvanced.SelectAskbeforeDel, 'OptionsAdvancedSelectAskbeforeDel'); diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas index b6489c70..3f6e70da 100644 --- a/Game/Code/Menu/UDisplay.pas +++ b/Game/Code/Menu/UDisplay.pas @@ -15,6 +15,7 @@ type Fade: Real; // fade-mod doFade: Boolean; + canFade: Boolean; myFade: integer; lastTime: Cardinal; pTexData : Pointer; @@ -37,42 +38,51 @@ var implementation -uses UGraphic, UTime, Graphics, Jpeg, UPliki, UTexture; +uses UGraphic, UTime, Graphics, Jpeg, UPliki, UTexture, UIni; constructor TDisplay.Create; begin inherited Create; // fade mod myfade:=0; - doFade:=True; + + if Ini.ScreenFade=1 then + doFade:=True + else + doFade:=False; + + canFade:=True; // generate texture for fading between screens GetMem(pTexData, 1024*1024*3); if pTexData <> NIL then begin glGenTextures(1, pTex); - if glGetError <> GL_NO_ERROR then doFade := False; + if glGetError <> GL_NO_ERROR then canFade := False; glBindTexture(GL_TEXTURE_2D, pTex); - if glGetError <> GL_NO_ERROR then doFade := False; + if glGetError <> GL_NO_ERROR then canFade := False; glTexImage2D(GL_TEXTURE_2D, 0, 3, 1024, 1024, 0, GL_RGB, GL_UNSIGNED_BYTE, pTexData); - if glGetError <> GL_NO_ERROR then doFade := False; + if glGetError <> GL_NO_ERROR then canFade := False; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - if glGetError <> GL_NO_ERROR then doFade := False; + if glGetError <> GL_NO_ERROR then canFade := False; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - if glGetError <> GL_NO_ERROR then doFade := False; + if glGetError <> GL_NO_ERROR then canFade := False; FreeMem(pTexData); end else begin - doFade:=False; + canFade:=False; end; - if not doFade then showmessage('Fehler beim Initialisieren der Fading-Textur... Fading deaktiviert'); + if not canFade then begin + showmessage('Fehler beim Initialisieren der Fading-Textur... Fading deaktiviert'); + doFade:=False; + end // end end; // fade mod destructor TDisplay.Destroy; begin - if doFade then + if canFade then glDeleteTextures(1,@pTex); inherited Destroy; end; @@ -113,11 +123,15 @@ begin Result := ActualScreen.Draw; // fade mod myfade:=0; + if (Ini.ScreenFade=1) and canFade then + doFade:=True + else if Ini.ScreenFade=0 then + doFade:=False; // end end else begin - if doFade then + if doFade and canFade then begin // fade mod //Create Fading texture if we're just starting @@ -128,7 +142,7 @@ begin glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 1024, 1024, 0); if glGetError <> GL_NO_ERROR then begin - doFade := False; + canFade := False; showmessage('Fehler beim Kopieren der Fade-Textur... Fading deaktiviert'); end; NextScreen.onShow; @@ -167,7 +181,7 @@ begin glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); end; - if (myfade > 40) or (not doFade) then begin // fade out complete... + if (myfade > 40) or (not doFade) or (not canFade) then begin // fade out complete... myFade:=0; ActualScreen.onHide; // nop... whatever ActualScreen.ShowFinish:=False; diff --git a/Game/Code/Screens/UScreenOptionsAdvanced.pas b/Game/Code/Screens/UScreenOptionsAdvanced.pas index 7904a284..ed3bc164 100644 --- a/Game/Code/Screens/UScreenOptionsAdvanced.pas +++ b/Game/Code/Screens/UScreenOptionsAdvanced.pas @@ -74,8 +74,8 @@ begin AddText(Theme.OptionsAdvanced.Text[I]); AddSelect(Theme.OptionsAdvanced.SelectLoadAnimation, Ini.LoadAnimation, ILoadAnimation); - AddSelect(Theme.OptionsAdvanced.SelectEffectPerfect, Ini.EffectPerfect, IEffectPerfect); - AddSelect(Theme.OptionsAdvanced.SelectEffectGolden, Ini.EffectGolden, IEffectGolden); + AddSelect(Theme.OptionsAdvanced.SelectScreenFade, Ini.ScreenFade, IScreenFade); + AddSelect(Theme.OptionsAdvanced.SelectEffectSing, Ini.EffectSing, IEffectSing); AddSelect(Theme.OptionsAdvanced.SelectLineBonus, Ini.LineBonus, ILineBonus); AddSelectSlide(Theme.OptionsAdvanced.SelectOnSongClick, Ini.OnSongClick, IOnSongClick); AddSelect(Theme.OptionsAdvanced.SelectAskbeforeDel, Ini.AskbeforeDel, IAskbeforeDel); diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index e4fd7add..29ea5c8b 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1115,7 +1115,7 @@ begin //PhrasenBonus - Line Bonus Mod End// } //PerfectLineTwinkle Mod (effect) Pt.1 - If (Ini.EffectPerfect>=1) then + If (Ini.EffectSing=1) then begin if A >= 8 then Player[I].LastSentencePerfect := True else Player[I].LastSentencePerfect := False; @@ -1128,7 +1128,8 @@ begin end; //PerfectLineTwinkle Mod (effect) Pt.2 - GoldenRec.SpawnPerfectLineTwinkle; + if Ini.EffectSing=1 then + GoldenRec.SpawnPerfectLineTwinkle; //PerfectLineTwinkle Mod end end; -- cgit v1.2.3