diff options
Diffstat (limited to 'cmake/plugins')
-rw-r--r-- | cmake/plugins/Blind/Blind.dpr | 2 | ||||
-rw-r--r-- | cmake/plugins/Dont_Get_Worse/Hold_The_Line.dpr | 23 | ||||
-rw-r--r-- | cmake/plugins/README(Plugins Status).txt | 3 | ||||
-rw-r--r-- | cmake/plugins/SDK/ModiSDK.pas | 26 | ||||
-rw-r--r-- | cmake/plugins/Team_Duell/TeamDuell.dpr | 29 |
5 files changed, 38 insertions, 45 deletions
diff --git a/cmake/plugins/Blind/Blind.dpr b/cmake/plugins/Blind/Blind.dpr index 82721102..3c68374c 100644 --- a/cmake/plugins/Blind/Blind.dpr +++ b/cmake/plugins/Blind/Blind.dpr @@ -69,7 +69,7 @@ var begin Result := 0; MaxScore := 0; - for Index := 0 to PlayerInfo.NumPlayers-1 do + for Index := 0 to PlayerInfo.NumPlayers - 1 do begin PlayerInfo.Playerinfo[Index].Percentage := PlayerInfo.Playerinfo[Index].Score div 9999; if (PlayerInfo.Playerinfo[Index].Score > MaxScore) then diff --git a/cmake/plugins/Dont_Get_Worse/Hold_The_Line.dpr b/cmake/plugins/Dont_Get_Worse/Hold_The_Line.dpr index 583a0b94..a7828f8e 100644 --- a/cmake/plugins/Dont_Get_Worse/Hold_The_Line.dpr +++ b/cmake/plugins/Dont_Get_Worse/Hold_The_Line.dpr @@ -5,18 +5,16 @@ library Hold_The_Line; {$ENDIF} 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, + ModiSDK in '..\SDK\ModiSDK.pas', + gl in '..\..\src\lib\JEDI-SDL\OpenGL\Pas\gl.pas'; var PointerTex: TSmallTexture; CountSentences: cardinal; Limit: byte; MethodRec: TMethodRec; - Frame: integer; +// Frame: integer; PlayerTimes: array[0..5] of integer; LastTick: cardinal; PointerVisible: boolean; @@ -92,7 +90,7 @@ begin CountSentences := Sentences.High; Limit := 0; - Frame := 0; +// Frame := 0; MethodRec := Methods; @@ -115,14 +113,12 @@ var Index: integer; L: byte; C: byte; -// Text: PChar; - Blink: boolean; Tick: cardinal; begin // activate blink if (CurSentence = CountSentences div 5 * 2 - 1) or (CurSentence = CountSentences div 3 * 2 - 1) then begin - Tick := SDL_GetTicks() div 400; + Tick := round(TimeStampToMSecs(DateTimeToTimeStamp(Now))) div 400; if (Tick <> LastTick) then begin LastTick := Tick; @@ -188,14 +184,7 @@ begin begin Inc(C); // Draw dismissed -// Text := CreateStr(PChar('PARTY_DISMISSED')); - glColor4f (0.8, 0.8, 0.8, 1); - -{ - MethodRec.Print (1, 18, PlayerInfo.Playerinfo[Index].PosX, PlayerInfo.Playerinfo[Index].PosY-8, Text); - FreeStr(Text); -} MethodRec.Print (1, 18, PlayerInfo.Playerinfo[Index].PosX, PlayerInfo.Playerinfo[Index].PosY-8, SoundName); end; end; diff --git a/cmake/plugins/README(Plugins Status).txt b/cmake/plugins/README(Plugins Status).txt index 6a371da0..a6756832 100644 --- a/cmake/plugins/README(Plugins Status).txt +++ b/cmake/plugins/README(Plugins Status).txt @@ -1,3 +1,6 @@ +All plugins are cleared off the SDL stuff (basically SDL_GetTicks), the StrUtils and moduleloader unit and should work on all platforms. +2009-May-23 KMS + Mac OS X: The following plugins can be compiled and used after being put in to the plugins folder: Blind, 5000Points, Duell diff --git a/cmake/plugins/SDK/ModiSDK.pas b/cmake/plugins/SDK/ModiSDK.pas index 7fc50bb8..e0b52a81 100644 --- a/cmake/plugins/SDK/ModiSDK.pas +++ b/cmake/plugins/SDK/ModiSDK.pas @@ -9,11 +9,11 @@ interface type // PluginInfo, for init TPluginInfo = record // Info - Name: array [0..32] of char; // modi to register for the plugin + Name: array [0..32] of char; // modus to register for the plugin Creator: array [0..32] of char; // name of the author PluginDesc: array [0..64] of char; // plugin description - // plugin type, atm: 8 only for partymode modi + // plugin type, atm: 8 only for partymode modus Case Typ: byte of 8: ( // Options @@ -37,7 +37,7 @@ type // PluginInfo, for init ShowBars: boolean; // Whether the white bars on top and bottom should be drawn TeamModeOnly: boolean; // If true the plugin can only be played in team mode GetSoundData: boolean; // If true the rdata procedure is called when new sound data is available - Dummy: boolean; // Should be set to false... for updateing plugin interface + Dummy: boolean; // Should be set to false... for updating plugin interface NumPlayers: byte // Number of available players for modus // Set different bits @@ -54,13 +54,13 @@ type // PluginInfo, for init TPlayerInfo = record NumPlayers: byte; Playerinfo: array[0..5] of record - Name: PChar; // Name of the player - Score: word; // Players score - Bar: byte; // Percentage of the singbar filled - PosX: real; // PosX of players singbar - PosY: real; // PosY " + Name: PChar; // Name of the player + Score: word; // Player's score + Bar: byte; // Percentage of the singbar filled + PosX: real; // PosX of player's singbar + PosY: real; // PosY " Enabled: boolean; // Whether the player could get points - Percentage: byte; // Percentage shown on the score screen + Percentage: byte; // Percentage shown on the score screen end; end; @@ -86,7 +86,7 @@ type // PluginInfo, for init end; TSentences = record - Current: integer; // aktualna czesc utworu do rysowania + Current: integer; // current part of a line High: integer; Number: integer; Resolution: integer; @@ -109,12 +109,12 @@ type // PluginInfo, for init Tone: integer; //Text: string; FreeStyle: boolean; - Typ: integer; // zwykla nuta x1, zlota nuta x2 + Typ: integer; // normal note x1, golden note x2 end; end; end; - dword = longword; + dword = longword; hstream = dword; TTextureType = ( @@ -156,7 +156,7 @@ type // PluginInfo, for init fModi_Finish = function (var Playerinfo: TPlayerinfo): byte; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} // Procedure called when new sound data is available - pModi_RData = procedure (handle: HSTREAM; buffer: Pointer; len: DWORD; user: DWORD); + pModi_RData = procedure (handle: hstream; buffer: pointer; len: dword; user: dword); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} implementation 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; |