diff options
Diffstat (limited to '')
-rw-r--r-- | src/base/ULyrics.pas | 23 | ||||
-rw-r--r-- | src/base/UThemes.pas | 34 | ||||
-rw-r--r-- | src/screens/UScreenSong.pas | 26 | ||||
-rw-r--r-- | src/ultrastardx.dpr | 1 |
4 files changed, 47 insertions, 37 deletions
diff --git a/src/base/ULyrics.pas b/src/base/ULyrics.pas index 305cb91f..ffc5d5af 100644 --- a/src/base/ULyrics.pas +++ b/src/base/ULyrics.pas @@ -136,29 +136,6 @@ uses SysUtils, math, UIni; -//----------- -//Helper procs to use TRGB in Opengl ...maybe this should be somewhere else -//----------- -procedure glColorRGB(Color: TRGB); overload; -begin - glColor3f(Color.R, Color.G, Color.B); -end; - -procedure glColorRGB(Color: TRGB; Alpha: Real); overload; -begin - glColor4f(Color.R, Color.G, Color.B, Alpha); -end; - -procedure glColorRGB(Color: TRGBA); overload; -begin - glColor4f(Color.R, Color.G, Color.B, Color.A); -end; - -procedure glColorRGB(Color: TRGBA; Alpha: Real); overload; -begin - glColor4f(Color.R, Color.G, Color.B, Min(Color.A, Alpha)); -end; - { TLyricLine } constructor TLyricLine.Create(); diff --git a/src/base/UThemes.pas b/src/base/UThemes.pas index fca75c24..2319107a 100644 --- a/src/base/UThemes.pas +++ b/src/base/UThemes.pas @@ -725,6 +725,11 @@ type RGB: TRGB; end; +procedure glColorRGB(Color: TRGB); overload; +procedure glColorRGB(Color: TRGB; Alpha: Real); overload; +procedure glColorRGB(Color: TRGBA); overload; +procedure glColorRGB(Color: TRGBA; Alpha: Real); overload; + function ColorExists(Name: string): integer; procedure LoadColor(var R, G, B: real; ColorName: string); function GetSystemColor(Color: integer): TRGB; @@ -741,7 +746,34 @@ uses UCommon, ULanguage, USkins, - UIni; + UIni, + gl, + glext, + math; + +//----------- +//Helper procs to use TRGB in Opengl ...maybe this should be somewhere else +//----------- +procedure glColorRGB(Color: TRGB); overload; +begin + glColor3f(Color.R, Color.G, Color.B); +end; + +procedure glColorRGB(Color: TRGB; Alpha: Real); overload; +begin + glColor4f(Color.R, Color.G, Color.B, Alpha); +end; + +procedure glColorRGB(Color: TRGBA); overload; +begin + glColor4f(Color.R, Color.G, Color.B, Color.A); +end; + +procedure glColorRGB(Color: TRGBA; Alpha: Real); overload; +begin + glColor4f(Color.R, Color.G, Color.B, Min(Color.A, Alpha)); +end; + constructor TTheme.Create(FileName: string); begin diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas index be1320f2..1b5e4c41 100644 --- a/src/screens/UScreenSong.pas +++ b/src/screens/UScreenSong.pas @@ -24,14 +24,13 @@ uses UTexture, ULanguage, USong, - UIni; + UIni, + UMenuEqualizer; type TScreenSong = class(TMenu) private - EqualizerData: TFFTData; // moved here to avoid stack overflows - EqualizerBands: array of Byte; - EqualizerTime: Cardinal; + Equalizer: Tms_Equalizer; procedure StartMusicPreview(); procedure StopMusicPreview(); @@ -41,7 +40,7 @@ type TextNumber: integer; //Video Icon Mod - VideoIcon: Cardinal; + VideoIcon: Cardinal; TextCat: integer; StaticCat: integer; @@ -777,11 +776,13 @@ begin // Randomize Patch Randomize; - //Equalizer + {//Equalizer SetLength(EqualizerBands, Theme.Song.Equalizer.Bands); //ClearArray For I := low(EqualizerBands) to high(EqualizerBands) do - EqualizerBands[I] := 3; + EqualizerBands[I] := 3; } + + Equalizer := Tms_Equalizer.Create(AudioPlayback); if (Length(CatSongs.Song) > 0) then Interaction := 0; @@ -1496,8 +1497,7 @@ begin //Draw Equalizer - if Theme.Song.Equalizer.Visible then - DrawEqualizer; + Equalizer.Draw; DrawExtensions; @@ -1657,16 +1657,16 @@ begin end; procedure TScreenSong.DrawEqualizer; -var +{var I, J: Integer; ChansPerBand: byte; // channels per band MaxChannel: Integer; CurBand: Integer; // current band CurTime: Cardinal; PosX, PosY: Integer; - Pos: Real; + Pos: Real; } begin - // Nothing to do if no music is played or an equalizer bar consists of no block + { // Nothing to do if no music is played or an equalizer bar consists of no block if (AudioPlayback.Finished or (Theme.Song.Equalizer.Length <= 0)) then Exit; @@ -1763,7 +1763,7 @@ begin PosX := PosX + Theme.Song.Equalizer.W + Theme.Song.Equalizer.Space else // Horizontal bars PosY := PosY + Theme.Song.Equalizer.H + Theme.Song.Equalizer.Space; - end; + end; } end; procedure TScreenSong.SelectRandomSong; diff --git a/src/ultrastardx.dpr b/src/ultrastardx.dpr index b75de422..90346c09 100644 --- a/src/ultrastardx.dpr +++ b/src/ultrastardx.dpr @@ -122,6 +122,7 @@ uses UMenuButton in 'menu\UMenuButton.pas', UMenuInteract in 'menu\UMenuInteract.pas', UMenuSelectSlide in 'menu\UMenuSelectSlide.pas', + UMenuEqualizer in 'menu\UMenuEqualizer.pas', UDrawTexture in 'menu\UDrawTexture.pas', UMenuButtonCollection in 'menu\UMenuButtonCollection.pas', |