diff options
author | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-10-18 21:13:16 +0000 |
---|---|---|
committer | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-10-18 21:13:16 +0000 |
commit | e60c0d3e29be2c77e7ab8deca6c37d0b07ebf085 (patch) | |
tree | a4c29e7270e22540b334938848b5b20b7854fa1d /src/menu/UMenuBackgroundFade.pas | |
parent | f004b6574c5311c743472010beb01a723e0baac5 (diff) | |
download | usdx-e60c0d3e29be2c77e7ab8deca6c37d0b07ebf085.tar.gz usdx-e60c0d3e29be2c77e7ab8deca6c37d0b07ebf085.tar.xz usdx-e60c0d3e29be2c77e7ab8deca6c37d0b07ebf085.zip |
style adjustments. no code change.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1456 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | src/menu/UMenuBackgroundFade.pas | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/src/menu/UMenuBackgroundFade.pas b/src/menu/UMenuBackgroundFade.pas index 3bdd631e..b6174738 100644 --- a/src/menu/UMenuBackgroundFade.pas +++ b/src/menu/UMenuBackgroundFade.pas @@ -44,18 +44,18 @@ uses type
TMenuBackgroundFade = class (TMenuBackground)
private
- Tex: TTexture;
+ Tex: TTexture;
Color: TRGB;
- Alpha: Real;
+ Alpha: real;
- useTexture: Boolean;
+ useTexture: boolean;
- FadeTime: Cardinal;
+ FadeTime: cardinal;
public
- Constructor Create(const ThemedSettings: TThemeBackground); override;
- Procedure OnShow; override;
- Procedure Draw; override;
- Destructor Destroy; override;
+ constructor Create(const ThemedSettings: TThemeBackground); override;
+ procedure OnShow; override;
+ procedure Draw; override;
+ destructor Destroy; override;
end;
const
@@ -68,15 +68,15 @@ uses sdl, USkins,
UCommon;
-Constructor TMenuBackgroundFade.Create(const ThemedSettings: TThemeBackground);
-var texFilename: String;
+constructor TMenuBackgroundFade.Create(const ThemedSettings: TThemeBackground);
+var texFilename: string;
begin
inherited;
FadeTime := 0;
Color := ThemedSettings.Color;
Alpha := ThemedSettings.Alpha;
- If (Length(ThemedSettings.Tex) > 0) then
+ if (Length(ThemedSettings.Tex) > 0) then
begin
texFilename := Skin.GetTextureFileName(ThemedSettings.Tex);
texFilename := AdaptFilePaths(texFilename);
@@ -85,43 +85,41 @@ begin UseTexture := (Tex.TexNum <> 0);
end
else
- UseTexture := False;
+ UseTexture := false;
- If (not UseTexture) then
+ if (not UseTexture) then
FreeandNil(Tex);
end;
-Destructor TMenuBackgroundFade.Destroy;
+destructor TMenuBackgroundFade.Destroy;
begin
//Why isn't there any Tex.free method?
- {If UseTexture then
+ {if UseTexture then
FreeandNil(Tex); }
inherited;
end;
-
-Procedure TMenuBackgroundFade.OnShow;
+procedure TMenuBackgroundFade.OnShow;
begin
FadeTime := SDL_GetTicks;
end;
-
-Procedure TMenuBackgroundFade.Draw;
+procedure TMenuBackgroundFade.Draw;
var
- Progress: Real;
+ Progress: real;
begin
- If FadeTime = 0 then
+ if FadeTime = 0 then
Progress := Alpha
- Else
+ else
Progress := Alpha * (SDL_GetTicks - FadeTime) / FADEINTIME;
- If Progress > Alpha then
+ if Progress > Alpha then
begin
FadeTime := 0;
Progress := Alpha;
end;
- If (UseTexture) then
+ if (UseTexture) then
begin //Draw Texture to Screen
glClear(GL_DEPTH_BUFFER_BIT);
|