diff options
Diffstat (limited to 'unicode/plugins')
-rw-r--r-- | unicode/plugins/5000Points/Until5000.dpr | 7 | ||||
-rw-r--r-- | unicode/plugins/Blind/Blind.dpr | 9 | ||||
-rw-r--r-- | unicode/plugins/Don't_Get_Worse/Hold_The_Line.dpr | 17 | ||||
-rw-r--r-- | unicode/plugins/Duell/Duell.dpr | 9 | ||||
-rw-r--r-- | unicode/plugins/SDK/ModiSDK.pas | 2 | ||||
-rw-r--r-- | unicode/plugins/SDK/StrUtils.pas | 10 | ||||
-rw-r--r-- | unicode/plugins/SDK/UPluginDefs.pas | 112 | ||||
-rw-r--r-- | unicode/plugins/Team_Duell/TeamDuell.dpr | 30 |
8 files changed, 110 insertions, 86 deletions
diff --git a/unicode/plugins/5000Points/Until5000.dpr b/unicode/plugins/5000Points/Until5000.dpr index 507159ff..df79bfe2 100644 --- a/unicode/plugins/5000Points/Until5000.dpr +++ b/unicode/plugins/5000Points/Until5000.dpr @@ -4,8 +4,6 @@ library Until5000; {$MODE Delphi} {$ENDIF} -{$I ../../Game/Code/switches.inc} - uses ModiSDK in '..\SDK\ModiSDK.pas'; @@ -90,7 +88,10 @@ for I := 0 to PlayerInfo.NumPlayers-1 do end; exports -PluginInfo, Init, Draw, Finish; + PluginInfo, + Init, + Draw, + Finish; begin diff --git a/unicode/plugins/Blind/Blind.dpr b/unicode/plugins/Blind/Blind.dpr index 2f94229c..d2824587 100644 --- a/unicode/plugins/Blind/Blind.dpr +++ b/unicode/plugins/Blind/Blind.dpr @@ -1,5 +1,9 @@ library Blind; +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + uses ModiSDK in '..\SDK\ModiSDK.pas'; @@ -95,7 +99,10 @@ begin end; exports -PluginInfo, Init, Draw, Finish; + PluginInfo, + Init, + Draw, + Finish; begin diff --git a/unicode/plugins/Don't_Get_Worse/Hold_The_Line.dpr b/unicode/plugins/Don't_Get_Worse/Hold_The_Line.dpr index a197d51b..8bfb292c 100644 --- a/unicode/plugins/Don't_Get_Worse/Hold_The_Line.dpr +++ b/unicode/plugins/Don't_Get_Worse/Hold_The_Line.dpr @@ -1,10 +1,15 @@ library Hold_The_Line; +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + uses - ModiSDK in '..\SDK\ModiSDK.pas', + ModiSDK in '..\SDK\ModiSDK.pas', StrUtils in '..\SDK\StrUtils.pas', - OpenGL12, - Windows; + 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'; var PointerTex: TSmallTexture; @@ -84,8 +89,6 @@ begin PlayerTimes[I] := 0; end; - LoadOpenGL; - Result := True; end; @@ -102,7 +105,7 @@ begin //Aktivate Blink If (CurSentence = CountSentences div 5 * 2 - 1) OR (CurSentence = CountSentences div 3 * 2 - 1) then begin - Tick := Gettickcount div 400; + Tick := SDL_GetTicks() div 400; If (Tick <> LastTick) then begin LastTick := Tick; @@ -172,7 +175,7 @@ begin glColor4f (0.8, 0.8, 0.8, 1); - MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text); + MethodRec.Print (1, 18, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text); FreeStr(Text); end; end; diff --git a/unicode/plugins/Duell/Duell.dpr b/unicode/plugins/Duell/Duell.dpr index 3aff4d3e..93c87d0e 100644 --- a/unicode/plugins/Duell/Duell.dpr +++ b/unicode/plugins/Duell/Duell.dpr @@ -1,5 +1,9 @@ library Duell; +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + uses ModiSDK in '..\SDK\ModiSDK.pas'; @@ -92,7 +96,10 @@ begin end; exports -PluginInfo, Init, Draw, Finish; + PluginInfo, + Init, + Draw, + Finish; begin diff --git a/unicode/plugins/SDK/ModiSDK.pas b/unicode/plugins/SDK/ModiSDK.pas index 76dcf8ea..c0e66387 100644 --- a/unicode/plugins/SDK/ModiSDK.pas +++ b/unicode/plugins/SDK/ModiSDK.pas @@ -6,8 +6,6 @@ interface {$MODE Delphi} {$ENDIF} -{$I switches.inc} - type //PluginInfo, for Init TPluginInfo = record //Info diff --git a/unicode/plugins/SDK/StrUtils.pas b/unicode/plugins/SDK/StrUtils.pas index a5735b8f..069c89c3 100644 --- a/unicode/plugins/SDK/StrUtils.pas +++ b/unicode/plugins/SDK/StrUtils.pas @@ -2,7 +2,9 @@ unit StrUtils; interface -{$I switches.inc} +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} uses ModiSDK; @@ -12,6 +14,10 @@ procedure FreeStr(Str: PChar); implementation +{$IFDEF FPC} + {$ASMMODE Intel} +{$ENDIF} + {function StrToAChar(Str: String): AChar; var L, I: Integer; @@ -70,4 +76,4 @@ begin FreeMem(Str); end; -end.
\ No newline at end of file +end. diff --git a/unicode/plugins/SDK/UPluginDefs.pas b/unicode/plugins/SDK/UPluginDefs.pas index 4cd094f7..45bae864 100644 --- a/unicode/plugins/SDK/UPluginDefs.pas +++ b/unicode/plugins/SDK/UPluginDefs.pas @@ -1,8 +1,8 @@ unit uPluginDefs; {********************* uPluginDefs - Some Basic Structures and Functions used to communicate with Plugins - Usable as Delphi Plugin SDK + Some basic structures and functions used to communicate with plugins + Usable as Delphi plugin SDK *********************} interface @@ -14,60 +14,60 @@ interface {$I switches.inc} type - DWORD = LongWord; + dword = LongWord; //Compatibility with 64 Bit Systems {$IFDEF CPU32} - TwParam = Integer; - TlParam = Pointer; //lParam is Used for 32 Bit addresses DWord is large enough + TwParam = integer; + TlParam = pointer; //lParam is used for 32 bit addresses. dword is large enough {$ELSE} - TwParam = Int64; - TlParam = Pointer; //lParam used for 64Bit addresses in 64 Bit Systems(FreePascal) + TwParam = int64; + TlParam = pointer; //lParam used for 64 bit addresses in 64 bit systems (FreePascal) {$ENDIF} - //wParam is mainly used for Ordninals - //lParam is mainly used for Pointers + //wParam is mainly used for ordinals + //lparam is mainly used for pointers //---------------- - // TUS_PluginInfo - Some Infos from Plugin to Core. - // Send when Plugininfo procedure is Called + // TUS_PluginInfo - some infos from plugin to core. + // Send when Plugininfo procedure is called // --- - // Version Structure: - // First Byte: Head Revison - // Second Byte: Sub Revison - // Third Byte: Sub Revision 2 - // Fourth Byte: Letter (For Bug Fix releases. 0 or 'a' .. 'z') + // Version structure: + // First byte: Head Revison + // Second byte: Sub Revison + // Third byte: Sub Revision 2 + // Fourth byte: Letter (For Bug Fix releases. 0 or 'a' .. 'z') //---------------- PUS_PluginInfo = ^TUS_PluginInfo; TUS_PluginInfo = record - cbSize: Integer; //Size of this record (usefull if record will be extended in the future) - - Name: Array [0..31] of Char; //Name of the Plugin - Version: DWord; //Version of the Plugin - Description: Array [0..127] of Char; //Description, what does this Plugin do - Author: Array [0..31] of Char; //Author of this Plugin - AuthorEmail: Array [0..63] of Char; //Authors Email - Homepage: Array [0..63] of Char; //Homepage of Plugin/Author + cbSize: integer; //Size of this record (usefull if record will be extended in the future) + + Name: array [0..31] of char; //Name of the Plugin + Version: dword; //Version of the Plugin + Description: array [0..127] of char; //Description, what does this Plugin do + Author: array [0..31] of char; //Author of this Plugin + AuthorEmail: array [0..63] of char; //Authors Email + Homepage: array [0..63] of char; //Homepage of Plugin/Author end; - AUS_PluginInfo = Array of TUS_PluginInfo; + AUS_PluginInfo = array of TUS_PluginInfo; PAUS_PluginInfo = ^AUS_PluginInfo; //---------------- - // TUS_Hook - Structure of the Hook Function + // TUS_Hook - Structure of the Hook function // Return 0 if the Hook should be continue, // or a non zero Value, if the Hook should be Interuped // In this Case the Caller of the Notifier gets the Return Value // Return Value Should not be -1 //---------------- - TUS_Hook = Function (wParam: TwParam; lParam: TlParam): integer; stdcall; - TUS_Hook_of_Object = Function (wParam: TwParam; lParam: TlParam): integer of Object; + TUS_Hook = function (wParam: TwParam; lParam: TlParam): integer; stdcall; + TUS_Hook_of_Object = function (wParam: TwParam; lParam: TlParam): integer of Object; //---------------- - // TUS_Service - Structure of the Service Function - // This Function is called if the Registered Service is Called + // TUS_Service - Structure of the Service function + // This function is called if the Registered Service is Called // Return Value Should not be SERVICE_NOT_FOUND //---------------- - TUS_Service = Function (wParam: TwParam; lParam: TlParam): integer; stdcall; - TUS_Service_of_Object = Function (wParam: TwParam; lParam: TlParam): integer of Object; + TUS_Service = function (wParam: TwParam; lParam: TlParam): integer; stdcall; + TUS_Service_of_Object = function (wParam: TwParam; lParam: TlParam): integer of Object; //---------------- // TUS_PluginInterface - Structure that Includes all Methods callable @@ -78,45 +78,45 @@ type {******** Hook specific Methods ********} {Function Creates a new Hookable Event and Returns the Handle or 0 on Failure. (Name already exists)} - CreateHookableEvent: Function (EventName: PChar): THandle; stdcall; + CreateHookableEvent: function (EventName: PChar): THandle; stdcall; {Function Destroys an Event and Unhooks all Hooks to this Event. 0 on success, not 0 on Failure} - DestroyHookableEvent: Function (hEvent: THandle): integer; stdcall; + DestroyHookableEvent: function (hEvent: THandle): integer; stdcall; {Function start calling the Hook Chain 0 if Chain is called until the End, -1 if Event Handle is not valid otherwise Return Value of the Hook that breaks the Chain} - NotivyEventHooks: Function (hEvent: THandle; wParam: TwParam; lParam: TlParam): integer; stdcall; + NotivyEventHooks: function (hEvent: THandle; wParam: TwParam; lParam: TlParam): integer; stdcall; {Function Hooks an Event by Name. Returns Hook Handle on Success, otherwise 0} - HookEvent: Function (EventName: PChar; HookProc: TUS_Hook): THandle; stdcall; + HookEvent: function (EventName: PChar; HookProc: TUS_Hook): THandle; stdcall; {Function Removes the Hook from the Chain Returns 0 on Success} - UnHookEvent: Function (hHook: THandle): Integer; stdcall; + UnHookEvent: function (hHook: THandle): integer; stdcall; {Function Returns Non Zero if a Event with the given Name Exists, otherwise 0} - EventExists: Function (EventName: PChar): Integer; stdcall; + EventExists: function (EventName: PChar): integer; stdcall; {******** Service specific Methods ********} {Function Creates a new Service and Returns the Services Handle or 0 on Failure. (Name already exists)} - CreateService: Function (ServiceName: PChar; ServiceProc: TUS_Service): THandle; stdcall; + CreateService: function (ServiceName: PChar; ServiceProc: TUS_Service): THandle; stdcall; {Function Destroys a Service. 0 on success, not 0 on Failure} - DestroyService: Function (hService: THandle): integer; stdcall; + DestroyService: function (hService: THandle): integer; stdcall; {Function Calls a Services Proc Returns Services Return Value or SERVICE_NOT_FOUND on Failure} - CallService: Function (ServiceName: PChar; wParam: TwParam; lParam: TlParam): integer; stdcall; + CallService: function (ServiceName: PChar; wParam: TwParam; lParam: TlParam): integer; stdcall; {Function Returns Non Zero if a Service with the given Name Exists, otherwise 0} - ServiceExists: Function (ServiceName: PChar): Integer; stdcall; + ServiceExists: function (ServiceName: PChar): integer; stdcall; end; //---------------- @@ -124,9 +124,9 @@ type //---------------- PModuleInfo = ^TModuleInfo; TModuleInfo = record - Name: String; + Name: string; Version: LongWord; - Description: String; + Description: string; end; AModuleInfo = array of TModuleInfo; @@ -139,11 +139,11 @@ type //Called on Plugins Load. If Non Zero is Returned => abort Loading //PInterface is Pointer to PluginInterface - Func_Load = function (const PInterface: PUS_PluginInterface): Integer; stdcall; + Func_Load = function (const PInterface: PUS_PluginInterface): integer; stdcall; //Called on Plugins Init. If Non Zero is Returned => abort Loading //PInterface is Pointer to PluginInterface - Func_Init = function (const PInterface: PUS_PluginInterface): Integer; stdcall; + Func_Init = function (const PInterface: PUS_PluginInterface): integer; stdcall; //Called on Plugins Deinit. //PInterface is Pointer to PluginInterface @@ -162,32 +162,30 @@ const CORE_SM_WARNING = 2; CORE_SM_INFO = 3; - //---------------- -// Some Functions to Handle Version DWords +// Some functions to Handle Version dwords //---------------- -Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord; -Function VersiontoSting(const Version: DWord): String; - +function MakeVersion(const HeadRevision, SubVersion, SubVersion2: byte; Letter: char): dword; +function VersionToString(const Version: dword): string; implementation //-------------- -// MakeVersion - Converts 4 Values to a valid Version DWord +// MakeVersion - converts 4 values to a valid version dword //-------------- -Function MakeVersion(const HeadRevision, SubVersion, SubVersion2: Byte; Letter: Char): DWord; +function MakeVersion(const HeadRevision, SubVersion, SubVersion2: byte; Letter: char): dword; begin - If (letter < 'a') or (Letter > 'z') then + if(letter < 'a') or (Letter > 'z') then letter := chr(0); Result := (HeadRevision shl 24) or (SubVersion shl 16) or (SubVersion2 shl 8) or Ord(Letter); end; //-------------- -// VersiontoString - Returns some beauty '1.0.2a' like String +// VersiontoString - Returns some beauty '1.0.2a' like string //-------------- -Function VersiontoSting(const Version: DWord): String; -begin // to-do : Write VersiontoString without SysUtils depencies +function VersionToString(const Version: dword): string; +begin // to-do : Write VersiontoString without SysUtils dependence //Result := InttoStr((ver and $FF000000) shr 24); Result := '1.0.1' end; diff --git a/unicode/plugins/Team_Duell/TeamDuell.dpr b/unicode/plugins/Team_Duell/TeamDuell.dpr index 20db2b2e..cb0e6349 100644 --- a/unicode/plugins/Team_Duell/TeamDuell.dpr +++ b/unicode/plugins/Team_Duell/TeamDuell.dpr @@ -1,11 +1,16 @@ library TeamDuell ; +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + uses - ModiSDK in '..\SDK\ModiSDK.pas', - StrUtils in '..\SDK\StrUtils.pas', - sysutils, - OpenGL12, - Windows; + ModiSDK in '..\SDK\ModiSDK.pas', + StrUtils in '..\SDK\StrUtils.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; var TeamPlayer: array of array of String; @@ -80,12 +85,11 @@ begin until NOT(NextSinger[I] = CurSinger[I]) OR (SPT[I] = 1) ; end; ChangeOnSentence := 8; - starttick := GetTickCount; + starttick := SDL_GetTicks(); firsttime := true; secondtime := true; bps := 1; MethodRec := Methods; - LoadOpenGL; Result := True; end; @@ -100,23 +104,23 @@ begin If (CurSentence = ChangeOnSentence - 7) AND (firsttime) then begin firsttime := false; - starttick := GetTickCount; + starttick := SDL_GetTicks(); end; start := false; // show first singers for 5sec - if (CurSentence < 1) AND ((starttick + 5000) > GetTickCount) then begin start := true; end; + if (CurSentence < 1) AND ((starttick + 5000) > SDL_GetTicks()) then begin start := true; end; // TickCount(thirdSentence) If (CurSentence = 3) AND (secondtime) then begin secondtime := false; firsttime := true; - endtick := GetTickCount; + endtick := SDL_GetTicks(); bps := (Startpoints[3]-Startpoints[1]) * 1000 / (endtick-starttick); // BeatsPerSecond end; // Time to next Change - RTtoNextChange := ((Startpoints[ChangeOnSentence]-Startpoints[ChangeOnSentence - 7]) / bps) - ((GetTickCount - starttick) / 1000); + RTtoNextChange := ((Startpoints[ChangeOnSentence]-Startpoints[ChangeOnSentence - 7]) / bps) - ((SDL_GetTicks() - starttick) / 1000); TtoNextChange := Trunc(RTtoNextChange) +1; // Next Singer for Team I @@ -176,11 +180,11 @@ begin // Names, Timer if (TtoNextChange <= 9) Then begin display := PChar(TeamPlayer[I,NextSinger[I]]); glColor4f (0.8, 0.1, 0.2, 1); - MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX+85, PlayerInfo.Playerinfo[I].PosY+10, CreateStr(PChar(IntToStr(Trunc(TtoNextChange))))); + MethodRec.Print (1, 18, PlayerInfo.Playerinfo[I].PosX+85, PlayerInfo.Playerinfo[I].PosY+10, CreateStr(PChar(IntToStr(Trunc(TtoNextChange))))); end; glColor4f (0.8, 0.8, 0.8, 1); if (CurSentence = 0) then display := PChar(TeamPlayer[I,CurSinger[I]]); - if (TtoNextChange <= 11) OR (start) Then MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX+5, PlayerInfo.Playerinfo[I].PosY+10, display); + if (TtoNextChange <= 11) OR (start) Then MethodRec.Print (1, 18, PlayerInfo.Playerinfo[I].PosX+5, PlayerInfo.Playerinfo[I].PosY+10, display); end; if (CurSentence = ChangeOnSentence) then begin ChangeOnSentence := CurSentence + 7; firsttime := true; end; Result := True; |