From d123263213fba448d5695df35660f7de4cbed433 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 11 Oct 2007 08:11:47 +0000 Subject: modified UTime to utilise SDL timer... this allows for reliable cross platform timers. Tested working on linux. Modified UVideo and screens to get Video playback working on linux currently only video stream... no audio.. but I Will be working towards this, for all audio playback ( at least for linux ) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@501 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UMain.pas | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Game/Code/Classes/UMain.pas') 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; -- cgit v1.2.3