aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UMain.pas
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-28 19:54:31 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-28 19:54:31 +0000
commit60e6d3f9904a8114e985fccd14454b9b604ea275 (patch)
treec3dc298e5c81272f3df8e80171ae0f60d8774f2e /Game/Code/Classes/UMain.pas
parent58a47541955f5010269d72a06e307bbb945211ea (diff)
downloadusdx-60e6d3f9904a8114e985fccd14454b9b604ea275.tar.gz
usdx-60e6d3f9904a8114e985fccd14454b9b604ea275.tar.xz
usdx-60e6d3f9904a8114e985fccd14454b9b604ea275.zip
- new SDL.dll (with a quick and dirty workaround for the hanging-mouse problem)
- changing of sorting and folder-option (on/off) does not need any restart now - a lot of code clean up - some bugfixes... i hope... dont't know which... git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2316 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UMain.pas')
-rw-r--r--Game/Code/Classes/UMain.pas41
1 files changed, 15 insertions, 26 deletions
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index cb70cd08..a20ba30c 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -2,7 +2,7 @@ unit UMain;
interface
uses SDL, UGraphic, UMusic, URecord, UTime, SysUtils, UDisplay, UIni, ULog, ULyrics, UScreenSing,
- gl, zlportio {you can disable it and all PortWriteB calls}, ULCD, ULight, UThemes{, UScreenPopup};
+ gl, zlportio {you can disable it and all PortWriteB calls}, UThemes{, UScreenPopup};
type
TPlayer = record
@@ -112,7 +112,7 @@ function GetTimeFromBeat(Beat: integer): real;
procedure ClearScores(PlayerNum: integer);
implementation
-uses USongs, UJoystick, math, UCommandLine;
+uses USongs, UJoystick, math, UCommandLine, UVideo;
procedure MainLoop;
var
@@ -132,12 +132,9 @@ begin
done := not Display.Draw;
SwapBuffers;
- // light
- Light.Refresh;
-
// delay
CountMidTime;
-// if 1000*TimeMid > 100 then beep;
+
Delay := Floor(1000 / 100 - 1000 * TimeMid);
if Delay >= 1 then
SDL_Delay(Delay); // dynamic, maximum is 100 fps
@@ -154,18 +151,27 @@ begin
End;
Procedure CheckEvents;
-//var
-// p: pointer;
Begin
if not Assigned(Display.NextScreen) then
While SDL_PollEvent( @event ) = 1 Do
Begin
-// beep;
Case Event.type_ Of
SDL_ACTIVEEVENT: //workaround for alt-tab bug
begin
if (Event.active.gain=1) then
+ begin
SDL_SetModState(KMOD_NONE);
+ if (Ini.FullScreen = 1) or (Params.FullScreen) then
+ SDL_ShowCursor(0);
+ EnableVideoDraw := true;
+ end;
+
+ if (Event.active.gain=0) then
+ begin
+ if (Ini.FullScreen = 1) or (Params.FullScreen) then
+ SDL_ShowCursor(1);
+ EnableVideoDraw := false;
+ end;
end;
SDL_QUITEV:
@@ -457,8 +463,6 @@ begin
else
LyricSub.Clear;
end;
-
- Sender.UpdateLCD;
//On Sentence Change...
Sender.onSentenceChange(Czesci[0].Akt);
@@ -476,12 +480,6 @@ begin
// operates on currently beated note
Sender.LyricMain.Selected := Pet;
-// LCD.MoveCursor(1, ScreenSing.LyricMain.SelectedLetter);
-// LCD.ShowCursor;
-
- LCD.MoveCursorBR(Sender.LyricMain.SelectedLetter);
- LCD.ShowCursor;
-
end;
end;
@@ -503,10 +501,6 @@ begin
//LPT_1 := 0;
// Light.LightOne(0, 150);
- Light.LightOne(1, 200); // beat light
- if ParamStr(1) = '-doublelights' then
- Light.LightOne(0, 200); // beat light
-
{ if ((Czas.AktBeatC + Czesci[0].Resolution + Czesci[0].NotesGAP) mod (Czesci[0].Resolution * 2) = 0) then
Light.LightOne(0, 150)
@@ -520,10 +514,6 @@ begin
if Ini.ClickAssist = 1 then
Music.PlayClick;
- //LPT_2 := 0;
- if ParamStr(1) <> '-doublelights' then
- Light.LightOne(0, 150); //125
-
// drum machine
(* TempBeat := Czas.AktBeat;// + 2;
@@ -743,4 +733,3 @@ begin
end;
end.
-