From 94cefdb78044e0f9996e3032de34b690de98b708 Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 23 Jul 2009 12:34:07 +0000 Subject: - revert to 1777 - Ocean.ini and SVN properties are not reverted git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1854 b956fd51-792f-4845-bead-9b4dfca2ff2c --- unicode/plugins/Don't_Get_Worse/Hold_The_Line.dpr | 222 ++++++++++------------ 1 file changed, 105 insertions(+), 117 deletions(-) (limited to 'unicode/plugins/Don't_Get_Worse/Hold_The_Line.dpr') 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 a7828f8e..8bfb292c 100644 --- a/unicode/plugins/Don't_Get_Worse/Hold_The_Line.dpr +++ b/unicode/plugins/Don't_Get_Worse/Hold_The_Line.dpr @@ -5,74 +5,67 @@ library Hold_The_Line; {$ENDIF} uses - SysUtils, - ModiSDK in '..\SDK\ModiSDK.pas', - gl in '..\..\src\lib\JEDI-SDL\OpenGL\Pas\gl.pas'; + 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'; var - PointerTex: TSmallTexture; - CountSentences: cardinal; - Limit: byte; - MethodRec: TMethodRec; -// Frame: integer; - PlayerTimes: array[0..5] of integer; - LastTick: cardinal; - PointerVisible: boolean; - - DismissedSound: cardinal; - -// Give the plugin's info -procedure PluginInfo (var Info: TPluginInfo); {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} + PointerTex: TSmallTexture; + CountSentences: Cardinal; + Limit: Byte; + MethodRec: TMethodRec; + Frame: Integer; + PlayerTimes: array[0..5] of Integer; + LastTick: Cardinal; + PointerVisible: Boolean; + + DismissedSound: Cardinal; + +//Gave the Plugins Info +procedure PluginInfo (var Info: TPluginInfo); stdcall; begin - Info.Name := 'PLUGIN_HDL_NAME'; + Info.Name := 'PLUGIN_HDL_NAME'; Info.Creator := 'Whiteshark'; Info.PluginDesc := 'PLUGIN_HDL_DESC'; - // Set to Party Modi Plugin - Info.Typ := 8; + //Set to Party Modi Plugin + Info.Typ := 8; Info.NumPlayers := 31; - // Options - Info.LoadSong := true; // Whether or not a song should be loaded - // Only when song is loaded: - Info.ShowScore := true; // Whether or not the score should be shown - Info.ShowNotes := true; // Whether the note lines should be displayed - Info.LoadVideo := true; // Should the video be loaded? - Info.LoadBack := true; // Should the background be loaded? - - Info.BGShowFull := false; // Whether the background or the video should be shown full size - Info.BGShowFull_O := true; // Whether the Background or the Video should be shown full size - - Info.ShowRateBar := true; // Whether the bar that shows how good the player was should be displayed - Info.ShowRateBar_O := false; // Load from ini whether the bar should be displayed - - Info.EnLineBonus := false; // Whether line bonus should be enabled - Info.EnLineBonus_O := true; // Load from ini whether line bonus should be enabled - - // Options even when song is not loaded - Info.ShowBars := false; // Whether the white bars on top and bottom should be drawn - Info.TeamModeOnly := false; // if true the plugin can only be played in team mode - Info.GetSoundData := false; // if true the rdata procedure is called when new sound data is available - Info.Dummy := false; // Should be set to false... for updating plugin interface + //Options + Info.LoadSong := True; //Whether or not a Song should be Loaded + //Only When Song is Loaded: + Info.ShowScore := True; //Whether or not the Score should be shown + Info.ShowNotes := True; //Whether the Note Lines should be displayed + Info.LoadVideo := True; //Should the Video be loaded ? + Info.LoadBack := True; //Should the Background be loaded ? + + Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize + Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize + + Info.ShowRateBar:= True; //Whether the Bar that shows how good the player was sould be displayed + Info.ShowRateBar_O := False; //Load from Ini whether the Bar should be Displayed + + Info.EnLineBonus := False; //Whether LineBonus Should be enabled + Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled + + //Options even when song is Not loaded + Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn + Info.TeamModeOnly := False; //If True the Plugin can only be Played in Team Mode + Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available + Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface end; -// executed on game start. if true game begins, else failure -function Init (const TeamInfo: TTeamInfo; - var Playerinfo: TPlayerinfo; - const Sentences: TSentences; - const Methods: TMethodRec) - : boolean; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} - -const - TextureName : PChar = 'HDL_Pointer'; - SoundName : PChar = 'dismissed.mp3'; +//Executed on Game Start //If True Game begins, else Failure +function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall; var - Index: integer; -// Texname: PChar; + I: Integer; + Texname: PChar; TexType: TTextureType; begin -{ TexName := CreateStr(PChar('HDL_Pointer')); TexType := TEXTURE_TYPE_TRANSPARENT; PointerTex := Methods.LoadTex(TexName, TexType); @@ -82,56 +75,50 @@ begin TexName := CreateStr(PChar('dismissed.mp3')); DismissedSound := Methods.LoadSound (TexName); FreeStr(TexName); -} - TexType := TEXTURE_TYPE_TRANSPARENT; - PointerTex := Methods.LoadTex(TextureName, TexType); - - DismissedSound := Methods.LoadSound (SoundName); CountSentences := Sentences.High; Limit := 0; -// Frame := 0; + Frame := 0; MethodRec := Methods; - for Index := 0 to PlayerInfo.NumPlayers-1 do + for I := 0 to PlayerInfo.NumPlayers-1 do begin - PlayerInfo.Playerinfo[Index].Enabled := true; - PlayerInfo.Playerinfo[Index].Percentage := 100; - PlayerTimes[Index] := 0; + PlayerInfo.Playerinfo[I].Enabled := True; + PlayerInfo.Playerinfo[I].Percentage := 100; + PlayerTimes[I] := 0; end; - Result := true; + Result := True; end; -function Draw (var Playerinfo: TPlayerinfo; - const CurSentence: cardinal) - : boolean; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} -const - SoundName : PChar = 'PARTY_DISMISSED'; +//Executed everytime the Screen is Drawed //If False The Game finishes +function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall; var - Index: integer; - L: byte; - C: byte; - Tick: cardinal; + I: 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 + //Aktivate Blink + If (CurSentence = CountSentences div 5 * 2 - 1) OR (CurSentence = CountSentences div 3 * 2 - 1) then begin - Tick := round(TimeStampToMSecs(DateTimeToTimeStamp(Now))) div 400; - if (Tick <> LastTick) then + Tick := SDL_GetTicks() div 400; + If (Tick <> LastTick) then begin LastTick := Tick; - PointerVisible := not PointerVisible; + PointerVisible := Not PointerVisible; end; end else - PointerVisible := true; + PointerVisible := True; - // inc limit - if (Limit = 0) and (CurSentence >= CountSentences div 5 * 2) then + //Inc Limit + if (Limit = 0) And (CurSentence >= CountSentences div 5 * 2) then Inc(Limit) - else if (Limit = 1) and (CurSentence >= CountSentences div 3 * 2) then + else if (Limit = 1) And (CurSentence >= CountSentences div 3 * 2) then Inc(Limit); case Limit of @@ -142,22 +129,22 @@ begin C:= 0; - Result := true; + Result := True; - for Index := 0 to PlayerInfo.NumPlayers-1 do + for I := 0 to PlayerInfo.NumPlayers-1 do begin - if PlayerInfo.Playerinfo[Index].Enabled then + if PlayerInfo.Playerinfo[I].Enabled then begin - if PlayerInfo.Playerinfo[Index].Bar < L then + if PlayerInfo.Playerinfo[I].Bar < L then begin - PlayerInfo.Playerinfo[Index].Enabled := false; + PlayerInfo.Playerinfo[I].Enabled := False; Inc(C); - PlayerTimes[Index] := CurSentence; // Save Time of Dismission - // PlaySound + PlayerTimes[I] := CurSentence; //Save Time of Dismission + //PlaySound MethodRec.PlaySound (DismissedSound); end; - // Draw pointer + //Draw Pointer if (PointerVisible) then begin glColor4f (0.2, 0.8, 0.1, 1); @@ -169,10 +156,10 @@ begin glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum); glBegin(GL_QUADS); - glTexCoord2f(1/32, 0); glVertex2f(PlayerInfo.Playerinfo[Index].PosX + L - 3, PlayerInfo.Playerinfo[Index].PosY - 4); - glTexCoord2f(1/32, 1); glVertex2f(PlayerInfo.Playerinfo[Index].PosX + L - 3, PlayerInfo.Playerinfo[Index].PosY + 12); - glTexCoord2f(31/32, 1); glVertex2f(PlayerInfo.Playerinfo[Index].PosX+ L + 3, PlayerInfo.Playerinfo[Index].PosY + 12); - glTexCoord2f(31/32, 0); glVertex2f(PlayerInfo.Playerinfo[Index].PosX+ L + 3, PlayerInfo.Playerinfo[Index].PosY - 4); + glTexCoord2f(1/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY - 4); + glTexCoord2f(1/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY + 12); + glTexCoord2f(31/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY + 12); + glTexCoord2f(31/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY - 4); glEnd; glDisable(GL_TEXTURE_2D); @@ -183,44 +170,45 @@ begin else begin Inc(C); - // Draw dismissed + //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, SoundName); + + MethodRec.Print (1, 18, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text); + FreeStr(Text); end; end; if (C >= PlayerInfo.NumPlayers-1) then - Result := false; + Result := False; end; -// is executed on finish, returns the player number of the winner -function Finish (var Playerinfo: TPlayerinfo): byte; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} +//Is Executed on Finish, Returns the Playernum of the Winner +function Finish (var Playerinfo: TPlayerinfo): byte; stdcall; var - Index: integer; + I:Integer; begin - Result := 0; - for Index := 0 to PlayerInfo.NumPlayers-1 do +Result := 0; +for I := 0 to PlayerInfo.NumPlayers-1 do begin - PlayerInfo.Playerinfo[Index].Percentage := (PlayerTimes[Index] * 100) div CountSentences; - if (PlayerInfo.Playerinfo[Index].Enabled) then + PlayerInfo.Playerinfo[I].Percentage := (PlayerTimes[I] * 100) div CountSentences; + if (PlayerInfo.Playerinfo[I].Enabled) then begin - PlayerInfo.Playerinfo[Index].Percentage := 100; - case Index of - 0: Result := Result or 1; - 1: Result := Result or 2; - 2: Result := Result or 4; - 3: Result := Result or 8; - 4: Result := Result or 16; - 5: Result := Result or 32; + PlayerInfo.Playerinfo[I].Percentage := 100; + Case I of + 0: Result := Result OR 1; + 1: Result := Result OR 2; + 2: Result := Result OR 4; + 3: Result := Result OR 8; + 4: Result := Result OR 16; + 5: Result := Result OR 32; end; end; end; end; exports - PluginInfo, - Init, - Draw, - Finish; +PluginInfo, Init, Draw, Finish; begin -- cgit v1.2.3