aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/plugins/Team_Duell
diff options
context:
space:
mode:
authors_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-06-29 01:02:40 +0000
committers_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-06-29 01:02:40 +0000
commit1ed2c76ecb3f7351b9194356623bbad2f1313aa8 (patch)
tree5d3df5062c8f76fa419d05a383e29fa68510845f /cmake/plugins/Team_Duell
parent94b6070c9a28db1d7ba5116a6580bff8e991ff75 (diff)
downloadusdx-1ed2c76ecb3f7351b9194356623bbad2f1313aa8.tar.gz
usdx-1ed2c76ecb3f7351b9194356623bbad2f1313aa8.tar.xz
usdx-1ed2c76ecb3f7351b9194356623bbad2f1313aa8.zip
merged svn trunk r1837 into cmake branche
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1838 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'cmake/plugins/Team_Duell')
-rw-r--r--cmake/plugins/Team_Duell/TeamDuell.dpr29
1 files changed, 15 insertions, 14 deletions
diff --git a/cmake/plugins/Team_Duell/TeamDuell.dpr b/cmake/plugins/Team_Duell/TeamDuell.dpr
index 7937a78c..1371c95d 100644
--- a/cmake/plugins/Team_Duell/TeamDuell.dpr
+++ b/cmake/plugins/Team_Duell/TeamDuell.dpr
@@ -4,15 +4,10 @@ library TeamDuell ;
{$MODE Delphi}
{$ENDIF}
-// compile with fpc -k-U -k_SDL_main TeamDuell.dpr -Fi../../src/lib/JEDI-SDL/SDL/Pas/
-
uses
- ModiSDK in '..\SDK\ModiSDK.pas',
-// USDXStrUtils in '..\SDK\USDXStrUtils.pas',
- sdl in '..\..\src\lib\JEDI-SDL\SDL\Pas\sdl.pas',
- moduleloader in '..\..\src\lib\JEDI-SDL\SDL\Pas\moduleloader.pas',
- gl in '..\..\src\lib\JEDI-SDL\OpenGL\Pas\gl.pas',
- sysutils;
+ SysUtils,
+ ModiSDK in '..\SDK\ModiSDK.pas',
+ gl in '..\..\src\lib\JEDI-SDL\OpenGL\Pas\gl.pas';
var
TeamPlayer: array of array of string;
@@ -24,6 +19,12 @@ var
bps, RTimeToNextChange: double;
firsttime, secondtime: boolean;
+function GetTicks: cardinal;
+// returns a time stamp in milliseconds
+begin
+ GetTicks := round(TimeStampToMSecs(DateTimeToTimeStamp(Now)));
+end;
+
// Give the plugin's info
procedure PluginInfo (var Info: TPluginInfo); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
begin
@@ -92,7 +93,7 @@ begin
until not(NextSinger[Index] = CurSinger[Index]) or (SPT[Index] = 1);
end;
ChangeOnSentence := 8;
- starttick := SDL_GetTicks();
+ starttick := GetTicks;
firsttime := true;
secondtime := true;
bps := 1;
@@ -114,11 +115,11 @@ begin
if (CurSentence = ChangeOnSentence - 7) and (firsttime) then
begin
firsttime := false;
- starttick := SDL_GetTicks();
+ starttick := GetTicks;
end;
start := false;
// show first singer for 5 sec
- if (CurSentence < 1) and ((starttick + 5000) > SDL_GetTicks()) then
+ if (CurSentence < 1) and ((starttick + 5000) > GetTicks) then
start := true;
// TickCount(thirdSentence)
@@ -126,12 +127,12 @@ begin
begin
secondtime := false;
firsttime := true;
- endtick := SDL_GetTicks();
+ endtick := GetTicks;
bps := (Startpoints[3]-Startpoints[1]) * 1000 / (endtick-starttick); // BeatsPerSecond
end;
// Time to next change
- RTimeToNextChange := ((Startpoints[ChangeOnSentence]-Startpoints[ChangeOnSentence - 7]) / bps) - ((SDL_GetTicks() - starttick) / 1000);
+ RTimeToNextChange := ((Startpoints[ChangeOnSentence]-Startpoints[ChangeOnSentence - 7]) / bps) - ((GetTicks - starttick) / 1000);
TimeToNextChange := Trunc(RTimeToNextChange) + 1;
// Next singer for team I
@@ -222,7 +223,7 @@ end;
// is executed on finish, returns the player number of the winner
function Finish (var Playerinfo: TPlayerinfo): byte; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
var
- Index: integer;
+ Index: integer;
MaxScore: word;
begin
Result := 0;