From 1d0359f2c24867091e969b644ecc27b44ad8d96e Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Thu, 10 Jun 2010 19:36:56 +0000 Subject: - 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 --- src/base/UMain.pas | 35 ++++++++++++++++++----------------- src/base/URecord.pas | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) (limited to 'src') 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; {* -- cgit v1.2.3