From 133f0b4ebcc3b731e680a72ced52d00638791bf7 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Thu, 4 Jun 2009 21:31:23 +0000 Subject: cosmetics git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1800 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/UMain.pas | 22 ++++++++++++---------- src/base/USingScores.pas | 2 +- src/base/UThemes.pas | 8 ++++---- src/base/UTime.pas | 28 ++++++++++++++-------------- 4 files changed, 31 insertions(+), 29 deletions(-) (limited to 'src/base') diff --git a/src/base/UMain.pas b/src/base/UMain.pas index 3900c877..275510fc 100644 --- a/src/base/UMain.pas +++ b/src/base/UMain.pas @@ -359,9 +359,11 @@ begin CountMidTime; Delay := Floor(1000 / MAX_FPS - 1000 * TimeMid); + Log.LogError ('MainLoop', 'Delay: ' + intToStr(Delay)); if Delay >= 1 then SDL_Delay(Delay); // dynamic, maximum is 100 fps + Log.LogError ('MainLoop', 'Delay: ok ' + intToStr(Delay)); CountSkipTime; @@ -386,15 +388,15 @@ begin begin Display.Fade := 0; Display.NextScreenWithCheck := nil; - Display.CheckOK := True; + Display.CheckOK := true; end; end; procedure CheckEvents; var - Event: TSDL_event; - mouseDown: Boolean; - mouseBtn: Integer; + Event: TSDL_event; + mouseDown: boolean; + mouseBtn: integer; begin if Assigned(Display.NextScreen) then Exit; @@ -416,18 +418,18 @@ begin case Event.type_ of SDL_MOUSEMOTION: begin - mouseDown := False; - mouseBtn := 0; + mouseDown := false; + mouseBtn := 0; end; SDL_MOUSEBUTTONDOWN: begin - mouseDown := True; - mouseBtn := Event.button.button; + mouseDown := true; + mouseBtn := Event.button.button; end; SDL_MOUSEBUTTONUP: begin - mouseDown := False; - mouseBtn := Event.button.button; + mouseDown := false; + mouseBtn := Event.button.button; end; end; diff --git a/src/base/USingScores.pas b/src/base/USingScores.pas index 32b63197..499e1188 100644 --- a/src/base/USingScores.pas +++ b/src/base/USingScores.pas @@ -530,7 +530,7 @@ var Result := 0; bPlayerCount := 1 shl (bPlayerCount - 1); - for I := 0 to PositionCount-1 do + for I := 0 to PositionCount - 1 do begin if ((Positions[I].PlayerCount and bPlayerCount) <> 0) then Inc(Result); diff --git a/src/base/UThemes.pas b/src/base/UThemes.pas index 832e17d9..3fd77853 100644 --- a/src/base/UThemes.pas +++ b/src/base/UThemes.pas @@ -42,13 +42,13 @@ uses type TRGB = record - R: single; - G: single; - B: single; + R: single; + G: single; + B: single; end; TRGBA = record - R, G, B, A: Double; + R, G, B, A: double; end; type diff --git a/src/base/UTime.pas b/src/base/UTime.pas index 3f35dffd..83844cb5 100644 --- a/src/base/UTime.pas +++ b/src/base/UTime.pas @@ -61,20 +61,20 @@ procedure CountSkipTime; procedure CountMidTime; var - USTime : TTime; + USTime: TTime; VideoBGTimer: TRelativeTimer; - TimeNew : int64; - TimeOld : int64; - TimeSkip : real; - TimeMid : real; - TimeMidTemp : int64; + TimeNew: int64; + TimeOld: int64; + TimeSkip: real; + TimeMid: real; + TimeMidTemp: int64; implementation uses sdl, - ucommon; + UCommon; const cSDLCorrectionRatio = 1000; @@ -91,14 +91,14 @@ http://www.gamedev.net/community/forums/topic.asp?topic_id=466145&whichpage=1%EE procedure CountSkipTimeSet; begin - TimeNew := SDL_GetTicks(); + TimeNew := SDL_GetTicks(); end; procedure CountSkipTime; begin - TimeOld := TimeNew; - TimeNew := SDL_GetTicks(); - TimeSkip := (TimeNew-TimeOld) / cSDLCorrectionRatio; + TimeOld := TimeNew; + TimeNew := SDL_GetTicks(); + TimeSkip := (TimeNew-TimeOld) / cSDLCorrectionRatio; end; procedure CountMidTime; @@ -127,10 +127,10 @@ end; **} (* - * Creates a new timer. - * If TriggerMode is false (default), the timer + * creates a new timer. + * if triggermode is false (default), the timer * will immediately begin with counting. - * If TriggerMode is true, it will wait until Get/SetTime() or Pause() is called + * if triggermode is true, it will wait until get/settime() or pause() is called * for the first time. *) constructor TRelativeTimer.Create(TriggerMode: boolean); -- cgit v1.2.3