aboutsummaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-10 19:36:56 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-10 19:36:56 +0000
commit1d0359f2c24867091e969b644ecc27b44ad8d96e (patch)
tree730d3aca5b0398353fb8d26a99f2767d6f1efea0 /src/base
parentc55bc6de5d68017431ac7dfb7fd3b77cf907eba0 (diff)
downloadusdx-1d0359f2c24867091e969b644ecc27b44ad8d96e.tar.gz
usdx-1d0359f2c24867091e969b644ecc27b44ad8d96e.tar.xz
usdx-1d0359f2c24867091e969b644ecc27b44ad8d96e.zip
- added missing Result assignment in TAudioInputProcessor.CheckPlayersConfig
- replaced "continue" var with "Done" in UMain - CheckEvents is now a procedure and not a function git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2477 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base')
-rw-r--r--src/base/UMain.pas35
-rw-r--r--src/base/URecord.pas2
2 files changed, 19 insertions, 18 deletions
diff --git a/src/base/UMain.pas b/src/base/UMain.pas
index 1d924d56..a2e43fc8 100644
--- a/src/base/UMain.pas
+++ b/src/base/UMain.pas
@@ -39,7 +39,7 @@ uses
procedure Main;
procedure MainLoop;
-function CheckEvents: boolean;
+procedure CheckEvents;
type
TMainThreadExecProc = procedure(Data: Pointer);
@@ -354,12 +354,12 @@ var
Delay: integer;
TicksCurrent: cardinal;
TicksBeforeFrame: cardinal;
- Continue: boolean;
+ Done: boolean;
begin
SDL_EnableKeyRepeat(125, 125);
CountSkipTime(); // JB - for some reason this seems to be needed when we use the SDL Timer functions.
- while Continue do
+ while not Done do
begin
TicksBeforeFrame := SDL_GetTicks;
@@ -368,10 +368,10 @@ begin
Joy.Update;
// keyboard events
- Continue := CheckEvents;
+ CheckEvents;
// display
- Continue := Display.Draw;
+ Done := not Display.Draw;
SwapBuffers;
// FPS limiter
@@ -401,13 +401,14 @@ begin
end;
end;
-function CheckEvents: boolean;
+procedure CheckEvents;
var
Event: TSDL_event;
mouseDown: boolean;
mouseBtn: integer;
+ Done: boolean;
begin
- Result := true;
+ Done := true;
while (SDL_PollEvent(@Event) <> 0) do
begin
case Event.type_ of
@@ -452,17 +453,17 @@ begin
if not Assigned(Display.NextScreen) then
begin //drop input when changing screens
if (ScreenPopupError <> nil) and (ScreenPopupError.Visible) then
- Result := ScreenPopupError.ParseMouse(mouseBtn, mouseDown, Event.button.x, Event.button.y)
+ Done := ScreenPopupError.ParseMouse(mouseBtn, mouseDown, Event.button.x, Event.button.y)
else if (ScreenPopupInfo <> nil) and (ScreenPopupInfo.Visible) then
- Result := ScreenPopupInfo.ParseMouse(mouseBtn, mouseDown, Event.button.x, Event.button.y)
+ Done := ScreenPopupInfo.ParseMouse(mouseBtn, mouseDown, Event.button.x, Event.button.y)
else if (ScreenPopupCheck <> nil) and (ScreenPopupCheck.Visible) then
- Result := ScreenPopupCheck.ParseMouse(mouseBtn, mouseDown, Event.button.x, Event.button.y)
+ Done := ScreenPopupCheck.ParseMouse(mouseBtn, mouseDown, Event.button.x, Event.button.y)
else
begin
- Result := Display.CurrentScreen^.ParseMouse(mouseBtn, mouseDown, Event.button.x, Event.button.y);
+ Done := Display.CurrentScreen^.ParseMouse(mouseBtn, mouseDown, Event.button.x, Event.button.y);
// if screen wants to exit
- if not Result then
+ if not Done then
DoQuit;
end;
end;
@@ -542,18 +543,18 @@ begin
// if there is a visible popup then let it handle input instead of underlying screen
// shoud be done in a way to be sure the topmost popup has preference (maybe error, then check)
else if (ScreenPopupError <> nil) and (ScreenPopupError.Visible) then
- Result := ScreenPopupError.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true)
+ Done := ScreenPopupError.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true)
else if (ScreenPopupInfo <> nil) and (ScreenPopupInfo.Visible) then
- Result := ScreenPopupInfo.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true)
+ Done := ScreenPopupInfo.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true)
else if (ScreenPopupCheck <> nil) and (ScreenPopupCheck.Visible) then
- Result := ScreenPopupCheck.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true)
+ Done := ScreenPopupCheck.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true)
else
begin
// check if screen wants to exit
- Result := Display.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true);
+ Done := Display.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, true);
// if screen wants to exit
- if not Result then
+ if not Done then
DoQuit;
end;
diff --git a/src/base/URecord.pas b/src/base/URecord.pas
index 6b8ba8cf..5cddcc77 100644
--- a/src/base/URecord.pas
+++ b/src/base/URecord.pas
@@ -714,7 +714,7 @@ function TAudioInputProcessor.CheckPlayersConfig(PlayerCount: cardinal): integer
var
PlayerState: TBooleanDynArray;
begin
- CheckPlayersConfig(PlayerCount, PlayerState);
+ Result := CheckPlayersConfig(PlayerCount, PlayerState);
end;
{*