aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UMain.pas
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code/Classes/UMain.pas')
-rw-r--r--Game/Code/Classes/UMain.pas16
1 files changed, 15 insertions, 1 deletions
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index aa4bc639..41676bf3 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -139,7 +139,11 @@ procedure MainLoop;
var
Delay: integer;
begin
+ Delay := 0;
SDL_EnableKeyRepeat(125, 125);
+
+
+ CountSkipTime(); // JB - for some reason this seems to be needed when we use the SDL Timer functions.
While not Done do
Begin
// joypad
@@ -158,16 +162,26 @@ begin
// delay
CountMidTime;
+
+ {$IFDEF DebugDisplay}
+ Writeln( 'TimeMid : '+ inttostr(trunc(TimeMid)) );
+ {$ENDIF}
+
// if 1000*TimeMid > 100 then beep;
Delay := Floor(1000 / 100 - 1000 * TimeMid);
+ {$IFDEF DebugDisplay}
+ Writeln( 'Delay ms : '+ inttostr(Delay) );
+ {$ENDIF}
+
if Delay >= 1 then
SDL_Delay(Delay); // dynamic, maximum is 100 fps
CountSkipTime;
// reinitialization of graphics
- if Restart then begin
+ if Restart then
+ begin
Reinitialize3D;
Restart := false;
end;