aboutsummaryrefslogtreecommitdiffstats
path: root/unicode/src/menu
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-03-14 21:18:50 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-03-14 21:18:50 +0000
commita92d9807237a024106b67f045822679f7ee4df54 (patch)
tree5f2c2501be7da18d2b82216fe60e645d1a2caaac /unicode/src/menu
parentc61a339ad465ecb43897975538a77c3eb87110be (diff)
downloadusdx-a92d9807237a024106b67f045822679f7ee4df54.tar.gz
usdx-a92d9807237a024106b67f045822679f7ee4df54.tar.xz
usdx-a92d9807237a024106b67f045822679f7ee4df54.zip
merge with current trunk (just update)
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1634 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'unicode/src/menu')
-rw-r--r--unicode/src/menu/UDisplay.pas11
-rw-r--r--unicode/src/menu/UDrawTexture.pas1
-rw-r--r--unicode/src/menu/UMenuBackgroundColor.pas6
-rw-r--r--unicode/src/menu/UMenuBackgroundFade.pas10
-rw-r--r--unicode/src/menu/UMenuBackgroundNone.pas6
-rw-r--r--unicode/src/menu/UMenuBackgroundTexture.pas7
-rw-r--r--unicode/src/menu/UMenuBackgroundVideo.pas6
-rw-r--r--unicode/src/menu/UMenuButton.pas63
8 files changed, 64 insertions, 46 deletions
diff --git a/unicode/src/menu/UDisplay.pas b/unicode/src/menu/UDisplay.pas
index f4cca4a5..3e653183 100644
--- a/unicode/src/menu/UDisplay.pas
+++ b/unicode/src/menu/UDisplay.pas
@@ -34,7 +34,7 @@ interface
{$I switches.inc}
uses
- ucommon,
+ UCommon,
SDL,
UMenu,
gl,
@@ -86,15 +86,16 @@ var
implementation
uses
- UImage,
TextGL,
+ UCommandLine,
+ UGraphic,
+ UIni,
+ UImage,
ULog,
UMain,
UTexture,
- UIni,
- UGraphic,
UTime,
- UCommandLine;
+ UPath;
constructor TDisplay.Create;
var
diff --git a/unicode/src/menu/UDrawTexture.pas b/unicode/src/menu/UDrawTexture.pas
index 33082765..bc136f11 100644
--- a/unicode/src/menu/UDrawTexture.pas
+++ b/unicode/src/menu/UDrawTexture.pas
@@ -74,7 +74,6 @@ var
begin
with Texture do
begin
- // rysuje paski gracza
glColor4f(ColR * Int, ColG * Int, ColB * Int, Alpha);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
diff --git a/unicode/src/menu/UMenuBackgroundColor.pas b/unicode/src/menu/UMenuBackgroundColor.pas
index 68cf2de4..a5c2a70a 100644
--- a/unicode/src/menu/UMenuBackgroundColor.pas
+++ b/unicode/src/menu/UMenuBackgroundColor.pas
@@ -52,7 +52,8 @@ type
implementation
uses
gl,
- glext;
+ glext,
+ UGraphic;
constructor TMenuBackgroundColor.Create(const ThemedSettings: TThemeBackground);
begin
@@ -62,8 +63,11 @@ end;
procedure TMenuBackgroundColor.Draw;
begin
+ if (ScreenAct = 1) then
+ begin //just clear once, even when using two screens
glClearColor(Color.R, Color.G, Color.B, 0);
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
+ end;
end;
end. \ No newline at end of file
diff --git a/unicode/src/menu/UMenuBackgroundFade.pas b/unicode/src/menu/UMenuBackgroundFade.pas
index b6174738..dc37da45 100644
--- a/unicode/src/menu/UMenuBackgroundFade.pas
+++ b/unicode/src/menu/UMenuBackgroundFade.pas
@@ -66,7 +66,8 @@ uses sdl,
gl,
glext,
USkins,
- UCommon;
+ UCommon,
+ UGraphic;
constructor TMenuBackgroundFade.Create(const ThemedSettings: TThemeBackground);
var texFilename: string;
@@ -121,7 +122,8 @@ begin
if (UseTexture) then
begin //Draw Texture to Screen
- glClear(GL_DEPTH_BUFFER_BIT);
+ If (ScreenAct = 1) then //Clear just once when in dual screen mode
+ glClear(GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
@@ -149,7 +151,9 @@ begin
end
else
begin //Clear Screen w/ progress Alpha + Color
- glClear(GL_DEPTH_BUFFER_BIT);
+ If (ScreenAct = 1) then //Clear just once when in dual screen mode
+ glClear(GL_DEPTH_BUFFER_BIT);
+
glDisable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
diff --git a/unicode/src/menu/UMenuBackgroundNone.pas b/unicode/src/menu/UMenuBackgroundNone.pas
index 6b63742a..1fccc007 100644
--- a/unicode/src/menu/UMenuBackgroundNone.pas
+++ b/unicode/src/menu/UMenuBackgroundNone.pas
@@ -52,7 +52,8 @@ type
implementation
uses
gl,
- glext;
+ glext,
+ UGraphic;
constructor TMenuBackgroundNone.Create(const ThemedSettings: TThemeBackground);
begin
@@ -62,7 +63,8 @@ end;
procedure TMenuBackgroundNone.Draw;
begin
//Do just nothing in here!
- glClear(GL_DEPTH_BUFFER_BIT);
+ If (ScreenAct = 1) then //Clear just once when in dual screen mode
+ glClear(GL_DEPTH_BUFFER_BIT);
end;
end. \ No newline at end of file
diff --git a/unicode/src/menu/UMenuBackgroundTexture.pas b/unicode/src/menu/UMenuBackgroundTexture.pas
index e8678fc5..a1b9e88a 100644
--- a/unicode/src/menu/UMenuBackgroundTexture.pas
+++ b/unicode/src/menu/UMenuBackgroundTexture.pas
@@ -61,7 +61,8 @@ uses
UCommon,
SysUtils,
gl,
- glext;
+ glext,
+ UGraphic;
constructor TMenuBackgroundTexture.Create(const ThemedSettings: TThemeBackground);
var texFilename: string;
@@ -92,7 +93,9 @@ end;
procedure TMenuBackgroundTexture.Draw;
begin
- glClear(GL_DEPTH_BUFFER_BIT);
+ If (ScreenAct = 1) then //Clear just once when in dual screen mode
+ glClear(GL_DEPTH_BUFFER_BIT);
+
glColorRGB(Color);
glEnable(GL_TEXTURE_2D);
diff --git a/unicode/src/menu/UMenuBackgroundVideo.pas b/unicode/src/menu/UMenuBackgroundVideo.pas
index 377c2170..d1ce0f09 100644
--- a/unicode/src/menu/UMenuBackgroundVideo.pas
+++ b/unicode/src/menu/UMenuBackgroundVideo.pas
@@ -105,7 +105,8 @@ uses
SysUtils,
UTime,
USkins,
- UCommon;
+ UCommon,
+ UGraphic;
constructor TMenuBackgroundVideo.Create(const ThemedSettings: TThemeBackground);
begin
@@ -146,7 +147,8 @@ end;
procedure TMenuBackgroundVideo.Draw;
begin
- glClear(GL_DEPTH_BUFFER_BIT);
+ If (ScreenAct = 1) then //Clear just once when in dual screen mode
+ glClear(GL_DEPTH_BUFFER_BIT);
VideoPlayback.GetFrame(VideoBGTimer.GetTime());
// FIXME: why do we draw on screen 2? Seems to be wrong.
diff --git a/unicode/src/menu/UMenuButton.pas b/unicode/src/menu/UMenuButton.pas
index a0cdaeef..c6ff8ab7 100644
--- a/unicode/src/menu/UMenuButton.pas
+++ b/unicode/src/menu/UMenuButton.pas
@@ -45,24 +45,24 @@ type
TButton = class
protected
- SelectBool: Boolean;
+ SelectBool: boolean;
- FadeProgress: Real;
- FadeLastTick: Cardinal;
+ FadeProgress: real;
+ FadeLastTick: cardinal;
DeSelectW,
DeSelectH,
PosX,
- PosY: Real;
+ PosY: real;
constructor Create(); overload;
public
- Text: Array of TText;
+ Text: array of TText;
Texture: TTexture; // Button Screen position and size
Texture2: TTexture; // second texture only used for fading full resolution covers
- Colorized: Boolean;
+ Colorized: boolean;
DeSelectTexture: TTexture; // texture for colorized hack
FadeTex: TTexture; //Texture for beautiful fading
@@ -73,15 +73,15 @@ type
Reflection: boolean;
Reflectionspacing,
- DeSelectReflectionspacing: Real;
+ DeSelectReflectionspacing: real;
Fade,
- FadeText: Boolean;
+ FadeText: boolean;
Selectable: boolean;
//Number of the Parent Collection, 0 if in no Collection
- Parent: Byte;
+ Parent: byte;
SelectColR,
SelectColG,
@@ -103,13 +103,13 @@ type
procedure SetW(Value: real);
procedure SetH(Value: real);
- procedure SetSelect(Value: Boolean); virtual;
+ procedure SetSelect(Value: boolean); virtual;
property X: real read PosX write SetX;
property Y: real read PosY write SetY;
property Z: real read Texture.z write Texture.z;
property W: real read DeSelectW write SetW;
property H: real read DeSelectH write SetH;
- property Selected: Boolean read SelectBool write SetSelect;
+ property Selected: boolean read SelectBool write SetSelect;
procedure Draw; virtual;
@@ -120,8 +120,9 @@ type
implementation
-uses SysUtils,
- UDrawTexture;
+uses
+ SysUtils,
+ UDrawTexture;
procedure TButton.SetX(Value: real);
{var
@@ -143,8 +144,8 @@ end;
procedure TButton.SetY(Value: real);
{var
- dY: real;
- T: integer; // text}
+ dY: real;
+ T: integer; // text}
begin
{dY := Value - PosY;
@@ -164,7 +165,7 @@ begin
DeSelectW := Value;
- if Not Fade then
+ if not Fade then
begin
if SelectBool then
Texture.W := SelectW
@@ -180,7 +181,7 @@ begin
DeSelectH := Value;
- if Not Fade then
+ if not Fade then
begin
if SelectBool then
Texture.H := SelectH
@@ -189,9 +190,9 @@ begin
end;
end;
-procedure TButton.SetSelect(Value : Boolean);
+procedure TButton.SetSelect(Value : boolean);
var
- T: integer;
+ T: integer;
begin
SelectBool := Value;
@@ -291,9 +292,9 @@ end;
procedure TButton.Draw;
var
- T: integer;
- Tick: Cardinal;
- Spacing: Real;
+ T: integer;
+ Tick: cardinal;
+ Spacing: real;
begin
if Visible then
begin
@@ -315,7 +316,7 @@ begin
if (FadeText) then
begin
- For T := 0 to high(Text) do
+ for T := 0 to high(Text) do
begin
Text[T].MoveX := (SelectW - DeSelectW) * FadeProgress;
Text[T].MoveY := (SelectH - DeSelectH) * FadeProgress;
@@ -353,7 +354,7 @@ begin
FadeTex.TexY1 := 0;
FadeTex.TexY2 := 1;
- Case FadeTexPos of
+ case FadeTexPos of
0: //FadeTex on Top
begin
//Standard Texture
@@ -465,7 +466,7 @@ begin
//Reflection Mod
if (Reflection) then // Draw Reflections
begin
- if (FadeProgress <> 0) AND (FadeProgress <> 1) then
+ if (FadeProgress <> 0) and (FadeProgress <> 1) then
begin
Spacing := DeSelectReflectionspacing - (DeSelectReflectionspacing - Reflectionspacing) * FadeProgress;
end
@@ -514,9 +515,10 @@ begin
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
- end else
+ end
+ else
with DeSelectTexture do
- begin
+ begin
//Bind Tex and GL Attributes
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
@@ -556,7 +558,8 @@ begin
end;
end;
- for T := 0 to High(Text) do begin
+ for T := 0 to High(Text) do
+ begin
Text[T].Draw;
end;
end;
@@ -577,7 +580,7 @@ begin
Texture.ColG := 0.5;
Texture.ColB := 0;
Texture.Int := 1;
- Colorized := False;
+ Colorized := false;
end;
// Button has the texture-type "colorized"
@@ -592,7 +595,7 @@ begin
Texture.ColG := 1;
Texture.ColB := 1;
Texture.Int := 1;
- Colorized := True;
+ Colorized := true;
end;
end.