From 6b6edf009b8708de5a3918cad39708b07f1886d9 Mon Sep 17 00:00:00 2001 From: b1indy Date: Tue, 17 Apr 2007 23:48:00 +0000 Subject: fixed a bug that caused song selection screen to be drawn incorrectly and singscreen crash when screen fading was disabled git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@111 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Menu/UDisplay.pas | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Game') diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas index 3f6e70da..fc18025f 100644 --- a/Game/Code/Menu/UDisplay.pas +++ b/Game/Code/Menu/UDisplay.pas @@ -2,7 +2,7 @@ unit UDisplay; interface -uses Windows, SDL, UMenu, OpenGL12, SysUtils, dialogs; +uses Windows, SDL, UMenu, OpenGL12, SysUtils, dialogs, Math; type TDisplay = class @@ -43,6 +43,7 @@ uses UGraphic, UTime, Graphics, Jpeg, UPliki, UTexture, UIni; constructor TDisplay.Create; begin inherited Create; + // fade mod myfade:=0; @@ -163,6 +164,8 @@ begin // ActualScreen.SetAnimationProgress(Fade-1); // nop? + glClearColor(Col, Col, Col , 0); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); NextScreen.Draw; // draw next screen // and draw old screen over it... slowly fading out @@ -180,7 +183,10 @@ begin glEnd; glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); - end; + end + else NextScreen.OnShow; + + if (myfade > 40) or (not doFade) or (not canFade) then begin // fade out complete... myFade:=0; ActualScreen.onHide; // nop... whatever -- cgit v1.2.3